dnl in the directory containing this script.
dnl If you changed any AC_DEFINES, also run autoheader.
dnl
-dnl Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2003, 2004,
-dnl 2005, 2006, 2007, 2008, 2009, 2010, 2011
-dnl Free Software Foundation, Inc.
+dnl Copyright (C) 1994-1996, 1999-2011 Free Software Foundation, Inc.
dnl
dnl This file is part of GNU Emacs.
dnl
with_x_toolkit=$val
])
+OPTION_DEFAULT_OFF([wide-int], [prefer wide Emacs integers (typically 62-bit)])
+if test "$with_wide_int" = yes; then
+ AC_DEFINE([WIDE_EMACS_INT], 1, [Use long long for EMACS_INT if available.])
+fi
+
dnl _ON results in a '--without' option in the --help output, so
dnl the help text should refer to "don't compile", etc.
OPTION_DEFAULT_ON([xpm],[don't compile with XPM image support])
OPTION_DEFAULT_ON([toolkit-scroll-bars],[don't use Motif or Xaw3d scroll bars])
OPTION_DEFAULT_ON([xaw3d],[don't use Xaw3d])
OPTION_DEFAULT_ON([xim],[don't use X11 XIM])
-OPTION_DEFAULT_OFF([ns],[use nextstep (Cocoa or GNUstep) windowing system])
+OPTION_DEFAULT_OFF([ns],[use NeXTstep (Cocoa or GNUstep) windowing system])
OPTION_DEFAULT_ON([gpm],[don't use -lgpm for mouse support on a GNU/Linux console])
OPTION_DEFAULT_ON([dbus],[don't compile with D-Bus support])
[enable make rules and dependencies not useful (and sometimes
confusing) to the casual installer])],
USE_MAINTAINER_MODE=$enableval,
- USE_MAINTAINER_MODE=no)
+ USE_MAINTAINER_MODE=yes)
if test $USE_MAINTAINER_MODE = yes; then
MAINT=
else
strings is redundantly recorded in sdata structures so that it can
be compared to the sizes recorded in Lisp strings.])
fi
-if test x$ac_gc_check_stringoverrun != x ; then
+if test x$ac_gc_check_string_overrun != x ; then
AC_DEFINE(GC_CHECK_STRING_OVERRUN, 1,
[Define this to check for short string overrun.])
fi
* ) srcdir="`(cd ${srcdir}; pwd)`" ;;
esac
-#### Check if the source directory already has a configured system in it.
-if test `pwd` != `(cd ${srcdir} && pwd)` \
- && test -f "${srcdir}/src/config.h" ; then
- AC_MSG_WARN([[The directory tree `${srcdir}' is being used
- as a build directory right now; it has been configured in its own
- right. To configure in another directory as well, you MUST
- use GNU make. If you do not have GNU make, then you must
- now do `make distclean' in ${srcdir},
- and then run $0 again.]])
-fi
-
#### Given the configuration name, set machfile and opsysfile to the
#### names of the m/*.h and s/*.h files we should use.
machine=hp800 opsys=hpux11
## FIXME. Peter O'Gorman reports that dumping using unexelf.o doesn't
## work either: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6811
- CANNOT_DUMP=yes
+ CANNOT_DUMP=yes
;;
hppa*-*-linux-gnu* )
test x"$CPP" = x; then
AC_MSG_CHECKING([whether we are using a Sun C compiler])
AC_CACHE_VAL(emacs_cv_sunpro_c,
- [AC_TRY_LINK([],
-[#ifndef __SUNPRO_C
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
+[[#ifndef __SUNPRO_C
fail;
#endif
-], emacs_cv_sunpro_c=yes, emacs_cv_sunpro_c=no)])
+]])], emacs_cv_sunpro_c=yes, emacs_cv_sunpro_c=no)])
AC_MSG_RESULT($emacs_cv_sunpro_c)
if test x"$emacs_cv_sunpro_c" = xyes; then
test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS"
fi
-### Use -Wno-pointer-sign if the compiler supports it
-AC_MSG_CHECKING([whether gcc understands -Wno-pointer-sign])
-SAVE_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -Wno-pointer-sign"
-AC_TRY_COMPILE([], [], has_option=yes, has_option=no,)
-if test $has_option = yes; then
- C_WARNINGS_SWITCH="-Wno-pointer-sign $C_WARNINGS_SWITCH"
-fi
-AC_MSG_RESULT($has_option)
-CFLAGS="$SAVE_CFLAGS"
-unset has_option
-unset SAVE_CFLAGS
-
### Use -Wdeclaration-after-statement if the compiler supports it
AC_MSG_CHECKING([whether gcc understands -Wdeclaration-after-statement])
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wdeclaration-after-statement"
-AC_TRY_COMPILE([], [], has_option=yes, has_option=no,)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], has_option=yes, has_option=no)
if test $has_option = yes; then
C_WARNINGS_SWITCH="-Wdeclaration-after-statement $C_WARNINGS_SWITCH"
fi
AC_MSG_CHECKING([whether gcc understands -Wold-style-definition])
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wold-style-definition"
-AC_TRY_COMPILE([], [], has_option=yes, has_option=no,)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], has_option=yes, has_option=no)
if test $has_option = yes; then
C_WARNINGS_SWITCH="-Wold-style-definition $C_WARNINGS_SWITCH"
fi
AC_MSG_CHECKING([whether gcc understands -Wimplicit-function-declaration])
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wimplicit-function-declaration"
-AC_TRY_COMPILE([], [], has_option=yes, has_option=no,)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], has_option=yes, has_option=no)
if test $has_option = yes; then
C_WARNINGS_SWITCH="-Wimplicit-function-declaration $C_WARNINGS_SWITCH"
fi
hpux*) LIBS_SYSTEM="-l:libdld.sl" ;;
- sol2*) LIBS_SYSTEM="-lsocket -lnsl -lkstat" ;;
+ sol2*) LIBS_SYSTEM="-lsocket -lnsl" ;;
## Motif needs -lgen.
unixware) LIBS_SYSTEM="-lsocket -lnsl -lelf -lgen" ;;
CPPFLAGS="$C_SWITCH_SYSTEM $C_SWITCH_MACHINE $CPPFLAGS"
fi
-dnl For AC_FUNC_GETLOADAVG, at least:
-AC_CONFIG_LIBOBJ_DIR(src)
+# Suppress obsolescent Autoconf test for size_t; Emacs assumes C89 or better.
+AC_DEFUN([AC_TYPE_SIZE_T])
dnl Do this early because it can frob feature test macros for Unix-98 &c.
AC_SYS_LARGEFILE
## If user specified a crt-dir, use that unconditionally.
if test "X$CRT_DIR" = "X"; then
-
+
case "$canonical" in
x86_64-*-linux-gnu* | s390x-*-linux-gnu*)
## On x86-64 and s390x GNU/Linux distributions, the standard library
## Default is /usr/lib.
test "X$CRT_DIR" = "X" && CRT_DIR=/usr/lib
+ ## If we're using gcc, try to determine it automatically by asking
+ ## gcc. [If this doesn't work, CRT_DIR will remain at the
+ ## system-dependent default from above.]
+ if test "x${GCC}" = xyes; then
+ crt_file=`$CC --print-file-name=crt1.o 2>/dev/null`
+ case "$crt_file" in
+ */*)
+ CRT_DIR=`AS_DIRNAME(["$crt_file"])`
+ ;;
+ esac
+ fi
+
else
## Some platforms don't use any of these files, so it is not
SAVE_LDFLAGS="$LDFLAGS"
CFLAGS="$ALSA_CFLAGS $CFLAGS"
LDFLAGS="$ALSA_LIBS $LDFLAGS"
- AC_TRY_COMPILE([#include <asoundlib.h>], [snd_lib_error_set_handler (0);],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <asoundlib.h>]], [[snd_lib_error_set_handler (0);]])],
emacs_alsa_normal=yes,
emacs_alsa_normal=no)
if test "$emacs_alsa_normal" != yes; then
- AC_TRY_COMPILE([#include <alsa/asoundlib.h>],
- [snd_lib_error_set_handler (0);],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <alsa/asoundlib.h>]],
+ [[snd_lib_error_set_handler (0);]])],
emacs_alsa_subdir=yes,
emacs_alsa_subdir=no)
if test "$emacs_alsa_subdir" != yes; then
sys/utsname.h pwd.h utmp.h dirent.h util.h)
AC_MSG_CHECKING(if personality LINUX32 can be set)
-AC_TRY_COMPILE([#include <sys/personality.h>], [personality (PER_LINUX32)],
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/personality.h>]], [[personality (PER_LINUX32)]])],
emacs_cv_personality_linux32=yes,
emacs_cv_personality_linux32=no)
AC_MSG_RESULT($emacs_cv_personality_linux32)
dnl Some systems have utime.h but don't declare the struct anyplace.
AC_CACHE_CHECK(for struct utimbuf, emacs_cv_struct_utimbuf,
-AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef TIME_WITH_SYS_TIME
#include <sys/time.h>
#include <time.h>
#else
#endif
#ifdef HAVE_UTIME_H
#include <utime.h>
-#endif], [static struct utimbuf x; x.actime = x.modtime;],
+#endif]], [[static struct utimbuf x; x.actime = x.modtime;]])],
emacs_cv_struct_utimbuf=yes, emacs_cv_struct_utimbuf=no))
if test $emacs_cv_struct_utimbuf = yes; then
AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1, [Define to 1 if `struct utimbuf' is declared by <utime.h>.])
fi
-dnl checks for typedefs
-AC_TYPE_SIGNAL
-
dnl Check for speed_t typedef.
AC_CACHE_CHECK(for speed_t, emacs_cv_speed_t,
- [AC_TRY_COMPILE([#include <termios.h>], [speed_t x = 1;],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <termios.h>]], [[speed_t x = 1;]])],
emacs_cv_speed_t=yes, emacs_cv_speed_t=no)])
if test $emacs_cv_speed_t = yes; then
AC_DEFINE(HAVE_SPEED_T, 1,
fi
AC_CACHE_CHECK(for struct timeval, emacs_cv_struct_timeval,
-AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef TIME_WITH_SYS_TIME
#include <sys/time.h>
#include <time.h>
#else
#else
#include <time.h>
#endif
-#endif], [static struct timeval x; x.tv_sec = x.tv_usec;],
+#endif]], [[static struct timeval x; x.tv_sec = x.tv_usec;]])],
emacs_cv_struct_timeval=yes, emacs_cv_struct_timeval=no))
HAVE_TIMEVAL=$emacs_cv_struct_timeval
if test $emacs_cv_struct_timeval = yes; then
fi
AC_CACHE_CHECK(for struct exception, emacs_cv_struct_exception,
-AC_TRY_COMPILE([#include <math.h>],
-[static struct exception x; x.arg1 = x.arg2 = x.retval; x.name = ""; x.type = 1;],
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]],
+[[static struct exception x; x.arg1 = x.arg2 = x.retval; x.name = ""; x.type = 1;]])],
emacs_cv_struct_exception=yes, emacs_cv_struct_exception=no))
HAVE_EXCEPTION=$emacs_cv_struct_exception
if test $emacs_cv_struct_exception != yes; then
AC_DEFINE(NO_MATHERR, 1, [Define to 1 if you don't have struct exception in math.h.])
fi
-AC_CHECK_HEADERS(sys/socket.h)
AC_CHECK_HEADERS(net/if.h, , , [AC_INCLUDES_DEFAULT
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
AC_C_PROTOTYPES
AC_C_VOLATILE
AC_C_CONST
-dnl This isn't useful because we can't turn on use of `inline' unless
-dnl the compiler groks `extern inline'.
-dnl AC_C_INLINE
AC_CACHE_CHECK([for void * support], emacs_cv_void_star,
- [AC_TRY_COMPILE(, [void * foo;],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[void * foo;]])],
emacs_cv_void_star=yes, emacs_cv_void_star=no)])
if test $emacs_cv_void_star = yes; then
AC_DEFINE(POINTER_TYPE, void)
AC_MSG_CHECKING([whether gcc understands -MMD -MF])
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -MMD -MF deps.d"
- AC_TRY_COMPILE([], [], , ac_enable_autodepend=no)
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], , ac_enable_autodepend=no)
CFLAGS="$SAVE_CFLAGS"
test -f deps.d || ac_enable_autodepend=no
rm -rf deps.d
DEPFLAGS='-MMD -MF ${DEPDIR}/$*.d'
## In parallel builds, another make might create depdir between
## the first test and mkdir, so stick another test on the end.
- ## Or use mkinstalldirs? mkdir -p is not portable.
+ ## Or use install-sh -d? mkdir -p is not portable.
MKDEPDIR='test -d ${DEPDIR} || mkdir ${DEPDIR} || test -d ${DEPDIR}'
deps_frag=autodeps.mk
fi
AC_SUBST_FILE(deps_frag)
+lisp_frag=$srcdir/src/lisp.mk
+AC_SUBST_FILE(lisp_frag)
+
+
dnl checks for operating system services
AC_SYS_LONG_FILE_NAMES
ns_frag=/dev/null
NS_OBJ=
-NS_SUPPORT=
+NS_OBJC_OBJ=
if test "${HAVE_NS}" = yes; then
window_system=nextstep
with_xft=no
prefix=${ns_appresdir}
fi
ns_frag=$srcdir/src/ns.mk
- NS_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o fontset.o fringe.o image.o"
- NS_SUPPORT="\${lispsource}/emacs-lisp/easymenu.elc \${lispsource}/term/ns-win.elc"
+ NS_OBJ="fontset.o fringe.o image.o"
+ NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o"
fi
CFLAGS="$tmp_CFLAGS"
CPPFLAGS="$tmp_CPPFLAGS"
AC_SUBST(NS_OBJ)
-AC_SUBST(NS_SUPPORT)
+AC_SUBST(NS_OBJC_OBJ)
AC_SUBST(LIB_STANDARD)
AC_SUBST_FILE(ns_frag)
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_TRY_LINK([extern void (* __after_morecore_hook)();],[__after_morecore_hook = 0],
+[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
use_mmap_for_buffers=no
case "$opsys" in
- freebsd|irix6-5) use_mmap_for_buffers=yes ;;
+ cygwin|freebsd|irix6-5) use_mmap_for_buffers=yes ;;
esac
AC_FUNC_MMAP
esac
LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
- AC_TRY_LINK([], [int i;], [], [gdb_cv_bigtoc=])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int i;]])], [], [gdb_cv_bigtoc=])
])
;;
esac
if test "${opsys}" = "gnu-linux"; then
AC_MSG_CHECKING(whether X on GNU/Linux needs -b to link)
- AC_TRY_LINK([],
- [XOpenDisplay ("foo");],
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
+ [[XOpenDisplay ("foo");]])],
[xlinux_first_failure=no],
[xlinux_first_failure=yes])
if test "${xlinux_first_failure}" = "yes"; then
C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout"
CPPFLAGS="$CPPFLAGS -b i486-linuxaout"
LIBS="$LIBS -b i486-linuxaout"
- AC_TRY_LINK([],
- [XOpenDisplay ("foo");],
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
+ [[XOpenDisplay ("foo");]])],
[xlinux_second_failure=no],
[xlinux_second_failure=yes])
if test "${xlinux_second_failure}" = "yes"; then
# Reportedly, some broken Solaris systems have XKBlib.h but are missing
# header files included from there.
AC_MSG_CHECKING(for Xkb)
- AC_TRY_LINK([#include <X11/Xlib.h>
-#include <X11/XKBlib.h>],
- [XkbDescPtr kb = XkbGetKeyboard (0, XkbAllComponentsMask, XkbUseCoreKbd);],
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h>
+#include <X11/XKBlib.h>]],
+ [[XkbDescPtr kb = XkbGetKeyboard (0, XkbAllComponentsMask, XkbUseCoreKbd);]])],
emacs_xkb=yes, emacs_xkb=no)
AC_MSG_RESULT($emacs_xkb)
if test $emacs_xkb = yes; then
if test "${window_system}" = "x11"; then
AC_MSG_CHECKING(X11 version 6)
AC_CACHE_VAL(emacs_cv_x11_version_6,
- [AC_TRY_LINK([#include <X11/Xlib.h>],
-[#if XlibSpecificationRelease < 6
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h>]],
+[[#if XlibSpecificationRelease < 6
fail;
#endif
-], emacs_cv_x11_version_6=yes, emacs_cv_x11_version_6=no)])
+]])], emacs_cv_x11_version_6=yes, emacs_cv_x11_version_6=no)])
if test $emacs_cv_x11_version_6 = yes; then
AC_MSG_RESULT(6 or newer)
AC_DEFINE(HAVE_X11R6, 1,
HAVE_IMAGEMAGICK=no
if test "${HAVE_X11}" = "yes"; then
if test "${with_imagemagick}" != "no"; then
- IMAGEMAGICK_MODULE="Wand"
+ ## 6.2.8 is the earliest version known to work, but earlier versions
+ ## might work - let us know if you find one.
+ ## 6.0.7 does not work. See bug#7955.
+ IMAGEMAGICK_MODULE="Wand >= 6.2.8"
PKG_CHECK_MODULES(IMAGEMAGICK, $IMAGEMAGICK_MODULE, HAVE_IMAGEMAGICK=yes, :)
AC_SUBST(IMAGEMAGICK_CFLAGS)
AC_SUBST(IMAGEMAGICK_LIBS)
HAVE_GTK=no
+GTK_OBJ=
if test "${with_gtk3}" = "yes"; then
- GLIB_REQUIRED=2.6
- GTK_REQUIRED=2.90
+ GLIB_REQUIRED=2.28
+ GTK_REQUIRED=3.0
GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
dnl Checks for libraries.
if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then
AC_MSG_ERROR($GTK_PKG_ERRORS)
fi
+ AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.])
+ GTK_OBJ=emacsgtkfixed.o
fi
if test "$pkg_check_gtk" != "yes"; then
fi
fi
-GTK_OBJ=
if test x"$pkg_check_gtk" = xyes; then
AC_SUBST(GTK_CFLAGS)
else
HAVE_GTK=yes
AC_DEFINE(USE_GTK, 1, [Define to 1 if using GTK.])
- GTK_OBJ=gtkutil.o
+ GTK_OBJ="gtkutil.o $GTK_OBJ"
USE_X_TOOLKIT=none
if $PKG_CONFIG --atleast-version=2.10 gtk+-2.0; then
:
AC_SUBST(LIBSELINUX_LIBS)
HAVE_GNUTLS=no
+HAVE_GNUTLS_CALLBACK_CERTIFICATE_VERIFY=no
if test "${with_gnutls}" = "yes" ; then
- PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.2.4], HAVE_GNUTLS=yes, HAVE_GNUTLS=no)
+ PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.6.0], HAVE_GNUTLS=yes, HAVE_GNUTLS=no)
if test "${HAVE_GNUTLS}" = "yes"; then
AC_DEFINE(HAVE_GNUTLS, 1, [Define if using GnuTLS.])
fi
+
+ CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
+ LIBS="$LIBGNUTLS_LIBS $LIBS"
+ AC_CHECK_FUNCS(gnutls_certificate_set_verify_function, HAVE_GNUTLS_CALLBACK_CERTIFICATE_VERIFY=yes)
+
+ if test "${HAVE_GNUTLS_CALLBACK_CERTIFICATE_VERIFY}" = "yes"; then
+ AC_DEFINE(HAVE_GNUTLS_CALLBACK_CERTIFICATE_VERIFY, 1, [Define if using GnuTLS certificate verification callbacks.])
+ fi
fi
+
AC_SUBST(LIBGNUTLS_LIBS)
AC_SUBST(LIBGNUTLS_CFLAGS)
if test "$with_xaw3d" != no; then
AC_MSG_CHECKING(for xaw3d)
AC_CACHE_VAL(emacs_cv_xaw3d,
- [AC_TRY_LINK([
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <X11/Intrinsic.h>
-#include <X11/Xaw3d/Simple.h>],
- [],
- emacs_cv_xaw3d=yes,
+#include <X11/Xaw3d/Simple.h>]],
+ [[]])],
+ [AC_CHECK_LIB(Xaw3d, XawScrollbarSetThumb,
+ emacs_cv_xaw3d=yes, emacs_cv_xaw3d=no)],
emacs_cv_xaw3d=no)])
else
emacs_cv_xaw3d=no
AC_MSG_RESULT(no)
AC_MSG_CHECKING(for libXaw)
AC_CACHE_VAL(emacs_cv_xaw,
- [AC_TRY_LINK([
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <X11/Intrinsic.h>
-#include <X11/Xaw/Simple.h>],
- [],
+#include <X11/Xaw/Simple.h>]],
+ [[]])],
emacs_cv_xaw=yes,
emacs_cv_xaw=no)])
if test $emacs_cv_xaw = yes; then
elif test x"${USE_X_TOOLKIT}" = xLUCID; then
AC_MSG_ERROR([Lucid toolkit requires X11/Xaw include files])
else
- AC_MSG_RESULT([no; do not use toolkit by default])
- USE_X_TOOLKIT=none
+ AC_MSG_ERROR([No X toolkit could be found.
+If you are sure you want Emacs compiled without an X toolkit, pass
+ --with-x-toolkit=no
+to configure. Otherwise, install the development libraries for the toolkit
+that you want to use (e.g. Gtk+) and re-run configure.])
fi
fi
fi
if test "${USE_X_TOOLKIT}" != "none"; then
AC_MSG_CHECKING(X11 toolkit version)
AC_CACHE_VAL(emacs_cv_x11_toolkit_version_6,
- [AC_TRY_LINK([#include <X11/Intrinsic.h>],
-[#if XtSpecificationRelease < 6
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <X11/Intrinsic.h>]],
+[[#if XtSpecificationRelease < 6
fail;
#endif
-], emacs_cv_x11_toolkit_version_6=yes, emacs_cv_x11_toolkit_version_6=no)])
+]])], emacs_cv_x11_toolkit_version_6=yes, emacs_cv_x11_toolkit_version_6=no)])
HAVE_X11XTR6=$emacs_cv_x11_toolkit_version_6
if test $emacs_cv_x11_toolkit_version_6 = yes; then
AC_MSG_RESULT(6 or newer)
LIBXP=
if test "${USE_X_TOOLKIT}" = "MOTIF"; then
AC_CACHE_CHECK(for Motif version 2.1, emacs_cv_motif_version_2_1,
- [AC_TRY_COMPILE([#include <Xm/Xm.h>],
- [#if XmVERSION > 2 || (XmVERSION == 2 && XmREVISION >= 1)
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <Xm/Xm.h>]],
+ [[#if XmVERSION > 2 || (XmVERSION == 2 && XmREVISION >= 1)
int x = 5;
#else
Motif version prior to 2.1.
-#endif],
+#endif]])],
emacs_cv_motif_version_2_1=yes, emacs_cv_motif_version_2_1=no)])
if test $emacs_cv_motif_version_2_1 = yes; then
AC_CHECK_LIB(Xp, XpCreateContext, LIBXP=-lXp)
OLD_CFLAGS=$CFLAGS
CPPFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $CPPFLAGS"
CFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $CFLAGS"
- [AC_TRY_COMPILE([#include </usr/X11R6/LessTif/Motif1.2/include/Xm/Xm.h>],
- [int x = 5;],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include </usr/X11R6/LessTif/Motif1.2/include/Xm/Xm.h>]],
+ [[int x = 5;]])],
emacs_cv_lesstif=yes, emacs_cv_lesstif=no)])
if test $emacs_cv_lesstif = yes; then
# Make sure this -I option remains in CPPFLAGS after it is set
fi
dnl See if XIM is available.
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <X11/Xlib.h>
- #include <X11/Xresource.h>],
- [XIMProc callback;],
+ #include <X11/Xresource.h>]],
+ [[XIMProc callback;]])],
[HAVE_XIM=yes
AC_DEFINE(HAVE_XIM, 1, [Define to 1 if XIM is available])],
HAVE_XIM=no)
if test "$GCC" = yes; then
CFLAGS="$CFLAGS --pedantic-errors"
fi
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <X11/Xlib.h>
-#include <X11/Xresource.h>],
-[Display *display;
+#include <X11/Xresource.h>]],
+[[Display *display;
XrmDatabase db;
char *res_name;
char *res_class;
char*, XIMProc, XPointer*);
#endif
(void)XRegisterIMInstantiateCallback(display, db, res_name, res_class, callback,
- client_data);],
+ client_data);]])],
[emacs_cv_arg6_star=yes])
AH_TEMPLATE(XRegisterIMInstantiateCallback_arg6,
[Define to the type of the 6th arg of XRegisterIMInstantiateCallback,
fi # "$HAVE_XFT" != no
fi # "x${with_xft}" != "xno"
- dnl For the "Does Emacs use" message at the end.
+ ## We used to allow building with FreeType and without Xft.
+ ## However, the ftx font backend driver is not in good shape.
if test "$HAVE_XFT" != "yes"; then
+ dnl For the "Does Emacs use" message at the end.
HAVE_XFT=no
+ HAVE_FREETYPE=no
+ else
+ dnl Strict linkers fail with
+ dnl ftfont.o: undefined reference to symbol 'FT_New_Face'
+ dnl if -lfreetype is not specified.
+ dnl The following is needed to set FREETYPE_LIBS.
+ PKG_CHECK_MODULES(FREETYPE, freetype2, HAVE_FREETYPE=yes,
+ HAVE_FREETYPE=no)
+
+ test "$HAVE_FREETYPE" = "no" && AC_MSG_ERROR(libxft requires libfreetype)
fi
- ## We used to allow building with FreeType and without Xft.
- ## However, the ftx font backend driver is not in good shape.
- HAVE_FREETYPE=$HAVE_XFT
-
HAVE_LIBOTF=no
if test "${HAVE_FREETYPE}" = "yes"; then
AC_DEFINE(HAVE_FREETYPE, 1,
### Use -lgpm if available, unless `--with-gpm=no'.
HAVE_GPM=no
LIBGPM=
-MOUSE_SUPPORT=
if test "${with_gpm}" != "no"; then
AC_CHECK_HEADER(gpm.h,
[AC_CHECK_LIB(gpm, Gpm_Open, HAVE_GPM=yes)])
if test "${HAVE_GPM}" = "yes"; then
AC_DEFINE(HAVE_GPM, 1, [Define to 1 if you have the gpm library (-lgpm).])
LIBGPM=-lgpm
- ## May be reset below.
- MOUSE_SUPPORT="\$(GPM_MOUSE_SUPPORT)"
fi
fi
AC_SUBST(LIBGPM)
# If netdb.h doesn't declare h_errno, we must declare it by hand.
AC_CACHE_CHECK(whether netdb declares h_errno,
emacs_cv_netdb_declares_h_errno,
-[AC_TRY_LINK([#include <netdb.h>],
- [return h_errno;],
+[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]],
+ [[return h_errno;]])],
emacs_cv_netdb_declares_h_errno=yes, emacs_cv_netdb_declares_h_errno=no)])
if test $emacs_cv_netdb_declares_h_errno = yes; then
AC_DEFINE(HAVE_H_ERRNO, 1, [Define to 1 if netdb.h declares h_errno.])
AC_CHECK_HEADERS(sys/un.h)
-AC_FUNC_GETLOADAVG
-
AC_FUNC_FSEEKO
AC_FUNC_GETPGRP
gl_ASSERT_NO_GNULIB_TESTS
gl_INIT
-AC_FUNC_STRFTIME
-
# UNIX98 PTYs.
AC_CHECK_FUNCS(grantpt)
freebsd)
AC_MSG_CHECKING([whether FreeBSD is new enough to use terminfo])
AC_CACHE_VAL(emacs_cv_freebsd_terminfo,
- [AC_TRY_LINK([#include <osreldate.h>],
-[#if __FreeBSD_version < 400000
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <osreldate.h>]],
+[[#if __FreeBSD_version < 400000
fail;
#endif
-], emacs_cv_freebsd_terminfo=yes, emacs_cv_freebsd_terminfo=no)])
+]])], emacs_cv_freebsd_terminfo=yes, emacs_cv_freebsd_terminfo=no)])
AC_MSG_RESULT($emacs_cv_freebsd_terminfo)
# Do we have res_init, for detecting changes in /etc/resolv.conf?
resolv=no
-AC_TRY_LINK([#include <netinet/in.h>
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>
#include <arpa/nameser.h>
-#include <resolv.h>],
- [return res_init();],
+#include <resolv.h>]],
+ [[return res_init();]])],
have_res_init=yes, have_res_init=no)
if test "$have_res_init" = no; then
OLIBS="$LIBS"
LIBS="$LIBS -lresolv"
AC_MSG_CHECKING(for res_init with -lresolv)
- AC_TRY_LINK([#include <netinet/in.h>
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>
#include <arpa/nameser.h>
-#include <resolv.h>],
- [return res_init();],
+#include <resolv.h>]],
+ [[return res_init();]])],
have_res_init=yes, have_res_init=no)
AC_MSG_RESULT($have_res_init)
if test "$have_res_init" = yes ; then
AC_MSG_CHECKING(whether localtime caches TZ)
AC_CACHE_VAL(emacs_cv_localtime_cache,
[if test x$ac_cv_func_tzset = xyes; then
-AC_TRY_RUN([#include <time.h>
+AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <time.h>
char TZ_GMT0[] = "TZ=GMT0";
char TZ_PST8[] = "TZ=PST8";
main()
if (localtime (&now)->tm_hour != hour_unset)
exit (1);
exit (0);
-}], emacs_cv_localtime_cache=no, emacs_cv_localtime_cache=yes,
+}]])], 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 test $ac_cv_func_gettimeofday = yes; then
AC_CACHE_CHECK(whether gettimeofday can accept two arguments,
emacs_cv_gettimeofday_two_arguments,
- [AC_TRY_COMPILE([
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifdef TIME_WITH_SYS_TIME
#include <sys/time.h>
#include <time.h>
#else
#include <time.h>
#endif
-#endif],
- [struct timeval time;
- gettimeofday (&time, 0);],
+#endif]],
+ [[struct timeval time;
+ gettimeofday (&time, 0);]])],
emacs_cv_gettimeofday_two_arguments=yes,
emacs_cv_gettimeofday_two_arguments=no)])
if test $emacs_cv_gettimeofday_two_arguments = no; then
dnl Adapted from Haible's version.
AC_CACHE_CHECK([for nl_langinfo and CODESET], emacs_cv_langinfo_codeset,
- [AC_TRY_LINK([#include <langinfo.h>],
- [char* cs = nl_langinfo(CODESET);],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],
+ [[char* cs = nl_langinfo(CODESET);]])],
emacs_cv_langinfo_codeset=yes,
emacs_cv_langinfo_codeset=no)
])
[Define if you have <langinfo.h> and nl_langinfo(CODESET).])
fi
-AC_CHECK_TYPES(size_t)
-
AC_TYPE_MBSTATE_T
AC_CACHE_CHECK([for C restricted array declarations], emacs_cv_c_restrict_arr,
- [AC_TRY_COMPILE([void fred (int x[__restrict]);], [],
+ [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,
AC_MSG_ERROR([GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'.])
fi
-#### Find out which version of Emacs this is.
-[version=`grep 'const char emacs_version' ${srcdir}/src/emacs.c \
- | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`]
-if test x"${version}" = x; then
- AC_MSG_ERROR([can't find current emacs version in `${srcdir}/src/emacs.c'.])
-fi
-if test x"${version}" != x"$PACKAGE_VERSION"; then
- AC_MSG_WARN([version mismatch between `${srcdir}/configure.in' and `${srcdir}/src/emacs.c'.])
-fi
+version=$PACKAGE_VERSION
### Specify what sort of things we'll be editing into Makefile and config.h.
### Use configuration here uncanonicalized to avoid exceeding size limits.
S_FILE="\$(srcdir)/${opsysfile}"
AC_SUBST(M_FILE)
AC_SUBST(S_FILE)
-AC_SUBST(GETLOADAVG_LIBS)
AC_SUBST(ns_appdir)
AC_SUBST(ns_appbindir)
AC_SUBST(ns_appresdir)
AC_SUBST(LIB_GCC)
-TOOLTIP_SUPPORT=
-WINDOW_SUPPORT=
## If we're using X11/GNUstep, define some consequences.
if test "$HAVE_X_WINDOWS" = "yes" || test "$HAVE_NS" = "yes"; then
AC_DEFINE(HAVE_WINDOW_SYSTEM, 1, [Define if you have a window system.])
AC_DEFINE(HAVE_MOUSE, 1, [Define if you have mouse support.])
- MOUSE_SUPPORT="\$(REAL_MOUSE_SUPPORT)"
- TOOLTIP_SUPPORT="\${lispsource}/mouse.elc"
-
- WINDOW_SUPPORT="\$(BASE_WINDOW_SUPPORT)"
- test "$HAVE_X_WINDOWS" = "yes" && \
- WINDOW_SUPPORT="$WINDOW_SUPPORT \$(X_WINDOW_SUPPORT)"
-
fi
-AC_SUBST(MOUSE_SUPPORT)
-AC_SUBST(TOOLTIP_SUPPORT)
-AC_SUBST(WINDOW_SUPPORT)
AH_TOP([/* GNU Emacs site configuration template file.
- Copyright (C) 1988, 1993, 1994, 1999, 2000, 2001, 2002, 2004, 2005,
- 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+
+Copyright (C) 1988, 1993-1994, 1999-2002, 2004-2011
+ Free Software Foundation, Inc.
This file is part of GNU Emacs.
/* Turned on June 1996 supposing nobody will mind it. */
#define AMPERSAND_FULL_NAME
-/* If using GNU, then support inline function declarations. */
-/* Don't try to switch on inline handling as detected by AC_C_INLINE
- generally, because even if non-gcc compilers accept `inline', they
- may reject `extern inline'. */
-#if defined (__GNUC__)
-#define INLINE __inline__
-#else
-#define INLINE
-#endif
-
/* `subprocesses' should be defined if you want to
have code for asynchronous subprocesses
(as used in M-x compile and M-x shell).
# define SYSTEM_PURESIZE_EXTRA 30000
#endif
-/* SIGTYPE is the macro we actually use. */
-#ifndef SIGTYPE
-#define SIGTYPE RETSIGTYPE
-#endif
-
#ifdef emacs /* Don't do this for lib-src. */
/* Tell regex.c to use a type compatible with Emacs. */
#define RE_TRANSLATE_TYPE Lisp_Object
#endif
#endif
-#define my_strftime nstrftime /* for strftime.c */
-
/* These default definitions are good for almost all machines.
- The exceptions override them in m/MACHINE.h. */
+ Any exceptions should override them in m/MACHINE.h.
+ They must be usable in preprocessor conditionals. */
#ifndef BITS_PER_CHAR
#define BITS_PER_CHAR 8
#define BITS_PER_SHORT 16
#endif
-/* Note that lisp.h uses this in a preprocessor conditional, so it
- would not work to use sizeof. That being so, we do all of them
- without sizeof, for uniformity's sake. */
#ifndef BITS_PER_INT
#define BITS_PER_INT 32
#endif
#endif
#endif
+#if !defined BITS_PER_LONG_LONG && HAVE_LONG_LONG_INT
+#define BITS_PER_LONG_LONG 64
+#endif
+
/* Define if the compiler supports function prototypes. It may do so but
not define __STDC__ (e.g. DEC C by default) or may define it as zero. */
#undef PROTOTYPES
void *alloca (size_t);
#endif
-#ifndef HAVE_SIZE_T
-typedef unsigned size_t;
-#endif
-
#ifndef HAVE_STRCHR
#define strchr(a, b) index (a, b)
#endif
#define EXTERNALLY_VISIBLE
#endif
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+# define ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+#else
+# define ATTRIBUTE_FORMAT(spec) /* empty */
+#endif
+
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
+# define ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
+ ATTRIBUTE_FORMAT ((__gnu_printf__, formatstring_parameter, first_argument))
+#else
+# define ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
+ ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
+#endif
+
/* Some versions of GNU/Linux define noinline in their headers. */
#ifdef noinline
#undef noinline
echo " Does Emacs use -ldbus? ${HAVE_DBUS}"
echo " Does Emacs use -lgconf? ${HAVE_GCONF}"
echo " Does Emacs use -lselinux? ${HAVE_LIBSELINUX}"
-echo " Does Emacs use -lgnutls? ${HAVE_GNUTLS}"
+echo " Does Emacs use -lgnutls (2.6.x or higher)? ${HAVE_GNUTLS}"
echo " Does Emacs use -lxml2? ${HAVE_LIBXML2}"
echo " Does Emacs use -lfreetype? ${HAVE_FREETYPE}"
test "${exec_prefix}" != NONE &&
exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\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
+dnl (else you get "no `Makefile.am' found for any configure output").
+dnl This will work, but you get a config.status that is not quite right
+dnl (see http://lists.gnu.org/archive/html/bug-autoconf/2008-08/msg00028.html).
+dnl That doesn't have any obvious consequences for Emacs, but on the whole
+dnl it seems better to just live with the duplication.
+SUBDIR_MAKEFILES="lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile"
+
+AC_CONFIG_FILES([Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile \
+ doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile \
+ doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile \
+ leim/Makefile])
+
+dnl test/ is not present in release tarfiles.
+opt_makefile=test/automated/Makefile
+
+if test -f $srcdir/${opt_makefile}.in; then
+ SUBDIR_MAKEFILES="$SUBDIR_MAKEFILES $opt_makefile"
+ dnl Again, it's best not to use a variable. Though you can add
+ dnl ", [], [opt_makefile='$opt_makefile']" and it should work.
+ AC_CONFIG_FILES([test/automated/Makefile])
+fi
+
+SUBDIR_MAKEFILES_IN=`echo " ${SUBDIR_MAKEFILES}" | sed -e 's| | $(srcdir)/|g' -e 's|Makefile|Makefile.in|g'`
+
+AC_SUBST(SUBDIR_MAKEFILES_IN)
+
+dnl Make the necessary directories, if they don't exist.
+AC_CONFIG_COMMANDS([mkdirs], [
+for dir in etc lisp ; do
+ test -d ${dir} || mkdir ${dir}
+done
+])
+
dnl You might wonder (I did) why epaths.h is generated by running make,
dnl rather than just letting configure generate it from epaths.in.
dnl One reason is that the various paths are not fully expanded (see above);
dnl to run `make prefix=/some/where/else' and override the values set
dnl by configure. This also explains the `move-if-change' test and
dnl the use of force in the `epaths-force' rule in Makefile.in.
-AC_OUTPUT(Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile \
- doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile \
- doc/lispref/Makefile src/Makefile \
- lwlib/Makefile lisp/Makefile leim/Makefile test/automated/Makefile, [
-
-### Make the necessary directories, if they don't exist.
-for dir in etc lisp ; do
- test -d ${dir} || mkdir ${dir}
-done
-
+AC_CONFIG_COMMANDS([epaths], [
echo creating src/epaths.h
${MAKE-make} epaths-force
+], [GCC="$GCC" NON_GNU_CPP="$NON_GNU_CPP" CPP="$CPP" CPPFLAGS="$CPPFLAGS"])
+AC_CONFIG_COMMANDS([gdbinit], [
if test ! -f src/.gdbinit && test -f $srcdir/src/.gdbinit; then
echo creating src/.gdbinit
echo source $srcdir/src/.gdbinit > src/.gdbinit
fi
+])
-], [GCC="$GCC" NON_GNU_CPP="$NON_GNU_CPP" CPP="$CPP" CPPFLAGS="$CPPFLAGS"])
+AC_OUTPUT
+
+dnl configure.in ends here