APPROVE COMMIT sjt-xft
This patch brings configure.ac into alignment with the latest version of
21.5's configure.in.
I still have my mainline based workspace for autoconf 2.5 if an xft-free
version is required.
ChangeLog addition:
2005-02-02 Malcolm Purvis <malcolmp(a)xemacs.org>
* configure.ac Align with the current mainline version of
configure.in.
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.1
diff -u -r1.1.14.1 configure.ac
--- configure.ac 2005/02/01 15:46:17 1.1.14.1
+++ configure.ac 2005/02/02 05:45:09
@@ -552,6 +552,9 @@
AC_HELP_STRING([--with-netinstall],[Support for installation over the internet.
Only functional on the MS Windows platforms.]),
[], [with_netinstall="no"])
+AC_ARG_WITH([optimization],
+ AC_HELP_STRING([--with-optimization],[Control whether compilation is optimized. By
default, optimization is on in release versions and off in beta versions, since it can
interfere with proper stack backtraces.]),
+ [], [])
AC_ARG_WITH([ipv6-cname],
AC_HELP_STRING([--with-ipv6-cname],[Try IPv6 information first when canonicalizing host
names. This option has no effect unless system supports getaddrinfo(3) and
getnameinfo(3).]),
[], [with_ipv6_cname="no"])
@@ -659,6 +662,16 @@
the maximum safe warning level.]),
[], [])
+AC_ARG_WITH([cflags-optimization],
+ AC_HELP_STRING([--with-cflags-optimization=FLAGS],
+ [Override compiler flags used to control optimization. Only has an effect when
optimization is enabled. Normally, don't set this, as XEmacs will already set the
maximum safe optimization flags appropriate for the compiler being invoked.]),
+ [], [])
+
+AC_ARG_WITH([cflags-debugging],
+ AC_HELP_STRING([--with-cflags-debugging=FLAGS],
+ [Override compiler flags used to add debugging information to the executable. Normally,
debugging information is added whenever possible (i.e. unless optimization is turned on
and the compiler does not permit debugging and optimization simultaneously).]),
+ [], [])
+
AC_ARG_WITH([cpp],
AC_HELP_STRING([--with-cpp],[C preprocessor to use (e.g. /usr/ccs/lib/cpp or cc -E)]),
[CPP="$with_cpp"], [])
@@ -1784,6 +1797,16 @@
else cflags_warning_specified=no;
fi
+if test "${cflags_optimization-unset}" != unset
+ then cflags_optimization_specified=yes;
+ else cflags_optimization_specified=no;
+fi
+
+if test "${cflags_debugging-unset}" != unset
+ then cflags_debugging_specified=yes;
+ else cflags_debugging_specified=no;
+fi
+
xe_save_CFLAGS="$CFLAGS"
AC_AIX dnl Defines _ALL_SOURCE on AIX.
@@ -2112,36 +2135,69 @@
xemacs_cc_cc_mismatch=no
fi
fi
-
-dnl #### This may need to be overhauled so that all of XEMACS_CC's flags
-dnl are handled separately, not just the xe_cflags_warning stuff.
-AC_MSG_CHECKING([for preferred CFLAGS])
+dnl Calculate optimization flags. These will be off by default in beta
+dnl versions and on in release versions.
-dnl Use either command line flag, environment var, or autodetection
-if test "$cflags_specified" = "no"; then
- dnl Following values of CFLAGS are known to work well.
- dnl Should we take debugging options into consideration?
- if test "$GCC" = "yes"; then
- CFLAGS="-g -O3"
- elif test "$__SUNPRO_C" = "yes"; then
- case "$opsys" in
- sol2 ) CFLAGS="-xO4" ;;
- sunos4* ) CFLAGS="-xO2" ;;
- esac
- elif test "$__DECC" = "yes"; then
- CFLAGS="-O3"
- elif test "$CC" = "xlc"; then
- CFLAGS="-g -O3 -qstrict -qnoansialias -qlibansi -qro -qmaxmem=20000"
- elif test "$__ICC" = "yes"; then
- CFLAGS="-g -O3 -Ob2"
- dnl ### Add optimal CFLAGS support for other compilers HERE!
+if test -z "$with_optimization" ; then
+ if test -n "$emacs_is_beta" ; then
+ with_optimization=no
else
- CFLAGS="-O" ;dnl The only POSIX-approved flag
+ with_optimization=yes
fi
fi
-AC_MSG_RESULT([${CFLAGS}])
+
+dnl #### We should be checking C_OPTIMIZE_SWITCH in m/*, s/*.
+
+AC_MSG_CHECKING([for preferred optimization flags])
+if test "$with_optimization" = "yes" ; then
+ if test "$cflags_optimization_specified" = "no"; then
+ dnl Following values of cflags_optimization are known to work well.
+ dnl Should we take debugging options into consideration?
+ if test "$GCC" = "yes"; then
+ with_cflags_optimization="-O3"
+ elif test "$__SUNPRO_C" = "yes"; then
+ case "$opsys" in
+ sol2 ) with_cflags_optimization="-xO4" ;;
+ sunos4* ) with_cflags_optimization="-xO2" ;;
+ esac
+ elif test "$__DECC" = "yes"; then
+ with_cflags_optimization="-O3"
+ elif test "$CC" = "xlc"; then
+ dnl see
http://www.nersc.gov/vendor_docs/ibm/vac/sc094959.pdf
+ with_cflags_optimization="-O3 -qstrict -qnoansialias -qlibansi
-qmaxmem=20000"
+ elif test "$__ICC" = "yes"; then
+ with_cflags_optimization="-O3 -Ob2"
+ dnl ### Add optimal cflags_optimization support for other compilers HERE!
+ else
+ with_cflags_optimization="-O" ;dnl The only POSIX-approved flag
+ fi
+ fi
+else
+ with_cflags_optimization=
+fi
+
+AC_MSG_RESULT([${with_cflags_optimization}])
+
+dnl #### We should be checking C_DEBUG_SWITCH in m/*, s/*.
+
+AC_MSG_CHECKING([for preferred debugging flags])
+if test "$cflags_debugging_specified" = "no"; then
+ dnl ### Add optimal debugging support for other compilers HERE!
+ with_cflags_debugging="-g"
+
+ debugging_ok_with_optimization=no
+ if test "$GCC" = "yes" -o "$CC" = "xlc" -o
"$__ICC" = "yes"; then
+ debugging_ok_with_optimization=yes
+ fi
+
+ if test "$with_optimization" = "yes" -a
"$debugging_ok_with_optimization" = "no"; then
+ with_cflags_debugging=
+ fi
+fi
+AC_MSG_RESULT([${with_cflags_debugging}])
+
dnl Calculate warning flags. We separate the flags for warnings from
dnl the other flags because we want to force the warnings to be seen
dnl by everyone who doesn't specifically override them.
@@ -2203,14 +2259,34 @@
AC_MSG_CHECKING([for preferred warning flags for CC])
AC_MSG_RESULT([${with_cflags_warning}])
+
+dnl Calculate remaining cflags.
+dnl Use either command line flag, environment var, or autodetection
+
+AC_MSG_CHECKING([for remaining CFLAGS])
-dnl Now combine all C flags. Put the warning flags first so that
-dnl user-specified flags will override.
-dnl Do XE_CFLAGS before adding warning flags to CFLAGS.
+if test "$cflags_specified" = "no"; then
+ dnl Following values of CFLAGS are known to work well.
+ if test "$CC" = "xlc"; then
+ CFLAGS="-qro"
+ dnl ### Add optimal CFLAGS support for other compilers HERE!
+ fi
+fi
+AC_MSG_RESULT([${CFLAGS}])
+
+dnl Now combine all C flags. Put the warning and optimization flags first
+dnl so that user-specified flags will override.
+dnl Do XE_CFLAGS before adding flags to CFLAGS.
dnl Flags for XEMACS_CC:
-XE_CFLAGS="$xe_cflags_warning $CFLAGS"
+
+XE_CFLAGS="$xe_cflags_warning $with_cflags_debugging $with_cflags_optimization
$CFLAGS"
dnl Flags for CC:
-CFLAGS="$with_cflags_warning $CFLAGS"
+CFLAGS="$with_cflags_warning $with_cflags_debugging $with_cflags_optimization
$CFLAGS"
+
+AC_MSG_CHECKING([total value of XE_CFLAGS])
+AC_MSG_RESULT([${XE_CFLAGS}])
+AC_MSG_CHECKING([total value of CFLAGS])
+AC_MSG_RESULT([${CFLAGS}])
dnl Search for GCC specific build problems we know about
if test "$GCC" = "yes"; then
@@ -4803,8 +4879,17 @@
break)
done
fi
+
+ if test "$sound_found" = "yes"; then
+ with_native_sound=yes
- test "$sound_found" = "yes" && with_native_sound=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
+ dnl or tested.)
+ if test "$opsys" = "netbsd" ; then
+ AC_CHECK_LIB(ossaudio, _oss_ioctl, native_sound_lib="-lossaudio")
+ fi
+ fi
fi
if test "$with_native_sound" = "yes"; then
--
Malcolm Purvis <malcolmp(a)xemacs.org>