diff --git a/configure b/configure index 9d89f4bc9..9a603b459 100755 --- a/configure +++ b/configure @@ -683,6 +683,7 @@ SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking +with_extra_version enable_coverage with_libcurl ' @@ -1311,6 +1312,8 @@ Optional Features: Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-extra-version=STRING + append STRING to version --without-libcurl do not use libcurl for anonymous statistics collection @@ -2156,13 +2159,6 @@ fi done -# CITUS_VERSION definition - -cat >>confdefs.h <<_ACEOF -#define CITUS_VERSION "$PACKAGE_VERSION" -_ACEOF - - # CITUS_MAJORVERSION definition CITUS_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\.[0-9][0-9]*\)'` @@ -2171,6 +2167,36 @@ cat >>confdefs.h <<_ACEOF _ACEOF +# CITUS_VERSION definition + + + +# Check whether --with-extra-version was given. +if test "${with_extra_version+set}" = set; then : + withval=$with_extra_version; + case $withval in + yes) + as_fn_error $? "argument required for --with-extra-version option" "$LINENO" 5 + ;; + no) + as_fn_error $? "argument required for --with-extra-version option" "$LINENO" 5 + ;; + *) + CITUS_VERSION="$PACKAGE_VERSION$withval" + ;; + esac + +else + CITUS_VERSION="$PACKAGE_VERSION" +fi + + + +cat >>confdefs.h <<_ACEOF +#define CITUS_VERSION "$CITUS_VERSION" +_ACEOF + + # CITUS_VERSION_NUM definition # awk -F is a regex on some platforms, and not on others, so make "." a tab CITUS_VERSION_NUM="`echo "$PACKAGE_VERSION" | sed 's/[A-Za-z].*$//' | diff --git a/configure.in b/configure.in index baee5bd9c..1c574ad78 100644 --- a/configure.in +++ b/configure.in @@ -12,13 +12,16 @@ AC_COPYRIGHT([Copyright (c) 2012-2017, Citus Data, Inc.]) AC_PROG_SED AC_PROG_AWK -# CITUS_VERSION definition -AC_DEFINE_UNQUOTED(CITUS_VERSION, "$PACKAGE_VERSION", [Citus version as a string]) - # CITUS_MAJORVERSION definition [CITUS_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\.[0-9][0-9]*\)'`] AC_DEFINE_UNQUOTED(CITUS_MAJORVERSION, "$CITUS_MAJORVERSION", [Citus major version as a string]) +# CITUS_VERSION definition +PGAC_ARG_REQ(with, extra-version, [STRING], [append STRING to version], + [CITUS_VERSION="$PACKAGE_VERSION$withval"], + [CITUS_VERSION="$PACKAGE_VERSION"]) +AC_DEFINE_UNQUOTED(CITUS_VERSION, "$CITUS_VERSION", [Citus version as a string]) + # CITUS_VERSION_NUM definition # awk -F is a regex on some platforms, and not on others, so make "." a tab [CITUS_VERSION_NUM="`echo "$PACKAGE_VERSION" | sed 's/[A-Za-z].*$//' |