comparison configure.ac @ 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 2865c4f6fab2
children 8826be40063c
comparison
equal deleted inserted replaced
5898:2aeaf9bc7175 5899:32f4ae21abc5
104 dnl 104 dnl
105 define([USAGE_ERROR], 105 define([USAGE_ERROR],
106 [(echo "$progname: Usage error:" 106 [(echo "$progname: Usage error:"
107 echo " " $1 107 echo " " $1
108 echo " Use \`$progname --help' to show usage.") >&2 && exit 1])dnl 108 echo " Use \`$progname --help' to show usage.") >&2 && exit 1])dnl
109 dnl
110 dnl CPP_to_sh(CPP_SYMBOL, SH_VAR, DEFAULT_VALUE)
111 define([CPP_to_sh],
112 [[#]ifndef [$1]
113 [#]define [$1]ifelse([$3],,, [ "$3"])
114 [#]endif
115 configure___ [$2]=[$1]
116 ])dnl CPP_to_sh
117 dnl
118 dnl CPP_boolean_to_sh(CPP_SYMBOL, SH_VAR)
119 define([CPP_boolean_to_sh],
120 [[#]ifdef [$1]
121 configure___ [$2]=yes
122 [#]else
123 configure___ [$2]=no
124 [#]endif
125 ])dnl CPP_boolean_to_sh
126 dnl
127 define(COLON_TO_SPACE_WARN,
128 [case "$[$1]" in *:* [)] dnl
129 case "$opsys" in *cygwin* [)]
130 echo " WARNING: Paths containing spaces will be misinterpreted." ;;
131 esac
132 [$1]="`echo '' $[$1] | sed -e 's/^ //' -e 's/:/ /g'`";; esac])dnl
109 dnl 133 dnl
110 dnl PRINT_VAR(var var ...) prints values of shell variables 134 dnl PRINT_VAR(var var ...) prints values of shell variables
111 define([PRINT_VAR],[for var in patsubst([$1],[[ 135 define([PRINT_VAR],[for var in patsubst([$1],[[
112 ]+],[ ]); do eval "echo \"$var = '\$$var'\""; done])dnl 136 ]+],[ ]); do eval "echo \"$var = '\$$var'\""; done])dnl
113 dnl 137 dnl
232 fi 256 fi
233 ])dnl 257 ])dnl
234 dnl 258 dnl
235 dnl The construct foo=`echo $w1 $w2 $w3` fails on some systems if $w1 = -e or -n 259 dnl The construct foo=`echo $w1 $w2 $w3` fails on some systems if $w1 = -e or -n
236 dnl So we use the following instead. 260 dnl So we use the following instead.
261 dnl #### Other macros save the computed value in the 2nd arg, but
262 dnl #### XE_SPACE returns the value in the first arg.
237 dnl XE_SPACE(var, words) 263 dnl XE_SPACE(var, words)
238 define([XE_SPACE],[ 264 define([XE_SPACE],[
239 T="" 265 T=""
240 for W in $2; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done 266 for W in $2; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
241 $1="$T" 267 $1="$T"
242 ])dnl XE_SPACE 268 ])dnl XE_SPACE
269 dnl XE_EXPAND_VARIABLE(original,expanded)
270 define([XE_EXPAND_VARIABLE],
271 [$2=[$]$1
272 while true; do
273 case "[$]$2" in
274 *\[$]* ) eval "$2=[$]$2" ;;
275 *) break ;;
276 esac
277 done])dnl XE_EXPAND_VARIABLE
243 dnl Autoconf 2.59 and 2.60 have slightly different versions of m4_cdr that 278 dnl Autoconf 2.59 and 2.60 have slightly different versions of m4_cdr that
244 dnl return different values for an empty list. XE_CDR is a copy of the 2.60 279 dnl return different values for an empty list. XE_CDR is a copy of the 2.60
245 dnl version which will be used with both versions. 280 dnl version which will be used with both versions.
246 define([XE_CDR], 281 define([XE_CDR],
247 [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], 282 [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
1089 exec_prefix='${prefix}' 1124 exec_prefix='${prefix}'
1090 else 1125 else
1091 AC_DEFINE(EXEC_PREFIX_USER_DEFINED) 1126 AC_DEFINE(EXEC_PREFIX_USER_DEFINED)
1092 fi 1127 fi
1093 1128
1094 define([XE_EXPAND_VARIABLE],
1095 [$2=[$]$1
1096 while true; do
1097 case "[$]$2" in
1098 *\[$]* ) eval "$2=[$]$2" ;;
1099 *) break ;;
1100 esac
1101 done])dnl XE_EXPAND_VARIABLE
1102
1103 XE_EXPAND_VARIABLE(prefix,prefix_expanded) 1129 XE_EXPAND_VARIABLE(prefix,prefix_expanded)
1104 XE_EXPAND_VARIABLE(datadir,datadir_expanded) 1130 XE_EXPAND_VARIABLE(datadir,datadir_expanded)
1105 XE_EXPAND_VARIABLE(exec_prefix,exec_prefix_expanded) 1131 XE_EXPAND_VARIABLE(exec_prefix,exec_prefix_expanded)
1106 XE_EXPAND_VARIABLE(libdir,libdir_expanded) 1132 XE_EXPAND_VARIABLE(libdir,libdir_expanded)
1107 XE_EXPAND_VARIABLE(infodir,infodir_expanded) 1133 XE_EXPAND_VARIABLE(infodir,infodir_expanded)
1716 1742
1717 dnl It is not important that this name contain the PID; you cannot run 1743 dnl It is not important that this name contain the PID; you cannot run
1718 dnl two configures in the same directory and have anything work 1744 dnl two configures in the same directory and have anything work
1719 dnl anyway. 1745 dnl anyway.
1720 tempcname="conftest.c" 1746 tempcname="conftest.c"
1721
1722 dnl CPP_to_sh(CPP_SYMBOL, SH_VAR, DEFAULT_VALUE)
1723 define([CPP_to_sh],
1724 [[#]ifndef [$1]
1725 [#]define [$1]ifelse([$3],,, [ "$3"])
1726 [#]endif
1727 configure___ [$2]=[$1]
1728 ])dnl CPP_to_sh
1729
1730 dnl CPP_boolean_to_sh(CPP_SYMBOL, SH_VAR)
1731 define([CPP_boolean_to_sh],
1732 [[#]ifdef [$1]
1733 configure___ [$2]=yes
1734 [#]else
1735 configure___ [$2]=no
1736 [#]endif
1737 ])dnl CPP_boolean_to_sh
1738 1747
1739 cat > $tempcname < confdefs.h 1748 cat > $tempcname < confdefs.h
1740 cat >> $tempcname <<EOF 1749 cat >> $tempcname <<EOF
1741 #define NOT_C_CODE 1750 #define NOT_C_CODE
1742 #define C_SWITCH_SITE 1751 #define C_SWITCH_SITE
5890 echo " GNU version of malloc: ${GNU_MALLOC}${GNU_MALLOC_reason}" 5899 echo " GNU version of malloc: ${GNU_MALLOC}${GNU_MALLOC_reason}"
5891 case "$ld_switch_site" in 5900 case "$ld_switch_site" in
5892 *nocombreloc*) echo " Linking with \`-z nocombreloc'. 5901 *nocombreloc*) echo " Linking with \`-z nocombreloc'.
5893 - Consider configuring with --with-pdump." ;; 5902 - Consider configuring with --with-pdump." ;;
5894 esac 5903 esac
5895
5896 define(COLON_TO_SPACE_WARN,
5897 [case "$[$1]" in *:* [)] dnl
5898 case "$opsys" in *cygwin* [)]
5899 echo " WARNING: Paths containing spaces will be misinterpreted." ;;
5900 esac
5901 [$1]="`echo '' $[$1] | sed -e 's/^ //' -e 's/:/ /g'`";; esac])dnl
5902
5903 echo " 5904 echo "
5904 Package Search (a 'root' contains '{xemacs,mule,site}-packages'):" 5905 Package Search (a 'root' contains '{xemacs,mule,site}-packages'):"
5905 5906
5906 if test -n "$with_early_packages"; then 5907 if test -n "$with_early_packages"; then
5907 COLON_TO_SPACE_WARN(with_early_packages) 5908 COLON_TO_SPACE_WARN(with_early_packages)