Skip to content

Commit

Permalink
Make gp_version_at_initdb.dat usable in VPATH builds
Browse files Browse the repository at this point in the history
(resolves #12059)
  • Loading branch information
d committed May 27, 2021
1 parent 840680c commit 0d94075
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 16 deletions.
12 changes: 6 additions & 6 deletions configure
Expand Up @@ -631,6 +631,7 @@ PG_SYSROOT
PG_VERSION_NUM
GP_MAJORVERSION
GP_VERSION_SHORT
GP_VERSION_LONG
BLD_ARCH
PROVE
DBTOEPUB
Expand Down Expand Up @@ -21866,19 +21867,14 @@ GP_VERSION_LONG=`bash ./getversion`

GP_VERSION_LONG="$GP_VERSION_LONG$with_extra_version"


echo $GP_VERSION_LONG > VERSION
GP_VERSION=`cat VERSION`

GP_VERSION_SHORT=`bash ./getversion --short`
GP_VERSION_SHORT="$GP_VERSION_SHORT$with_extra_version"


GP_VERSION_IN="src/include/catalog/gp_version_at_initdb.in"
GP_VERSION_DAT="src/include/catalog/gp_version_at_initdb.dat"
if grep '\$\$' $GP_VERSION_IN > /dev/null 2>&1 ; then
sed "s,\\$.*\\$\\$,$GP_VERSION," $GP_VERSION_IN > $GP_VERSION_DAT
fi

GP_BASH_VERSION_IN="gpMgmt/bin/lib/gp_bash_version.sh.in"
GP_BASH_VERSION_SH="gpMgmt/bin/lib/gp_bash_version.sh"
if grep '##' $GP_BASH_VERSION_IN > /dev/null 2>&1 ; then
Expand Down Expand Up @@ -22000,6 +21996,9 @@ fi
ac_config_files="$ac_config_files GNUmakefile src/Makefile.global"


ac_config_files="$ac_config_files src/include/catalog/gp_version_at_initdb.dat"


ac_config_links="$ac_config_links src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION} src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION} src/include/pg_config_os.h:src/include/port/${template}.h src/Makefile.port:src/makefiles/Makefile.${template}"


Expand Down Expand Up @@ -22721,6 +22720,7 @@ do
"src/backend/port/tas.s") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/tas.s:src/backend/port/tas/${tas_file}" ;;
"GNUmakefile") CONFIG_FILES="$CONFIG_FILES GNUmakefile" ;;
"src/Makefile.global") CONFIG_FILES="$CONFIG_FILES src/Makefile.global" ;;
"src/include/catalog/gp_version_at_initdb.dat") CONFIG_FILES="$CONFIG_FILES src/include/catalog/gp_version_at_initdb.dat" ;;
"src/backend/port/pg_sema.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION}" ;;
"src/backend/port/pg_shmem.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION}" ;;
"src/include/pg_config_os.h") CONFIG_LINKS="$CONFIG_LINKS src/include/pg_config_os.h:src/include/port/${template}.h" ;;
Expand Down
9 changes: 3 additions & 6 deletions configure.in
Expand Up @@ -2758,6 +2758,7 @@ AC_SUBST(BLD_ARCH)
GP_VERSION_LONG=`bash ./getversion`

GP_VERSION_LONG="$GP_VERSION_LONG$with_extra_version"
AC_SUBST(GP_VERSION_LONG)

echo $GP_VERSION_LONG > VERSION
GP_VERSION=`cat VERSION`
Expand All @@ -2766,12 +2767,6 @@ GP_VERSION_SHORT=`bash ./getversion --short`
GP_VERSION_SHORT="$GP_VERSION_SHORT$with_extra_version"
AC_SUBST(GP_VERSION_SHORT)

GP_VERSION_IN="src/include/catalog/gp_version_at_initdb.in"
GP_VERSION_DAT="src/include/catalog/gp_version_at_initdb.dat"
if grep '\$\$' $GP_VERSION_IN > /dev/null 2>&1 ; then
sed "s,\\$.*\\$\\$,$GP_VERSION," $GP_VERSION_IN > $GP_VERSION_DAT
fi

GP_BASH_VERSION_IN="gpMgmt/bin/lib/gp_bash_version.sh.in"
GP_BASH_VERSION_SH="gpMgmt/bin/lib/gp_bash_version.sh"
if grep '##' $GP_BASH_VERSION_IN > /dev/null 2>&1 ; then
Expand Down Expand Up @@ -2866,6 +2861,8 @@ AC_SUBST(vpath_build)

AC_CONFIG_FILES([GNUmakefile src/Makefile.global])

AC_CONFIG_FILES([src/include/catalog/gp_version_at_initdb.dat])

AC_CONFIG_LINKS([
src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION}
src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION}
Expand Down
9 changes: 7 additions & 2 deletions src/backend/catalog/Makefile
Expand Up @@ -90,10 +90,15 @@ POSTGRES_BKI_DATA = $(addprefix $(top_srcdir)/src/include/catalog/,\
pg_pltemplate.dat pg_proc.dat pg_range.dat pg_tablespace.dat \
pg_ts_config.dat pg_ts_config_map.dat pg_ts_dict.dat pg_ts_parser.dat \
pg_ts_template.dat pg_type.dat \
gp_version_at_initdb.dat pg_resgroup.dat pg_resgroupcapability.dat \
pg_compression.dat \
)

POSTGRES_BKI_DATA += $(addprefix $(top_srcdir)/src/include/catalog/,\
pg_compression.dat \
pg_resgroup.dat pg_resgroupcapability.dat \
) \
$(top_builddir)/src/include/catalog/gp_version_at_initdb.dat


all: distprep generated-header-symlinks

distprep: bki-stamp
Expand Down
2 changes: 2 additions & 0 deletions src/include/catalog/gp_version_at_initdb.dat.in
@@ -0,0 +1,2 @@
# This is generated by autoconf from gp_version_at_initdb.in.
{ schemaversion => '2', productversion => '@GP_VERSION_LONG@' }
2 changes: 0 additions & 2 deletions src/include/catalog/gp_version_at_initdb.in

This file was deleted.

0 comments on commit 0d94075

Please sign in to comment.