mirror of https://github.com/citusdata/citus.git
Move version header into citus_config
parent
21b3090fec
commit
54e66545dc
|
@ -44,8 +44,8 @@ $(citus_top_builddir)/Makefile.global: $(citus_abs_top_srcdir)/configure $(citus
|
||||||
$(citus_top_builddir)/config.status: $(citus_abs_top_srcdir)/configure
|
$(citus_top_builddir)/config.status: $(citus_abs_top_srcdir)/configure
|
||||||
cd @abs_top_builddir@ && ./config.status --recheck
|
cd @abs_top_builddir@ && ./config.status --recheck
|
||||||
|
|
||||||
# Regenerate configure if configure.in changed
|
# Regenerate configure if configure.in or citus.control (which has our version #) changed
|
||||||
$(citus_abs_top_srcdir)/configure: $(citus_abs_top_srcdir)/configure.in
|
$(citus_abs_top_srcdir)/configure: $(citus_abs_top_srcdir)/configure.in $(citus_abs_top_srcdir)/src/backend/distributed/citus.control
|
||||||
cd ${citus_abs_top_srcdir} && ./autogen.sh
|
cd ${citus_abs_top_srcdir} && ./autogen.sh
|
||||||
|
|
||||||
# If specified via configure, replace the default compiler. Normally
|
# If specified via configure, replace the default compiler. Normally
|
||||||
|
|
|
@ -618,6 +618,7 @@ infodir
|
||||||
docdir
|
docdir
|
||||||
oldincludedir
|
oldincludedir
|
||||||
includedir
|
includedir
|
||||||
|
runstatedir
|
||||||
localstatedir
|
localstatedir
|
||||||
sharedstatedir
|
sharedstatedir
|
||||||
sysconfdir
|
sysconfdir
|
||||||
|
@ -689,6 +690,7 @@ datadir='${datarootdir}'
|
||||||
sysconfdir='${prefix}/etc'
|
sysconfdir='${prefix}/etc'
|
||||||
sharedstatedir='${prefix}/com'
|
sharedstatedir='${prefix}/com'
|
||||||
localstatedir='${prefix}/var'
|
localstatedir='${prefix}/var'
|
||||||
|
runstatedir='${localstatedir}/run'
|
||||||
includedir='${prefix}/include'
|
includedir='${prefix}/include'
|
||||||
oldincludedir='/usr/include'
|
oldincludedir='/usr/include'
|
||||||
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
|
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
|
||||||
|
@ -941,6 +943,15 @@ do
|
||||||
| -silent | --silent | --silen | --sile | --sil)
|
| -silent | --silent | --silen | --sile | --sil)
|
||||||
silent=yes ;;
|
silent=yes ;;
|
||||||
|
|
||||||
|
-runstatedir | --runstatedir | --runstatedi | --runstated \
|
||||||
|
| --runstate | --runstat | --runsta | --runst | --runs \
|
||||||
|
| --run | --ru | --r)
|
||||||
|
ac_prev=runstatedir ;;
|
||||||
|
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
|
||||||
|
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
|
||||||
|
| --run=* | --ru=* | --r=*)
|
||||||
|
runstatedir=$ac_optarg ;;
|
||||||
|
|
||||||
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
|
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
|
||||||
ac_prev=sbindir ;;
|
ac_prev=sbindir ;;
|
||||||
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
|
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
|
||||||
|
@ -1078,7 +1089,7 @@ fi
|
||||||
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
|
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
|
||||||
datadir sysconfdir sharedstatedir localstatedir includedir \
|
datadir sysconfdir sharedstatedir localstatedir includedir \
|
||||||
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
|
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
|
||||||
libdir localedir mandir
|
libdir localedir mandir runstatedir
|
||||||
do
|
do
|
||||||
eval ac_val=\$$ac_var
|
eval ac_val=\$$ac_var
|
||||||
# Remove trailing slashes.
|
# Remove trailing slashes.
|
||||||
|
@ -1231,6 +1242,7 @@ Fine tuning of the installation directories:
|
||||||
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
|
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
|
||||||
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
|
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
|
||||||
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
|
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
|
||||||
|
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
|
||||||
--libdir=DIR object code libraries [EPREFIX/lib]
|
--libdir=DIR object code libraries [EPREFIX/lib]
|
||||||
--includedir=DIR C header files [PREFIX/include]
|
--includedir=DIR C header files [PREFIX/include]
|
||||||
--oldincludedir=DIR C header files for non-gcc [/usr/include]
|
--oldincludedir=DIR C header files for non-gcc [/usr/include]
|
||||||
|
@ -1922,6 +1934,14 @@ else
|
||||||
$as_echo "$as_me: building against PostgreSQL $version_num" >&6;}
|
$as_echo "$as_me: building against PostgreSQL $version_num" >&6;}
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
|
citus_version=$(grep "default_version" src/backend/distributed/citus.control | cut -d\' -f2)
|
||||||
|
format_check=$(echo "$citus_version" | grep -E "^[0-9]+\.[0-9]+-[0-9]+$")
|
||||||
|
if (( $? )); then
|
||||||
|
as_fn_error $? "Citus version \"$citus_version\", found in citus.control, is in the wrong format" "$LINENO" 5
|
||||||
|
fi
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: Citus version \"$citus_version\"" >&5
|
||||||
|
$as_echo "$as_me: Citus version \"$citus_version\"" >&6;}
|
||||||
|
|
||||||
# Check whether we're building inside the source tree, if not, prepare
|
# Check whether we're building inside the source tree, if not, prepare
|
||||||
# the build directory.
|
# the build directory.
|
||||||
if test "$srcdir" -ef '.' ; then
|
if test "$srcdir" -ef '.' ; then
|
||||||
|
@ -2944,6 +2964,11 @@ ac_config_files="$ac_config_files Makefile.global"
|
||||||
ac_config_headers="$ac_config_headers src/include/citus_config.h"
|
ac_config_headers="$ac_config_headers src/include/citus_config.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define CITUS_VERSION "$citus_version"
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
cat >confcache <<\_ACEOF
|
cat >confcache <<\_ACEOF
|
||||||
# This file is a shell script that caches the results of configure
|
# This file is a shell script that caches the results of configure
|
||||||
# tests run on this system so they can be shared between configure
|
# tests run on this system so they can be shared between configure
|
||||||
|
|
|
@ -42,6 +42,13 @@ else
|
||||||
AC_MSG_NOTICE([building against PostgreSQL $version_num])
|
AC_MSG_NOTICE([building against PostgreSQL $version_num])
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
|
citus_version=$(grep "default_version" src/backend/distributed/citus.control | cut -d\' -f2)
|
||||||
|
format_check=$(echo "$citus_version" | grep -E "^@<:@0-9@:>@+\.@<:@0-9@:>@+-@<:@0-9@:>@+$")
|
||||||
|
if (( $? )); then
|
||||||
|
AC_MSG_ERROR([Citus version "$citus_version", found in citus.control, is in the wrong format])
|
||||||
|
fi
|
||||||
|
AC_MSG_NOTICE([Citus version "$citus_version"])
|
||||||
|
|
||||||
# Check whether we're building inside the source tree, if not, prepare
|
# Check whether we're building inside the source tree, if not, prepare
|
||||||
# the build directory.
|
# the build directory.
|
||||||
if test "$srcdir" -ef '.' ; then
|
if test "$srcdir" -ef '.' ; then
|
||||||
|
@ -114,4 +121,5 @@ AH_TOP([
|
||||||
* Do not manually edit!
|
* Do not manually edit!
|
||||||
*/
|
*/
|
||||||
])
|
])
|
||||||
|
AC_DEFINE_UNQUOTED([CITUS_VERSION], "$citus_version", [so the shared-library knows its own version])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
|
@ -11,19 +11,6 @@ EXTVERSIONS = 5.0 5.0-1 5.0-2 \
|
||||||
6.0-1 6.0-2 6.0-3 6.0-4 6.0-5 6.0-6 6.0-7 6.0-8 6.0-9 6.0-10 6.0-11 6.0-12 \
|
6.0-1 6.0-2 6.0-3 6.0-4 6.0-5 6.0-6 6.0-7 6.0-8 6.0-9 6.0-10 6.0-11 6.0-12 \
|
||||||
6.0-13 6.0-14 6.0-15 6.0-16
|
6.0-13 6.0-14 6.0-15 6.0-16
|
||||||
|
|
||||||
ifeq ($(wildcard citus.control),)
|
|
||||||
$(error citus.control not found!)
|
|
||||||
endif
|
|
||||||
MODVERSION = $(shell grep "default_version" citus.control | grep -oE "'[0-9]+\.[0-9]+-[0-9]+'")
|
|
||||||
ifeq ($(MODVERSION),)
|
|
||||||
WRONGVERSION = $(shell grep "default_version" citus.control | grep -oE "'.*'")
|
|
||||||
$(warning version $(WRONGVERSION) is incorrect)
|
|
||||||
$(error the version in citus.control should match: \d+.\d+-\d+)
|
|
||||||
endif
|
|
||||||
CITUS_VERSION = $(shell echo $(MODVERSION) | sed "s/\'//")
|
|
||||||
$(info building citus version $(CITUS_VERSION))
|
|
||||||
override CFLAGS+=-DCITUS_VERSION=$(CITUS_VERSION)
|
|
||||||
|
|
||||||
# All citus--*.sql files in the source directory
|
# All citus--*.sql files in the source directory
|
||||||
DATA = $(patsubst $(citus_abs_srcdir)/%.sql,%.sql,$(wildcard $(citus_abs_srcdir)/$(EXTENSION)--*--*.sql))
|
DATA = $(patsubst $(citus_abs_srcdir)/%.sql,%.sql,$(wildcard $(citus_abs_srcdir)/$(EXTENSION)--*--*.sql))
|
||||||
# Generated files for each version
|
# Generated files for each version
|
||||||
|
|
|
@ -11,9 +11,9 @@
|
||||||
#include "postgres.h"
|
#include "postgres.h"
|
||||||
|
|
||||||
#include "fmgr.h"
|
#include "fmgr.h"
|
||||||
#include "lib/stringinfo.h"
|
|
||||||
|
|
||||||
#include "utils/builtins.h"
|
#include "utils/builtins.h"
|
||||||
|
#include "citus_config.h"
|
||||||
|
|
||||||
|
|
||||||
/* exports for SQL callable functions */
|
/* exports for SQL callable functions */
|
||||||
|
@ -23,9 +23,6 @@ PG_FUNCTION_INFO_V1(citus_running_version);
|
||||||
#error Something went wrong, CITUS_VERSION is not set!
|
#error Something went wrong, CITUS_VERSION is not set!
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define STRINGIFY(x) #x
|
|
||||||
#define MACRO(x) STRINGIFY(x)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* citus_running_version returns the version string the currently running code was built
|
* citus_running_version returns the version string the currently running code was built
|
||||||
* with.
|
* with.
|
||||||
|
@ -33,7 +30,7 @@ PG_FUNCTION_INFO_V1(citus_running_version);
|
||||||
Datum
|
Datum
|
||||||
citus_running_version(PG_FUNCTION_ARGS)
|
citus_running_version(PG_FUNCTION_ARGS)
|
||||||
{
|
{
|
||||||
const char *versionStr = MACRO(CITUS_VERSION);
|
const char *versionStr = CITUS_VERSION;
|
||||||
text *versionText = cstring_to_text(versionStr);
|
text *versionText = cstring_to_text(versionStr);
|
||||||
|
|
||||||
PG_RETURN_TEXT_P(versionText);
|
PG_RETURN_TEXT_P(versionText);
|
||||||
|
|
|
@ -10,6 +10,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* so the shared-library knows its own version */
|
||||||
|
#undef CITUS_VERSION
|
||||||
|
|
||||||
/* Define to the address where bug reports for this package should be sent. */
|
/* Define to the address where bug reports for this package should be sent. */
|
||||||
#undef PACKAGE_BUGREPORT
|
#undef PACKAGE_BUGREPORT
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue