mirror of
https://github.com/postgres/postgres.git
synced 2025-07-26 01:22:12 +03:00
Simplify passing of configure arguments to pg_config
The previous system had configure put the value into the makefiles and then have the makefiles pass them to the build of pg_config. That was put in place when pg_config was a shell script. We can simplify that by having configure put the value into pg_config.h directly. This also makes the standard build system match how the MSVC build system already does it. Discussion: https://www.postgresql.org/message-id/flat/6e457870-cef5-5f1d-b57c-fc89cfb8a788%402ndquadrant.com
This commit is contained in:
6
configure
vendored
6
configure
vendored
@ -777,7 +777,6 @@ build_vendor
|
|||||||
build_cpu
|
build_cpu
|
||||||
build
|
build
|
||||||
PG_MAJORVERSION
|
PG_MAJORVERSION
|
||||||
configure_args
|
|
||||||
target_alias
|
target_alias
|
||||||
host_alias
|
host_alias
|
||||||
build_alias
|
build_alias
|
||||||
@ -2798,7 +2797,10 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
configure_args=$ac_configure_args
|
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define CONFIGURE_ARGS "$ac_configure_args"
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
|
||||||
PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\)'`
|
PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\)'`
|
||||||
|
@ -27,7 +27,7 @@ AC_COPYRIGHT([Copyright (c) 1996-2020, PostgreSQL Global Development Group])
|
|||||||
AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c])
|
AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c])
|
||||||
AC_CONFIG_AUX_DIR(config)
|
AC_CONFIG_AUX_DIR(config)
|
||||||
AC_PREFIX_DEFAULT(/usr/local/pgsql)
|
AC_PREFIX_DEFAULT(/usr/local/pgsql)
|
||||||
AC_SUBST(configure_args, [$ac_configure_args])
|
AC_DEFINE_UNQUOTED(CONFIGURE_ARGS, ["$ac_configure_args"], [Saved arguments from configure])
|
||||||
|
|
||||||
[PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\)'`]
|
[PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\)'`]
|
||||||
AC_SUBST(PG_MAJORVERSION)
|
AC_SUBST(PG_MAJORVERSION)
|
||||||
|
@ -74,9 +74,6 @@ endif # not PGXS
|
|||||||
|
|
||||||
vpathsearch = `for f in $(addsuffix /$(1),$(subst :, ,. $(VPATH))); do test -r $$f && echo $$f && break; done`
|
vpathsearch = `for f in $(addsuffix /$(1),$(subst :, ,. $(VPATH))); do test -r $$f && echo $$f && break; done`
|
||||||
|
|
||||||
# Saved arguments from configure
|
|
||||||
configure_args = @configure_args@
|
|
||||||
|
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
#
|
#
|
||||||
|
@ -31,7 +31,6 @@ include $(top_builddir)/src/Makefile.global
|
|||||||
# don't include subdirectory-path-dependent -I and -L switches
|
# don't include subdirectory-path-dependent -I and -L switches
|
||||||
STD_CPPFLAGS := $(filter-out -I$(top_srcdir)/src/include -I$(top_builddir)/src/include,$(CPPFLAGS))
|
STD_CPPFLAGS := $(filter-out -I$(top_srcdir)/src/include -I$(top_builddir)/src/include,$(CPPFLAGS))
|
||||||
STD_LDFLAGS := $(filter-out -L$(top_builddir)/src/common -L$(top_builddir)/src/port,$(LDFLAGS))
|
STD_LDFLAGS := $(filter-out -L$(top_builddir)/src/common -L$(top_builddir)/src/port,$(LDFLAGS))
|
||||||
override CPPFLAGS += -DVAL_CONFIGURE="\"$(configure_args)\""
|
|
||||||
override CPPFLAGS += -DVAL_CC="\"$(CC)\""
|
override CPPFLAGS += -DVAL_CC="\"$(CC)\""
|
||||||
override CPPFLAGS += -DVAL_CPPFLAGS="\"$(STD_CPPFLAGS)\""
|
override CPPFLAGS += -DVAL_CPPFLAGS="\"$(STD_CPPFLAGS)\""
|
||||||
override CPPFLAGS += -DVAL_CFLAGS="\"$(CFLAGS)\""
|
override CPPFLAGS += -DVAL_CFLAGS="\"$(CFLAGS)\""
|
||||||
|
@ -124,11 +124,7 @@ get_configdata(const char *my_exec_path, size_t *configdata_len)
|
|||||||
i++;
|
i++;
|
||||||
|
|
||||||
configdata[i].name = pstrdup("CONFIGURE");
|
configdata[i].name = pstrdup("CONFIGURE");
|
||||||
#ifdef VAL_CONFIGURE
|
configdata[i].setting = pstrdup(CONFIGURE_ARGS);
|
||||||
configdata[i].setting = pstrdup(VAL_CONFIGURE);
|
|
||||||
#else
|
|
||||||
configdata[i].setting = pstrdup(_("not recorded"));
|
|
||||||
#endif
|
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
configdata[i].name = pstrdup("CC");
|
configdata[i].name = pstrdup("CC");
|
||||||
|
@ -42,6 +42,9 @@
|
|||||||
Changing BLCKSZ requires an initdb. */
|
Changing BLCKSZ requires an initdb. */
|
||||||
#undef BLCKSZ
|
#undef BLCKSZ
|
||||||
|
|
||||||
|
/* Saved arguments from configure */
|
||||||
|
#undef CONFIGURE_ARGS
|
||||||
|
|
||||||
/* Define to the default TCP port number on which the server listens and to
|
/* Define to the default TCP port number on which the server listens and to
|
||||||
which clients will try to connect. This can be overridden at run-time, but
|
which clients will try to connect. This can be overridden at run-time, but
|
||||||
it's convenient if your clients have the right default compiled in.
|
it's convenient if your clients have the right default compiled in.
|
||||||
|
@ -195,6 +195,7 @@ sub GenerateFiles
|
|||||||
ALIGNOF_SHORT => 2,
|
ALIGNOF_SHORT => 2,
|
||||||
AC_APPLE_UNIVERSAL_BUILD => undef,
|
AC_APPLE_UNIVERSAL_BUILD => undef,
|
||||||
BLCKSZ => 1024 * $self->{options}->{blocksize},
|
BLCKSZ => 1024 * $self->{options}->{blocksize},
|
||||||
|
CONFIGURE_ARGS => '"' . $self->GetFakeConfigure() . '"',
|
||||||
DEF_PGPORT => $port,
|
DEF_PGPORT => $port,
|
||||||
DEF_PGPORT_STR => qq{"$port"},
|
DEF_PGPORT_STR => qq{"$port"},
|
||||||
ENABLE_GSS => $self->{options}->{gss} ? 1 : undef,
|
ENABLE_GSS => $self->{options}->{gss} ? 1 : undef,
|
||||||
@ -538,12 +539,6 @@ sub GenerateFiles
|
|||||||
$self->GenerateConfigHeader('src/include/pg_config_ext.h', \%define, 0);
|
$self->GenerateConfigHeader('src/include/pg_config_ext.h', \%define, 0);
|
||||||
$self->GenerateConfigHeader('src/interfaces/ecpg/include/ecpg_config.h', \%define, 0);
|
$self->GenerateConfigHeader('src/interfaces/ecpg/include/ecpg_config.h', \%define, 0);
|
||||||
|
|
||||||
open(my $f, '>>', 'src/include/pg_config.h')
|
|
||||||
|| confess "Could not write to src/include/pg_config.h\n";
|
|
||||||
print $f "\n";
|
|
||||||
print $f "#define VAL_CONFIGURE \"" . $self->GetFakeConfigure() . "\"\n";
|
|
||||||
close($f);
|
|
||||||
|
|
||||||
$self->GenerateDefFile(
|
$self->GenerateDefFile(
|
||||||
"src/interfaces/libpq/libpqdll.def",
|
"src/interfaces/libpq/libpqdll.def",
|
||||||
"src/interfaces/libpq/exports.txt",
|
"src/interfaces/libpq/exports.txt",
|
||||||
|
Reference in New Issue
Block a user