It looks like Robert's problems with --with-xft haven't been a result of
recent changes to XE_PARSE_COMPLEX_OPTION but because of a long standing bug
that only manifests itself when the defaults for complex values are
non-blank. This patch should fix this and get xft to work again.
The specifications for complex arguments have evolved over the last few months
and are not well documented. Therefore below are various combinations that
the patch supports. Stephen, is this the behaviour that you expect? Can you
also check that I haven't broken the other complex arguments?
Given a complex option --with-complex with three values: 'foo', 'bar' and
'baz' that have defaults of 'yes', 'no' and "" the shell
variables under
different conditions are:
1) --with-complex not supplied:
with_complex_foo=""
with_complex_bar=""
with_complex_baz=""
2) --with-complex
with_complex_foo=yes
with_complex_bar=no
with_complex_baz=""
3) --without-complex
with_complex_foo=no
with_complex_bar=no
with_complex_baz=no
4) --with-complex=bar
with_complex_foo=no
with_complex_bar=yes
with_complex_baz=no
5) --with-complex=all
with_complex_foo=yes
with_complex_bar=yes
with_complex_baz=yes
6) --with-complex=none,bar
with_complex_foo=no
with_complex_bar=yes
with_complex_baz=no
7) --with-complex=all,nofoo
with_complex_foo=no
with_complex_bar=yes
with_complex_baz=yes
ChangeLog addition:
2005-11-29 Malcolm Purvis <malcolmp(a)xemacs.org>
* configure.ac (XE_PARSE_COMPLEX_OPTION): Correctly handle
--with-FOO[=yes]. Only enable defaults when the arg is
specified.
* configure.ac (XE_COMPLEX_ARG[xft]): Default everything on;
change doc.
xemacs-autoconf-2.5 source patch:
Diff command: cvs -q diff -u
Files affected: configure.ac configure
Index: configure.ac
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/configure.ac,v
retrieving revision 1.26
diff -u -r1.26 configure.ac
--- configure.ac 2005/11/28 09:50:20 1.26
+++ configure.ac 2005/11/29 12:51:51
@@ -368,8 +368,7 @@
dnl value and to note the values in an option list.
dnl
define([XE_EXPAND_COMPLEX_OPTION],
-[with_[$1]_[$2]=[$3]
-enable_[$1]_[$2]=[$3]
+[_[$1]_[$2]_default=[$3]
m4_append([XE_COMPONENT_LIST],[$2],[ ])dnl
dnl Separate with a ':' instead of a ',' (see <prefix>_default
below) to avoid
dnl confusion with marco parameter lists.
@@ -413,7 +412,7 @@
dnl Internal macro to parse the option values. If an undeclared option is
dnl found then an error is generated. Because something has been supplied on
dnl the command line initialise all the complex options to 'no' rather than
-dnl the default. In thius way --enable-complex=foo will give the expected
+dnl the default. In this way --enable-complex=foo will give the expected
dnl value (no) for bar.
dnl
define([XE_PARSE_COMPLEX_OPTION],
@@ -423,13 +422,20 @@
done
for x in `echo "$with_[$1]" | sed -e 's/,/ /g'` ; do
_[$1]_all_default=""
+ _[$1]_use_default=""
_[$1]_found=""
case "$x" in
n | no | non | none ) _[$1]_all_default=no ;;
a | al | all | both ) _[$1]_all_default=yes ;;
+ y | yes ) _[$1]_use_default=yes ;;
esac
- if test -z "$_[$1]_all_default"; then
+ if test -n "$_[$1]_use_default"; then
+ for y in $_[$1]_types; do
+ eval "with_[$1]_$y=\$_[$1]_${y}_default"
+ eval "enable_[$1]_$y=\$_[$1]_${y}_default"
+ done
+ elif test -z "$_[$1]_all_default"; then
for y in $_[$1]_types; do
dnl echo "testing x='$x' against y='$y'"
if test "$x" = "$y"; then
@@ -449,11 +455,12 @@
test -z "$_[$1]_found" && _[$1]_bogus=yes
fi
if test "$_[$1]_bogus" = "yes" -o \
- \( -n "$_[$1]_all_default" -a -n "$_[$1]_notfirst" \) ;
then
- USAGE_ERROR(["Valid values for the [$2] option are:
-$_[$1]_types. With prefix \"no\", switch it off.
-Defaults may be overridden with \`all' or \`none' first in the list.
-Hardcoded default is: $_[$1]_default."])
+ \( \( -n "$_[$1]_all_default" -o -n "$_[$1]_use_default" \)
-a -n "$_[$1]_notfirst" \) ; then
+ USAGE_ERROR(["Invalid option supplied. Valid values for the [$2] option are:
+ $_[$1]_types.
+ A prefix of \"no\" will turn an option off. Options not given are set to
off.
+ Without an argument the default is $_[$1]_default.
+ If the first option is \`all' or \`none' then all options are turned on or
off."])
elif test -n "$_[$1]_all_default" ; then
for y in $_[$1]_types; do
eval "with_[$1]_$y=$_[$1]_all_default"
@@ -637,12 +644,12 @@
[Xft],
[`emacs' (buffers), `menubars', `tabs', and `gauges'],
[X11, Xft, Xrender, freetype, and fontconfig],
- [`noemacs, nomenubars, notabs, nogauges'])],
+ [`emacs, menubars, tabs, gauges'])],
[],[],
- [XE_COMPLEX_OPTION([emacs],[no]),
- XE_COMPLEX_OPTION([menubars],[no]),
- XE_COMPLEX_OPTION([tabs],[no]),
- XE_COMPLEX_OPTION([gauges],[no])])
+ [XE_COMPLEX_OPTION([emacs],[yes]),
+ XE_COMPLEX_OPTION([menubars],[yes]),
+ XE_COMPLEX_OPTION([tabs],[yes]),
+ XE_COMPLEX_OPTION([gauges],[yes])])
XE_MERGED_ARG([gtk],
AC_HELP_STRING([--with-gtk],[Support GTK on the X Window System. (EXPERIMENTAL)]),
[true], [with_gtk=no])
--
Malcolm Purvis <malcolmp(a)xemacs.org>