This patch makes the following changes to configure.ac:
1. Aliases all --enable- options to --with (see the macro
XE_ARG_ENABLE_OR_WITH below).
2. Requires that only autoconf 2.59 be used to generate the configure script
3. Replaces numerous blank lines with the proper m4 'blank line' macro. This
prevents stray blan lines appearing at the wrong places in the configure
script.
The aliasing means that any option that was previously available only as
--enable now can be set with --with as well (and --without instead of
--disable). In addition the option appears in the help output in both forms.
Existing --with options are not aliased to --enable.
Malcolm
ChangeLog addition:
2005-10-07 Malcolm Purvis <malcolmp(a)xemacs.org>
* configure: Added XE_ARG_ENABLE_OR_WITH and alias all --enable
options to --with. configure can only be built with autoconf
2.59. Prevent many unwanted blank lines from appearing in
configure.
xemacs-autoconf-2.5 source patch:
Diff command: cvs -q diff -u
Files affected: configure.ac
Index: configure.ac
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/configure.ac,v
retrieving revision 1.14
diff -u -r1.14 configure.ac
--- configure.ac 2005/10/04 17:51:13 1.14
+++ configure.ac 2005/10/07 13:07:54
@@ -15,13 +15,17 @@
ac_link='$CC -o conftest$ac_exeext $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' >&AS_MESSAGE_LOG_FD'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
])
-
+dnl
dnl -------------------------------------------------------------------------
dnl Autoconf startup.
-
+dnl
+dnl Due to a dependence on the implementation of certain internal autoconf
+dnl macros, die if any version other than 2.59 is used.
AC_PREREQ(2.59)dnl
+m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]), [2.59]), 1,
+ [m4_fatal([This script can only be generated with autoconf 2.59])], [])dnl
AC_INIT(src/lisp.h)dnl
-
+dnl
dnl -------------------------------------------------------------------------
dnl Local copyright notices.
@@ -85,39 +89,39 @@
dnl If there's reason to prefer $0 over this, make sure you fix all the
dnl uses in this script!!
progname="`echo $0 | sed 's:^\./\./:\./:'`"
-
+dnl
dnl -------------------------------------------------------------------------
dnl Local macros
-
+dnl
define([USAGE_ERROR],
[(echo "$progname: Usage error:"
echo " " $1
-echo " Use \`$progname --help' to show usage.") >&2 && exit 1])
-
+echo " Use \`$progname --help' to show usage.") >&2 && exit 1])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])
-
+]+],[ ]); do eval "echo \"$var = '\$$var'\""; done])dnl
+dnl
dnl XE_ADD_OBJS(foo.o)
define([XE_ADD_OBJS],
[extra_objs="$extra_objs [$1]" && dnl
if test "$verbose" = "yes"; then
echo " xemacs will be linked with \"[$1]\""
fi])dnl XE_ADD_OBJS
-
+dnl
dnl XE_APPEND(value, varname)
define([XE_APPEND],
[[$2]="$[$2] [$1]" && dnl
- if test "$verbose" = "yes"; then echo " Appending \"[$1]\" to \$[$2]"; fi])
-
+ if test "$verbose" = "yes"; then echo " Appending \"[$1]\" to \$[$2]"; fi])dnl
+dnl
dnl XE_PREPEND(value, varname)
define([XE_PREPEND],
[[$2]="[$1] $[$2]" && dnl
- if test "$verbose" = "yes"; then echo " Prepending \"[$1]\" to \$[$2]"; fi])
-
+ if test "$verbose" = "yes"; then echo " Prepending \"[$1]\" to \$[$2]"; fi])dnl
+dnl
dnl XE_DIE(message)
-define([XE_DIE], [{ echo "Error:" $1 >&2; exit 1; }])
-
+define([XE_DIE], [{ echo "Error:" $1 >&2; exit 1; }])dnl
+dnl
dnl XE_CHECK_FEATURE_DEPENDENCY(feature1, feature2)
define([XE_CHECK_FEATURE_DEPENDENCY],
[if test "$with_[$1] $with_[$2]" = "yes no"; then
@@ -125,13 +129,13 @@
elif test "$with_[$2]" = "no" ; then with_[$1]=no
elif test "$with_[$1]" = "yes"; then with_[$2]=yes
fi
-])
-
+])dnl
+dnl
dnl XE_STRIP_4TH_COMPONENT(var)
dnl Changes i986-pc-linux-gnu to i986-pc-linux, as God (not RMS) intended.
define([XE_STRIP_4TH_COMPONENT],
-[$1=`echo "$$1" | sed '[s/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/]'`])
-
+[$1=`echo "$$1" | sed '[s/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/]'`])dnl
+dnl
dnl Do our best to deal with automounter brokenness
dnl CANONICALIZE_PATH(varname)
define([CANONICALIZE_PATH],
@@ -140,7 +144,7 @@
$1=`echo "[$]$1" | \
sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
fi])dnl
-
+dnl
dnl XE_PROTECT_LINKER_FLAGS(shell_var)
define([XE_PROTECT_LINKER_FLAGS], [
if test "$GCC" = "yes"; then
@@ -155,11 +159,11 @@
shift
done
fi])dnl
-
+dnl
dnl Allow use of either ":" or spaces for lists of directories
define(COLON_TO_SPACE,
[case "$[$1]" in *:* [)] [$1]="`echo '' $[$1] | sed -e 's/^ //' -e 's/:/ /g'`";; esac])dnl
-
+dnl
dnl XE_ADD_RUNPATH_DIR(directory)
define([XE_ADD_RUNPATH_DIR],[{
xe_runpath_dir=$1
@@ -169,7 +173,7 @@
-n "`ls ${xe_runpath_dir}/*.s[[ol]] 2>/dev/null`" && \
eval "$xe_add_unique_runpath_dir"
}])dnl
-
+dnl
dnl XE_COMPUTE_RUNPATH()
define([XE_COMPUTE_RUNPATH],[
if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
@@ -217,7 +221,7 @@
fi
fi
])dnl
-
+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 XE_SPACE(var, words)
@@ -226,7 +230,40 @@
for W in $2; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
$1="$T"
])dnl XE_SPACE
-
+dnl
+dnl XE_ARG_ENABLE_OR_WITH(FEATURE, HELP-STRING, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+dnl ------------------------------------------------------------------------
+dnl
+dnl Arguments that can be specified with either --enable or --with. For some
+dnl XEmacs arguments the division between --enable or --with is arbitrary, so
+dnl all those to be specified by either argument. The value is stored in
+dnl enable_FEATURE.
+AC_DEFUN([XE_ARG_ENABLE_OR_WITH],
+[m4_divert_once([HELP_ENABLE], [[
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]]])dnl
+m4_divert_once([HELP_WITH], [[
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)]])
+m4_divert_once([HELP_ENABLE], [$2])dnl
+m4_divert_once([HELP_WITH], m4_bpatsubst([[$2]],[--enable\([^ ]+\) ],[--with\1 ]))dnl
+# If --with-$1 or --without-$1 were given then copy the value to the
+# equivalent enable_$1 variable.
+if test "[${with_]m4_bpatsubst([$1], -, _)+set}" = set; then
+ [enable_]m4_bpatsubst([$1], -, _)="[$with_]m4_bpatsubst([$1], -, _)"
+ echo Setting
+fi;
+# Check whether --enable-$1 or --disable-$1 was given.
+if test "[${enable_]m4_bpatsubst([$1], -, _)+set}" = set; then
+ enableval="[$enable_]m4_bpatsubst([$1], -, _)"
+ $3
+m4_ifvaln([$4], [else
+ $4])dnl
+fi; dnl
+])dnl XE_ARG_ENABLE_OR_WITH
+dnl
dnl XEmacs keyword option support
dnl =============================
dnl
@@ -258,7 +295,7 @@
fi
unset _[$1]_bogus
undefine([XE_KEYWORD_LIST])dnl
-undefine([XE_KEYWORD_VALUES])])
+undefine([XE_KEYWORD_VALUES])])dnl
dnl
dnl XE_KEYWORD(keyword)
dnl --------------------------------
@@ -269,7 +306,7 @@
dnl Separate with a ':' instead of a ',' (see the parsing code above) to avoid
dnl confusion with marco parameter lists.
m4_append([XE_KEYWORD_VALUES],[\`$1'],[:])dnl
-])
+])dnl
dnl
dnl XE_KEYWORD_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE, ACTION-IF-FALSE,
dnl [XE_KEYWORD(keyword), ....])
@@ -283,7 +320,7 @@
AC_ARG_WITH([$1],[$2],
[XE_PARSE_KEYWORD_OPTION([with_]patsubst([$1], -, _), [--with-$1])
$3
-],[$4])])
+],[$4])])dnl
dnl
dnl XE_KEYWORD_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE, ACTION-IF-FALSE,
dnl [XE_KEYWORD(keyword), ....])
@@ -294,10 +331,10 @@
dnl
define([XE_KEYWORD_ARG_ENABLE],
[m4_map([XE_KEYWORD],m4_shiftn(4, $@))
-AC_ARG_ENABLE([$1],[$2],
+XE_ARG_ENABLE_OR_WITH([$1],[$2],
[XE_PARSE_KEYWORD_OPTION([enable_]patsubst([$1], -, _), [--enable-$1])
$3
-],[$4])])
+],[$4])])dnl
dnl
dnl XEmacs complex option support
dnl =============================
@@ -335,7 +372,7 @@
define([XE_EXPAND_COMPLEX_OPTIONS],
[m4_if([$2], [[]], [],
[XE_EXPAND_COMPLEX_OPTION([$1], m4_fst($2))[]dnl
-XE_EXPAND_COMPLEX_OPTIONS([$1], m4_cdr($2))])])
+XE_EXPAND_COMPLEX_OPTIONS([$1], m4_cdr($2))])])dnl
dnl
dnl XE_INIT_COMPLEX_OPTION(prefix, option_list)
dnl -------------------------------------------
@@ -356,8 +393,8 @@
dnl options.
undefine([XE_COMPONENT_LIST])
undefine([XE_COMPONENT_DEFAULT])
-])
-
+])dnl
+dnl
dnl XE_PARSE_COMPLEX_OPTION(prefix, cmdline-flag)
dnl ---------------------------------------------
dnl
@@ -405,8 +442,8 @@
done
unset _[$1]_bogus _[$1]_found _[$1]_notfirst _[$1]_types
unset _[$1]_default _[$1]_all_default x y
-])
-
+])dnl
+dnl
dnl XE_COMPLEX_OPTION(option, yesno)
dnl --------------------------------
dnl
@@ -423,7 +460,7 @@
define([XE_COMPLEX_OPTION_HELP_STRING],
[AC_HELP_STRING([$1],[Compile with support for $2. Components that can use
$3 are $4. Prefix component with `no' to disable its use of $3. Requires
-$5 support. Default is $6.])])
+$5 support. Default is $6.])])dnl
dnl
dnl XE_COMPLEX_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE, ACTION-IF-FALSE,
dnl [XE_COMPLEX_OPTION(a,yes), ....])
@@ -437,7 +474,7 @@
AC_ARG_WITH([$1],[$2],
[XE_PARSE_COMPLEX_OPTION([with_]patsubst([$1], -, _), [--with-$1])
$3
-],[$4])])
+],[$4])])dnl
dnl
dnl XE_COMPLEX_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE, ACTION-IF-FALSE,
dnl [XE_COMPLEX_OPTION, ....])
@@ -448,10 +485,10 @@
dnl
define([XE_COMPLEX_ARG_ENABLE],
[XE_INIT_COMPLEX_OPTION([enable_]patsubst([$1], -, _), m4_shiftn(4, $@))
-AC_ARG_ENABLE([$1],[$2],
+XE_ARG_ENABLE_OR_WITH([$1],[$2],
[XE_PARSE_COMPLEX_OPTION([enable_]patsubst([$1], -, _), [--enable-$1])
$3
-],[$4])])
+],[$4])])dnl
dnl
dnl -------------------------------------------------------------------------
XE_APPEND(lib-src, MAKE_SUBDIR)
@@ -462,19 +499,6 @@
dnl Note that AC_HELP_STRING compresses whitespace, wraps, and indents the
dnl string to fit the --help display; there's no need to preformat.
dnl
-dnl Error-checking on old-style flags
-AC_ARG_WITH([mule],[],[XE_DIE([--enable-mule, NOT --with-mule])],[])
-AC_ARG_WITH([menubars],[],[XE_DIE([--enable-menubars, NOT --with-menubars])],[])
-AC_ARG_WITH([scrollbars],[],[XE_DIE([--enable-scrollbars, NOT --with-scrollbars])],[])
-AC_ARG_WITH([dialogs],[],[XE_DIE([--enable-dialogs, NOT --with-dialogs])],[])
-AC_ARG_WITH([widgets],[],[XE_DIE([--enable-widgets, NOT --with-widgets])],[])
-AC_ARG_WITH([sound],[],[XE_DIE([--enable-sound, NOT --with-sound])],[])
-AC_ARG_WITH([default-eol-detection],[],[XE_DIE([--enable-default-eol-detection, NOT --with-default-eol-detection])],[])
-AC_ARG_WITH([clash-detection],[],[XE_DIE([--enable-clash-detection, NOT --with-clash-detection])],[])
-AC_ARG_WITH([database],[],[XE_DIE([--enable-database, NOT --with-database])],[])
-AC_ARG_WITH([modules],[],[XE_DIE([--enable-modules, NOT --with-modules])],[])
-AC_ARG_WITH([toolbars],[],[XE_DIE([--enable-toolbars, NOT --with-toolbars])],[])
-
dnl I think these will be caught by autoconf internal checks,
dnl only --with-* are unchecked
dnl --external-widget --enable-external-widget
@@ -489,7 +513,7 @@
dnl --use-union-type --enable-union-type
dnl --pdump --enable-pdump
dnl --use-kkcc --enable-kkcc
-
+dnl
dnl parse flags
AC_ARG_WITH([prefix],
AC_HELP_STRING([--with-prefix=no],[Don't compile the value for `prefix' into the executable.]),
@@ -589,8 +613,8 @@
AC_ARG_WITH([quantify],
AC_HELP_STRING([--with-quantify],[Support performance debugging using Quantify.]),
[], [])
-AC_ARG_ENABLE([toolbars],
- AC_HELP_STRING([--with-toolbars],[Enable toolbar support. Default: yes.]),
+XE_ARG_ENABLE_OR_WITH([toolbars],
+ AC_HELP_STRING([--enable-toolbars],[Enable toolbar support. Default: yes.]),
[], [])
AC_ARG_WITH([tty],
AC_HELP_STRING([--with-tty],[Enable TTY support. Default: yes.]),
@@ -600,12 +624,12 @@
menubar. Incompatible with `--with-xim=motif'.
`--enable-menubars=lucid' (the default) is desirable.]),
[], [])
-AC_ARG_ENABLE([mule],
- AC_HELP_STRING([--enable-mule],[Compile with Mule (MUlti-Lingual Emacs) support,
+XE_ARG_ENABLE_OR_WITH([mule],
+ AC_HELP_STRING([--enable-mule],[Compile with Mule (Multi-Lingual Emacs) support,
needed to support non-Latin-1 (including Asian)
languages.]),
[], [])
-AC_ARG_ENABLE([default-eol-detection],
+XE_ARG_ENABLE_OR_WITH([default-eol-detection],
AC_HELP_STRING([--enable-default-eol-detection],[Turns on by default auto-detection of end-of-line type
when reading a file. Applies to those platforms where
auto-detection is off by default (non-Mule Unix). Has
@@ -702,44 +726,44 @@
AC_ARG_WITH([package-path],
AC_HELP_STRING([--with-package-path],[Search path for package hierarchies.]),
[AC_DEFINE(PACKAGE_PATH_USER_DEFINED)], [])
-AC_ARG_ENABLE([external-widget],
+XE_ARG_ENABLE_OR_WITH([external-widget],
AC_HELP_STRING([--enable-external-widget],[Support XEmacs server for text widgets in other applications.]),
[], [])
-AC_ARG_ENABLE([kkcc],
+XE_ARG_ENABLE_OR_WITH([kkcc],
AC_HELP_STRING([--enable-kkcc],[Enable new GC algorithms.]),
- [], [])
-AC_ARG_ENABLE([mc-alloc],
+ [], [enable_kkcc=yes])
+XE_ARG_ENABLE_OR_WITH([mc-alloc],
AC_HELP_STRING([--enable-mc-alloc],[Enable new allocator.]),
- [], [])
-AC_ARG_ENABLE([union-type],
+ [], [enable_mc_alloc=yes])
+XE_ARG_ENABLE_OR_WITH([union-type],
AC_HELP_STRING([--enable-union-type],[Use union definition of Lisp_Object type. Known to trigger bugs in some compilers.]),
[], [])
-AC_ARG_ENABLE([pdump],
+XE_ARG_ENABLE_OR_WITH([pdump],
AC_HELP_STRING([--enable-pdump],[Enable portable LISP preloader.]),
[], [])
-AC_ARG_ENABLE([dump-in-exec],
+XE_ARG_ENABLE_OR_WITH([dump-in-exec],
AC_HELP_STRING([--enable-dump-in-exec],[Enable dumping into executable (enabled by default
for `pdump', not enabled by default in combination
with `mc-alloc').]),
[], [])
-AC_ARG_ENABLE([debug],
+XE_ARG_ENABLE_OR_WITH([debug],
AC_HELP_STRING([--enable-debug],[Enable additional debugging information. No time cost.]),
[], [])
-AC_ARG_ENABLE([assertions],
+XE_ARG_ENABLE_OR_WITH([assertions],
AC_HELP_STRING([--enable-assertions],[]),
[], [])
-AC_ARG_ENABLE([memory-usage-stats],
+XE_ARG_ENABLE_OR_WITH([memory-usage-stats],
AC_HELP_STRING([--enable-memory-usage-stats],[Enable LISP memory usage API.]),
[], [])
-AC_ARG_ENABLE([clash-detection],
+XE_ARG_ENABLE_OR_WITH([clash-detection],
AC_HELP_STRING([--enable-clash-detection],[Disable use of lock files to detect multiple edits
of the same file.]),
[], [])
-AC_ARG_ENABLE([modules],
+XE_ARG_ENABLE_OR_WITH([modules],
AC_HELP_STRING([--enable-modules],[Compile in experimental support for dynamically
loaded libraries (Dynamic Shared Objects).]),
[], [])
-AC_ARG_ENABLE([quick-build],
+XE_ARG_ENABLE_OR_WITH([quick-build],
AC_HELP_STRING([--enable-quick-build],[Speed up the build cycle by leaving out steps where
XEmacs will still work (more or less) without them.
Potentially dangerous if you don't know what you're
--
Malcolm Purvis <malcolmp(a)xemacs.org>