Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4632891

Browse files
committed
configure: Allow adding a custom string to PG_VERSION
This can be used to mark custom built binaries with an extra versionstring such as a git describe identifier or distribution package releaseversion.From: Oskari Saarenmaa <os@ohmu.fi>
1 parentccca6f5 commit4632891

File tree

3 files changed

+54
-6
lines changed

3 files changed

+54
-6
lines changed

‎configure

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,7 @@ SHELL'
804804
ac_subst_files=''
805805
ac_user_opts='
806806
enable_option_checking
807+
with_extra_version
807808
with_template
808809
with_includes
809810
with_libraries
@@ -1507,6 +1508,8 @@ Optional Features:
15071508
Optional Packages:
15081509
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
15091510
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
1511+
--with-extra-version=STRING
1512+
append STRING to version
15101513
--with-template=NAME override operating system template
15111514
--with-includes=DIRS look for additional header files in DIRS
15121515
--with-libraries=DIRS look for additional libraries in DIRS
@@ -2047,16 +2050,44 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
20472050
configure_args=$ac_configure_args
20482051

20492052

2053+
PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\.[0-9][0-9]*\)'`
2054+
20502055

20512056
cat >>confdefs.h <<_ACEOF
2052-
#definePG_VERSION "$PACKAGE_VERSION"
2057+
#definePG_MAJORVERSION "$PG_MAJORVERSION"
20532058
_ACEOF
20542059

2055-
PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\.[0-9][0-9]*\)'`
2060+
2061+
2062+
2063+
2064+
# Check whether --with-extra-version was given.
2065+
if test "${with_extra_version+set}" = set; then
2066+
withval=$with_extra_version;
2067+
case $withval in
2068+
yes)
2069+
{ { $as_echo "$as_me:$LINENO: error: argument required for --with-extra-version option" >&5
2070+
$as_echo "$as_me: error: argument required for --with-extra-version option" >&2;}
2071+
{ (exit 1); exit 1; }; }
2072+
;;
2073+
no)
2074+
{ { $as_echo "$as_me:$LINENO: error: argument required for --with-extra-version option" >&5
2075+
$as_echo "$as_me: error: argument required for --with-extra-version option" >&2;}
2076+
{ (exit 1); exit 1; }; }
2077+
;;
2078+
*)
2079+
PG_VERSION="$PACKAGE_VERSION$withval"
2080+
;;
2081+
esac
2082+
2083+
else
2084+
PG_VERSION="$PACKAGE_VERSION"
2085+
fi
2086+
20562087

20572088

20582089
cat >>confdefs.h <<_ACEOF
2059-
#definePG_MAJORVERSION "$PG_MAJORVERSION"
2090+
#definePG_VERSION "$PG_VERSION"
20602091
_ACEOF
20612092

20622093

@@ -30284,7 +30315,7 @@ fi
3028430315

3028530316

3028630317
cat >>confdefs.h <<_ACEOF
30287-
#define PG_VERSION_STR "PostgreSQL $PACKAGE_VERSION on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"
30318+
#define PG_VERSION_STR "PostgreSQL $PG_VERSION on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"
3028830319
_ACEOF
3028930320

3029030321

‎configure.in

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,15 @@ AC_CONFIG_AUX_DIR(config)
2929
AC_PREFIX_DEFAULT(/usr/local/pgsql)
3030
AC_SUBST(configure_args, [$ac_configure_args])
3131

32-
AC_DEFINE_UNQUOTED(PG_VERSION, "$PACKAGE_VERSION", [PostgreSQL version as a string])
3332
[PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\.[0-9][0-9]*\)'`]
3433
AC_SUBST(PG_MAJORVERSION)
3534
AC_DEFINE_UNQUOTED(PG_MAJORVERSION, "$PG_MAJORVERSION", [PostgreSQL major version as a string])
3635

36+
PGAC_ARG_REQ(with, extra-version, [STRING], [append STRING to version],
37+
[PG_VERSION="$PACKAGE_VERSION$withval"],
38+
[PG_VERSION="$PACKAGE_VERSION"])
39+
AC_DEFINE_UNQUOTED(PG_VERSION, "$PG_VERSION", [PostgreSQL version as a string])
40+
3741
AC_CANONICAL_HOST
3842

3943
template=
@@ -1914,7 +1918,7 @@ else
19141918
fi
19151919

19161920
AC_DEFINE_UNQUOTED(PG_VERSION_STR,
1917-
["PostgreSQL $PACKAGE_VERSION on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"],
1921+
["PostgreSQL $PG_VERSION on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"],
19181922
[A string containing the version number, platform, and C compiler])
19191923

19201924
# Supply a numeric version string for use by 3rd party add-ons

‎doc/src/sgml/installation.sgml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,19 @@ su - postgres
628628

629629
<para>
630630
<variablelist>
631+
<varlistentry>
632+
<term><option>--with-extra-version=<replaceable>STRING</></option></term>
633+
<listitem>
634+
<para>
635+
Append <replaceable>STRING</> to the PostgreSQL version number. You
636+
can use this, for example, to mark binaries built from unreleased Git
637+
snapshots or containing custom patches with an extra version string
638+
such as a <command>git describe</command> identifier or a
639+
distribution package release number.
640+
</para>
641+
</listitem>
642+
</varlistentry>
643+
631644
<varlistentry>
632645
<term><option>--with-includes=<replaceable>DIRECTORIES</></option></term>
633646
<listitem>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp