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

Commitf7ef575

Browse files
committed
Use Autoconf provided AS_HELP_STRING macro to automatically format and
align strings in the --help output. Do this through our abstraction layerto eliminate redundancy and randomness in configure.in.
1 parent06735e3 commitf7ef575

File tree

3 files changed

+118
-92
lines changed

3 files changed

+118
-92
lines changed

‎config/general.m4

Lines changed: 47 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $PostgreSQL: pgsql/config/general.m4,v 1.9 2006/11/30 22:21:23 tgl Exp $
1+
# $PostgreSQL: pgsql/config/general.m4,v 1.10 2008/10/29 09:27:24 petere Exp $
22

33
# This file defines new macros to process configure command line
44
# arguments, to replace the brain-dead AC_ARG_WITH and AC_ARG_ENABLE.
@@ -17,52 +17,57 @@ m4_define([pgac_arg_to_variable],
1717
[$1[]_[]patsubst($2, -, _)])
1818

1919

20-
# PGAC_ARG(TYPE, NAME, HELP-STRING,
20+
# PGAC_ARG(TYPE, NAME, HELP-STRING-LHS-EXTRA, HELP-STRING-RHS,
2121
# [ACTION-IF-YES], [ACTION-IF-NO], [ACTION-IF-ARG],
2222
# [ACTION-IF-OMITTED])
23-
# ----------------------------------------------------------
23+
# ------------------------------------------------------------
2424
# This is the base layer. TYPE is either "with" or "enable", depending
25-
# on what you like. NAME is the rest of the option name, HELP-STRING
26-
# as usual. ACTION-IF-YES is executed if the option is given without
27-
# an argument (or "yes", which is the same); similar for ACTION-IF-NO.
25+
# on what you like. NAME is the rest of the option name.
26+
# HELP-STRING-LHS-EXTRA is a string to append to the option name on
27+
# the left-hand side of the help output, e.g., an argument name. If
28+
# set to "-", append nothing, but let the option appear in the
29+
# negative form (disable/without). HELP-STRING-RHS is the option
30+
# description, for the right-hand side of the help output.
31+
# ACTION-IF-YES is executed if the option is given without an argument
32+
# (or "yes", which is the same); similar for ACTION-IF-NO.
2833

2934
AC_DEFUN([PGAC_ARG],
3035
[
3136
pgac_args="$pgac_args pgac_arg_to_variable([$1],[$2])"
3237
m4_case([$1],
3338
3439
enable,[
35-
AC_ARG_ENABLE([$2],[$3],[
40+
AC_ARG_ENABLE([$2],[AS_HELP_STRING([--]m4_if($3,-,disable,enable)[-$2]m4_if($3,-, ,$3),[$4])],[
3641
case[$]enableval in
3742
yes)
38-
m4_default([$4],:)
43+
m4_default([$5],:)
3944
;;
4045
no)
41-
m4_default([$5],:)
46+
m4_default([$6],:)
4247
;;
4348
*)
44-
$6
49+
$7
4550
;;
4651
esac
4752
],
48-
[$7])[]dnl AC_ARG_ENABLE
53+
[$8])[]dnl AC_ARG_ENABLE
4954
],
5055
5156
with,[
52-
AC_ARG_WITH([$2],[$3],[
57+
AC_ARG_WITH([$2],[AS_HELP_STRING([--]m4_if($3,-,without,with)[-$2]m4_if($3,-, ,$3),[$4])],[
5358
case[$]withval in
5459
yes)
55-
m4_default([$4],:)
60+
m4_default([$5],:)
5661
;;
5762
no)
58-
m4_default([$5],:)
63+
m4_default([$6],:)
5964
;;
6065
*)
61-
$6
66+
$7
6267
;;
6368
esac
6469
],
65-
[$7])[]dnl AC_ARG_WITH
70+
[$8])[]dnl AC_ARG_WITH
6671
],
6772
6873
[m4_fatal([first argument of$0 must be 'enable' or 'with', not '$1'])]
@@ -86,43 +91,52 @@ AC_DEFUN([PGAC_ARG_CHECK],
8691
AC_MSG_WARN([option ignored: --$pgac_txt])
8792
done])# PGAC_ARG_CHECK
8893

