]
)
+# clang is unduly picky about some things.
+AC_CACHE_CHECK([whether the compiler is clang], [emacs_cv_clang],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #ifndef __clang__
+ #error "not clang"
+ #endif
+ ]])],
+ [emacs_cv_clang=yes],
+ [emacs_cv_clang=no])])
+
# When compiling with GCC, prefer -isystem to -I when including system
# include files, to avoid generating useless diagnostics for the files.
if test "$gl_gcc_warnings" != yes; then
isystem='-I'
+ if test "$emacs_cv_clang" = yes
+ then
+ # Turn off some warnings if supported.
+ gl_WARN_ADD([-Wno-switch])
+ gl_WARN_ADD([-Wno-tautological-constant-out-of-range-compare])
+ gl_WARN_ADD([-Wno-pointer-sign])
+ fi
else
isystem='-isystem '
nw="$nw -Wtype-limits"
nw="$nw -Wunused-parameter"
- # clang is unduly picky about some things.
- AC_CACHE_CHECK([whether the compiler is clang], [emacs_cv_clang],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[
- #ifndef __clang__
- #error "not clang"
- #endif
- ]])],
- [emacs_cv_clang=yes],
- [emacs_cv_clang=no])])
if test $emacs_cv_clang = yes; then
nw="$nw -Wcast-align"
fi
gl_WARN_ADD([-Wno-unused-value])
fi
- gl_WARN_ADD([-fdiagnostics-show-option])
- gl_WARN_ADD([-funit-at-a-time])
-
AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.])
AH_VERBATIM([FORTIFY_SOURCE],
[/* Enable compile-time and run-time bounds-checking, and some warnings,
if test "x$GCC" = "xyes"; then
C_SWITCH_MACHINE="-fno-common"
else
- AC_MSG_ERROR([What gives? Fix me if DEC Unix supports ELF now.])
+ AC_MSG_ERROR([Non-GCC compilers are not supported.])
fi
else
- UNEXEC_OBJ=unexalpha.o
+ dnl This was the unexalpha.c case. Removed in 24.1, 2010-07-24,
+ dnl albeit under the mistaken assumption that said file
+ dnl was no longer used.
+ AC_MSG_ERROR([Non-ELF systems are not supported since Emacs 24.1.])
fi
;;
esac
fi
fi
-### If we're using X11, we should use the X menu package.
-HAVE_MENUS=no
-case ${HAVE_X11} in
- yes ) HAVE_MENUS=yes ;;
-esac
+### We always support menus.
+HAVE_MENUS=yes
# Does the opsystem file prohibit the use of the GNU malloc?
# Assume not, until told otherwise.
AC_SUBST(LIBSELINUX_LIBS)
HAVE_GNUTLS=no
+HAVE_GNUTLS3=no
if test "${with_gnutls}" = "yes" ; then
- PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.6.6], HAVE_GNUTLS=yes, HAVE_GNUTLS=no)
+ PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 3.0.0], HAVE_GNUTLS3=yes, HAVE_GNUTLS3=no)
+ if test "${HAVE_GNUTLS3}" = "yes"; then
+ AC_DEFINE(HAVE_GNUTLS3, 1, [Define if using GnuTLS v3.])
+ HAVE_GNUTLS="yes"
+ else
+ PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.6.6], HAVE_GNUTLS=yes, HAVE_GNUTLS=no)
+ fi
if test "${HAVE_GNUTLS}" = "yes"; then
AC_DEFINE(HAVE_GNUTLS, 1, [Define if using GnuTLS.])
fi
|| test "${HAVE_W32}" = "yes"; then
AC_CHECK_HEADER(gif_lib.h,
# EGifPutExtensionLast only exists from version libungif-4.1.0b1.
-# Earlier versions can crash Emacs.
- [AC_CHECK_LIB(gif, EGifPutExtensionLast, HAVE_GIF=yes, HAVE_GIF=maybe)])
+# Earlier versions can crash Emacs, but version 5.0 removes EGifPutExtensionLast.
+ [AC_CHECK_LIB(gif, GifMakeMapObject, HAVE_GIF=yes,
+ [AC_CHECK_LIB(gif, EGifPutExtensionLast, HAVE_GIF=yes, HAVE_GIF=maybe)])])
if test "$HAVE_GIF" = yes; then
LIBGIF=-lgif
## 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
- # We also have mouse menus.
- HAVE_MENUS=yes
OTHER_FILES=ns-app
fi
-if test "${HAVE_W32}" = "yes"; then
- HAVE_MENUS=yes
-fi
-
### Use session management (-lSM -lICE) if available
HAVE_X_SM=no
LIBXSM=
AC_SUBST(DESLIB)
AC_SUBST(KRB4LIB)
+AC_CHECK_HEADERS(valgrind/valgrind.h)
+
AC_CHECK_FUNCS_ONCE(tzset)
AC_MSG_CHECKING(whether localtime caches TZ)
AC_CACHE_VAL(emacs_cv_localtime_cache,
if test "${HAVE_MENUS}" = "yes" ; then
AC_DEFINE(HAVE_MENUS, 1,
- [Define to 1 if you have mouse menus.
- (This is automatic if you use X, but the option to specify it remains.)
- It is also defined with other window systems that support xmenu.c.])
+ [Define to 1 if you have mouse menus. (This is supported in all configurations, but the option to specify it remains.)])
fi
if test "${GNU_MALLOC}" = "yes" ; then
AC_SUBST(PRE_ALLOC_OBJ)
AC_SUBST(POST_ALLOC_OBJ)
+dnl Call this 'FORTIFY_SOUR' so that it sorts before the 'FORTIFY_SOURCE'
+dnl verbatim defined above. The tricky name is apropos, as this hack
+dnl makes Fortify go sour!
+AH_VERBATIM([FORTIFY_SOUR],
+[/* Without the following workaround, Emacs runs slowly on OS X 10.8.
+ The workaround disables some useful run-time checking, so it
+ should be conditional to the platforms with the performance bug.
+ Perhaps Apple will fix this some day; also see m4/extern-inline.m4. */
+#if defined __APPLE__ && defined __GNUC__
+# ifndef _DONT_USE_CTYPE_INLINE_
+# define _DONT_USE_CTYPE_INLINE_
+# endif
+# ifndef _FORTIFY_SOURCE
+# define _FORTIFY_SOURCE 0
+# endif
+#endif
+])
+
# Configure gnulib. Although this does not affect CFLAGS or LIBS permanently.
# it temporarily reverts them to their pre-pkg-config values,
# because gnulib needs to work with both src (which uses the