1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

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.
This commit is contained in:
Peter Eisentraut
2006-10-30 22:15:04 +00:00
parent e45edb35e1
commit 0b9f93e6b0
3 changed files with 61 additions and 111 deletions

View File

@ -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.
# 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_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
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])