89-
# PGAC_ARG_BOOL(TYPE, NAME, DEFAULT, HELP-STRING,
94+
# PGAC_ARG_BOOL(TYPE, NAME, DEFAULT, HELP-STRING-RHS,
9095
# [ACTION-IF-YES], [ACTION-IF-NO])
91-
# -----------------------------------------------
96+
# ---------------------------------------------------
9297
# Accept a boolean option, that is, one that only takes yes or no.
9398
# ("no" is equivalent to "disable" or "without"). DEFAULT is what
9499
# should be done if the option is omitted; it should be "yes" or "no".
95100
# (Consequently, one of ACTION-IF-YES and ACTION-IF-NO will always
96101
# execute.)
97102

98103
AC_DEFUN([PGAC_ARG_BOOL],
99-
[PGAC_ARG([$1],[$2],[$4],[$5],[$6],
104+
[dnl The following hack is necessary because in a few instances this
105+
dnl macro is called twice for the same option with different default
106+
dnl values. But we only want it to appear once in the help. We achieve
107+
dnl that by making the help string look the same, which is why we need to
108+
dnl save the default that was passed in previously.
109+
m4_define([_pgac_helpdefault],m4_ifdef([pgac_defined_$1_$2_bool],[m4_defn([pgac_defined_$1_$2_bool])],[$3]))dnl
110+
PGAC_ARG([$1],[$2],[m4_if(_pgac_helpdefault,yes,-)],[$4],[$5],[$6],
100111
[AC_MSG_ERROR([no argument expected for --$1-$2 option])],
101112
[m4_case([$3],
102113
yes,[pgac_arg_to_variable([$1],[$2])=yes
103114
$5],
104115
no,[pgac_arg_to_variable([$1],[$2])=no
105116
$6],
106117
[m4_fatal([third argument of$0 must be 'yes' or 'no', not '$3'])])])[]dnl
118+
m4_define([pgac_defined_$1_$2_bool],[$3])dnl
107119
])# PGAC_ARG_BOOL
108120

109121

110-
# PGAC_ARG_REQ(TYPE, NAME, HELP-STRING, [ACTION-IF-GIVEN], [ACTION-IF-NOT-GIVEN])
111-
# -------------------------------------------------------------------------------
122+
# PGAC_ARG_REQ(TYPE, NAME, HELP-ARGNAME, HELP-STRING-RHS,
123+
# [ACTION-IF-GIVEN], [ACTION-IF-NOT-GIVEN])
124+
# -------------------------------------------------------
112125
# This option will require an argument; "yes" or "no" will not be
113-
# accepted.
126+
# accepted. HELP-ARGNAME is a name for the argument for the help output.
114127

115128
AC_DEFUN([PGAC_ARG_REQ],
116-
[PGAC_ARG([$1],[$2],[$3],
129+
[PGAC_ARG([$1],[$2],[=$3],[$4],
117130
[AC_MSG_ERROR([argument required for --$1-$2 option])],
118131
[AC_MSG_ERROR([argument required for --$1-$2 option])],
119-
[$4],
120-
[$5])])# PGAC_ARG_REQ
132+
[$5],
133+
[$6])])# PGAC_ARG_REQ
121134

122135

123-
# PGAC_ARG_OPTARG(TYPE, NAME, HELP-STRING, [DEFAULT-ACTION], [ARG-ACTION]
136+
# PGAC_ARG_OPTARG(TYPE, NAME, HELP-ARGNAME, HELP-STRING-RHS,
137+
# [DEFAULT-ACTION], [ARG-ACTION],
124138
# [ACTION-ENABLED], [ACTION-DISABLED])
125-
# -----------------------------------------------------------------------
139+
# ----------------------------------------------------------
126140
# This will create an option that behaves as follows: If omitted, or
127141
# called with "no", then set the enable_variable to "no" and do
128142
# nothing else. If called with "yes", then execute DEFAULT-ACTION. If
@@ -134,18 +148,18 @@ AC_DEFUN([PGAC_ARG_REQ],
134148
# additional piece of information.
135149

136150
AC_DEFUN([PGAC_ARG_OPTARG],
137-
[PGAC_ARG([$1],[$2],[$3],[$4],[],
151+
[PGAC_ARG([$1],[$2],[@<:@=$3@:>@],[$4],[$5],[],
138152
[pgac_arg_to_variable([$1],[$2])=yes
139-
$5],
153+
$6],
140154
[pgac_arg_to_variable([$1],[$2])=no])
141155
dnl Add this code only if there's a ACTION-ENABLED or ACTION-DISABLED.
142-
m4_ifval([$6[]$7],
156+
m4_ifval([$7[]$8],
143157
[
144158
if test "[$]pgac_arg_to_variable([$1],[$2])" = yes; then
145-
m4_default([$6],:)
146-
m4_ifval([$7],
159+
m4_default([$7],:)
160+
m4_ifval([$8],
147161
[else
148-
$7
162+
$8
149163
])[]dnl
150164
fi
151165
])[]dnl

‎configure

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,10 +1353,13 @@ if test -n "$ac_init_help"; then
13531353
Optional Features:
13541354
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
13551355
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
1356-
--disable-integer-datetimes disable 64-bit integer date/time support
1357-
--enable-nls[=LANGUAGES] enable Native Language Support
1356+
--disable-integer-datetimes
1357+
disable 64-bit integer date/time support
1358+
--enable-nls[=LANGUAGES]
1359+
enable Native Language Support
13581360
--disable-shared do not build shared libraries
1359-
--disable-rpath do not embed shared library search path in executables
1361+
--disable-rpath do not embed shared library search path in
1362+
executables
13601363
--disable-spinlocks do not use spinlocks
13611364
--enable-debug build with debugging symbols (-g)
13621365
--enable-profiling build with profiling enabled
@@ -1365,40 +1368,49 @@ Optional Features:
13651368
--enable-depend turn on automatic dependency tracking
13661369
--enable-cassert enable assertion checks (for debugging)
13671370
--enable-thread-safety make client libraries thread-safe
1368-
--enable-thread-safety-force force thread-safety despite thread test failure
1371+
--enable-thread-safety-force
1372+
force thread-safety despite thread test failure
13691373
--disable-float4-byval disable float4 passed by value
13701374
--disable-float8-byval disable float8 passed by value
13711375
--disable-largefile omit support for large files
13721376

13731377
Optional Packages:
13741378
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
13751379
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
1376-
1380+
--with-template=NAME override operating system template
13771381
--with-includes=DIRS look for additional header files in DIRS
13781382
--with-libraries=DIRS look for additional libraries in DIRS
13791383
--with-libs=DIRS alternative spelling of --with-libraries
13801384
--with-pgport=PORTNUM set default port number [5432]
1381-
--with-blocksize=BLOCKSIZE set table block size in kB [8]
1385+
--with-blocksize=BLOCKSIZE
1386+
set table block size in kB [8]
13821387
--with-segsize=SEGSIZE set table segment size in GB [1]
1383-
--with-wal-blocksize=BLOCKSIZE set WAL block size in kB [8]
1384-
--with-wal-segsize=SEGSIZE set WAL segment size in MB [16]
1388+
--with-wal-blocksize=BLOCKSIZE
1389+
set WAL block size in kB [8]
1390+
--with-wal-segsize=SEGSIZE
1391+
set WAL segment size in MB [16]
1392+
--with-CC=CMD set compiler (deprecated)
13851393
--with-tcl build Tcl modules (PL/Tcl)
13861394
--with-tclconfig=DIR tclConfig.sh is in DIR
13871395
--with-perl build Perl modules (PL/Perl)
13881396
--with-python build Python modules (PL/Python)
13891397
--with-gssapi build with GSSAPI support
13901398
--with-krb5 build with Kerberos 5 support
1391-
--with-krb-srvnam=NAME default service principal name in Kerberos [postgres]
1399+
--with-krb-srvnam=NAME default service principal name in Kerberos
1400+
[postgres]
13921401
--with-pam build with PAM support
13931402
--with-ldap build with LDAP support
13941403
--with-bonjour build with Bonjour support
13951404
--with-openssl build with OpenSSL support
13961405
--without-readline do not use GNU Readline nor BSD Libedit for editing
1397-
--with-libedit-preferred prefer BSD Libedit over GNU Readline
1398-
--with-ossp-uuid use OSSP UUID library when building contrib/uuid-ossp
1406+
--with-libedit-preferred
1407+
prefer BSD Libedit over GNU Readline
1408+
--with-ossp-uuid use OSSP UUID library when building
1409+
contrib/uuid-ossp
13991410
--with-libxml build with XML support
14001411
--with-libxslt use XSLT support when building contrib/xml2
1401-
--with-system-tzdata=DIR use system time zone data in DIR
1412+
--with-system-tzdata=DIR
1413+
use system time zone data in DIR
14021414
--without-zlib do not use Zlib
14031415
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
14041416

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp