diff --git a/configure b/configure index 1298be99..c2871aa7 100755 --- a/configure +++ b/configure @@ -1,6 +1,8 @@ #!/bin/sh # Try and be like autotools configure, but without autotools +VERSION=0.18 + # Ensure that we do not inherit these from env STRLCPY= STRLCAT= @@ -141,6 +143,7 @@ rm -f $CONFIG_H $CONFIG_MK echo "# Common vars used by XBPS on $OS." >$CONFIG_MK echo "/* $OS */" >$CONFIG_H +echo "VERSION = $VERSION" >>$CONFIG_MK echo "TOPDIR ?= $TOPDIR" >>$CONFIG_MK echo "PREFIX ?= $PREFIX" >>$CONFIG_MK echo "EPREFIX ?= $EPREFIX" >>$CONFIG_MK @@ -189,6 +192,7 @@ fi echo "CPPFLAGS = -I. -I\$(TOPDIR) -I\$(TOPDIR)/include" >>$CONFIG_MK echo "CPPFLAGS += -DHAVE_CONFIG_H" >>$CONFIG_MK echo "CPPFLAGS += -DXBPS_SYSCONF_PATH=\\\"${ETCDIR}\\\"" >>$CONFIG_MK +echo "CPPFLAGS += -DXBPS_VERSION=\\\"${VERSION}\\\"" >>$CONFIG_MK if [ -n "$DEBUG" -a "$DEBUG" != no -a "$DEBUG" != false ]; then echo "Building with debugging symbols." diff --git a/data/Makefile b/data/Makefile index 33207f25..1fc7c63b 100644 --- a/data/Makefile +++ b/data/Makefile @@ -1,6 +1,5 @@ -include ../config.mk -VERSION = 0.12 PCFILE = libxbps.pc .PHONY: all diff --git a/include/Makefile b/include/Makefile index 2223d124..f74e0e77 100644 --- a/include/Makefile +++ b/include/Makefile @@ -4,6 +4,7 @@ INCS = xbps_api.h .PHONY: all all: + sed -e "s|@@VERSION@@|${VERSION}|g" ${INCS}.in > ${INCS} .PHONY: install install: @@ -16,3 +17,4 @@ uninstall: .PHONY: clean clean: + -rm -f ${INCS} diff --git a/include/xbps_api.h b/include/xbps_api.h.in similarity index 99% rename from include/xbps_api.h rename to include/xbps_api.h.in index bb94e68d..e109dcf0 100644 --- a/include/xbps_api.h +++ b/include/xbps_api.h.in @@ -57,7 +57,10 @@ #define XBPS_PKGINDEX_VERSION "1.5" #define XBPS_API_VERSION "20120930" -#define XBPS_VERSION "0.17" + +#ifndef XBPS_VERSION + #define XBPS_VERSION "0.17" +#endif /** * @def XBPS_RELVER