# FIXME? Is it really our business to decide this for the user?
if test -d /sw/include && test -d /sw/lib; then
GCC_TEST_OPTIONS="-I/sw/include -L/sw/lib"
- CPP_TEST_OPTIONS=${GCC_TEST_OPTIONS}
NON_GCC_TEST_OPTIONS=${GCC_TEST_OPTIONS}
fi
;;
# Without defining _LANGUAGE_C, things get masked out in the headers
# so that, for instance, grepping for `free' in stdlib.h fails and
# AC_HEADER_STD_C fails. (MIPSPro 7.2.1.2m compilers, Irix 6.5.3m).
- NON_GNU_CPP="/lib/cpp -D_LANGUAGE_C"
NON_GCC_TEST_OPTIONS="-D_LANGUAGE_C"
;;
case "${canonical}" in
*-sunos5.6* | *-solaris2.6* )
opsys=sol2-6
- NON_GNU_CPP=/usr/ccs/lib/cpp
RANLIB="ar -ts"
;;
*-sunos5.[7-9]* | *-solaris2.[7-9]* )
opsys=sol2-6
emacs_check_sunpro_c=yes
- NON_GNU_CPP=/usr/ccs/lib/cpp
;;
*-sunos5* | *-solaris* )
opsys=sol2-10
emacs_check_sunpro_c=yes
- NON_GNU_CPP=/usr/ccs/lib/cpp
;;
esac
## Watch out for a compiler that we know will not work.
case "${canonical}" in
*-cygwin ) opsys=cygwin ;;
*-darwin* ) opsys=darwin ;;
- *-sysv4.2uw* ) opsys=unixware; NON_GNU_CPP=/lib/cpp ;;
- *-sysv5uw* ) opsys=unixware; NON_GNU_CPP=/lib/cpp ;;
- *-sysv5OpenUNIX* ) opsys=unixware; NON_GNU_CPP=/lib/cpp ;;
+ *-sysv4.2uw* ) opsys=unixware ;;
+ *-sysv5uw* ) opsys=unixware ;;
+ *-sysv5OpenUNIX* ) opsys=unixware ;;
## Otherwise, we'll fall through to the generic opsys code at the bottom.
esac
;;
#### Choose a compiler.
-test -n "$CC" && cc_specified=yes
-
-# Save the value of CFLAGS that the user specified.
-SPECIFIED_CFLAGS="$CFLAGS"
-
-# Save specified CPP (if any), before AC_PROG_CPP runs.
-SPECIFIED_CPP="$CPP"
dnl Sets GCC=yes if using gcc.
AC_PROG_CC
AM_PROG_CC_C_O
-# Initialize gnulib right after verifying that the C compiler works.
-# Note: this ends up setting CPP.
-gl_EARLY
-
-dnl Note: looks like gl_EARLY has already done this (via AC_PROG_CPP).
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-
-## If not using gcc, and on Solaris, and no CPP specified, see if
-## using a Sun compiler, which needs -Xs to prevent whitespace.
-if test x"$GCC" != xyes && test x"$emacs_check_sunpro_c" = xyes && \
- test x"$CPP" = x; then
- AC_MSG_CHECKING([whether we are using a Sun C compiler])
- AC_CACHE_VAL(emacs_cv_sunpro_c,
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
-[[#ifndef __SUNPRO_C
-fail;
-#endif
-]])], emacs_cv_sunpro_c=yes, emacs_cv_sunpro_c=no)])
- AC_MSG_RESULT($emacs_cv_sunpro_c)
-
- if test x"$emacs_cv_sunpro_c" = xyes; then
- NON_GNU_CPP="$CC -E -Xs"
- fi
-fi
-
-## If using gcc, and on darwin, see if using Apple's gcc, where old
-## (pre gcc 3.3?) versions need -no-cpp-precomp to workaround some
-## (unrecorded) issue.
-## Frankly, I suspect this option is no longer needed on any system
-## still in use today. It is at best a no-op since Apple's version
-## of gcc 3.3 (?), which corresponds (?) to Xcode 1.5 from 2004.
-## This was for OS X 10.3, and the nextstep port (for example)
-## only supports 10.4 or later (although you could be building a
-## non-ns version on some older OS X I guess).
-if test x"$opsys" = xdarwin && test x"$GCC" = xyes; then
- AC_MSG_CHECKING([whether we are using an Apple version of GCC])
- AC_CACHE_VAL(emacs_cv_apple_gcc,
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
-[[#ifndef __APPLE_CC__
-fail;
-#endif
-]])], emacs_cv_apple_gcc=yes, emacs_cv_apple_gcc=no)])
- AC_MSG_RESULT($emacs_cv_apple_gcc)
-
- ## This only tests that adding the option does not cause an error.
- ## FIXME It may still cause "unrecognized option"
- ## (in gcc < 4.6 --no-foo does that; newer versions throw an error).
- ## The message appears on stderr, so AC_EGREP_CPP is no use.
- ## It would be better to test if it is actually needed.
- ## For that, someone would have actually had to document what the
- ## issues it worked around were, so we could test for them.
- if test $emacs_cv_apple_gcc = yes; then
- AC_MSG_CHECKING([whether preprocessor accepts -no-cpp-precomp])
- save_CPP="$CPP"
- test x$SPECIFIED_CPP = x && CPP="${CC-cc} -E"
- CPP="$CPP -no-cpp-precomp"
- dnl NB this will run AC_PROG_CPP first if it has not already happened.
- AC_CACHE_VAL(emacs_cv_precomp,
- [AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[]],[[]])], emacs_cv_precomp=yes, emacs_cv_precomp=no)])
- AC_MSG_RESULT($emacs_cv_precomp)
-
- test $emacs_cv_precomp = no && CPP="$save_CPP"
- fi
-fi
-
-#### Some systems specify a CPP to use unless we are using GCC.
-#### Now that we know whether we are using GCC, we can decide whether
-#### to use that one.
-if test "x$NON_GNU_CPP" != x && test x$GCC != xyes && test "x$CPP" = x
-then
- CPP="$NON_GNU_CPP"
-fi
-
-test "x$CPP_TEST_OPTIONS" != x && CPP="$CPP $CPP_TEST_OPTIONS"
-
-#### Some systems specify a CC to use unless we are using GCC.
-#### Now that we know whether we are using GCC, we can decide whether
-#### to use that one.
-if test "x$NON_GNU_CC" != x && test x$GCC != xyes &&
- test x$cc_specified != xyes
-then
- CC="$NON_GNU_CC"
-fi
-
if test x$GCC = xyes; then
test "x$GCC_TEST_OPTIONS" != x && CC="$CC $GCC_TEST_OPTIONS"
else
test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS"
fi
+# Initialize gnulib right after choosing the compiler.
+gl_EARLY
+
AC_ARG_ENABLE([gcc-warnings],
[AS_HELP_STRING([--enable-gcc-warnings],
[turn on lots of GCC warnings (for developers)])],
-#### Some other nice autoconf tests.
-
-dnl Note: looks like gl_EARLY has already done this.
-AC_PROG_CPP
-AC_PROG_INSTALL
-
-dnl Note: looks like configure does this very early on anyway.
-AC_PROG_MKDIR_P
-
-dnl Note: looks like gl_EARLY has already done this.
-if test "x$RANLIB" = x; then
- AC_PROG_RANLIB
-fi
+dnl Some other nice autoconf tests.
+dnl These are commented out, since gl_EARLY and/or Autoconf already does them.
+dnl AC_PROG_INSTALL
+dnl AC_PROG_MKDIR_P
+dnl if test "x$RANLIB" = x; then
+dnl AC_PROG_RANLIB
+dnl fi
## Although we're running on an amd64 kernel, we're actually compiling for
## the x86 architecture. The user should probably have provided an
[AC_MSG_RESULT(no)])
-# The value of CPP is a quoted variable reference, so we need to do this
-# to get its actual value...
-CPP=`eval "echo $CPP"`
-
-
dnl The function dump-emacs will not be defined and temacs will do
dnl (load "loadup") automatically unless told otherwise.
test "x$CANNOT_DUMP" = "x" && CANNOT_DUMP=no
AC_CONFIG_COMMANDS([epaths], [
echo creating src/epaths.h
${MAKE-make} epaths-force
-], [GCC="$GCC" NON_GNU_CPP="$NON_GNU_CPP" CPP="$CPP" CPPFLAGS="$CPPFLAGS"])
+], [GCC="$GCC" CPPFLAGS="$CPPFLAGS"])
AC_CONFIG_COMMANDS([gdbinit], [
if test ! -f src/.gdbinit && test -f $srcdir/src/.gdbinit; then