diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2006-10-30 22:15:04 +0000 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2006-10-30 22:15:04 +0000 |
commit | 0b9f93e6b04d941d3428d6e709ab8c4b03554f2f (patch) | |
tree | 6cb5d492890e07afc50f99f97a4fa12dba2f0fd4 /config | |
parent | e45edb35e1fb2b05c251c232477a55bd2428a3c2 (diff) | |
download | postgresql-0b9f93e6b04d941d3428d6e709ab8c4b03554f2f.tar.gz |
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.
Diffstat (limited to 'config')
-rw-r--r-- | config/general.m4 | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/config/general.m4 b/config/general.m4 index 8139f0ae3f..45edfc4c0e 100644 --- a/config/general.m4 +++ b/config/general.m4 @@ -1,4 +1,4 @@ -# $PostgreSQL: pgsql/config/general.m4,v 1.6 2006/10/13 20:23:07 petere Exp $ +# $PostgreSQL: pgsql/config/general.m4,v 1.7 2006/10/30 22:15:04 petere Exp $ # This file defines new macros to process configure command line # arguments, to replace the brain-dead AC_ARG_WITH and AC_ARG_ENABLE. @@ -16,9 +16,6 @@ m4_define([pgac_arg_to_variable], [$1[]_[]patsubst($2, -, _)]) -# This is the divert which we store all declared 'with' and 'enable' -# arguments for use with PGAC_CHECK_ARGS -m4_define([_m4_divert(PGAC_ARGS)], 5432) # PGAC_ARG(TYPE, NAME, HELP-STRING, # [ACTION-IF-YES], [ACTION-IF-NO], [ACTION-IF-ARG], @@ -31,7 +28,7 @@ m4_define([_m4_divert(PGAC_ARGS)], 5432) AC_DEFUN([PGAC_ARG], [ -m4_divert_text([PGAC_ARGS],[pgac_arg_to_variable([$1],[$2])) ;;]) +pgac_args="$pgac_args pgac_arg_to_variable([$1],[$2])" m4_case([$1], enable, [ @@ -72,25 +69,22 @@ AC_ARG_WITH([$2], [$3], [ ) ])# PGAC_ARG -# PGAC_CHECK_ARGS() -# ----------------- -# Checks if the user passed any --with/without/enable/disable arguments that -# we don't recognize. Just prints out a warning message, so this should be -# called near the end, so the user will see it. - -AC_DEFUN([PGAC_CHECK_ARGS], -[ - for pgac_var in `set | sed 's/=.*//' | $EGREP 'with_|enable_'`; do - case $pgac_var in - m4_undivert([PGAC_ARGS]) - with_gnu_ld) ;; - *) - pgac_txt=`echo $pgac_var | tr '_' '-'` - AC_MSG_WARN([option ignored: --$pgac_txt]) - ;; - esac +# PGAC_ARG_CHECK() +# ---------------- +# Checks if the user passed any --with/without/enable/disable +# arguments that were not defined. Just prints out a warning message, +# so this should be called near the end, so the user will see it. + +AC_DEFUN([PGAC_ARG_CHECK], +[for pgac_var in `set | sed 's/=.*//' | $EGREP 'with_|enable_'`; do + for pgac_arg in $pgac_args with_gnu_ld; do + if test "$pgac_var" = "$pgac_arg"; then + continue 2 + fi done -])# PGAC_CHECK_ARGS + pgac_txt=`echo $pgac_var | tr '_' '-'` + AC_MSG_WARN([option ignored: --$pgac_txt]) +done])# PGAC_ARG_CHECK # PGAC_ARG_BOOL(TYPE, NAME, DEFAULT, HELP-STRING, # [ACTION-IF-YES], [ACTION-IF-NO]) |