Merge pull request #1700 from citusdata/improve_build_metadata

Improve build metadata generated by configure

cr: @pykello
pull/1712/head
Jason Petersen 2017-10-16 18:29:05 -06:00 committed by GitHub
commit e4072a3dbb
9 changed files with 2345 additions and 516 deletions

1460
config/config.guess vendored Normal file

File diff suppressed because it is too large Load Diff

1304
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -12,13 +12,28 @@ AC_COPYRIGHT([Copyright (c) 2012-2017, Citus Data, Inc.])
AC_PROG_SED AC_PROG_SED
AC_PROG_AWK AC_PROG_AWK
# CITUS_VERSION definition # CITUS_NAME definition
AC_DEFINE_UNQUOTED(CITUS_VERSION, "$PACKAGE_VERSION", [Citus version as a string]) AC_DEFINE_UNQUOTED(CITUS_NAME, "$PACKAGE_NAME", [Citus full name as a string])
case $PACKAGE_NAME in
'Citus Enterprise') citus_edition=enterprise ;;
Citus) citus_edition=community ;;
*) AC_MSG_ERROR([Unrecognized package name.]) ;;
esac
# CITUS_EDITION definition
AC_DEFINE_UNQUOTED(CITUS_EDITION, "$citus_edition", [Citus edition as a string])
# CITUS_MAJORVERSION definition # CITUS_MAJORVERSION definition
[CITUS_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\.[0-9][0-9]*\)'`] [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]) 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 # CITUS_VERSION_NUM definition
# awk -F is a regex on some platforms, and not on others, so make "." a tab # 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].*$//' | [CITUS_VERSION_NUM="`echo "$PACKAGE_VERSION" | sed 's/[A-Za-z].*$//' |
@ -86,6 +101,23 @@ SAVE_CFLAGS="$CFLAGS"
AC_PROG_CC([$($PG_CONFIG --cc)]) AC_PROG_CC([$($PG_CONFIG --cc)])
CFLAGS="$SAVE_CFLAGS" CFLAGS="$SAVE_CFLAGS"
host_guess=`${SHELL} $srcdir/config/config.guess`
# Create compiler version string
if test x"$GCC" = x"yes" ; then
cc_string=`${CC} --version | sed q`
case $cc_string in [[A-Za-z]]*) ;; *) cc_string="GCC $cc_string";; esac
elif test x"$SUN_STUDIO_CC" = x"yes" ; then
cc_string=`${CC} -V 2>&1 | sed q`
else
cc_string=$CC
fi
AC_CHECK_SIZEOF([void *])
AC_DEFINE_UNQUOTED(CITUS_VERSION_STR,
["$PACKAGE_NAME $CITUS_VERSION on $host_guess, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"],
[A string containing the version number, platform, and C compiler])
# Locate source and build directory of the postgres we're building # Locate source and build directory of the postgres we're building
# against. Can't rely on either still being present, but e.g. optional # against. Can't rely on either still being present, but e.g. optional

View File

@ -12,7 +12,7 @@ EXTVERSIONS = 5.0 5.0-1 5.0-2 \
6.1-1 6.1-2 6.1-3 6.1-4 6.1-5 6.1-6 6.1-7 6.1-8 6.1-9 6.1-10 6.1-11 6.1-12 6.1-13 6.1-14 6.1-15 6.1-16 6.1-17 \ 6.1-1 6.1-2 6.1-3 6.1-4 6.1-5 6.1-6 6.1-7 6.1-8 6.1-9 6.1-10 6.1-11 6.1-12 6.1-13 6.1-14 6.1-15 6.1-16 6.1-17 \
6.2-1 6.2-2 6.2-3 6.2-4 \ 6.2-1 6.2-2 6.2-3 6.2-4 \
7.0-1 7.0-2 7.0-3 7.0-4 7.0-5 7.0-6 7.0-7 7.0-8 7.0-9 7.0-10 7.0-11 7.0-12 7.0-13 7.0-14 7.0-15 \ 7.0-1 7.0-2 7.0-3 7.0-4 7.0-5 7.0-6 7.0-7 7.0-8 7.0-9 7.0-10 7.0-11 7.0-12 7.0-13 7.0-14 7.0-15 \
7.1-1 7.1-1 7.1-2
# 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))
@ -172,6 +172,8 @@ $(EXTENSION)--7.0-15.sql: $(EXTENSION)--7.0-14.sql $(EXTENSION)--7.0-14--7.0-15.
cat $^ > $@ cat $^ > $@
$(EXTENSION)--7.1-1.sql: $(EXTENSION)--7.0-15.sql $(EXTENSION)--7.0-15--7.1-1.sql $(EXTENSION)--7.1-1.sql: $(EXTENSION)--7.0-15.sql $(EXTENSION)--7.0-15--7.1-1.sql
cat $^ > $@ cat $^ > $@
$(EXTENSION)--7.1-2.sql: $(EXTENSION)--7.1-1.sql $(EXTENSION)--7.1-1--7.1-2.sql
cat $^ > $@
NO_PGXS = 1 NO_PGXS = 1

