X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/3907e630a71d48e693062b350571990d7ba08bbb..d5e5e7b41166815a843148f2081d19bc14b628b2:/configure.ac diff --git a/configure.ac b/configure.ac index abdf515144..2f1124d7ea 100644 --- a/configure.ac +++ b/configure.ac @@ -23,6 +23,9 @@ dnl along with GNU Emacs. If not, see . AC_PREREQ(2.65) AC_INIT(emacs, 24.3.50) +dnl This is the documented way to record the args passed to configure, +dnl rather than $ac_configure_args. +emacs_config_options="$@" AC_CONFIG_HEADER(src/config.h:src/config.in) AC_CONFIG_SRCDIR(src/lisp.h) AC_CONFIG_AUX_DIR(build-aux) @@ -184,6 +187,7 @@ OPTION_DEFAULT_ON([dbus],[don't compile with D-Bus support]) OPTION_DEFAULT_ON([gconf],[don't compile with GConf support]) OPTION_DEFAULT_ON([gsettings],[don't compile with GSettings support]) OPTION_DEFAULT_ON([selinux],[don't compile with SELinux support]) +OPTION_DEFAULT_ON([acl],[don't compile with ACL support]) OPTION_DEFAULT_ON([gnutls],[don't use -lgnutls for SSL/TLS support]) OPTION_DEFAULT_ON([inotify],[don't compile with inotify (file-watch) support]) @@ -726,23 +730,12 @@ else # . nw="$nw -Wshadow" + # Emacs's use of alloca inhibits protecting the stack. + nw="$nw -Wstack-protector" + # The following line should be removable at some point. nw="$nw -Wsuggest-attribute=pure" - AC_MSG_CHECKING([whether to use -Wstack-protector]) - AC_PREPROC_IFELSE( - [AC_LANG_PROGRAM( - [[#if (1 <= __LONG_MAX__ >> 31 >> 31 \ - && 4 < __GNUC__ + (7 < __GNUC_MINOR__ + (2 <= __GNUC_PATCHLEVEL__))) - /* OK */ - #else - #error "Not GCC, or GCC before 4.7.2, or 'long int' has < 64 bits." - #endif - ]])], - [AC_MSG_RESULT(yes)], - [AC_MSG_RESULT(no) - nw="$nw -Wstack-protector"]) - gl_MANYWARN_ALL_GCC([ws]) gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw]) for w in $ws; do @@ -1482,8 +1475,8 @@ tmp_CPPFLAGS="$CPPFLAGS" tmp_CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS -x objective-c" CFLAGS="$CFLAGS -x objective-c" -TEMACS_LDFLAGS2="\${LDFLAGS}" GNU_OBJC_CFLAGS= +LIBS_GNUSTEP= if test "${with_ns}" != no; then if test "${opsys}" = darwin; then NS_IMPL_COCOA=yes @@ -1510,9 +1503,9 @@ if test "${with_ns}" != no; then CPPFLAGS="$CPPFLAGS -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}" CFLAGS="$CFLAGS -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}" LDFLAGS="$LDFLAGS -L${GNUSTEP_SYSTEM_LIBRARIES} ${GNUSTEP_LOCAL_LIBRARIES}" + LIBS_GNUSTEP="-lgnustep-gui -lgnustep-base -lobjc -lpthread" LIB_STANDARD= START_FILES= - TEMACS_LDFLAGS2= dnl GNUstep defines BASE_NATIVE_OBJC_EXCEPTIONS to 0 or 1. dnl If they had chosen to either define it or not, we could have dnl just used AC_CHECK_DECL here. @@ -1563,7 +1556,7 @@ fail; fi fi -AC_SUBST(TEMACS_LDFLAGS2) +AC_SUBST(LIBS_GNUSTEP) INSTALL_ARCH_INDEP_EXTRA=install-etc ns_self_contained=no @@ -1606,6 +1599,8 @@ AC_SUBST(LIB_STANDARD) HAVE_W32=no W32_OBJ= W32_LIBS= +W32_RES= +W32_RES_LINK= if test "${with_w32}" != no; then if test "${opsys}" != "cygwin"; then AC_MSG_ERROR([Using w32 with an autotools build is only supported for Cygwin.]) @@ -1614,13 +1609,21 @@ if test "${with_w32}" != no; then [AC_MSG_ERROR([`--with-w32' was specified, but windows.h cannot be found.])]) AC_DEFINE(HAVE_NTGUI, 1, [Define to use native MS Windows GUI.]) + AC_CHECK_TOOL(WINDRES, [windres], + [AC_MSG_ERROR([No resource compiler found.])]) W32_OBJ="w32fns.o w32menu.o w32reg.o w32font.o w32term.o" W32_OBJ="$W32_OBJ w32xfns.o w32select.o w32uniscribe.o" W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32" W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool" + W32_RES="emacs.res" + # Tell the linker that emacs.res is an object (which we compile from + # the rc file), not a linker script. + W32_RES_LINK="-Wl,-bpe-i386 -Wl,emacs.res" fi AC_SUBST(W32_OBJ) AC_SUBST(W32_LIBS) +AC_SUBST(W32_RES) +AC_SUBST(W32_RES_LINK) if test "${HAVE_W32}" = "yes"; then window_system=w32 @@ -2177,17 +2180,33 @@ AC_SUBST(LIBGNUTLS_LIBS) AC_SUBST(LIBGNUTLS_CFLAGS) dnl inotify is only available on GNU/Linux. -HAVE_INOTIFY=no if test "${with_inotify}" = "yes"; then AC_CHECK_HEADERS(sys/inotify.h) if test "$ac_cv_header_sys_inotify_h" = yes ; then - AC_CHECK_FUNCS(inotify_init1 inotify_add_watch inotify_rm_watch, HAVE_INOTIFY=yes) + AC_CHECK_FUNC(inotify_init1) fi fi -if test "${HAVE_INOTIFY}" = "yes"; then - AC_DEFINE(HAVE_INOTIFY, [1], [Define to 1 to use inotify]) +if test "$ac_cv_func_inotify_init1" = yes; then + AC_DEFINE(HAVE_INOTIFY, 1, [Define to 1 to use inotify.]) fi +dnl POSIX ACL support: provided by libacl on GNU/Linux, by libc on FreeBSD. +HAVE_POSIX_ACL=no +LIBACL_LIBS= +if test "${with_acl}" = "yes"; then + AC_CHECK_LIB([acl], [acl_set_file], HAVE_POSIX_ACL=yes, HAVE_POSIX_ACL=no) + if test "$HAVE_POSIX_ACL" = yes; then + AC_DEFINE(HAVE_POSIX_ACL, 1, [Define to 1 if using POSIX ACL support.]) + LIBACL_LIBS=-lacl + else + AC_CHECK_FUNC(acl_set_file, HAVE_POSIX_ACL=yes, HAVE_POSIX_ACL=no) + if test "$HAVE_POSIX_ACL" = yes; then + AC_DEFINE(HAVE_POSIX_ACL, 1, [Define to 1 if using POSIX ACL support.]) + fi + fi +fi +AC_SUBST(LIBACL_LIBS) + dnl Do not put whitespace before the #include statements below. dnl Older compilers (eg sunos4 cc) choke on it. HAVE_XAW3D=no @@ -3657,7 +3676,7 @@ AH_TEMPLATE(SIGNALS_VIA_CHARACTERS, [Make process_send_signal work by case $opsys in dnl Perry Smith says this is correct for AIX. dnl thomas@mathematik.uni-bremen.de says this is needed for IRIX. - aix4-2 | cygwin | gnu | irix6-5 | freebsd | netbsd | openbsd ) + aix4-2 | cygwin | gnu | irix6-5 | freebsd | netbsd | openbsd | darwin ) AC_DEFINE(SIGNALS_VIA_CHARACTERS, 1) ;; @@ -3832,7 +3851,6 @@ esac dnl Define symbols to identify the version of Unix this is. dnl Define all the symbols that apply correctly. -AH_TEMPLATE(BSD4_2, [Define if the system is compatible with BSD 4.2.]) AH_TEMPLATE(BSD_SYSTEM, [Define if the system is compatible with BSD 4.2.]) AH_TEMPLATE(DOS_NT, [Define if the system is MS DOS or MS Windows.]) AH_TEMPLATE(MSDOS, [Define if the system is MS DOS.]) @@ -3858,7 +3876,6 @@ case $opsys in darwin) dnl BSD4_3 and BSD4_4 are already defined in sys/param.h. - AC_DEFINE(BSD4_2, []) AC_DEFINE(BSD_SYSTEM, []) dnl More specific than the above two. We cannot use __APPLE__ as this dnl may not be defined on non-OSX Darwin, and we cannot define DARWIN @@ -3868,7 +3885,6 @@ case $opsys in ;; freebsd) - AC_DEFINE(BSD4_2, []) dnl Hack to avoid calling AC_PREPROC_IFELSE multiple times. dnl Would not be needed with autoconf >= 2.67, where the dnl preprocessed output is accessible in "conftest.i". @@ -3876,7 +3892,6 @@ case $opsys in ;; gnu | netbsd | openbsd ) - AC_DEFINE(BSD4_2, []) AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ #ifndef BSD_SYSTEM # error "BSD_SYSTEM not defined" @@ -4056,7 +4071,9 @@ fi AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "${canonical}", [Define to the canonical Emacs configuration name.]) -AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${ac_configure_args}", +dnl Replace any embedded " characters (bug#13274). +emacs_config_options=`echo "$emacs_config_options" | sed -e "s/\"/'/g"` +AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${emacs_config_options}", [Define to the options passed to configure.]) AH_TEMPLATE(config_opsysfile, [Some platforms that do not use configure define this to include extra configuration information.]) @@ -4270,10 +4287,6 @@ case "$opsys" in *) LD_SWITCH_SYSTEM_TEMACS= ;; esac -if test "$NS_IMPL_GNUSTEP" = "yes"; then - LD_SWITCH_SYSTEM_TEMACS="${LD_SWITCH_SYSTEM_TEMACS} -L${GNUSTEP_SYSTEM_LIBRARIES} ${GNUSTEP_LOCAL_LIBRARIES} -lgnustep-gui -lgnustep-base -lobjc -lpthread" -fi - AC_SUBST(LD_SWITCH_SYSTEM_TEMACS)