changeset 5899:32f4ae21abc5

Collect macro definitions in configure.ac.
author Stephen J. Turnbull <stephen@xemacs.org>
date Tue, 05 May 2015 12:45:20 +0900
parents 2aeaf9bc7175
children 8826be40063c
files ChangeLog configure configure.ac
diffstat 3 files changed, 44 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue May 05 04:06:37 2015 +0900
+++ b/ChangeLog	Tue May 05 12:45:20 2015 +0900
@@ -1,3 +1,12 @@
+2015-05-05  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* configure.ac (XE_EXPAND_VARIABLE):
+	(CPP_to_sh):
+	(CPP_boolean_to_sh):
+	(COLON_TO_SPACE_WARN):
+	Collect with other macro definitions.
+	* configure: Regenerate.
+
 2015-05-05  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* configure.ac (PostgreSQL): Fix shell syntax error.
--- a/configure	Tue May 05 04:06:37 2015 +0900
+++ b/configure	Tue May 05 12:45:20 2015 +0900
@@ -5514,7 +5514,6 @@
 
 fi
 
-
 prefix_expanded=$prefix
 while true; do
   case "$prefix_expanded" in
@@ -9292,8 +9291,6 @@
 
 tempcname="conftest.c"
 
-
-
 cat > $tempcname < confdefs.h
 cat >> $tempcname <<EOF
 #define NOT_C_CODE
@@ -22059,8 +22056,6 @@
   *nocombreloc*) echo "  Linking with \`-z nocombreloc'.
     - Consider configuring with --with-pdump." ;;
 esac
-
-
 echo "
 Package Search (a 'root' contains '{xemacs,mule,site}-packages'):"
 
--- a/configure.ac	Tue May 05 04:06:37 2015 +0900
+++ b/configure.ac	Tue May 05 12:45:20 2015 +0900
@@ -107,6 +107,30 @@
 echo " " $1
 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1])dnl
 dnl
+dnl CPP_to_sh(CPP_SYMBOL, SH_VAR, DEFAULT_VALUE)
+define([CPP_to_sh],
+[[#]ifndef [$1]
+[#]define [$1]ifelse([$3],,, [ "$3"])
+[#]endif
+configure___ [$2]=[$1]
+])dnl CPP_to_sh
+dnl
+dnl CPP_boolean_to_sh(CPP_SYMBOL, SH_VAR)
+define([CPP_boolean_to_sh],
+[[#]ifdef [$1]
+configure___ [$2]=yes
+[#]else
+configure___ [$2]=no
+[#]endif
+])dnl CPP_boolean_to_sh
+dnl
+define(COLON_TO_SPACE_WARN,
+  [case "$[$1]" in *:* [)] dnl
+case "$opsys" in *cygwin* [)]
+  echo "  WARNING: Paths containing spaces will be misinterpreted." ;;
+esac
+[$1]="`echo '' $[$1] | sed -e 's/^ //' -e 's/:/ /g'`";; esac])dnl
+dnl
 dnl PRINT_VAR(var var ...)  prints values of shell variables
 define([PRINT_VAR],[for var in patsubst([$1],[[
 ]+],[ ]); do eval "echo \"$var = '\$$var'\""; done])dnl
@@ -234,12 +258,23 @@
 dnl
 dnl The construct foo=`echo $w1 $w2 $w3` fails on some systems if $w1 = -e or -n
 dnl So we use the following instead.
+dnl #### Other macros save the computed value in the 2nd arg, but
+dnl #### XE_SPACE returns the value in the first arg.
 dnl XE_SPACE(var, words)
 define([XE_SPACE],[
 T=""
 for W in $2; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
 $1="$T"
 ])dnl XE_SPACE
+dnl XE_EXPAND_VARIABLE(original,expanded)
+define([XE_EXPAND_VARIABLE],
+[$2=[$]$1
+while true; do
+  case "[$]$2" in
+    *\[$]* ) eval "$2=[$]$2" ;;
+    *) break ;;
+  esac
+done])dnl XE_EXPAND_VARIABLE
 dnl Autoconf 2.59 and 2.60 have slightly different versions of m4_cdr that
 dnl return different values for an empty list.  XE_CDR is a copy of the 2.60
 dnl version which will be used with both versions.
@@ -1091,15 +1126,6 @@
   AC_DEFINE(EXEC_PREFIX_USER_DEFINED)
 fi
 
-define([XE_EXPAND_VARIABLE],
-[$2=[$]$1
-while true; do
-  case "[$]$2" in
-    *\[$]* ) eval "$2=[$]$2" ;;
-    *) break ;;
-  esac
-done])dnl XE_EXPAND_VARIABLE
-
 XE_EXPAND_VARIABLE(prefix,prefix_expanded)
 XE_EXPAND_VARIABLE(datadir,datadir_expanded)
 XE_EXPAND_VARIABLE(exec_prefix,exec_prefix_expanded)
@@ -1719,23 +1745,6 @@
 dnl anyway.
 tempcname="conftest.c"
 
-dnl CPP_to_sh(CPP_SYMBOL, SH_VAR, DEFAULT_VALUE)
-define([CPP_to_sh],
-[[#]ifndef [$1]
-[#]define [$1]ifelse([$3],,, [ "$3"])
-[#]endif
-configure___ [$2]=[$1]
-])dnl CPP_to_sh
-
-dnl CPP_boolean_to_sh(CPP_SYMBOL, SH_VAR)
-define([CPP_boolean_to_sh],
-[[#]ifdef [$1]
-configure___ [$2]=yes
-[#]else
-configure___ [$2]=no
-[#]endif
-])dnl CPP_boolean_to_sh
-
 cat > $tempcname < confdefs.h
 cat >> $tempcname <<EOF
 #define NOT_C_CODE
@@ -5892,14 +5901,6 @@
   *nocombreloc*) echo "  Linking with \`-z nocombreloc'.
     - Consider configuring with --with-pdump." ;;
 esac
-
-define(COLON_TO_SPACE_WARN,
-  [case "$[$1]" in *:* [)] dnl
-case "$opsys" in *cygwin* [)]
-  echo "  WARNING: Paths containing spaces will be misinterpreted." ;;
-esac
-[$1]="`echo '' $[$1] | sed -e 's/^ //' -e 's/:/ /g'`";; esac])dnl
-
 echo "
 Package Search (a 'root' contains '{xemacs,mule,site}-packages'):"