dnl in the directory containing this script.
dnl If you changed any AC_DEFINES, also run autoheader.
dnl
-dnl Copyright (C) 1994-1996, 1999-2014 Free Software Foundation, Inc.
+dnl Copyright (C) 1994-1996, 1999-2015 Free Software Foundation, Inc.
dnl
dnl This file is part of GNU Emacs.
dnl
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.
dnl Canonicalize the configuration name.
AC_CANONICAL_HOST
-canonical=$host
-configuration=${host_alias-${build_alias-$host}}
-dnl We get MINGW64 with MSYS2, MINGW32 with MSYS.
-case $canonical in
+case $host in
*-mingw*)
+
+ if test -z "$host_alias"; then
+
+ # No --host argument was given to 'configure'; therefore $host
+ # was set to a default value based on the build platform. But
+ # this default value may be wrong if we are building from a
+ # 64-bit MSYS[2] pre-configured to build 32-bit MinGW programs.
+ # Therefore, we'll try to get the right host platform from the
+ # compiler's target.
+
+ AC_MSG_CHECKING([the compiler's target])
+ if test -z "$CC"; then
+ cc=gcc
+ else
+ cc=$CC
+ fi
+ cc_target=`$cc -v 2>&1 | sed -n 's/Target: //p'`
+ case "$cc_target" in
+ *-*) host=$cc_target
+ ;;
+ "") AC_MSG_ERROR([Impossible to obtain $cc compiler target.
+Please explicitly provide --host.])
+ ;;
+ *) AC_MSG_WARN([Compiler reported non-standard target.
+Defaulting to $host.])
+ ;;
+ esac
+ AC_MSG_RESULT([$host])
+ fi
+
. $srcdir/nt/mingw-cfg.site
case $srcdir in
# "/c/foo/bar", to simplify later conversions to native Windows
# format ("c:/foo/bar").
srcdir=`cd "${srcdir}" && pwd -W`
- srcdir="/${srcdir:0:1}${srcdir:2}"
+ # 'eval' pacifies strict POSIX non-MinGW shells (Bug#18612).
+ eval 'srcdir="/${srcdir:0:1}${srcdir:2}"'
;;
esac;;
esac
+canonical=$host
+configuration=${host_alias-${build_alias-$host}}
+
dnl Support for --program-prefix, --program-suffix and
dnl --program-transform-name options
AC_ARG_PROGRAM
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;
## Apple Darwin / Mac OS X
*-apple-darwin* )
case "${canonical}" in
- i[3456]86-* ) ;;
- powerpc-* ) ;;
- x86_64-* ) ;;
+ *-apple-darwin[0-9].*) unported=yes ;;
+ i[3456]86-* | x86_64-* ) ;;
* ) unported=yes ;;
esac
opsys=darwin
Check `etc/MACHINES' for recognized configuration names.])
fi
-
#### Choose a compiler.
dnl Don't bother to test for C89.
gl_WARN_ADD([-Wno-switch])
gl_WARN_ADD([-Wno-tautological-constant-out-of-range-compare])
gl_WARN_ADD([-Wno-pointer-sign])
+ gl_WARN_ADD([-Wno-string-plus-int])
fi
else
isystem='-isystem '
fi
AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.])
- AH_VERBATIM([FORTIFY_SOURCE],
+ AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks])
+ AH_VERBATIM([GNULIB_PORTCHECK_FORTIFY_SOURCE],
[/* Enable compile-time and run-time bounds-checking, and some warnings,
without upsetting glibc 2.15+. */
- #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
+ #if (defined GNULIB_PORTCHECK && !defined _FORTIFY_SOURCE \
+ && defined __OPTIMIZE__ && __OPTIMIZE__)
# define _FORTIFY_SOURCE 2
#endif
])
- AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks])
# We use a slightly smaller set of warning options for lib/.
# Remove the following and save the result in GNULIB_WARN_CFLAGS.
MAKEINFO=makeinfo
fi
case `($MAKEINFO --version) 2>/dev/null` in
- 'makeinfo (GNU texinfo) '4.[[7-9]]* | \
- 'makeinfo (GNU texinfo) '4.[[1-9][0-9]]* | \
- 'makeinfo (GNU texinfo) '[[5-9]]* | \
- 'makeinfo (GNU texinfo) '[[1-9][0-9]]* ) ;;
+ *' (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
;;
ns_appbindir=${ns_appdir}/Contents/MacOS
ns_appresdir=${ns_appdir}/Contents/Resources
ns_appsrc=Cocoa/Emacs.base
+ ns_fontfile=macfont.o
elif test -f $GNUSTEP_CONFIG_FILE; then
NS_IMPL_GNUSTEP=yes
ns_appdir=`pwd`/nextstep/Emacs.app
ns_appbindir=${ns_appdir}
ns_appresdir=${ns_appdir}/Resources
ns_appsrc=GNUstep/Emacs.base
+ ns_fontfile=nsfont.o
dnl FIXME sourcing this several times in subshells seems inefficient.
GNUSTEP_SYSTEM_HEADERS="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_HEADERS)"
GNUSTEP_SYSTEM_LIBRARIES="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_LIBRARIES)"
macfont_file=""
if test "${NS_IMPL_COCOA}" = "yes"; then
- AC_MSG_CHECKING([for OSX 10.4 or newer])
+ AC_MSG_CHECKING([for OSX 10.6 or newer])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AppKit/AppKit.h>],
[
#ifdef MAC_OS_X_VERSION_MAX_ALLOWED
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
; /* OK */
#else
- error "OSX 10.4 or newer required";
+ error "OSX 10.6 or newer required";
#endif
#endif
])],
- ns_osx_have_104=yes,
- ns_osx_have_104=no)
- AC_MSG_RESULT([$ns_osx_have_104])
+ ns_osx_have_106=yes,
+ ns_osx_have_106=no)
+ AC_MSG_RESULT([$ns_osx_have_106])
- if test $ns_osx_have_104 = no; then
- AC_MSG_ERROR([`OSX 10.4 or newer is required']);
- fi
- AC_MSG_CHECKING([for OSX 10.5 or newer])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AppKit/AppKit.h>],
- [
-#ifdef MAC_OS_X_VERSION_MAX_ALLOWED
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- ; /* OK */
-#else
- error "OSX 10.5 not found";
-#endif
-#endif
- ])],
- ns_osx_have_105=yes,
- ns_osx_have_105=no)
- AC_MSG_RESULT([$ns_osx_have_105])
- if test $ns_osx_have_105 = yes; then
- macfont_file="macfont.o"
+ if test $ns_osx_have_106 = no; then
+ AC_MSG_ERROR([`OSX 10.6 or newer is required']);
fi
fi
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <Foundation/NSObjCRuntime.h>],
- [NSInteger i;])],
- ns_have_nsinteger=yes,
- 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(LIBS_GNUSTEP)
INSTALL_ARCH_INDEP_EXTRA=
fi
- NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o $macfont_file"
+ NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o $ns_fontfile"
fi
CFLAGS="$tmp_CFLAGS"
CPPFLAGS="$tmp_CPPFLAGS"
x86_64-*-*) EMACS_MANIFEST="emacs-x64.manifest" ;;
*) EMACS_MANIFEST="emacs-x86.manifest" ;;
esac
+ dnl Construct something of the form "24,4,0,0" with 4 components.
+ comma_version=`echo "${PACKAGE_VERSION}.0.0" | sed -e 's/\./,/g' -e 's/^\([[^,]]*,[[^,]]*,[[^,]]*,[[^,]]*\).*/\1/'`
+
+ comma_space_version=`echo "$comma_version" | sed 's/,/, /g'`
+ AC_SUBST(comma_version)
+ AC_SUBST(comma_space_version)
+ AC_CONFIG_FILES([nt/emacs.rc nt/emacsclient.rc])
if test "${opsys}" = "cygwin"; then
W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32"
W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool"
AC_SUBST(LIBSELINUX_LIBS)
HAVE_GNUTLS=no
-HAVE_GNUTLS3=no
if test "${with_gnutls}" = "yes" ; then
- EMACS_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
- EMACS_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.6.6],
- [HAVE_GNUTLS=yes], [HAVE_GNUTLS=no])
- fi
+ EMACS_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.6.6],
+ [HAVE_GNUTLS=yes], [HAVE_GNUTLS=no])
if test "${HAVE_GNUTLS}" = "yes"; then
AC_DEFINE(HAVE_GNUTLS, 1, [Define if using GnuTLS.])
+ EMACS_CHECK_MODULES([LIBGNUTLS3], [gnutls >= 3.0.0],
+ [AC_DEFINE(HAVE_GNUTLS3, 1, [Define if using GnuTLS v3.])], [])
fi
# Windows loads GnuTLS dynamically
EMACS_CHECK_MODULES([XRANDR], [$XRANDR_MODULES])
if test $HAVE_XRANDR = no; then
# Test old way in case pkg-config doesn't have it (older machines).
+ # Include Xrender.h by hand to work around bug in older Xrandr.h
+ # (e.g. RHEL5) and silence (harmless) configure warning (bug#18465).
AC_CHECK_HEADER(X11/extensions/Xrandr.h,
- [AC_CHECK_LIB(Xrandr, XRRGetScreenResources, HAVE_XRANDR=yes)])
+ [AC_CHECK_LIB(Xrandr, XRRGetScreenResources, HAVE_XRANDR=yes)],
+ [], [AC_INCLUDES_DEFAULT
+#include <X11/extensions/Xrender.h>])
if test $HAVE_XRANDR = yes; then
XRANDR_LIBS=-lXrandr
fi
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 x$ac_cv_func_tzset = xyes; then
-AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <time.h>
-char TZ_GMT0[] = "TZ=GMT0";
-char TZ_PST8[] = "TZ=PST8";
-main()
-{
- time_t now = time ((time_t *) 0);
- int hour_GMT0, hour_unset;
- if (putenv (TZ_GMT0) != 0)
- exit (1);
- hour_GMT0 = localtime (&now)->tm_hour;
- unsetenv("TZ");
- hour_unset = localtime (&now)->tm_hour;
- if (putenv (TZ_PST8) != 0)
- exit (1);
- if (localtime (&now)->tm_hour == hour_GMT0)
- exit (1);
- unsetenv("TZ");
- if (localtime (&now)->tm_hour != hour_unset)
- exit (1);
- exit (0);
-}]])], emacs_cv_localtime_cache=no, emacs_cv_localtime_cache=yes,
-[# If we have tzset, assume the worst when cross-compiling.
-emacs_cv_localtime_cache=yes])
-else
- # If we lack tzset, report that localtime does not cache TZ,
- # since we can't invalidate the cache if we don't have tzset.
- emacs_cv_localtime_cache=no
-fi])dnl
-AC_MSG_RESULT($emacs_cv_localtime_cache)
-if test $emacs_cv_localtime_cache = yes; then
- AC_DEFINE(LOCALTIME_CACHE, 1,
- [Define to 1 if localtime caches TZ.])
-fi
+AC_CHECK_FUNCS_ONCE(tzalloc tzset)
ok_so_far=yes
AC_CHECK_FUNC(socket, , ok_so_far=no)
structure to an N-byte boundary.])
fi
-AC_CACHE_CHECK([for statement expressions],
- [emacs_cv_statement_expressions],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([], [[return ({ int x = 5; x-x; });]])],
- [emacs_cv_statement_expressions=yes],
- [emacs_cv_statement_expressions=no])])
-if test "$emacs_cv_statement_expressions" = yes; then
- AC_DEFINE([HAVE_STATEMENT_EXPRESSIONS], 1,
- [Define to 1 if statement expressions work.])
-fi
-
if test "${GNU_MALLOC}" = "yes" ; then
AC_DEFINE(GNU_MALLOC, 1,
[Define to 1 if you want to use the GNU memory allocator.])
case "$opsys" in
aix4-2) LD_SWITCH_SYSTEM_TEMACS="-Wl,-bnodelcsect" ;;
+ cygwin) LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000" ;;
+
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"
AC_SUBST(ns_check_file)
fi
+dnl config.status treats $srcdir specially, so I think this is ok...
+AC_CONFIG_FILES([$srcdir/doc/man/emacs.1])
+
dnl Obviously there is duplication here wrt $SUBDIR_MAKEFILES.
dnl You _can_ use that variable in AC_CONFIG_FILES, so long as any directory
dnl using automake (ie lib/) is explicitly listed and not "hidden" in a variable
fi
])
+dnl Perhaps this would be better named doc-emacs-emacsver.texi?
+dnl See comments for etc-refcards-emacsver.tex.
+dnl Since we get a doc/emacs directory generated anyway, for the Makefile,
+dnl it is not quite the same. But we are generating in $srcdir.
+AC_CONFIG_COMMANDS([doc/emacs/emacsver.texi], [
+${MAKE-make} -s --no-print-directory -C doc/emacs doc-emacsver || \
+AC_MSG_ERROR(['doc/emacs/emacsver.texi' could not be made.])
+])
+
+dnl If we give this the more natural name, etc/refcards/emacsver.texi,
+dnl then a directory etc/refcards is created in the build directory,
+dnl which is probably harmless, but confusing (in out-of-tree builds).
+dnl (If we were to generate etc/refcards/Makefile, this might change.)
+dnl It is really $srcdir/etc/refcards/emacsver.tex that we generate.
+AC_CONFIG_COMMANDS([etc-refcards-emacsver.tex], [
+${MAKE-make} -s MAKEFILE_NAME=do-not-make-Makefile etc-emacsver || \
+AC_MSG_ERROR(['etc/refcards/emacsver.tex' could not be made.])
+])
+
AC_OUTPUT
test "$MAKE" = make || AC_MSG_NOTICE([Now you can run '$MAKE'.])