APPROVE COMMIT
This adds a new set of macros for options that require a value from a set of
keywords (eg --enable-menubars, etc) and converts a whole lot of options to
use these macros and the complex option ones. It also documents that complex
options can be assigned a default value of "" (maybe) which means 'yes, if the
libraries can be found'.
This is the final patch before I move autoconf 2.59 support over to the main
line.
ChangeLog addition:
2005-02-11 Malcolm Purvis <malcolmp(a)xemacs.org>
* configure.ac: Added keyword option support. Converted database,
sound, athena, xim, bignum, error-checking, menubars, scrollbars,
dialogs and widgets command line arguments to use keyword option
and complex option macros.
xemacs-xft-bugfixes 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.1.14.3
diff -u -r1.1.14.3 configure.ac
--- configure.ac 2005/02/09 03:40:30 1.1.14.3
+++ configure.ac 2005/02/11 05:04:37
@@ -227,7 +227,86 @@
$1="$T"
])dnl XE_SPACE
+dnl XEmacs keyword option support
+dnl =============================
+dnl
+dnl A "keyword" option is one that accepts one of a number of pre-defined
+dnl values (if more than one value is needed see "complex options" below).
+dnl For example --with-mail-locking=flock.
+dnl
+dnl Complex options used an expanded forms of AC_ARG_[WITH|ENABLE] called
+dnl XE_KEYWORD_ARG_[WITH|ENABLE] both taking 5 parameters. The first 4
+dnl parameters of these macros are the same as original macros with the
+dnl exception that all four paramaters are REQUIRED. The ACTION-IF-TRUE code
+dnl is run after the argument list has been parsed.
+dnl
+dnl The 5th parameter is a list keywords. The list must be quoted but the
+dnl individual macros should not.
+dnl
+dnl If the option value is a not a valid keyword then an error message is
+dnl generated, otherwise rthe value is left untouched.
+dnl
+dnl XE_PARSE_KEYWORD_OPTION(prefix, cmdline-flag)
+dnl ---------------------------------------------
+dnl
+dnl Internal macro to parse the option values. If an undeclared option is
+dnl found then an error is generated.
+dnl
+define([XE_PARSE_KEYWORD_OPTION],
+[[$1]_bogus=yes
+ for x in XE_KEYWORD_LIST ; do
+ if test $x = $[$1] ; then
+ [$1]_bogus=no
+ fi
+ done
+ if test "$[$1]_bogus" = "yes" ; then
+ USAGE_ERROR(["The [$2] option must have one of these values: m4_translit(XE_KEYWORD_VALUES,[:],[,])."])
+ fi
+unset [$1]_bogus
+undefine([XE_KEYWORD_LIST])dnl
+undefine([XE_KEYWORD_VALUES])])
+dnl
+dnl XE_KEYWORD(keyword)
+dnl --------------------------------
+dnl
+dnl
+define([XE_KEYWORD],
+[m4_append([XE_KEYWORD_LIST],[$1],[ ])dnl
+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 XE_KEYWORD_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE, ACTION-IF-FALSE,
+dnl [XE_KEYWORD(keyword), ....])
+dnl --------------------------------------------------------------------------
+dnl
+dnl Expanded version of AC_ARG_WITH for keyword options. All the parameters
+dnl are required.
+dnl
+define([XE_KEYWORD_ARG_WITH],
+[m4_map([XE_KEYWORD],m4_shiftn(4, $@))
+AC_ARG_WITH([$1],[$2],
+[XE_PARSE_KEYWORD_OPTION([with_]patsubst([$1], -, _), [--with-$1])
+$3
+],[$4])])
+dnl
+dnl XE_KEYWORD_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE, ACTION-IF-FALSE,
+dnl [XE_KEYWORD(keyword), ....])
+dnl --------------------------------------------------------------------------
+dnl
+dnl Expanded version of AC_ARG_ENABLE for keyword options. All the parameters
+dnl are required.
+dnl
+define([XE_KEYWORD_ARG_ENABLE],
+[m4_map([XE_KEYWORD],m4_shiftn(4, $@))
+AC_ARG_ENABLE([$1],[$2],
+[XE_PARSE_KEYWORD_OPTION([enable_]patsubst([$1], -, _), [--enable-$1])
+$3
+],[$4])])
+dnl
dnl XEmacs complex option support
+dnl =============================
dnl
dnl A "complex option" is one that takes a number of related values.
dnl For example, we might use "--with-xft=all,nomenubars" for compatibility
@@ -245,7 +324,14 @@
dnl the individual macros should not.
dnl
dnl Option values are stored in the variables with_<package>_<component> or
-dnl enable_<feature>_<component> (eg with_xft_menubars)
+dnl enable_<feature>_<component> (eg with_xft_menubars).
+dnl
+dnl Option values are either 'yes' which means that the option must be used
+dnl and an error must occur if there is a configuration problems (such as a
+dnl missing library) or 'no' which means that the option must not be used.
+dnl The default value can also be "", meaning maybe, which means 'yes' if the
+dnl configuration is present otherwise no. Users cannot specify 'maybe' from
+dnl the command line.
dnl
dnl There are two possible uses in XEmacs for this kind of facility. One is
dnl exemplified by sound: there are alternative protocols (native, ESD, NAS)
@@ -254,7 +340,7 @@
dnl XEmacs, as exemplified by Xft. This latter usage may be more common
dnl during development of a feature. Perhaps specialized APIs should be
dnl provided, see comment on XE_COMPLEX_OPTION_HELP_STRING below.
-
+dnl
dnl XE_COMPLEX_OPTION_DEFAULT(prefix, component, yesno)
dnl ---------------------------------------------------
dnl
@@ -268,7 +354,7 @@
dnl confusion with marco parameter lists.
m4_append([XE_COMPONENT_DEFAULT],[m4_if([$3],no,no)[$2]],[:])
])
-
+dnl
dnl XE_EXPAND_COMPLEX_OPTIONS(prefix, option_list)
dnl ----------------------------------------------
dnl
@@ -353,7 +439,7 @@
dnl --------------------------------
dnl
dnl Declare a complex option and its default value. The value MUST be either
-dnl yes or no.
+dnl yes or no or "" (which means maybe).
dnl
define([XE_COMPLEX_OPTION],[[$1,$2]])
@@ -379,8 +465,7 @@
AC_ARG_WITH([$1],[$2],
[XE_PARSE_COMPLEX_OPTION([with_]patsubst([$1], -, _), [--with-$1])
$3
-],[$4])
-])
+],[$4])])
dnl XE_COMPLEX_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE, ACTION-IF-FALSE,
dnl [XE_COMPLEX_OPTION, ....])
@@ -394,9 +479,8 @@
AC_ARG_ENABLE([$1],[$2],
[XE_PARSE_COMPLEX_OPTION([enable_]patsubst([$1], -, _), [--enable-$1])
$3
-],[$4])
-])
-
+],[$4])])
+dnl
dnl -------------------------------------------------------------------------
XE_APPEND(lib-src, MAKE_SUBDIR)
XE_APPEND(lib-src, INSTALL_ARCH_DEP_SUBDIR)
@@ -504,8 +588,7 @@
[XE_COMPLEX_OPTION([emacs],[yes]),
XE_COMPLEX_OPTION([menubars],[yes]),
XE_COMPLEX_OPTION([tabs],[yes]),
- XE_COMPLEX_OPTION([gauges],[yes])]
-)
+ XE_COMPLEX_OPTION([gauges],[yes])])
dnl sanity checking
dnl #### Maybe we should XE_DIE here instead? Or fix the UI so that
dnl emacs is always implicit? (I worry that --without-xft would be weird.)
@@ -753,32 +836,22 @@
#Enable code.
-AC_ARG_ENABLE([database],
+XE_COMPLEX_ARG_ENABLE([database],
AC_HELP_STRING([--enable-database],[Compile with database support. Valid types are
`no' or a comma-separated list of one or more
of `berkdb' and either `dbm' or `gnudbm'.]),
[
-with_database_berkdb=no
-with_database_dbm=no
-with_database_gdbm=no
-for x in `echo "$enable_database" | sed -e 's/,/ /g'` ; do
- case "$x" in
- no ) ;;
- b | be | ber | berk | berkd | berkdb ) with_database_berkdb=yes ;;
- d | db | dbm ) with_database_dbm=yes ;;
- g | gn | gnu | gnud | gnudb | gnudbm | gdbm) with_database_gdbm=yes ;;
- * ) USAGE_ERROR(["The \`--$optname' option value
-must be either \`no' or a comma-separated list
-of one or more of \`berkdb' and either \`dbm' or \`gnudbm'."]) ;;
- esac
-done
-if test "$with_database_dbm" = "yes" -a "$with_database_gdbm" = "yes"; then
+if test "$enable_database_dbm" = "yes" -a "$enable_database_gdbm" = "yes"; then
USAGE_ERROR("Only one of \`dbm' and \`gnudbm' may be specified
with the \`--$optname' option.")
fi
-], [])
+],
+[],
+[XE_COMPLEX_OPTION([berkdb],[""]),
+ XE_COMPLEX_OPTION([dbm],[""]),
+ XE_COMPLEX_OPTION([gdbm],[""])])
-AC_ARG_ENABLE([sound],
+XE_COMPLEX_ARG_ENABLE([sound],
AC_HELP_STRING([--enable-sound],[Compile with sound support.
Valid types are `native', `nas' and `esd'.
Prefix a type with 'no' to disable.
@@ -787,254 +860,70 @@
Later options override earlier ones for the same TYPE.
The default is to autodetect all sound support except
for ESD which defaults to off.]),
- [
-dnl values is a subset of all,native,nas,esd
-dnl or their negatives: none,nonative,nonas,noesd
-for x in `echo "$enable_sound" | sed -e 's/,/ /g'` ; do
- case "$x" in
- dnl all and none are only permitted as the first in the list.
- n | no | non | none ) new_sdefault=no ;;
- a | al | all | both ) new_sdefault=yes ;;
-
- native ) with_native_sound=yes ;;
- nonative ) with_native_sound=no ;;
-
- nas ) with_nas_sound=yes ;;
- nonas ) with_nas_sound=no ;;
-
- esd ) with_esd_sound=yes ;;
- noesd ) with_esd_sound=no ;;
-
- * ) bogus_sound=yes ;;
- esac
- if test "$bogus_sound" -o \
- \( -n "$new_sdefault" -a -n "$sound_notfirst" \) ; then
- types="\`all', \`none', \`(no)native', \`no(nas)', \`(no)esd'."
- USAGE_ERROR(["Valid types for the \`--$optname' option are:
-$types.
-Option \`all' or \`none' must be first in the list.
-The default is to autodetect native and NAS sound support."])
- elif test -n "$new_sdefault" ; then
- with_native_sound=$new_sdefault
- with_nas_sound=$new_sdefault
- with_esd_sound=$new_sdefault
- new_sdefault= # reset this
- fi
- sound_notfirst=true
-done
-], [with_esd_sound=no])
+ [],
+ [enable_sound_nas=""],
+ [XE_COMPLEX_OPTION([native],[""]),
+ XE_COMPLEX_OPTION([nas],[""]),
+ XE_COMPLEX_OPTION([esd],[no])])
-AC_ARG_WITH([athena],
+XE_KEYWORD_ARG_WITH([athena],
AC_HELP_STRING([--with-athena],[Use TYPE Athena widgets (xaw, 3d, next, 95, or xpm).]),
-[case "$with_athena" in
- xa | xaw ) val=xaw ;;
- 3 | 3d | xaw3d ) val=3d ;;
- dnl No `n' for next, someone may try `no'
- ne | nex | next | naxtaw) val=next ;;
- dnl Have not tested the next two...
- 9 | 95 | xaw95 ) val=95 ;;
- xp | xpm | xawxpm ) val=xpm ;;
- * ) USAGE_ERROR(["The \`--with-athena' option must have one of these values:
- \`xaw', \`3d', \`next', \`95', or \`xpm'."]) ;;
- esac
-dnl #### I don't think this needs to be an `eval'
-eval "with_athena=\"$val\""
-]
-)dnl
+[],[],[xaw,xaw3d,next,95,xpm])dnl
-AC_ARG_WITH([xim],
- AC_HELP_STRING([--with-xim],[]),
- [
-case "$with_xim" in
- y | ye | yes ) val=yes ;;
- n | no | non | none ) val=no ;;
- x | xl | xli | xlib ) val=xlib ;;
- m | mo | mot | moti | motif ) val=motif ;;
- * ) USAGE_ERROR(["The \`--$optname' option must have one of these values:
- \`motif', \`xlib', \`yes', or \`no'."]) ;;
-esac
-eval "with_xim=\"$val\""
-], [])
+XE_KEYWORD_ARG_WITH([xim],[],[],[],[yes,no,xlib,motif])dnl
-AC_ARG_WITH([mail-locking],
+XE_KEYWORD_ARG_WITH([mail-locking],
AC_HELP_STRING([--with-mail-locking],[Specify the locking to be used by movemail to prevent
concurrent updates of mail spool files. Valid types
are `lockf', `flock', `dot', `locking' or `mmdf'.]),
- [
-case "$with_mail_locking" in
- lockf ) val=lockf ;;
- flock ) val=flock ;;
- file | dot ) val=file ;;
- locking ) val=locking ;;
- mmdf ) val=mmdf ;;
- pop ) val=pop ;;
- * ) USAGE_ERROR(["The \`--$optname' option must have one of these values:
- \`lockf', \`flock', \`file', \`dot', \`locking', \`mmdf', or \`pop'."]) ;;
-esac
-eval "with_mail_locking=\"$val\""
-], [])
+[],[],[lockf,flock,file,locking,mmdf,pop])dnl
+
-AC_ARG_ENABLE([bignum],
+XE_KEYWORD_ARG_ENABLE([bignum],
AC_HELP_STRING([--enable-bignum=TYPE],[Compile in support for bignums, ratios, or bigfloats
using library support. TYPE must be one of "gmp"
(for GNU MP), "mp" (for BSD MP), or "no" (disabled).]),
- [
-case "$enable_bignum" in
- gmp ) val=gmp ;;
- mp ) val=mp ;;
- no|non|none ) val=no ;;
- * ) USAGE_ERROR(["The \`--$optname' option must have one of these values:
-\`gmp', \`mp', or \`no'."]) ;;
-esac
-eval "enable_bignum=\"$val\""
-], [enable_bignum="no"])
+ [], [enable_bignum="no"],[no,gmp,mp])
-AC_ARG_ENABLE([error-checking],
+XE_COMPLEX_ARG_ENABLE([error-checking],
AC_HELP_STRING([--enable-error-checking],[Compile with internal error-checking added.
Causes noticeable loss of speed. Valid types
are extents, bufpos, malloc, gc, types, text, byte_code, glyphs, display, structures.]),
- [
-dnl value can be all, none, and/or a list of categories to check.
-dnl Example: --enable-error-checking=all,noextents,nocharbpos
-dnl Example: --enable-error-checking=none,malloc,gc
-
-for x in `echo "$enable_error_checking" | sed -e 's/,/ /g'` ; do
- case "$x" in
- dnl all and none are only permitted as the first in the list.
- n | no | non | none ) new_default=no ;;
- a | al | all ) new_default=yes ;;
-
- extents ) error_check_extents=yes ;;
- noextents ) error_check_extents=no ;;
-
- types ) error_check_types=yes ;;
- notypes ) error_check_types=no ;;
-
- text ) error_check_text=yes ;;
- notext ) error_check_text=no ;;
-
- gc ) error_check_gc=yes ;;
- nogc ) error_check_gc=no ;;
-
- malloc ) error_check_malloc=yes ;;
- nomalloc ) error_check_malloc=no ;;
-
- byte_code ) error_check_byte_code=yes ;;
- nobyte_code ) error_check_byte_code=no ;;
-
- glyphs ) error_check_glyphs=yes ;;
- noglyphs ) error_check_glyphs=no ;;
+ [], [],
+[XE_COMPLEX_OPTION([extents],[""]),
+ XE_COMPLEX_OPTION([types],[""]),
+ XE_COMPLEX_OPTION([text],[""]),
+ XE_COMPLEX_OPTION([gc],[""]),
+ XE_COMPLEX_OPTION([malloc],[""]),
+ XE_COMPLEX_OPTION([byte_code],[""]),
+ XE_COMPLEX_OPTION([glyphs],[""]),
+ XE_COMPLEX_OPTION([display],[""]),
+ XE_COMPLEX_OPTION([structures],[""])])
- display ) error_check_display=yes ;;
- nodisplay ) error_check_display=no ;;
-
- structures ) error_check_structures=yes ;;
- nostructures ) error_check_structures=no ;;
-
- * ) bogus_error_check=yes ;;
- esac
-
- if test "$bogus_error_check" -o \
- \( -n "$new_default" -a -n "$echeck_notfirst" \) ; then
- if test "$error_check_default" = yes ; then
- types="\`all' (default), \`none', \`noextents', \`notypes', \`notext', \`nogc', \`nomalloc', \`noglyphs', \`nobyte-code', \`nodisplay', \`nostructures'."
- else
- types="\`all', \`none' (default), \`extents', \`types', \`text', \`gc', \`malloc', \`glyphs', \`byte-code', \`display', \`structures'."
- fi
- USAGE_ERROR(["Valid types for the \`--$optname' option are:
-$types."])
- elif test -n "$new_default" ; then
- error_check_extents=$new_default
- error_check_types=$new_default
- error_check_text=$new_default
- error_check_gc=$new_default
- error_check_malloc=$new_default
- error_check_byte_code=$new_default
- error_check_glyphs=$new_default
- error_check_display=$new_default
- error_check_structures=$new_default
- new_default= # reset this
- fi
- echeck_notfirst=true
- done
-], [])
-
-AC_ARG_ENABLE([menubars],
+XE_KEYWORD_ARG_ENABLE([menubars],
AC_HELP_STRING([--enable-menubars=TYPE],[Use TYPE menubars (lucid, motif, or no). The Lucid
widgets emulate Motif (mostly) but are faster.
*WARNING* The Motif menubar is currently broken.
Lucid menubars are the default.]),
- [
-case "$enable_menubars" in
- l | lu | luc | luci | lucid ) val=lucid ;;
- mo | mot | moti | motif ) val=motif ;;
- a | at | ath | athe | athen | athena ) val=athena ;;
- n | no | non | none ) val=no ;;
- y | ye | yes ) val=yes ;;
- g | gt | gtk ) val=gtk ;;
- ms | msw ) val=msw ;;
- * ) USAGE_ERROR(["The \`--$optname' option must have one of these values:
- \`gtk', \`lucid', \`motif', \`athena', \`yes', or \`no'."]) ;;
-esac
-eval "enable_menubars=\"$val\""
-], [])
+ [], [],[yes,no,lucid,motif,athena,gtk,msw])
-AC_ARG_ENABLE([scrollbars],
+XE_KEYWORD_ARG_ENABLE([scrollbars],
AC_HELP_STRING([--enable-scrollbars=TYPE],[Use TYPE scrollbars (lucid, motif, athena, or no).
Lucid scrollbars are the default.]),
- [
-case "$enable_scrollbars" in
- l | lu | luc | luci | lucid ) val=lucid ;;
- mo | mot | moti | motif ) val=motif ;;
- a | at | ath | athe | athen | athena ) val=athena ;;
- n | no | non | none ) val=no ;;
- y | ye | yes ) val=yes ;;
- g | gt | gtk ) val=gtk ;;
- ms | msw ) val=msw ;;
- * ) USAGE_ERROR(["The \`--$optname' option must have one of these values:
- \`gtk', \`lucid', \`motif', \`athena', \`yes', or \`no'."]) ;;
-esac
-eval "enable_scrollbars=\"$val\""
-], [])
+ [], [],[yes,no,lucid,motif,athena,gtk,msw])
-AC_ARG_ENABLE([dialogs],
+XE_KEYWORD_ARG_ENABLE([dialogs],
AC_HELP_STRING([--enable-dialogs=TYPE],[Use TYPE dialog boxes (lucid, motif, athena, or no).
There are no true Lucid dialogs; Motif dialogs will be
used if Motif can be found, else Athena is used.]),
- [
-case "$enable_dialogs" in
- l | lu | luc | luci | lucid ) val=lucid ;;
- mo | mot | moti | motif ) val=motif ;;
- a | at | ath | athe | athen | athena ) val=athena ;;
- n | no | non | none ) val=no ;;
- y | ye | yes ) val=yes ;;
- g | gt | gtk ) val=gtk ;;
- ms | msw ) val=msw ;;
- * ) USAGE_ERROR(["The \`--$optname' option must have one of these values:
- \`gtk', \`lucid', \`motif', \`athena', \`yes', or \`no'."]) ;;
-esac
-eval "enable_dialogs=\"$val\""
-], [])
+ [], [],[yes,no,lucid,motif,athena,gtk,msw])
-AC_ARG_ENABLE([widgets],
+XE_KEYWORD_ARG_ENABLE([widgets],
AC_HELP_STRING([--enable-widgets],[Use TYPE native widgets (lucid, motif, athena, or no).
Other widget types are currently unsupported.
There are no true Lucid widgets; Motif widgets will be
used if Motif can be found, else Athena is used.]),
- [
-case "$enable_widgets" in
- l | lu | luc | luci | lucid ) val=lucid ;;
- mo | mot | moti | motif ) val=motif ;;
- a | at | ath | athe | athen | athena ) val=athena ;;
- n | no | non | none ) val=no ;;
- y | ye | yes ) val=yes ;;
- g | gt | gtk ) val=gtk ;;
- ms | msw ) val=msw ;;
- * ) USAGE_ERROR(["The \`--$optname' option must have one of these values:
- \`gtk', \`lucid', \`motif', \`athena', \`yes', or \`no'."]) ;;
-esac
-eval "enable_widgets=\"$val\""
-], [])
+ [], [],[yes,no,lucid,motif,athena,gtk,msw])
dnl -------------------------------------------------------------------------
dnl Final command line argument checks.
@@ -1205,15 +1094,15 @@
dnl Error checking default to "yes" in beta versions, to "no" in releases.
dnl Same goes for --enable-debug and --extra-verbosity.
if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
-test "${error_check_extents=$beta}" = yes && AC_DEFINE(ERROR_CHECK_EXTENTS)
-test "${error_check_types=$beta}" = yes && AC_DEFINE(ERROR_CHECK_TYPES)
-test "${error_check_text=$beta}" = yes && AC_DEFINE(ERROR_CHECK_TEXT)
-test "${error_check_gc=$beta}" = yes && AC_DEFINE(ERROR_CHECK_GC)
-test "${error_check_malloc=$beta}" = yes && AC_DEFINE(ERROR_CHECK_MALLOC)
-test "${error_check_byte_code=$beta}" = yes && AC_DEFINE(ERROR_CHECK_BYTE_CODE)
-test "${error_check_glyphs=$beta}" = yes && AC_DEFINE(ERROR_CHECK_GLYPHS)
-test "${error_check_display=$beta}" = yes && AC_DEFINE(ERROR_CHECK_DISPLAY)
-test "${error_check_structures=$beta}" = yes && AC_DEFINE(ERROR_CHECK_STRUCTURES)
+test "${enable_error_checking_extents=$beta}" = yes && AC_DEFINE(ERROR_CHECK_EXTENTS)
+test "${enable_error_checking_types=$beta}" = yes && AC_DEFINE(ERROR_CHECK_TYPES)
+test "${enable_error_checking_text=$beta}" = yes && AC_DEFINE(ERROR_CHECK_TEXT)
+test "${enable_error_checking_gc=$beta}" = yes && AC_DEFINE(ERROR_CHECK_GC)
+test "${enable_error_checking_malloc=$beta}" = yes && AC_DEFINE(ERROR_CHECK_MALLOC)
+test "${enable_error_checking_byte_code=$beta}" = yes && AC_DEFINE(ERROR_CHECK_BYTE_CODE)
+test "${enable_error_checking_glyphs=$beta}" = yes && AC_DEFINE(ERROR_CHECK_GLYPHS)
+test "${enable_error_checking_display=$beta}" = yes && AC_DEFINE(ERROR_CHECK_DISPLAY)
+test "${enable_error_checking_structures=$beta}" = yes && AC_DEFINE(ERROR_CHECK_STRUCTURES)
dnl enable_debug=yes must be set when error checking is present. This should be
dnl fixed up.
dnl enable_debug implies other options
@@ -2263,7 +2152,7 @@
elif test "$CC" = "xlc"; then
with_cflags_warning="-qinfo"
elif test "$GCC" = "yes"; then
- with_cflags_warning="-Wall -Wno-switch -Wmissing-prototypes"
+ with_cflags_warning="-Wall -Wno-switch -Wundef"
dnl This is not very useful, as it issues warnings that may appear
dnl or disappear rather randomly, cannot easily be fixed, and are
dnl not a big deal. If you want it, add it yourself.
@@ -2273,7 +2162,6 @@
dnl Warnings about char subscripts are pretty pointless, though,
dnl and we use them in various places.
with_cflags_warning="$with_cflags_warning -Wsign-compare -Wno-char-subscripts"
- with_cflags_warning="$with_cflags_warning -Wundef -Wstrict-prototypes"
test "$__GCC3" = "yes" && with_cflags_warning="$with_cflags_warning -Wpacked"
dnl glibc is intentionally not `-Wpointer-arith'-clean.
dnl Ulrich Drepper has rejected patches to fix the glibc header files.
@@ -2294,6 +2182,7 @@
xe_cflags_warning="$with_cflags_warning -Wunused-parameter"
fi
with_cflags_warning="$with_cflags_warning -Wshadow -Wmissing-declarations"
+ with_cflags_warning="$with_cflags_warning -Wmissing-prototypes -Wstrict-prototypes"
dnl **** If more gcc/g++ flags are added, from here on must handle
dnl **** with_cflags_warning and xe_cflags_warning in parallel
elif test "$__ICC" = "yes"; then
@@ -2785,7 +2674,7 @@
dnl Try this again when 2.1 hits the streets.
dnl Avoid using free-hook.c if support exists for malloc debugging in libc
dnl have_libmcheck=no
-dnl if test "$error_check_malloc" = "yes" -a \
+dnl if test "$enable_error_checking_malloc" = "yes" -a \
dnl "$have_glibc" = "yes" -a \
dnl "$doug_lea_malloc" = "yes"; then
dnl AC_CHECK_HEADERS(mcheck.h)
@@ -3508,12 +3397,12 @@
dnl if test "$with_tty" = "no" ; then
dnl AC_MSG_ERROR([No window system support and no TTY support - Unable to proceed.])
dnl fi
- for feature in tooltalk cde offix wmcommand xim xmu nas_sound
+ for feature in with_tooltalk with_cde with_offix with_wmcommand with_xim with_xmu enable_sound_nas
do
- if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
- AC_MSG_WARN([--with-$feature ignored: Not valid without X support])
+ if eval "test -n \"\${feature}\" -a \"\${feature}\" != no" ; then
+ AC_MSG_WARN([--$feature ignored: Not valid without X support])
fi
- eval "with_${feature}=no"
+ eval "${feature}=no"
done
fi
@@ -4846,9 +4735,9 @@
dnl Autodetect native sound
AC_CHECKING("for sound support")
-test -z "$with_native_sound" -a -n "$with_native_sound_lib" && with_native_sound=yes
+test -n "$with_native_sound_lib" && enable_sound_native=yes
-if test "$with_native_sound" != "no"; then
+if test "$enable_sound_native" != "no"; then
dnl Maybe sound is already on include path...
if test -n "$with_native_sound_lib"; then
AC_CHECK_HEADER(multimedia/audio_device.h,
@@ -4928,7 +4817,7 @@
fi
if test "$sound_found" = "yes"; then
- with_native_sound=yes
+ enable_sound_native=yes
dnl NetBSD can use Linux's sound API, but it needs an extra library at
dnl link time to do so. (OpenBSD apparently needs the same; not written
@@ -4936,20 +4825,25 @@
if test "$opsys" = "netbsd" ; then
AC_CHECK_LIB(ossaudio, _oss_ioctl, native_sound_lib="-lossaudio")
fi
+ else
+ if test "$enable_sound_native" = "yes" ; then
+ AC_MSG_WARN([No native libraries found. Disabling native sound support.])
+ fi
+ enable_sound_native=no
fi
fi
-if test "$with_native_sound" = "yes"; then
+if test "$enable_sound_native" = "yes"; then
AC_DEFINE(HAVE_NATIVE_SOUND)
test -n "$with_native_sound_lib" && XE_PREPEND($with_native_sound_lib, LIBS)
fi
dnl NAS Sound support
-if test "$with_nas_sound" != "no"; then
+if test "$enable_sound_nas" != "no"; then
AC_CHECK_HEADER(audio/audiolib.h, [
AC_CHECK_LIB(audio, AuOpenServer, have_nas_sound=yes)])
if test "$have_nas_sound" = "yes"; then
- with_nas_sound=yes
+ enable_sound_nas=yes
AC_DEFINE(HAVE_NAS_SOUND)
XE_ADD_OBJS(nas.o)
XE_PREPEND(-laudio, libs_x)
@@ -4957,14 +4851,14 @@
dnl then we force safer behavior.
AC_EGREP_HEADER(AuXtErrorJump,audio/Xtutil.h,,[old_nas=yes; AC_DEFINE(NAS_NO_ERROR_JUMP)])
else
- test "$with_nas_sound" = "yes" && \
+ test "$enable_sound_nas" = "yes" && \
XE_DIE("Required NAS sound support cannot be provided.")
- with_nas_sound=no
+ enable_sound_nas=no
fi
fi
dnl ESD Sound support
-if test "$with_esd_sound" != "no"; then
+if test "$enable_sound_esd" != "no"; then
AC_CHECK_PROG(have_esd_config, esd-config, yes, no)
if test "$have_esd_config" = "yes"; then
save_c_switch_site="$c_switch_site" save_LIBS="$LIBS"
@@ -4976,14 +4870,14 @@
fi
if test "$have_esd_sound" = "yes"; then
- with_esd_sound=yes
+ enable_sound_esd=yes
need_miscplay=yes
XE_ADD_OBJS(esd.o)
AC_DEFINE(HAVE_ESD_SOUND)
else
- test "$with_esd_sound" = "yes" && \
+ test "$enable_sound_esd" = "yes" && \
XE_DIE("Required ESD sound support cannot be provided.")
- with_esd_sound=no
+ enable_sound_esd=no
fi
fi
@@ -5080,45 +4974,45 @@
dnl On FreeBSD, both DB and DBM are part of libc.
dnl By default, we check for DBM support in libgdbm, then libc, then libdbm.
-test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \
+test "$enable_database_gdbm $enable_database_dbm $enable_database_berkdb" \
!= "no no no" && AC_CHECKING(for database support)
dnl Check for ndbm.h, required for either kind of DBM support.
-if test "$with_database_gdbm $with_database_dbm" != "no no"; then
+if test "$enable_database_gdbm $enable_database_dbm" != "no no"; then
AC_CHECK_HEADER(ndbm.h, [:], [
- test "$with_database_gdbm" = "yes" -o \
- "$with_database_dbm" = "yes" && \
+ test "$enable_database_gdbm" = "yes" -o \
+ "$enable_database_dbm" = "yes" && \
XE_DIE("Required DBM support cannot be provided.")
- with_database_gdbm=no with_database_dbm=no])
+ enable_database_gdbm=no enable_database_dbm=no])
fi
dnl Check for DBM support in libgdbm.
-if test "$with_database_gdbm" != "no"; then
+if test "$enable_database_gdbm" != "no"; then
AC_CHECK_LIB(gdbm, dbm_open, [
- with_database_gdbm=yes with_database_dbm=no libdbm=-lgdbm], [
- if test "$with_database_gdbm" = "yes"; then
+ enable_database_gdbm=yes enable_database_dbm=no libdbm=-lgdbm], [
+ if test "$enable_database_gdbm" = "yes"; then
XE_DIE("Required GNU DBM support cannot be provided.")
fi
- with_database_gdbm=no])
+ enable_database_gdbm=no])
fi
dnl Check for DBM support in libc and libdbm.
-if test "$with_database_dbm" != "no"; then
- AC_CHECK_FUNC(dbm_open, [with_database_dbm=yes libdbm=], [
- AC_CHECK_LIB(dbm, dbm_open, [with_database_dbm=yes libdbm=-ldbm], [
- test "$with_database_dbm" = "yes" && \
+if test "$enable_database_dbm" != "no"; then
+ AC_CHECK_FUNC(dbm_open, [enable_database_dbm=yes libdbm=], [
+ AC_CHECK_LIB(dbm, dbm_open, [enable_database_dbm=yes libdbm=-ldbm], [
+ test "$enable_database_dbm" = "yes" && \
XE_DIE("Required DBM support cannot be provided.")
- with_database_dbm=no])])
+ enable_database_dbm=no])])
fi
dnl Tell make about the DBM support we detected.
test -n "$libdbm" && XE_PREPEND("$libdbm", LIBS)
-test "$with_database_gdbm" = "yes" -o \
- "$with_database_dbm" = "yes" && \
+test "$enable_database_gdbm" = "yes" -o \
+ "$enable_database_dbm" = "yes" && \
AC_DEFINE(HAVE_DBM)
dnl Check for Berkeley DB.
-if test "$with_database_berkdb" != "no"; then
+if test "$enable_database_berkdb" != "no"; then
AC_MSG_CHECKING(for Berkeley db.h)
for header in "db/db.h" "db.h"; do
AC_TRY_COMPILE([
@@ -5139,11 +5033,11 @@
],[], db_h_file="$header"; break)
done
if test -z "$db_h_file"
- then AC_MSG_RESULT(no); with_database_berkdb=no
+ then AC_MSG_RESULT(no); enable_database_berkdb=no
else AC_MSG_RESULT($db_h_file)
fi
- if test "$with_database_berkdb" != "no"; then
+ if test "$enable_database_berkdb" != "no"; then
AC_MSG_CHECKING(for Berkeley DB version)
AC_EGREP_CPP(yes,
[#include <$db_h_file>
@@ -5164,12 +5058,12 @@
AC_MSG_RESULT(3); dbfunc=db_create; dbver=3])],[
AC_MSG_RESULT(2); dbfunc=db_open; dbver=2])],[
AC_MSG_RESULT(1); dbfunc=dbopen; dbver=1])
- AC_CHECK_FUNC($dbfunc, with_database_berkdb=yes need_libdb=no, [
- AC_CHECK_LIB(db, $dbfunc, with_database_berkdb=yes need_libdb=yes)])
+ AC_CHECK_FUNC($dbfunc, enable_database_berkdb=yes need_libdb=no, [
+ AC_CHECK_LIB(db, $dbfunc, enable_database_berkdb=yes need_libdb=yes)])
fi
dnl Berk db 4.1 decorates public functions with version information
- if test "$with_database_berkdb" != "yes" -a "$dbver" = "4"; then
+ if test "$enable_database_berkdb" != "yes" -a "$dbver" = "4"; then
rm -f $tempcname
echo "#include <$db_h_file>" > $tempcname
echo "configure___ dbfunc=db_create" >> $tempcname
@@ -5178,18 +5072,18 @@
| sed -n -e "s/[[ TAB]]*=[[ TAB\"]]*/='/" -e "s/[[ TAB\"]]*\$/'/" -e "s/^configure___//p"`
rm -f $tempcname
AC_MSG_WARN("db_create is really $dbfunc")
- AC_CHECK_LIB(db, $dbfunc, with_database_berkdb=yes need_libdb=yes)
+ AC_CHECK_LIB(db, $dbfunc, enable_database_berkdb=yes need_libdb=yes)
fi
- if test "$with_database_berkdb" = "yes"; then
+ if test "$enable_database_berkdb" = "yes"; then
AC_DEFINE_UNQUOTED(DB_H_FILE, "$db_h_file")
AC_DEFINE(HAVE_BERKELEY_DB)
test "$need_libdb" = "yes" && XE_PREPEND(-ldb, LIBS)
- else with_database_berkdb=no
+ else enable_database_berkdb=no
fi
fi
-if test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \
+if test "$enable_database_gdbm $enable_database_dbm $enable_database_berkdb" \
!= "no no no"; then
AC_DEFINE(HAVE_DATABASE)
fi
@@ -5830,16 +5724,16 @@
echo "
Sound:"
-test "$with_native_sound" = yes && echo " Compiling in support for sound (native)."
-test "$with_nas_sound" = yes && echo " Compiling in support for NAS (network audio system)."
+test "$enable_sound_native" = yes && echo " Compiling in support for sound (native)."
+test "$enable_sound_nas" = yes && echo " Compiling in support for NAS (network audio system)."
test "$old_nas" = yes && echo " - NAS library lacks error trapping; will play synchronously."
-test "$with_esd_sound" = yes && echo " Compiling in support for ESD (Enlightened Sound Daemon)."
+test "$enable_sound_esd" = yes && echo " Compiling in support for ESD (Enlightened Sound Daemon)."
echo "
Databases:"
-test "$with_database_berkdb" = yes && echo " Compiling in support for Berkeley database."
-test "$with_database_dbm" = yes && echo " Compiling in support for DBM."
-test "$with_database_gdbm" = yes && echo " Compiling in support for GNU DBM."
+test "$enable_database_berkdb" = yes && echo " Compiling in support for Berkeley database."
+test "$enable_database_dbm" = yes && echo " Compiling in support for DBM."
+test "$enable_database_gdbm" = yes && echo " Compiling in support for GNU DBM."
test "$with_ldap" = yes && echo " Compiling in support for LDAP."
if test "$with_postgresql" = yes; then
echo " Compiling in support for PostgreSQL."
@@ -5891,7 +5785,7 @@
test "$enable_pdump" = yes && echo " Using the new portable dumper."
test "$enable_debug" = yes && echo " Compiling in support for extra debugging code."
test "$usage_tracking" = yes && echo " Compiling in support for active usage tracking (Sun internal)."
-if test "$error_check_extents $error_check_types $error_check_text $error_check_gc $error_check_malloc $error_check_glyphs $error_check_byte_code $error_check_display $error_check_structures" \
+if test "$enable_error_checking_extents $enable_error_checking_types $enable_error_checking_text $enable_error_checking_gc $enable_error_checking_malloc $enable_error_checking_glyphs $enable_error_checking_byte_code $enable_error_checking_display $enable_error_checking_structures" \
!= "no no no no no no no no no"; then
echo " Compiling in support for runtime error checking."
echo " WARNING: ---------------------------------------------------------"
--
Malcolm Purvis <malcolmp(a)xemacs.org>