Hi all,
In the process of trying to get some things working properly on my
Mac "Yosemite" box, I noticed that configure.ac is in pretty bad
repair.
In particular, the Makefiles use $c_switch_all in the compile command,
but Installation reports $XE_CFLAGS, which on my box contains only
warnings. I think that the use of various cflag variables is so
confused that it's worth re-thinking the whole thing. For starters,
at least I'd like to change the XE_CFLAGS in the compile command
reported in Installation to c_switch_all.
A second issue is that a lot of changes have been made to the core
configure.ac that are not reflected in the modules' configure.acs.
I think it might be a good idea to move our XEmacs-specific macros to
an aclocal file (or whatever it is), and perhaps macro-fy more of our
special tests.
In preparation for this, I created a patch (attached) which moves all
of the macros defined in configure.ac into the "Local macros" section
(which was already present). (I see I need to improve the ChangeLog.)
I wonder how much of the work done to improve SXEmacs's build process
might be relevant to us.
Comments (and volunteers! -- my autoconf-foo is poor :-/ ) welcome.
Steve
# HG changeset patch
# Parent 6b57aad276aaed84a34704bd39a01984dc60de1e
diff -r 6b57aad276aa ChangeLog
--- a/ChangeLog Sat Jan 10 21:11:10 2015 +0900
+++ b/ChangeLog Sat Jan 10 23:55:16 2015 +0900
@@ -1,3 +1,7 @@
+2015-01-10 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * configure.ac (XE_EXPAND_VARIABLE): Move to other macro definitions.
+
2015-01-10 Stephen J. Turnbull <stephen(a)xemacs.org>
* configure.ac (Postgresql): Improve Installation text.
diff -r 6b57aad276aa configure.ac
--- a/configure.ac Sat Jan 10 21:11:10 2015 +0900
+++ b/configure.ac Sat Jan 10 23:55:16 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.
@@ -1087,15 +1122,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)
@@ -1706,23 +1732,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
@@ -5841,14 +5850,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'):"
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta