X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/9ee7d8b93cb143b473e6dffb708e777bc6fe5bd0..3a4155de6637f737ff8b12ec3ceb2633f8e8fa26:/configure.in diff --git a/configure.in b/configure.in index c9592921e7..8c3b322824 100644 --- a/configure.in +++ b/configure.in @@ -492,12 +492,10 @@ case "${canonical}" in * ) unported=yes ;; esac opsys=darwin - # Define CPP as follows to make autoconf work correctly. - CPP="${CC-cc} -E -no-cpp-precomp" # Use fink packages if available. + # 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="${CPP} ${GCC_TEST_OPTIONS}" NON_GCC_TEST_OPTIONS=${GCC_TEST_OPTIONS} fi ;; @@ -532,7 +530,6 @@ case "${canonical}" in # 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" ;; @@ -549,18 +546,15 @@ case "${canonical}" in 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. @@ -581,12 +575,10 @@ case "${canonical}" in machine=intel386 case "${canonical}" in *-cygwin ) opsys=cygwin ;; - *-darwin* ) opsys=darwin - CPP="${CC-cc} -E -no-cpp-precomp" - ;; - *-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 ;; + *-darwin* ) opsys=darwin ;; + *-sysv4.2uw* ) opsys=unixware ;; + *-sysv5uw* ) opsys=unixware ;; + *-sysv5OpenUNIX* ) opsys=unixware ;; ## Otherwise, we'll fall through to the generic opsys code at the bottom. esac ;; @@ -628,64 +620,20 @@ opsysfile="s/${opsys}.h" #### Choose a compiler. -test -n "$CC" && cc_specified=yes - -# Save the value of CFLAGS that the user specified. -SPECIFIED_CFLAGS="$CFLAGS" 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. -gl_EARLY - -# 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 - -#### 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 - -#### 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)])], @@ -737,7 +685,7 @@ else AC_SUBST([WERROR_CFLAGS]) nw="$nw -Waggregate-return" # anachronistic - nw="$nw -Wlong-long" # C90 is anachronistic (lib/gethrxtime.h) + nw="$nw -Wlong-long" # C90 is anachronistic nw="$nw -Wc++-compat" # We don't care about C++ compilers nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib nw="$nw -Wtraditional" # Warns on #elif which we use often @@ -803,14 +751,13 @@ fi -#### Some other nice autoconf tests. - -dnl checks for programs -AC_PROG_CPP -AC_PROG_INSTALL -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 @@ -865,6 +812,12 @@ with the `--without-makeinfo' option to build without the manuals.] ) fi AC_SUBST(HAVE_MAKEINFO) +dnl Just so that there is only a single place we need to edit. +INFO_EXT=.info +INFO_OPTS=--no-split +AC_SUBST(INFO_EXT) +AC_SUBST(INFO_OPTS) + dnl Add our options to ac_link now, after it is set up. if test x$GCC = xyes; then @@ -895,11 +848,6 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [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 @@ -951,7 +899,9 @@ case "$opsys" in ## Let `ld' find image libs and similar things in /usr/local/lib. ## The system compiler, GCC, has apparently been modified to not ## look there, contrary to what a stock GCC would do. - LD_SWITCH_SYSTEM=-L/usr/local/lib +### It's not our place to do this. See bug#10313#17. +### LD_SWITCH_SYSTEM=-L/usr/local/lib + : ;; gnu-linux) @@ -960,7 +910,9 @@ case "$opsys" in ;; netbsd) - LD_SWITCH_SYSTEM="-Wl,-rpath,/usr/pkg/lib -L/usr/pkg/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib" +### It's not our place to do this. See bug#10313#17. +### LD_SWITCH_SYSTEM="-Wl,-rpath,/usr/pkg/lib -L/usr/pkg/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib" + : ;; openbsd) @@ -973,7 +925,7 @@ AC_SUBST(LD_SWITCH_SYSTEM) ac_link="$ac_link $LD_SWITCH_SYSTEM" -## This setting of LD_SWITCH_SYSTEM references LD_SWITCH_X_SITE_AUX, +## This setting of LD_SWITCH_SYSTEM references LD_SWITCH_X_SITE_RPATH, ## which has not been defined yet. When this was handled with cpp, ## it was expanded to null when configure sourced the s/*.h file. ## Thus LD_SWITCH_SYSTEM had different values in configure and the Makefiles. @@ -985,8 +937,7 @@ ac_link="$ac_link $LD_SWITCH_SYSTEM" ## LD_SWITCH_SYSTEM_TEMACS. case "$opsys" in netbsd|openbsd) - ## _AUX_RPATH is like _AUX, but uses -rpath instead of -R. - LD_SWITCH_SYSTEM="\$(LD_SWITCH_X_SITE_AUX_RPATH) $LD_SWITCH_SYSTEM" ;; + LD_SWITCH_SYSTEM="\$(LD_SWITCH_X_SITE_RPATH) $LD_SWITCH_SYSTEM" ;; esac @@ -1471,10 +1422,8 @@ if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then fi if test $ac_enable_autodepend = yes; then DEPFLAGS='-MMD -MF ${DEPDIR}/$*.d -MP' - ## In parallel builds, another make might create depdir between - ## the first test and mkdir, so stick another test on the end. - ## Or use install-sh -d? mkdir -p is not portable. - MKDEPDIR='test -d ${DEPDIR} || mkdir ${DEPDIR} || test -d ${DEPDIR}' + ## MKDIR_P is documented (see AC_PROG_MKDIR_P) to be parallel-safe. + MKDEPDIR='${MKDIR_P} ${DEPDIR}' deps_frag=autodeps.mk fi fi @@ -1500,13 +1449,11 @@ else window_system=x11 fi -LD_SWITCH_X_SITE_AUX= -LD_SWITCH_X_SITE_AUX_RPATH= +LD_SWITCH_X_SITE_RPATH= if test "${x_libraries}" != NONE; then if test -n "${x_libraries}"; then LD_SWITCH_X_SITE=-L`echo ${x_libraries} | sed -e "s/:/ -L/g"` - LD_SWITCH_X_SITE_AUX=-R`echo ${x_libraries} | sed -e "s/:/ -R/g"` - LD_SWITCH_X_SITE_AUX_RPATH=`echo ${LD_SWITCH_X_SITE_AUX} | sed -e 's/-R/-Wl,-rpath,/'` + LD_SWITCH_X_SITE_RPATH=-Wl,-rpath,`echo ${x_libraries} | sed -e "s/:/ -Wl,-rpath,/g"` fi x_default_search_path="" x_search_path=${x_libraries} @@ -1529,8 +1476,7 @@ ${x_library}/X11/%T/%N%S" fi done fi -AC_SUBST(LD_SWITCH_X_SITE_AUX) -AC_SUBST(LD_SWITCH_X_SITE_AUX_RPATH) +AC_SUBST(LD_SWITCH_X_SITE_RPATH) if test "${x_includes}" != NONE && test -n "${x_includes}"; then C_SWITCH_X_SITE="$isystem"`echo ${x_includes} | sed -e "s/:/ $isystem/g"` @@ -1563,20 +1509,17 @@ CPPFLAGS="$CPPFLAGS -x objective-c" CFLAGS="$CFLAGS -x objective-c" TEMACS_LDFLAGS2="\${LDFLAGS}" GNU_OBJC_CFLAGS= -dnl I don't think it's especially important, but src/Makefile.in -dnl (now the only user of ns_appdir) used to go to the trouble of adding a -dnl trailing "/" to it, so now we do it here. if test "${with_ns}" != no; then if test "${opsys}" = darwin; then NS_IMPL_COCOA=yes ns_appdir=`pwd`/nextstep/Emacs.app - ns_appbindir=${ns_appdir}/Contents/MacOS/ + ns_appbindir=${ns_appdir}/Contents/MacOS ns_appresdir=${ns_appdir}/Contents/Resources ns_appsrc=${srcdir}/nextstep/Cocoa/Emacs.base elif test -f $GNUSTEP_CONFIG_FILE; then NS_IMPL_GNUSTEP=yes ns_appdir=`pwd`/nextstep/Emacs.app - ns_appbindir=${ns_appdir}/ + ns_appbindir=${ns_appdir} ns_appresdir=${ns_appdir}/Resources ns_appsrc=${srcdir}/nextstep/GNUstep/Emacs.base dnl FIXME sourcing this several times in subshells seems inefficient. @@ -1630,6 +1573,7 @@ fail; fi AC_SUBST(TEMACS_LDFLAGS2) +LEIM_INSTALLDIR="\${install_prefix}/leim" ns_frag=/dev/null NS_OBJ= NS_OBJC_OBJ= @@ -1644,7 +1588,10 @@ if test "${HAVE_NS}" = yes; then if test "${EN_NS_SELF_CONTAINED}" = yes; then prefix=${ns_appresdir} exec_prefix=${ns_appbindir} - libexecdir=${ns_appbindir}/libexec + dnl This one isn't really used, only archlibdir is. + libexecdir="\${ns_appbindir}/libexec" + archlibdir="\${ns_appbindir}/libexec" + LEIM_INSTALLDIR="\${ns_appresdir}/leim" fi ns_frag=$srcdir/src/ns.mk NS_OBJ="fontset.o fringe.o image.o" @@ -1652,6 +1599,7 @@ if test "${HAVE_NS}" = yes; then fi CFLAGS="$tmp_CFLAGS" CPPFLAGS="$tmp_CPPFLAGS" +AC_SUBST(LEIM_INSTALLDIR) AC_SUBST(NS_OBJ) AC_SUBST(NS_OBJC_OBJ) AC_SUBST(LIB_STANDARD) @@ -1708,17 +1656,20 @@ esac # Do the opsystem or machine files prohibit the use of the GNU malloc? # Assume not, until told otherwise. GNU_MALLOC=yes -doug_lea_malloc=yes -AC_CHECK_FUNC(malloc_get_state, ,doug_lea_malloc=no) -AC_CHECK_FUNC(malloc_set_state, ,doug_lea_malloc=no) -AC_CACHE_CHECK(whether __after_morecore_hook exists, - emacs_cv_var___after_morecore_hook, -[AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern void (* __after_morecore_hook)();]],[[__after_morecore_hook = 0]])], - emacs_cv_var___after_morecore_hook=yes, - emacs_cv_var___after_morecore_hook=no)]) -if test $emacs_cv_var___after_morecore_hook = no; then - doug_lea_malloc=no -fi + +AC_CACHE_CHECK( + [whether malloc is Doug Lea style], + [emacs_cv_var_doug_lea_malloc], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include + static void hook (void) {}]], + [[malloc_set_state (malloc_get_state ()); + __after_morecore_hook = hook; + __malloc_initialize_hook = hook;]])], + [emacs_cv_var_doug_lea_malloc=yes], + [emacs_cv_var_doug_lea_malloc=no])]) +doug_lea_malloc=$emacs_cv_var_doug_lea_malloc dnl See comments in aix4-2.h about maybe using system malloc there. @@ -1855,9 +1806,9 @@ if test "${HAVE_X11}" = "yes"; then CPPFLAGS="$C_SWITCH_X_SITE $CPPFLAGS" # On Solaris, arrange for LD_RUN_PATH to point to the X libraries for tests. - # This is handled by LD_SWITCH_X_SITE_AUX during the real build, - # but it's more convenient here to set LD_RUN_PATH - # since this also works on hosts that don't understand LD_SWITCH_X_SITE_AUX. + # This is handled by LD_SWITCH_X_SITE_RPATH during the real build, + # but it's more convenient here to set LD_RUN_PATH since this + # also works on hosts that don't understand LD_SWITCH_X_SITE_RPATH. if test "${x_libraries}" != NONE && test -n "${x_libraries}"; then LD_RUN_PATH=$x_libraries${LD_RUN_PATH+:}$LD_RUN_PATH export LD_RUN_PATH @@ -2076,8 +2027,7 @@ if test "${HAVE_GTK}" = "yes"; then fi dnl D-Bus has been tested under GNU/Linux only. Must be adapted for -dnl other platforms. Support for higher D-Bus versions than 1.0 is -dnl also not configured. +dnl other platforms. HAVE_DBUS=no DBUS_OBJ= if test "${with_dbus}" = "yes"; then @@ -2085,7 +2035,13 @@ if test "${with_dbus}" = "yes"; then if test "$HAVE_DBUS" = yes; then LIBS="$LIBS $DBUS_LIBS" AC_DEFINE(HAVE_DBUS, 1, [Define to 1 if using D-Bus.]) - AC_CHECK_FUNCS([dbus_watch_get_unix_fd]) + dnl dbus_watch_get_unix_fd has been introduced in D-Bus 1.1.1. + dnl dbus_validate_* have been introduced in D-Bus 1.5.12. + AC_CHECK_FUNCS(dbus_watch_get_unix_fd \ + dbus_validate_bus_name \ + dbus_validate_path \ + dbus_validate_interface \ + dbus_validate_member) DBUS_OBJ=dbusbind.o fi fi @@ -2864,7 +2820,7 @@ AC_DEFUN([tputs_link_source], [ ]) # Maybe curses should be tried earlier? # See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9736#35 -for tputs_library in '' ncurses terminfo termcap curses; do +for tputs_library in '' tinfo ncurses terminfo termcap curses; do OLIBS=$LIBS if test -z "$tputs_library"; then LIBS_TERMCAP= @@ -2884,41 +2840,28 @@ done AC_MSG_RESULT([$msg]) if test "X$msg" = Xno; then AC_MSG_ERROR([The required function `tputs' was not found in any library. -These libraries were tried: libncurses, libterminfo, libtermcap, libcurses. +The following libraries were tried (in order): + libtinfo, libncurses, libterminfo, libtermcap, libcurses Please try installing whichever of these libraries is most appropriate for your system, together with its header files. For example, a libncurses-dev(el) or similar package.]) fi -# Must define this when any termcap library is found. -AC_DEFINE(HAVE_LIBNCURSES, 1, - [Define to 1 if you have the `ncurses' library (-lncurses).]) -## FIXME This was the cpp logic, but I am not sure it is right. -## The above test has not necessarily found libncurses. -HAVE_LIBNCURSES=yes - -## Use terminfo instead of termcap? -## Note only system files NOT using terminfo are: -## freebsd < 40000, ms-w32, msdos, netbsd < 599002500, and -## darwin|gnu without ncurses. -TERMINFO=no -case "$opsys" in - ## cygwin: Fewer environment variables to go wrong, more terminal types. - ## hpux10-20: Use the system provided termcap(3) library. - ## openbsd: David Mazieres says this - ## is necessary. Otherwise Emacs dumps core when run -nw. - aix4-2|cygwin|hpux*|irix6-5|openbsd|sol2*|unixware) TERMINFO=yes ;; +## Use termcap instead of terminfo? +## Only true for: freebsd < 40000, ms-w32, msdos, netbsd < 599002500. +TERMINFO=yes +## FIXME? In the cases below where we unconditionally set +## LIBS_TERMCAP="-lncurses", this overrides LIBS_TERMCAP = -ltinfo, +## if that was found above to have tputs. +## Should we use the gnu* logic everywhere? +case "$opsys" in ## darwin: Prevents crashes when running Emacs in Terminal.app under 10.2. ## The ncurses library has been moved out of the System framework in ## Mac OS X 10.2. So if configure detects it, set the command-line ## option to use it. - darwin|gnu*) - ## (HAVE_LIBNCURSES was not always true, but is since 2010-03-18.) - if test "x$HAVE_LIBNCURSES" = "xyes"; then - TERMINFO=yes - LIBS_TERMCAP="-lncurses" - fi - ;; + darwin) LIBS_TERMCAP="-lncurses" ;; + + gnu*) test -z "$LIBS_TERMCAP" && LIBS_TERMCAP="-lncurses" ;; freebsd) AC_MSG_CHECKING([whether FreeBSD is new enough to use terminfo]) @@ -2932,34 +2875,29 @@ fail; AC_MSG_RESULT($emacs_cv_freebsd_terminfo) if test $emacs_cv_freebsd_terminfo = yes; then - TERMINFO=yes LIBS_TERMCAP="-lncurses" else + TERMINFO=no LIBS_TERMCAP="-ltermcap" fi ;; netbsd) - if test $ac_cv_search_tputs = -lterminfo; then - TERMINFO=yes - LIBS_TERMCAP="-lterminfo" - else + if test "x$LIBS_TERMCAP" != "x-lterminfo"; then + TERMINFO=no LIBS_TERMCAP="-ltermcap" fi ;; -esac + openbsd) LIBS_TERMCAP="-lncurses" ;; -case "$opsys" in ## hpux: Make sure we get select from libc rather than from libcurses ## because libcurses on HPUX 10.10 has a broken version of select. ## We used to use -lc -lcurses, but this may be cleaner. + ## FIXME? But TERMINFO = yes on hpux (it used to be explicitly + # set that way, now it uses the default). Isn't this a contradiction? hpux*) LIBS_TERMCAP="-ltermcap" ;; - openbsd) LIBS_TERMCAP="-lncurses" ;; - - ## Must use system termcap, if we use any termcap. It does special things. - sol2*) test "$TERMINFO" != yes && LIBS_TERMCAP="-ltermcap" ;; esac TERMCAP_OBJ=tparam.o @@ -3502,13 +3440,14 @@ case "$opsys" in LD_SWITCH_SYSTEM_TEMACS="-X $LD_SWITCH_SYSTEM_TEMACS" ;; - ## LD_SWITCH_X_SITE_AUX is a -R option saying where to find X at run-time. - ## When handled by cpp, this was in LD_SWITCH_SYSTEM. However, at - ## the point where configure sourced the s/*.h file, LD_SWITCH_X_SITE_AUX + ## LD_SWITCH_X_SITE_RPATH is a -rpath option saying where to + ## find X at run-time. + ## When handled by cpp, this was in LD_SWITCH_SYSTEM. However, at the + ## point where configure sourced the s/*.h file, LD_SWITCH_X_SITE_RPATH ## had not yet been defined and was expanded to null. Hence LD_SWITCH_SYSTEM ## had different values in configure (in ac_link) and src/Makefile.in. ## It seems clearer therefore to put this piece in LD_SWITCH_SYSTEM_TEMACS. - gnu*) LD_SWITCH_SYSTEM_TEMACS="\$(LD_SWITCH_X_SITE_AUX_RPATH)" ;; + gnu*) LD_SWITCH_SYSTEM_TEMACS="\$(LD_SWITCH_X_SITE_RPATH)" ;; *) LD_SWITCH_SYSTEM_TEMACS= ;; esac @@ -3938,7 +3877,7 @@ dnl the use of force in the `epaths-force' rule in Makefile.in. 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