Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0b9f93e

Browse files
committed
Code the unknown options check without using m4 diversions. Otherwise this
code relies on the checking macro actually being called at the end, or the automatic undiversion will produce garbage. These sort of implicit side-effects undermine the modularity of the macros and happen to break the ODBC driver which makes use of them. Also put the warnings at the very end of configure, so there is an even better chance of seeing them.
1 parent e45edb3 commit 0b9f93e

File tree

3 files changed

+62
-112
lines changed

3 files changed

+62
-112
lines changed

config/general.m4

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $PostgreSQL: pgsql/config/general.m4,v 1.6 2006/10/13 20:23:07 petere Exp $
1+
# $PostgreSQL: pgsql/config/general.m4,v 1.7 2006/10/30 22:15:04 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.
@@ -16,9 +16,6 @@
1616
m4_define([pgac_arg_to_variable],
1717
[$1[]_[]patsubst($2, -, _)])
1818

19-
# This is the divert which we store all declared 'with' and 'enable'
20-
# arguments for use with PGAC_CHECK_ARGS
21-
m4_define([_m4_divert(PGAC_ARGS)], 5432)
2219

2320
# PGAC_ARG(TYPE, NAME, HELP-STRING,
2421
# [ACTION-IF-YES], [ACTION-IF-NO], [ACTION-IF-ARG],
@@ -31,7 +28,7 @@ m4_define([_m4_divert(PGAC_ARGS)], 5432)
3128

3229
AC_DEFUN([PGAC_ARG],
3330
[
34-
m4_divert_text([PGAC_ARGS],[pgac_arg_to_variable([$1],[$2])) ;;])
31+
pgac_args="$pgac_args pgac_arg_to_variable([$1],[$2])"
3532
m4_case([$1],
3633
3734
enable, [
@@ -72,25 +69,22 @@ AC_ARG_WITH([$2], [$3], [
7269
)
7370
])# PGAC_ARG
7471

75-
# PGAC_CHECK_ARGS()
76-
# -----------------
77-
# Checks if the user passed any --with/without/enable/disable arguments that
78-
# we don't recognize. Just prints out a warning message, so this should be
79-
# called near the end, so the user will see it.
80-
81-
AC_DEFUN([PGAC_CHECK_ARGS],
82-
[
83-
for pgac_var in `set | sed 's/=.*//' | $EGREP 'with_|enable_'`; do
84-
case $pgac_var in
85-
m4_undivert([PGAC_ARGS])
86-
with_gnu_ld) ;;
87-
*)
88-
pgac_txt=`echo $pgac_var | tr '_' '-'`
89-
AC_MSG_WARN([option ignored: --$pgac_txt])
90-
;;
91-
esac
72+
# PGAC_ARG_CHECK()
73+
# ----------------
74+
# Checks if the user passed any --with/without/enable/disable
75+
# arguments that were not defined. Just prints out a warning message,
76+
# so this should be called near the end, so the user will see it.
77+
78+
AC_DEFUN([PGAC_ARG_CHECK],
79+
[for pgac_var in `set | sed 's/=.*//' | $EGREP 'with_|enable_'`; do
80+
for pgac_arg in $pgac_args with_gnu_ld; do
81+
if test "$pgac_var" = "$pgac_arg"; then
82+
continue 2
83+
fi
9284
done
93-
])# PGAC_CHECK_ARGS
85+
pgac_txt=`echo $pgac_var | tr '_' '-'`
86+
AC_MSG_WARN([option ignored: --$pgac_txt])
87+
done])# PGAC_ARG_CHECK
9488

9589
# PGAC_ARG_BOOL(TYPE, NAME, DEFAULT, HELP-STRING,
9690
# [ACTION-IF-YES], [ACTION-IF-NO])

0 commit comments

Comments
 (0)