diff options
| author | Peter Eisentraut | 2002-03-29 17:32:55 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2002-03-29 17:32:55 +0000 |
| commit | 7c1ff354105e2256d7904497d8e282ccec53d2e6 (patch) | |
| tree | ae1c9485bf5eda1e049d11e327d5c759da2c19d2 /config/general.m4 | |
| parent | eb1ee9e63f1076753769f4ef1e8e0a93898a3e34 (diff) | |
Upgrade to Autoconf version 2.53. Replaced many custom macro
calls with new or now-built-in versions. Make sure that all
calls to AC_DEFINE have a third argument, for possible use of
autoheader in the future.
Diffstat (limited to 'config/general.m4')
| -rw-r--r-- | config/general.m4 | 91 |
1 files changed, 44 insertions, 47 deletions
diff --git a/config/general.m4 b/config/general.m4 index 2e17f2ba0bd..1a0a60dd60e 100644 --- a/config/general.m4 +++ b/config/general.m4 @@ -1,4 +1,4 @@ -# $Header: /cvsroot/pgsql/config/general.m4,v 1.1 2000/09/21 20:17:42 petere Exp $ +# $Header: /cvsroot/pgsql/config/general.m4,v 1.2 2002/03/29 17:32:53 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. @@ -12,16 +12,9 @@ # in the option evaluation code. -# print an error message and exit (while running `autoconf') -define([pgac_error], - [errprint(__file__:__line__[: error: $1 -]) - m4exit(10)]) - - # Convert type and name to shell variable name (e.g., "enable_long_strings") -define([pgac_arg_to_variable], - [$1[]_[]patsubst($2, -, _)]) +m4_define([pgac_arg_to_variable], + [$1[]_[]patsubst($2, -, _)]) # PGAC_ARG(TYPE, NAME, HELP-STRING, @@ -34,42 +27,45 @@ define([pgac_arg_to_variable], # and argument (or "yes", which is the same); similar for ACTION-IF-NO. AC_DEFUN([PGAC_ARG], -[dnl Check arguments -ifelse([$1], enable, , - [$1], with, , - [pgac_error([first argument of $0 must be `enable' or `with', not `$1'])])[]dnl -define([pgac_variable], [pgac_arg_to_variable([$1], [$2])])[]dnl -dnl Register help string, only if there is one -ifelse([$3], [], [], -[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl -ac_help="$ac_help -[$3]" -AC_DIVERT_POP()])dnl -[#] Check whether --$1-$2 was given -if test x"[$]{pgac_variable+set}" = xset; then - case [$]pgac_variable in +[ +m4_case([$1], + +enable, [ +AC_ARG_ENABLE([$2], [$3], [ + case [$]enableval in yes) - ifelse([$4], [], :, [$4]) + m4_default([$4], :) ;; no) - ifelse([$5], [], :, [$5]) + m4_default([$5], :) ;; -dnl Action if called with argument -ifelse([$6], [], [], -[ *) -dnl Set up $withval or $enableval - $1[]val=[$]pgac_variable + *) $6 ;; -])[]dnl - esac [#] [$]pgac_variable -dnl Action if omitted -ifelse([$7], [], [], -[else - $7 -])[]dnl -fi[]dnl -undefine([pgac_variable])dnl + esac +], +[$7])[]dnl AC_ARG_ENABLE +], + +with, [ +AC_ARG_WITH([$2], [$3], [ + case [$]withval in + yes) + m4_default([$4], :) + ;; + no) + m4_default([$5], :) + ;; + *) + $6 + ;; + esac +], +[$7])[]dnl AC_ARG_WITH +], + +[m4_fatal([first argument of $0 must be 'enable' or 'with', not '$1'])] +) ])# PGAC_ARG @@ -83,13 +79,14 @@ undefine([pgac_variable])dnl # execute.) AC_DEFUN([PGAC_ARG_BOOL], -[PGAC_ARG([$1], [$2], [$4], [$5], [$6], +[PGAC_ARG([$1], [$2], [$4], [$5], [$6], [AC_MSG_ERROR([no argument expected for --$1-$2 option])], - [ifelse([$3], yes, [pgac_arg_to_variable([$1], [$2])=yes + [m4_case([$3], + yes, [pgac_arg_to_variable([$1], [$2])=yes $5], - [$3], no, [pgac_arg_to_variable([$1], [$2])=no + no, [pgac_arg_to_variable([$1], [$2])=no $6], - [pgac_error([third argument of $0 must be `yes' or `no', not `$3'])])])[]dnl + [m4_fatal([third argument of $0 must be 'yes' or 'no', not '$3'])])])[]dnl ])# PGAC_ARG_BOOL @@ -125,11 +122,11 @@ AC_DEFUN([PGAC_ARG_OPTARG], $5], [pgac_arg_to_variable([$1], [$2])=no]) dnl Add this code only if there's a ACTION-ENABLED or ACTION-DISABLED. -ifelse([$6[]$7], [], [], +m4_ifval([$6[]$7], [ if test "[$]pgac_arg_to_variable([$1], [$2])" = yes; then - ifelse([$6], [], :, [$6]) -ifelse([$7], [], [], + m4_default([$6], :) +m4_ifval([$7], [else $7 ])[]dnl |