View File

@ -0,0 +1,8 @@
/* citus--7.1-1--7.1-2 */
CREATE OR REPLACE FUNCTION pg_catalog.citus_version()
RETURNS text
LANGUAGE C STABLE STRICT
AS 'MODULE_PATHNAME', $$citus_version$$;
COMMENT ON FUNCTION pg_catalog.citus_version()
IS 'Citus version string';

View File

@ -1,6 +1,6 @@
# Citus extension # Citus extension
comment = 'Citus distributed database' comment = 'Citus distributed database'
default_version = '7.1-1' default_version = '7.1-2'
module_pathname = '$libdir/citus' module_pathname = '$libdir/citus'
relocatable = false relocatable = false
schema = pg_catalog schema = pg_catalog

View File

@ -0,0 +1,26 @@
/*-------------------------------------------------------------------------
*
* citus_version.c
*
* This file contains functions for displaying the Citus version string
*
* Copyright (c) 2017, Citus Data, Inc.
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "citus_version.h"
#include "utils/builtins.h"
/* exports for SQL callable functions */
PG_FUNCTION_INFO_V1(citus_version);
Datum
citus_version(PG_FUNCTION_ARGS)
{
PG_RETURN_TEXT_P(cstring_to_text(CITUS_VERSION_STR));
}

View File

@ -10,18 +10,27 @@
*/ */
/* Citus edition as a string */
#undef CITUS_EDITION
/* Extension version expected by this Citus build */ /* Extension version expected by this Citus build */
#undef CITUS_EXTENSIONVERSION #undef CITUS_EXTENSIONVERSION
/* Citus major version as a string */ /* Citus major version as a string */
#undef CITUS_MAJORVERSION #undef CITUS_MAJORVERSION
/* Citus full name as a string */
#undef CITUS_NAME
/* Citus version as a string */ /* Citus version as a string */
#undef CITUS_VERSION #undef CITUS_VERSION
/* Citus version as a number */ /* Citus version as a number */
#undef CITUS_VERSION_NUM #undef CITUS_VERSION_NUM
/* A string containing the version number, platform, and C compiler */
#undef CITUS_VERSION_STR
/* Define to 1 if you have the <inttypes.h> header file. */ /* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H #undef HAVE_INTTYPES_H
@ -70,5 +79,8 @@
/* Define to the version of this package. */ /* Define to the version of this package. */
#undef PACKAGE_VERSION #undef PACKAGE_VERSION
/* The size of `void *', as computed by sizeof. */
#undef SIZEOF_VOID_P
/* Define to 1 if you have the ANSI C header files. */ /* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS #undef STDC_HEADERS

View File

@ -1,5 +1,11 @@
/* This file is created manually */ /* This file is created manually */
/* Citus full name as a string */
#undef CITUS_NAME
/* Citus edition as a string */
#undef CITUS_EDITION
/* Extension version expected by this Citus build */ /* Extension version expected by this Citus build */
#undef CITUS_EXTENSIONVERSION #undef CITUS_EXTENSIONVERSION
@ -12,5 +18,8 @@
/* Citus version as a number */ /* Citus version as a number */
#undef CITUS_VERSION_NUM #undef CITUS_VERSION_NUM
/* A string containing the version number, platform, and C compiler */
#undef CITUS_VERSION_STR
/* Define to 1 if you have the `curl' library (-lcurl). */ /* Define to 1 if you have the `curl' library (-lcurl). */
#undef HAVE_LIBCURL #undef HAVE_LIBCURL