X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/3bace81626cc6ecdffc7901f3d03aa051d18c0af..eceeb5fca618f3bc0743c2388148dd758229c7c9:/configure.in diff --git a/configure.in b/configure.in index 8be0da2ab2..81e8765990 100644 --- a/configure.in +++ b/configure.in @@ -737,7 +737,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 @@ -763,6 +763,8 @@ else nw="$nw -Wshadow" # The following lines should be removable at some point. + nw="$nw -Wstack-protector" + nw="$nw -Wstrict-overflow" nw="$nw -Wsuggest-attribute=const" nw="$nw -Wsuggest-attribute=pure" @@ -785,8 +787,6 @@ else gl_WARN_ADD([-fdiagnostics-show-option]) gl_WARN_ADD([-funit-at-a-time]) - AC_SUBST([WARN_CFLAGS]) - AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.]) AC_DEFINE([_FORTIFY_SOURCE], [2], [enable compile-time and run-time bounds-checking, and some warnings]) @@ -865,6 +865,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 @@ -951,7 +957,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 +968,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 +983,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 +995,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 @@ -1500,22 +1509,11 @@ else window_system=x11 fi -## Workaround for bug in autoconf <= 2.62. -## http://lists.gnu.org/archive/html/emacs-devel/2008-04/msg01551.html -## No need to do anything special for these standard directories. -if test -n "${x_libraries}" && test x"${x_libraries}" != xNONE; then - - x_libraries=`echo :${x_libraries}: | sed -e 's|:/usr/lib64:|:|g' -e 's|:/lib64:|:|g' -e 's|^:||' -e 's|:$||'` - -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} @@ -1538,8 +1536,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"` @@ -1629,13 +1626,12 @@ fail; AC_CHECK_HEADER([AppKit/AppKit.h], [HAVE_NS=yes], [AC_MSG_ERROR([`--with-ns' was specified, but the include files are missing or cannot be compiled.])]) - NS_HAVE_NSINTEGER=yes AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], [NSInteger i;])], ns_have_nsinteger=yes, ns_have_nsinteger=no) - if test $ns_have_nsinteger = no; then - NS_HAVE_NSINTEGER=no + if test $ns_have_nsinteger = yes; then + AC_DEFINE(NS_HAVE_NSINTEGER, 1, [Define to 1 if `NSInteger' is defined.]) fi fi AC_SUBST(TEMACS_LDFLAGS2) @@ -1718,17 +1714,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. @@ -1865,9 +1864,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 @@ -2086,8 +2085,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 @@ -2095,7 +2093,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 @@ -2683,9 +2687,6 @@ if test "${HAVE_NS}" = "yes"; then ## Extra CFLAGS applied to src/*.m files. GNU_OBJC_CFLAGS="$GNU_OBJC_CFLAGS -fgnu-runtime -Wno-import -fconstant-string-class=NSConstantString -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGSWARN -DGSDIAGNOSE" fi - if test "${NS_HAVE_NSINTEGER}" = "yes"; then - AC_DEFINE(NS_HAVE_NSINTEGER, 1, [Define to 1 if `NSInteger' is defined.]) - fi # We also have mouse menus. HAVE_MENUS=yes OTHER_FILES=ns-app @@ -2828,6 +2829,7 @@ __fpending mblen mbrlen mbsinit strsignal setitimer ualarm \ sendto recvfrom getsockopt setsockopt getsockname getpeername \ gai_strerror mkstemp getline getdelim mremap fsync sync \ difftime mempcpy mblen mbrlen posix_memalign \ +getpwent endpwent getgrent endgrent \ cfmakeraw cfsetspeed copysign __executable_start) dnl Cannot use AC_CHECK_FUNCS @@ -2876,7 +2878,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= @@ -2896,41 +2898,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*) [ "x$LIBS_TERMCAP" = x ] && LIBS_TERMCAP="-lncurses" ;; freebsd) AC_MSG_CHECKING([whether FreeBSD is new enough to use terminfo]) @@ -2944,34 +2933,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 [ "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 @@ -3514,13 +3498,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-linux) LD_SWITCH_SYSTEM_TEMACS="\$(LD_SWITCH_X_SITE_AUX)" ;; + gnu*) LD_SWITCH_SYSTEM_TEMACS="\$(LD_SWITCH_X_SITE_RPATH)" ;; *) LD_SWITCH_SYSTEM_TEMACS= ;; esac