AC_PREREQ(2.65)
dnl Note this is parsed by (at least) make-dist and lisp/cedet/ede/emacs.el.
-AC_INIT(GNU Emacs, 24.4.50, bug-gnu-emacs@gnu.org)
+AC_INIT(GNU Emacs, 25.0.50, bug-gnu-emacs@gnu.org)
dnl Set emacs_config_options to the options of 'configure', quoted for the shell,
dnl and then quoted again for a C string. Separate options with spaces.
For example, run '$0 MAKE=gnu-make'.]])
}
MAKE=$ac_cv_path_MAKE
+export MAKE
dnl Fairly arbitrary, older versions might work too.
AM_INIT_AUTOMAKE(1.11)
canonical=$host
configuration=${host_alias-${build_alias-$host}}
-dnl We get MINGW64 with MSYS2.
+dnl We get MINGW64 with MSYS2, MINGW32 with MSYS.
case $canonical in
*-mingw*)
. $srcdir/nt/mingw-cfg.site
AC_ARG_WITH([sound],[AS_HELP_STRING([--with-sound=VALUE],
[compile with sound support (VALUE one of: yes, alsa, oss, bsd-ossaudio, no;
-default yes). Only for GNU/Linux, FreeBSD, NetBSD, MinGW.])],
+default yes). Only for GNU/Linux, FreeBSD, NetBSD, MinGW, Cygwin.])],
[ case "${withval}" in
yes|no|alsa|oss|bsd-ossaudio) val=$withval ;;
*) AC_MSG_ERROR([`--with-sound=$withval' is invalid;
nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
nw="$nw -Woverlength-strings" # Not a problem these days
- nw="$nw -Wlogical-op" # any use of fwrite provokes this
nw="$nw -Wformat-nonliteral" # we do this a lot
- nw="$nw -Wvla" # warnings in gettext.h
- nw="$nw -Wnested-externs" # use of XARGMATCH/verify_function__
+ nw="$nw -Wvla" # Emacs uses <vla.h>.
nw="$nw -Wswitch-default" # Too many warnings for now
nw="$nw -Winline" # OK to ignore 'inline'
nw="$nw -Wjump-misses-init" # We sometimes safely jump over init.
# Emacs's use of alloca inhibits protecting the stack.
nw="$nw -Wstack-protector"
- # The following line should be removable at some point.
+ # Emacs's use of partly-pure functions such as CHECK_TYPE make this
+ # option problematic.
nw="$nw -Wsuggest-attribute=pure"
# This part is merely for shortening the command line,
gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
gl_WARN_ADD([-Wno-format-nonliteral])
- # In spite of excluding -Wlogical-op above, it is enabled, as of
- # gcc 4.5.0 20090517.
- gl_WARN_ADD([-Wno-logical-op])
-
# More things that clang is unduly picky about.
if test $emacs_cv_clang = yes; then
gl_WARN_ADD([-Wno-format-extra-args])
fi
fi)
+dnl Port to Automake 1.11.
+dnl This section can be removed once we assume Automake 1.14 or later.
+: ${AM_DEFAULT_VERBOSITY=1}
+: ${AM_V=$AM_DEFAULT_VERBOSITY}
+: ${AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY}
+AC_SUBST([AM_V])
+AM_SUBST_NOTMAKE([AM_V])
+AC_SUBST([AM_DEFAULT_V])
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])
+AC_SUBST([AM_DEFAULT_VERBOSITY])
+
dnl Some other nice autoconf tests.
dnl These are commented out, since gl_EARLY and/or Autoconf already does them.
dnl AC_PROG_INSTALL
fi
## Need makeinfo >= 4.7 (?) to build the manuals.
-AC_PATH_PROG(MAKEINFO, makeinfo, no)
-dnl By this stage, configure has already checked for egrep and set EGREP,
-dnl or exited with an error if no egrep was found.
if test "$MAKEINFO" != "no"; then
- case `
- $MAKEINFO --version 2> /dev/null |
- $EGREP 'texinfo[[^0-9]]*([[1-4]][[0-9]]+|[[5-9]]|4\.[[7-9]]|4\.[[1-6]][[0-9]]+)'
- ` in
- '') MAKEINFO=no;;
+ if test "$MAKEINFO" = "${am_missing_run}makeinfo"; then
+ MAKEINFO=makeinfo
+ fi
+ case `($MAKEINFO --version) 2>/dev/null` in
+ *' (GNU texinfo) '4.[[7-9]]* | \
+ *' (GNU texinfo) '4.[[1-9][0-9]]* | \
+ *' (GNU texinfo) '[[5-9]]* | \
+ *' (GNU texinfo) '[[1-9][0-9]]* ) ;;
+ *) MAKEINFO=no;;
esac
fi
HAVE_SOUND=no
if test "${with_sound}" != "no"; then
- # Sound support for GNU/Linux, the free BSDs, and MinGW.
- AC_CHECK_HEADERS([machine/soundcard.h sys/soundcard.h soundcard.h],
+ # Sound support for GNU/Linux, the free BSDs, MinGW, and Cygwin.
+ AC_CHECK_HEADERS([machine/soundcard.h sys/soundcard.h soundcard.h mmsystem.h],
have_sound_header=yes, [], [
#ifdef __MINGW32__
#define WIN32_LEAN_AND_MEAN
case "$opsys" in
dnl defined __FreeBSD__ || defined __NetBSD__ || defined __linux__
dnl Adjust the --with-sound help text if you change this.
- gnu-linux|freebsd|netbsd|mingw32)
+ gnu-linux|freebsd|netbsd|mingw32|cygwin)
AC_DEFINE(HAVE_SOUND, 1, [Define to 1 if you have sound support.])
HAVE_SOUND=yes
;;
[Define to 1 if personality LINUX32 can be set.])
fi
+# Note that Solaris has sys/sysinfo.h which defines struct
+# sysinfo as well. To make sure that we're using GNU/Linux
+# sysinfo, we explicitly set one of its fields.
if test "$ac_cv_header_sys_sysinfo_h" = yes; then
AC_MSG_CHECKING([if Linux sysinfo may be used])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/sysinfo.h>]],
- [[struct sysinfo si; sysinfo (&si)]])],
+ [[struct sysinfo si;
+ si.totalram = 0;
+ sysinfo (&si)]])],
emacs_cv_linux_sysinfo=yes, emacs_cv_linux_sysinfo=no)
AC_MSG_RESULT($emacs_cv_linux_sysinfo)
if test $emacs_cv_linux_sysinfo = yes; then
doug_lea_malloc=$emacs_cv_var_doug_lea_malloc
system_malloc=$emacs_cv_sanitize_address
+
+hybrid_malloc=
+
case "$opsys" in
## darwin ld insists on the use of malloc routines in the System framework.
darwin|mingw32|sol2-10) system_malloc=yes ;;
+ cygwin) hybrid_malloc=yes;;
esac
GMALLOC_OBJ=
GNU_MALLOC_reason="
(The GNU allocators don't work with this system configuration.)"
VMLIMIT_OBJ=
+elif test "$hybrid_malloc" = yes; then
+ AC_DEFINE(HYBRID_MALLOC, 1,
+ [Define to use gmalloc before dumping and the system malloc after.])
+ GNU_MALLOC=
+ GNU_MALLOC_reason="only before dumping"
+ GMALLOC_OBJ=gmalloc.o
+ VMLIMIT_OBJ=
else
test "$doug_lea_malloc" != "yes" && GMALLOC_OBJ=gmalloc.o
VMLIMIT_OBJ=vm-limit.o
AC_CHECK_FUNCS(accept4 fchdir gethostname \
getrusage get_current_dir_name \
lrand48 random rint \
-select getpagesize setlocale \
+select getpagesize setlocale newlocale \
getrlimit setrlimit shutdown getaddrinfo \
pthread_sigmask strsignal setitimer \
sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \
LIBS=$OLD_LIBS
dnl No need to check for aligned_alloc and posix_memalign if using
-dnl gmalloc.o, as it supplies them. Don't use these functions on
-dnl Darwin as they are incompatible with unexmacosx.c.
-if test -z "$GMALLOC_OBJ" && test "$opsys" != darwin; then
+dnl gmalloc.o, as it supplies them, unless we're using hybrid_malloc.
+dnl Don't use these functions on Darwin as they are incompatible with
+dnl unexmacosx.c.
+if (test -z "$GMALLOC_OBJ" || test "$hybrid_malloc" = yes) \
+ && test "$opsys" != darwin; then
AC_CHECK_FUNCS([aligned_alloc posix_memalign], [break])
fi
[Define to 1 if timerfd functions are supported as in GNU/Linux.])
fi
+# Alternate stack for signal handlers.
+AC_CACHE_CHECK([whether signals can be handled on alternate stack],
+ [emacs_cv_alternate_stack],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <signal.h>
+ ]],
+ [[stack_t ss;
+ struct sigaction sa;
+ ss.ss_sp = malloc (SIGSTKSZ);
+ ss.ss_size = SIGSTKSZ;
+ sa.sa_flags = SA_SIGINFO | SA_ONSTACK;
+ sigaltstack (&ss, 0);
+ sigaction (SIGSEGV, &sa, 0);]])],
+ [emacs_cv_alternate_stack=yes],
+ [emacs_cv_alternate_stack=no])])
+
# Do we have res_init, for detecting changes in /etc/resolv.conf?
# On Darwin, res_init appears not to be useful: see bug#562 and
# http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01467.html
AC_TYPE_MBSTATE_T
-AC_CACHE_CHECK([for C restricted array declarations], emacs_cv_c_restrict_arr,
- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[void fred (int x[__restrict]);]], [[]])],
- emacs_cv_c_restrict_arr=yes, emacs_cv_c_restrict_arr=no)])
-if test "$emacs_cv_c_restrict_arr" = yes; then
- AC_DEFINE(__restrict_arr, __restrict,
- [Define to compiler's equivalent of C99 restrict keyword in array
- declarations. Define as empty for no equivalent.])
-fi
-
dnl Fixme: AC_SYS_POSIX_TERMIOS should probably be used, but it's not clear
dnl how the tty code is related to POSIX and/or other versions of termios.
dnl The following looks like a useful start.
[emacs_cv_func__setjmp=no])])
if test $emacs_cv_func__setjmp = yes; then
AC_DEFINE([HAVE__SETJMP], 1, [Define to 1 if _setjmp and _longjmp work.])
-else
- AC_CACHE_CHECK([for sigsetjmp], [emacs_cv_func_sigsetjmp],
- [AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <setjmp.h>
- ]],
- [[sigjmp_buf j;
- if (! sigsetjmp (j, 1))
- siglongjmp (j, 1);]])],
- [emacs_cv_func_sigsetjmp=yes],
- [emacs_cv_func_sigsetjmp=no])])
- if test $emacs_cv_func_sigsetjmp = yes; then
- AC_DEFINE([HAVE_SIGSETJMP], 1,
- [Define to 1 if sigsetjmp and siglongjmp work.
- The value of this symbol is irrelevant if HAVE__SETJMP is defined.])
- fi
+fi
+
+# We need to preserve signal mask to handle C stack overflows.
+AC_CACHE_CHECK([for sigsetjmp], [emacs_cv_func_sigsetjmp],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <setjmp.h>
+ ]],
+ [[sigjmp_buf j;
+ if (! sigsetjmp (j, 1))
+ siglongjmp (j, 1);]])],
+ [emacs_cv_func_sigsetjmp=yes],
+ [emacs_cv_func_sigsetjmp=no])])
+if test $emacs_cv_func_sigsetjmp = yes; then
+ AC_DEFINE([HAVE_SIGSETJMP], 1,
+ [Define to 1 if sigsetjmp and siglongjmp work.])
+fi
+
+# We need all of these features to handle C stack overflows.
+if test "$ac_cv_header_sys_resource_h" = "yes" -a \
+ "$ac_cv_func_getrlimit" = "yes" -a \
+ "$emacs_cv_func_sigsetjmp" = "yes" -a \
+ "$emacs_cv_alternate_stack" = yes; then
+ AC_DEFINE([HAVE_STACK_OVERFLOW_HANDLING], 1,
+ [Define to 1 if C stack overflow can be handled in some cases.])
fi
case $opsys in
fi
fi
-
case $opsys in
- dnl Emacs supplies its own malloc, but glib calls posix_memalign,
- dnl and on Cygwin prior to version 1.7.24 that becomes the
- dnl Cygwin-supplied posix_memalign. As malloc is not the Cygwin
- dnl malloc, the Cygwin posix_memalign always returns ENOSYS. A
- dnl workaround is to set G_SLICE=always-malloc. This is no longer
- dnl needed starting with cygwin-1.7.24, and it is no longer
- dnl effective starting with glib-2.36. */
- cygwin)
- AC_DEFINE(G_SLICE_ALWAYS_MALLOC, 1, [Define to set the
- G_SLICE environment variable to "always-malloc" at startup.])
- ;;
-
hpux11)
dnl It works to open the pty's tty in the parent (Emacs), then
dnl close and reopen it in the child.
fi
AC_SUBST(LIBXMENU)
+AC_CACHE_CHECK([for struct alignment],
+ [emacs_cv_struct_alignment],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <stddef.h>
+ struct __attribute__ ((aligned (8))) s { char c; };
+ struct t { char c; struct s s; };
+ char verify[offsetof (struct t, s) == 8 ? 1 : -1];
+ ]])],
+ [emacs_cv_struct_alignment=yes],
+ [emacs_cv_struct_alignment=no])])
+if test "$emacs_cv_struct_alignment" = yes; then
+ AC_DEFINE([HAVE_STRUCT_ATTRIBUTE_ALIGNED], 1,
+ [Define to 1 if 'struct __attribute__ ((aligned (N)))' aligns the
+ structure to an N-byte boundary.])
+fi
+
if test "${GNU_MALLOC}" = "yes" ; then
AC_DEFINE(GNU_MALLOC, 1,
[Define to 1 if you want to use the GNU memory allocator.])
darwin)
## The -headerpad option tells ld (see man page) to leave room at the
## end of the header for adding load commands. Needed for dumping.
- ## 0x690 is the total size of 30 segment load commands (at 56
- ## each); under Cocoa 31 commands are required.
+ ## 0x1000 is enough for roughly 52 load commands on the x86_64
+ ## architecture (where they are 78 bytes each). The actual number of
+ ## load commands added is not consistent but normally ranges from
+ ## about 14 to about 34. Setting it high gets us plenty of slop and
+ ## only costs about 1.5K of wasted binary space.
+ headerpad_extra=1000
if test "$HAVE_NS" = "yes"; then
libs_nsgui="-framework AppKit"
if test "$NS_IMPL_COCOA" = "yes"; then
libs_nsgui="$libs_nsgui -framework IOKit"
fi
- headerpad_extra=6C8
else
libs_nsgui=
- headerpad_extra=690
fi
LD_SWITCH_SYSTEM_TEMACS="-fno-pie -prebind $libs_nsgui -Xlinker -headerpad -Xlinker $headerpad_extra"