dnl in the directory containing this script.
dnl If you changed any AC_DEFINES, also run autoheader.
dnl
-dnl Copyright (C) 1994-1996, 1999-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 1994-1996, 1999-2016 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)])
+OPTION_DEFAULT_OFF([wide-int], [prefer wide Emacs integers (typically 62-bit); allows buffer and string size up to 2GB on 32-bit hosts, at the cost of 10% to 30% slowdown of Lisp interpreter and larger memory footprint])
if test "$with_wide_int" = yes; then
AC_DEFINE([WIDE_EMACS_INT], 1, [Use long long for EMACS_INT if available.])
fi
OPTION_DEFAULT_ON([selinux],[don't compile with SELinux support])
OPTION_DEFAULT_ON([gnutls],[don't use -lgnutls for SSL/TLS support])
OPTION_DEFAULT_ON([zlib],[don't compile with zlib decompression support])
+OPTION_DEFAULT_OFF([modules],[compile with dynamic modules support])
AC_ARG_WITH([file-notification],[AS_HELP_STRING([--with-file-notification=LIB],
- [use a file notification library (LIB one of: yes, gfile, inotify, w32, no)])],
+ [use a file notification library (LIB one of: yes, inotify, kqueue, gfile, w32, no)])],
[ case "${withval}" in
y | ye | yes ) val=yes ;;
n | no ) val=no ;;
- g | gf | gfi | gfil | gfile ) val=gfile ;;
i | in | ino | inot | inoti | inotif | inotify ) val=inotify ;;
+ k | kq | kqu | kque | kqueu | kqueue ) val=kqueue ;;
+ g | gf | gfi | gfil | gfile ) val=gfile ;;
w | w3 | w32 ) val=w32 ;;
* ) AC_MSG_ERROR(['--with-file-notification=$withval' is invalid;
-this option's value should be 'yes', 'no', 'gfile', 'inotify' or 'w32'.
+this option's value should be 'yes', 'no', 'inotify', 'kqueue', 'gfile' or 'w32'.
'yes' is a synonym for 'w32' on MS-Windows, for 'no' on Nextstep,
-otherwise for the first of 'inotify' or 'gfile' that is usable.])
+otherwise for the first of 'inotify', 'kqueue' or 'gfile' that is usable.])
;;
esac
with_file_notification=$val
[[malloc_set_state (malloc_get_state ());
__after_morecore_hook = hook;
__malloc_initialize_hook = hook;]])],
- [emacs_cv_var_doug_lea_malloc=yes])])
- fi
+ [emacs_cv_var_doug_lea_malloc=yes])
+ fi])
doug_lea_malloc=$emacs_cv_var_doug_lea_malloc
system_malloc=$emacs_cv_sanitize_address
AC_CACHE_CHECK([for pthread library],
[emacs_cv_pthread_lib],
[emacs_cv_pthread_lib=no
- OLD_CPPFLAGS=$CPPFLAGS
OLD_LIBS=$LIBS
for emacs_pthread_lib in 'none needed' -lpthread; do
case $emacs_pthread_lib in
if test "$emacs_cv_pthread_lib" != no; then
break
fi
- done
- CPPFLAGS=$OLD_CPPFLAGS])
+ done])
if test "$emacs_cv_pthread_lib" != no; then
AC_DEFINE([HAVE_PTHREAD], 1, [Define to 1 if you have POSIX threads.])
case $emacs_cv_pthread_lib in
NOTIFY_OBJ=
NOTIFY_SUMMARY=no
-dnl FIXME? Don't auto-detect on NS, but do allow someone to specify
-dnl a particular library. This doesn't make much sense?
-if test "${HAVE_NS}" = yes && test ${with_file_notification} = yes; then
- with_file_notification=no
-fi
-
dnl MS Windows native file monitor is available for mingw32 only.
case $with_file_notification,$opsys in
w32,cygwin)
fi ;;
esac
+dnl kqueue is available on BSD-like systems.
+case $with_file_notification,$NOTIFY_OBJ in
+ kqueue,* | yes,)
+ EMACS_CHECK_MODULES([KQUEUE], [libkqueue])
+ if test "$HAVE_KQUEUE" = "yes"; then
+ AC_DEFINE(HAVE_KQUEUE, 1, [Define to 1 to use kqueue.])
+ CPPFLAGS="$CPPFLAGS -I/usr/include/kqueue"
+ NOTIFY_CFLAGS=$KQUEUE_CFLAGS
+ NOTIFY_LIBS=$KQUEUE_LIBS
+ NOTIFY_OBJ=kqueue.o
+ NOTIFY_SUMMARY="yes -lkqueue"
+ else
+ AC_SEARCH_LIBS(kqueue, [])
+ if test "$ac_cv_search_kqueue" != no; then
+ AC_DEFINE(HAVE_KQUEUE, 1, [Define to 1 to use kqueue.])
+ NOTIFY_OBJ=kqueue.o
+ NOTIFY_SUMMARY="yes (kqueue)"
+ fi
+ fi ;;
+esac
+
dnl g_file_monitor exists since glib 2.18. G_FILE_MONITOR_EVENT_MOVED
dnl has been added in glib 2.24. It has been tested under
dnl GNU/Linux only.
case $with_file_notification,$NOTIFY_OBJ in
gfile,* | yes,)
- EMACS_CHECK_MODULES([GFILENOTIFY], [gio-2.0 >= 2.24])
- if test "$HAVE_GFILENOTIFY" = "yes"; then
- AC_DEFINE(HAVE_GFILENOTIFY, 1, [Define to 1 if using GFile.])
- NOTIFY_OBJ=gfilenotify.o
- NOTIFY_SUMMARY="yes -lgio (gfile)"
+ if test "${HAVE_NS}" = yes; then
+ AC_MSG_ERROR(['--with-file-notification=gfile' is not supported in NextStep builds.
+Consider kqueue instead.])
+ else
+ EMACS_CHECK_MODULES([GFILENOTIFY], [gio-2.0 >= 2.24])
+ if test "$HAVE_GFILENOTIFY" = "yes"; then
+ AC_DEFINE(HAVE_GFILENOTIFY, 1, [Define to 1 if using GFile.])
+ NOTIFY_CFLAGS=$GFILENOTIFY_CFLAGS
+ NOTIFY_LIBS=$GFILENOTIFY_LIBS
+ NOTIFY_OBJ=gfilenotify.o
+ NOTIFY_SUMMARY="yes -lgio (gfile)"
+ fi
fi ;;
esac
if test -n "$NOTIFY_OBJ"; then
AC_DEFINE(USE_FILE_NOTIFY, 1, [Define to 1 if using file notifications.])
fi
+AC_SUBST(NOTIFY_CFLAGS)
+AC_SUBST(NOTIFY_LIBS)
AC_SUBST(NOTIFY_OBJ)
-AC_SUBST(GFILENOTIFY_CFLAGS)
-AC_SUBST(GFILENOTIFY_LIBS)
dnl Do not put whitespace before the #include statements below.
dnl Older compilers (eg sunos4 cc) choke on it.
fi
AC_SUBST(LIBZ)
+### Dynamic modules support
+LIBMODULES=
+HAVE_MODULES=no
+MODULES_OBJ=
+MODULES_SUFFIX=
+if test "${with_modules}" != "no"; then
+ if test "$opsys" = "gnu-linux"; then
+ LIBMODULES="-ldl"
+ MODULES_SUFFIX=".so"
+ HAVE_MODULES=yes
+ elif test "$opsys" = "cygwin"; then
+ MODULES_SUFFIX=".dll"
+ HAVE_MODULES=yes
+ elif test "$opsys" = "darwin"; then
+ MODULES_SUFFIX=".so"
+ HAVE_MODULES=yes
+ elif test "$opsys" = "mingw32"; then
+ MODULES_SUFFIX=".dll"
+ HAVE_MODULES=yes
+ else
+ # BSD system have dlopen in the libc
+ AC_CHECK_FUNC(dlopen, [MODULES_SUFFIX=".so"]
+ [HAVE_MODULES=yes], [])
+ fi
+
+ if test "${HAVE_MODULES}" = no; then
+ AC_MSG_ERROR([Dynamic modules are not supported on your system])
+ else
+ SAVE_LIBS=$LIBS
+ LIBS="$LIBS $LIBMODULES"
+ AC_CHECK_FUNCS([dlfunc])
+ LIBS=$SAVE_LIBS
+ fi
+fi
+
+if test "${HAVE_MODULES}" = yes; then
+ MODULES_OBJ="dynlib.o emacs-module.o"
+ AC_DEFINE(HAVE_MODULES, 1, [Define to 1 if dynamic modules are enabled])
+ AC_DEFINE_UNQUOTED(MODULES_SUFFIX, "$MODULES_SUFFIX",
+ [System extension for dynamic libraries])
+fi
+AC_SUBST(MODULES_OBJ)
+AC_SUBST(LIBMODULES)
+AX_GCC_VAR_ATTRIBUTE(cleanup)
+AC_CHECK_FUNCS(dladdr)
+
### Use -lpng if available, unless '--with-png=no'.
HAVE_PNG=no
LIBPNG=
# Built-in libxml2 on OS X 10.8 lacks libxml-2.0.pc.
if test "${HAVE_LIBXML2}" != "yes" && test "$opsys" = "darwin"; then
SAVE_CPPFLAGS="$CPPFLAGS"
+ if test -z "$xcsdkdir" -a -n "$XCRUN" -a ! -d /usr/include; then
+ dnl /usr/include is not found. Try Xcode SDK dir if it is sane.
+ xcsdkdir=`$XCRUN --show-sdk-path 2>/dev/null`
+ case $xcsdkdir in
+ *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
+ xcsdkdir="" ;;
+ esac
+ fi
CPPFLAGS="$CPPFLAGS -I$xcsdkdir/usr/include/libxml2"
AC_CHECK_HEADER(libxml/HTMLparser.h,
[AC_CHECK_DECL(HTML_PARSE_RECOVER, HAVE_LIBXML2=yes, ,
OLDLIBS="$LIBS"
CFLAGS="$CFLAGS $GTK_CFLAGS $RSVG_CFLAGS $DBUS_CFLAGS $SETTINGS_CFLAGS"
LIBS="$LIBS $GTK_LIBS $RSVG_LIBS $DBUS_LIBS $SETTINGS_LIBS"
-CFLAGS="$CFLAGS $GFILENOTIFY_CFLAGS $CAIRO_CFLAGS"
-LIBS="$LIBS $GFILENOTIFY_LIBS $CAIRO_LIBS"
+CFLAGS="$CFLAGS $NOTIFY_CFLAGS $CAIRO_CFLAGS"
+LIBS="$LIBS $NOTIFY_LIBS $CAIRO_LIBS"
AC_MSG_CHECKING([whether GLib is linked in])
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <glib.h>
SEPCHAR=':'
fi
AC_DEFINE_UNQUOTED(SEPCHAR, ['$SEPCHAR'], [Character that separates PATH elements.])
-dnl This is for MinGW, and is used in test/automated/Makefile.in.
+dnl This is for MinGW, and is used in test/Makefile.in.
dnl The MSYS Bash has heuristics for replacing ':' with ';' when it
dnl decides that a command-line argument to be passed to a MinGW program
dnl is a PATH-style list of directories. But that heuristics plays it
AC_DEFINE(PTY_TTY_NAME_SPRINTF, [])
;;
- dnl FIXME? Maybe use same as freebsd - see bug#12040.
- darwin )
- AC_DEFINE(PTY_ITERATION, [int i; for (i = 0; i < 1; i++)])
- dnl Not used, because PTY_ITERATION is defined.
- AC_DEFINE(FIRST_PTY_LETTER, ['p'])
- dnl Note that openpty may fork via grantpt on Mac OS X 10.4/Darwin 8.
- dnl But we don't have to block SIGCHLD because it is blocked in the
- dnl implementation of grantpt.
- AC_DEFINE(PTY_OPEN, [ do { int slave; if (openpty (&fd, &slave, pty_name, NULL, NULL) == -1) fd = -1; else emacs_close (slave); } while (false)])
- AC_DEFINE(PTY_NAME_SPRINTF, [])
- AC_DEFINE(PTY_TTY_NAME_SPRINTF, [])
- ;;
-
gnu | openbsd )
AC_DEFINE(FIRST_PTY_LETTER, ['p'])
;;
- gnu-linux | gnu-kfreebsd | dragonfly | freebsd | netbsd | nacl )
+ gnu-linux | gnu-kfreebsd | dragonfly | freebsd | netbsd | darwin | nacl )
dnl if HAVE_GRANTPT
if test "x$ac_cv_func_grantpt" = xyes; then
AC_DEFINE(UNIX98_PTYS, 1, [Define if the system has Unix98 PTYs.])
version=$PACKAGE_VERSION
-copyright="Copyright (C) 2015 Free Software Foundation, Inc."
+copyright="Copyright (C) 2016 Free Software Foundation, Inc."
AC_DEFINE_UNQUOTED(COPYRIGHT, ["$copyright"],
[Short copyright string for this version of Emacs.])
AC_SUBST(copyright)
AH_TOP([/* GNU Emacs site configuration template file.
-Copyright (C) 1988, 1993-1994, 1999-2002, 2004-2015
+Copyright (C) 1988, 1993-1994, 1999-2002, 2004-2016
Free Software Foundation, Inc.
This file is part of GNU Emacs.
emacs_config_features=
for opt in XAW3D XPM JPEG TIFF GIF PNG RSVG CAIRO IMAGEMAGICK SOUND GPM DBUS \
GCONF GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT \
- LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS X_TOOLKIT X11 NS; do
+ LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS X_TOOLKIT X11 NS MODULES; do
case $opt in
NOTIFY|ACL) eval val=\${${opt}_SUMMARY} ;;
Does Emacs use -lotf? ${HAVE_LIBOTF}
Does Emacs use -lxft? ${HAVE_XFT}
Does Emacs directly use zlib? ${HAVE_ZLIB}
+ Does Emacs have dynamic modules support? ${HAVE_MODULES}
Does Emacs use toolkit scroll bars? ${USE_TOOLKIT_SCROLL_BARS}
"])
leim/Makefile nextstep/Makefile nt/Makefile])
dnl test/ is not present in release tarfiles.
-opt_makefile=test/automated/Makefile
+opt_makefile=test/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])
+ AC_CONFIG_FILES([test/Makefile])
fi