dnl along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
AC_PREREQ(2.65)
-AC_INIT(emacs, 24.1.50)
+AC_INIT(emacs, 24.2.50)
AC_CONFIG_HEADER(src/config.h:src/config.in)
AC_CONFIG_SRCDIR(src/lisp.h)
AC_CONFIG_AUX_DIR(build-aux)
-AM_INIT_AUTOMAKE
+dnl Fairly arbitrary, older versions might work too.
+AM_INIT_AUTOMAKE(1.11)
dnl Support for --program-prefix, --program-suffix and
dnl --program-transform-name options
docdir='${datadir}/emacs/${version}/etc'
gamedir='${localstatedir}/games/emacs'
+dnl Special option to disable the most of other options.
+AC_ARG_WITH(all,
+[AS_HELP_STRING([--without-all],
+ [omit almost all features and build
+ small executable with minimal dependencies])],
+ with_features=$withval,
+ with_features=yes)
+
dnl OPTION_DEFAULT_OFF(NAME, HELP-STRING)
dnl Create a new --with option that defaults to being disabled.
dnl NAME is the base name of the option. The shell variable with_NAME
])dnl
dnl OPTION_DEFAULT_ON(NAME, HELP-STRING)
-dnl Create a new --with option that defaults to being enabled. NAME
-dnl is the base name of the option. The shell variable with_NAME
+dnl Create a new --with option that defaults to $enable_features.
+dnl NAME is the base name of the option. The shell variable with_NAME
dnl will be set either to 'no' (for a plain --without-NAME) or to
dnl 'yes' (if the option is not specified). Note that the shell
dnl variable name is constructed as autoconf does, by replacing
dnl HELP-STRING is the help text for the option.
AC_DEFUN([OPTION_DEFAULT_ON], [dnl
AC_ARG_WITH([$1],[AS_HELP_STRING([--without-$1],[$2])],[],[dnl
- m4_bpatsubst([with_$1], [[^0-9a-z]], [_])=yes])dnl
+ m4_bpatsubst([with_$1], [[^0-9a-z]], [_])=$with_features])dnl
])dnl
OPTION_DEFAULT_ON([pop],[don't support POP mail retrieval with movemail])
OPTION_DEFAULT_ON([sound],[don't compile with sound support])
-OPTION_DEFAULT_ON([sync-input],[process async input synchronously])
-if test "$with_sync_input" = yes; then
- AC_DEFINE(SYNC_INPUT, 1, [Process async input synchronously.])
-fi
-
dnl FIXME currently it is not the last.
dnl This should be the last --with option, because --with-x is
dnl added later on when we find the path of X, and it's best to
dnl keep them together visually.
AC_ARG_WITH([x-toolkit],[AS_HELP_STRING([--with-x-toolkit=KIT],
- [use an X toolkit (KIT one of: yes or gtk, gtk3, lucid or athena, motif, no)])],
+ [use an X toolkit (KIT one of: yes or gtk, gtk2, gtk3, lucid or athena, motif, no)])],
[ case "${withval}" in
y | ye | yes ) val=gtk ;;
n | no ) val=no ;;
a | at | ath | athe | athen | athena ) val=athena ;;
m | mo | mot | moti | motif ) val=motif ;;
g | gt | gtk ) val=gtk ;;
+ gtk2 ) val=gtk2 ;;
gtk3 ) val=gtk3 ;;
* )
AC_MSG_ERROR([`--with-x-toolkit=$withval' is invalid;
-this option's value should be `yes', `no', `lucid', `athena', `motif', `gtk' or
-`gtk3'. `yes' and `gtk' are synonyms. `athena' and `lucid' are synonyms.])
+this option's value should be `yes', `no', `lucid', `athena', `motif', `gtk',
+`gtk2' or `gtk3'. `yes' and `gtk' are synonyms.
+`athena' and `lucid' are synonyms.])
;;
esac
with_x_toolkit=$val
* ) srcdir="`(cd ${srcdir}; pwd)`" ;;
esac
-#### Given the configuration name, set opsysfile to the
-#### name of s/*.h file we should use.
-
### Canonicalize the configuration name.
AC_CANONICAL_HOST
Check `etc/MACHINES' for recognized configuration names.])
fi
-opsysfile="s/${opsys}.h"
-
#### Choose a compiler.
# Initialize gnulib right after choosing the compiler.
gl_EARLY
+# It's helpful to have C macros available to GDB, so prefer -g3 to -g
+# if -g3 works and the user does not specify CFLAGS.
+# This test must follow gl_EARLY; otherwise AC_LINK_IFELSE complains.
+if test "$ac_test_CFLAGS" != set; then
+ case $CFLAGS in
+ '-g')
+ emacs_g3_CFLAGS='-g3';;
+ '-g -O2')
+ emacs_g3_CFLAGS='-g3 -O2';;
+ *)
+ emacs_g3_CFLAGS='';;
+ esac
+ if test -n "$emacs_g3_CFLAGS"; then
+ emacs_save_CFLAGS=$CFLAGS
+ CFLAGS=$emacs_g3_CFLAGS
+ AC_CACHE_CHECK([whether $CC accepts $emacs_g3_CFLAGS],
+ [emacs_cv_prog_cc_g3],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM()],
+ [emacs_cv_prog_cc_g3=yes],
+ [emacs_cv_prog_cc_g3=no])])
+ if test $emacs_cv_prog_cc_g3 = yes; then
+ CFLAGS=$emacs_g3_CFLAGS
+ else
+ CFLAGS=$emacs_save_CFLAGS
+ fi
+ fi
+fi
+
AC_ARG_ENABLE([gcc-warnings],
[AS_HELP_STRING([--enable-gcc-warnings],
[turn on lots of GCC warnings. This is intended for
nw="$nw -Wswitch-default" # Too many warnings for now
nw="$nw -Wfloat-equal" # warns about high-quality code
nw="$nw -Winline" # OK to ignore 'inline'
+ nw="$nw -Wjump-misses-init" # We sometimes safely jump over init.
nw="$nw -Wsync-nand" # irrelevant here, and provokes ObjC warning
nw="$nw -Wunsafe-loop-optimizations" # OK to suppress unsafe optimizations
gl_WARN_ADD([-funit-at-a-time])
AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.])
- AC_DEFINE([_FORTIFY_SOURCE], [2],
- [enable compile-time and run-time bounds-checking, and some warnings])
+ AH_VERBATIM([FORTIFY_SOURCE],
+ [/* Enable compile-time and run-time bounds-checking, and some warnings,
+ without upsetting glibc 2.15+. */
+ #if 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/.
dnl if test "x$RANLIB" = x; then
dnl AC_PROG_RANLIB
dnl fi
+AC_PROG_LN_S
AC_PATH_PROG(INSTALL_INFO, install-info, :,
$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin)
if test $opsys = gnu-linux; then
AC_PATH_PROG(PAXCTL, paxctl,,
[$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/sbin])
+ if test "X$PAXCTL" != X; then
+ AC_MSG_CHECKING([whether binaries have a PT_PAX_FLAGS header])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
+ [if $PAXCTL -v conftest$EXEEXT >/dev/null 2>&1; then AC_MSG_RESULT(yes)
+ else AC_MSG_RESULT(no); PAXCTL=""; fi])
+ fi
fi
## Need makeinfo >= 4.7 (?) to build the manuals.
START_FILES='pre-crt0.o'
;;
freebsd )
- LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o'
- START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o'
+ LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtn.o'
+ START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o'
SYSTEM_TYPE=berkeley-unix
;;
gnu-linux | gnu-kfreebsd )
esac
-# Configure gnulib before invoking PKG_CHECK_MODULES, as the latter might
-# for example add -lrt to RSVG_LIBS, which would then cause gnulib to
-# incorrectly conclude that -lrt is not needed to link clock_gettime.
-gl_ASSERT_NO_GNULIB_POSIXCHECK
-gl_ASSERT_NO_GNULIB_TESTS
-gl_INIT
+pre_PKG_CONFIG_CFLAGS=$CFLAGS
+pre_PKG_CONFIG_LIBS=$LIBS
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
$1_CFLAGS=""
$1_LIBS=""
## If we have a custom action on failure, don't print errors, but
- ## do set a variable so people can do so.
- $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
- ifelse([$4], ,echo $$1_PKG_ERRORS,)
+ ## do set a variable so people can do so. Do it in a subshell
+ ## to capture any diagnostics in invoking pkg-config.
+ $1_PKG_ERRORS=`($PKG_CONFIG --print-errors "$2") 2>&1`
+ ifelse([$4], ,echo "$$1_PKG_ERRORS",)
fi
AC_SUBST($1_CFLAGS)
[Define to 1 if `speed_t' is declared by <termios.h>.])
fi
-AC_CACHE_CHECK(for struct exception, emacs_cv_struct_exception,
-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
-dnl Define on Darwin so emacs symbols will not conflict with those
-dnl in the System framework. Otherwise -prebind will not work.
-if test $emacs_cv_struct_exception != yes || test $opsys = darwin; then
- AC_DEFINE(NO_MATHERR, 1, [Define to 1 if you don't have struct exception in math.h.])
-fi
-
AC_CHECK_HEADERS_ONCE(sys/socket.h)
AC_CHECK_HEADERS(net/if.h, , , [AC_INCLUDES_DEFAULT
#if HAVE_SYS_SOCKET_H
dnl Check for endianness.
dnl AC_C_BIGENDIAN is done by gnulib.
-AC_CACHE_CHECK([for __attribute__ ((__aligned__ (expr)))],
- [emacs_cv_attribute_aligned],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[char __attribute__ ((__aligned__ (1 << 3))) c;]],
- [[]])],
- [emacs_cv_attribute_aligned=yes],
- [emacs_cv_attribute_aligned=no])])
-if test $emacs_cv_attribute_aligned = yes; then
- AC_DEFINE([HAVE_ATTRIBUTE_ALIGNED], 1,
- [Define to 1 if GCC-style __attribute__ ((__aligned__ (expr))) works.])
-fi
-
dnl check for Make feature
dnl AC_PROG_MAKE_SET is done by Automake.
#### Choose a window system.
+## We leave window_system equal to none if
+## we end up building without one. Any new window system should
+## set window_system to an appropriate value and add objects to
+## window-system-specific substs.
+
+window_system=none
AC_PATH_X
-if test "$no_x" = yes; then
- window_system=none
-else
+if test "$no_x" != yes; then
window_system=x11
fi
ns_appdir=`pwd`/nextstep/Emacs.app
ns_appbindir=${ns_appdir}/Contents/MacOS
ns_appresdir=${ns_appdir}/Contents/Resources
- ns_appsrc=${srcdir}/nextstep/Cocoa/Emacs.base
+ ns_appsrc=Cocoa/Emacs.base
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=${srcdir}/nextstep/GNUstep/Emacs.base
+ ns_appsrc=GNUstep/Emacs.base
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)"
INSTALL_ARCH_INDEP_EXTRA=install-etc
ns_self_contained=no
-ns_frag=/dev/null
NS_OBJ=
NS_OBJC_OBJ=
if test "${HAVE_NS}" = yes; then
fi
window_system=nextstep
- with_xft=no
# set up packaging dirs
if test "${EN_NS_SELF_CONTAINED}" = yes; then
ns_self_contained=yes
leimdir="\${ns_appresdir}/leim"
INSTALL_ARCH_INDEP_EXTRA=
fi
- ns_frag=$srcdir/src/ns.mk
- 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"
AC_SUBST(NS_OBJ)
AC_SUBST(NS_OBJC_OBJ)
AC_SUBST(LIB_STANDARD)
-AC_SUBST_FILE(ns_frag)
+
+## $window_system is now set to the window system we will
+## ultimately use.
+
+term_header=
+HAVE_X_WINDOWS=no
+HAVE_X11=no
+USE_X_TOOLKIT=none
case "${window_system}" in
x11 )
HAVE_X_WINDOWS=yes
HAVE_X11=yes
+ term_header=xterm.h
case "${with_x_toolkit}" in
athena | lucid ) USE_X_TOOLKIT=LUCID ;;
motif ) USE_X_TOOLKIT=MOTIF ;;
gtk ) with_gtk=yes
+ term_header=gtkutil.h
dnl Don't set this for GTK. A lot of tests below assumes Xt when
dnl USE_X_TOOLKIT is set.
USE_X_TOOLKIT=none ;;
+ gtk2 ) with_gtk2=yes
+ term_header=gtkutil.h
+ USE_X_TOOLKIT=none ;;
gtk3 ) with_gtk3=yes
+ term_header=gtkutil.h
USE_X_TOOLKIT=none ;;
no ) USE_X_TOOLKIT=none ;;
dnl If user did not say whether to use a toolkit, make this decision later:
* ) USE_X_TOOLKIT=maybe ;;
esac
;;
- nextstep | none )
- HAVE_X_WINDOWS=no
- HAVE_X11=no
- USE_X_TOOLKIT=none
+ nextstep )
+ term_header=nsterm.h
;;
esac
+if test -n "${term_header}"; then
+ AC_DEFINE_UNQUOTED(TERM_HEADER, "${term_header}",
+ [Define to the header for the built-in window system.])
+fi
+
if test "$window_system" = none && test "X$with_x" != "Xno"; then
AC_CHECK_PROG(HAVE_XSERVER, X, true, false)
if test "$HAVE_XSERVER" = true ||
HAVE_GTK=no
GTK_OBJ=
-if test "${with_gtk3}" = "yes"; then
+check_gtk2=no
+gtk3_pkg_errors=
+if test "${with_gtk3}" = "yes" || test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then
GLIB_REQUIRED=2.28
GTK_REQUIRED=3.0
GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
dnl Checks for libraries.
PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no)
- if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then
+ if test "$pkg_check_gtk" = "no" && test "$with_gtk3" = "yes"; 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
+ if test "$pkg_check_gtk" = "yes"; then
+ AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.])
+ GTK_OBJ=emacsgtkfixed.o
+ term_header=gtkutil.h
+ else
+ check_gtk2=yes
+ gtk3_pkg_errors="$GTK_PKG_ERRORS "
+ fi
fi
-if test "$pkg_check_gtk" != "yes"; then
- HAVE_GTK=no
-if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then
+if test "${with_gtk2}" = "yes" || test "$check_gtk2" = "yes"; then
GLIB_REQUIRED=2.10
GTK_REQUIRED=2.10
GTK_MODULES="gtk+-2.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
dnl Checks for libraries.
PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no)
- if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then
- AC_MSG_ERROR($GTK_PKG_ERRORS)
+ if test "$pkg_check_gtk" = "no" &&
+ { test "$with_gtk" = yes || test "$with_gtk2" = "yes"; }
+ then
+ AC_MSG_ERROR($gtk3_pkg_errors$GTK_PKG_ERRORS)
fi
fi
-fi
if test x"$pkg_check_gtk" = xyes; then
gtk_widget_get_mapped gtk_adjustment_get_page_size \
gtk_orientable_set_orientation \
gtk_window_set_has_resize_grip)
+
+ term_header=gtkutil.h
fi
dnl D-Bus has been tested under GNU/Linux only. Must be adapted for
fi
if test "$HAVE_GSETTINGS" = "yes" || test "$HAVE_GCONF" = "yes"; then
+ PKG_CHECK_MODULES(GOBJECT, gobject-2.0 >= 2.0, HAVE_GOBJECT=yes, HAVE_GOBJECT=no)
+ if test "$HAVE_GOBJECT" = "yes"; then
+ SETTINGS_CFLAGS="$SETTINGS_CFLAGS $GOBJECT_CFLAGS"
+ SETTINGS_LIBS="$SETTINGS_LIBS $GOBJECT_LIBS"
+ fi
SAVE_CFLAGS="$CFLAGS"
SAVE_LIBS="$LIBS"
CFLAGS="$SETTINGS_CFLAGS $CFLAGS"
LUCID_LIBW=
if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then
if test "$with_xaw3d" != no; then
- AC_MSG_CHECKING(for xaw3d)
AC_CACHE_VAL(emacs_cv_xaw3d,
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <X11/Intrinsic.h>
emacs_cv_xaw3d=no
fi
if test $emacs_cv_xaw3d = yes; then
+ AC_MSG_CHECKING(for xaw3d)
AC_MSG_RESULT([yes; using Lucid toolkit])
USE_X_TOOLKIT=LUCID
HAVE_XAW3D=yes
AC_DEFINE(HAVE_XAW3D, 1,
[Define to 1 if you have the Xaw3d library (-lXaw3d).])
else
+ AC_MSG_CHECKING(for xaw3d)
AC_MSG_RESULT(no)
AC_MSG_CHECKING(for libXaw)
AC_CACHE_VAL(emacs_cv_xaw,
fi
AC_CHECK_LIB(Xmu, XmuConvertStandardSelection)
test $ac_cv_lib_Xmu_XmuConvertStandardSelection = no && LIBS="$OLDLIBS"
+ dnl ac_cv_lib_Xmu_XmuConvertStandardSelection is also referenced below.
fi
AC_SUBST(LIBXTR6)
LIBXP=
if test "${USE_X_TOOLKIT}" = "MOTIF"; then
- AC_CACHE_CHECK(for Motif version 2.1, emacs_cv_motif_version_2_1,
+ # OpenMotif may be installed in such a way on some GNU/Linux systems.
+ if test -d /usr/include/openmotif; then
+ CPPFLAGS="-I/usr/include/openmotif $CPPFLAGS"
+ emacs_cv_openmotif=yes
+ case "$canonical" in
+ x86_64-*-linux-gnu* | powerpc64-*-linux-gnu* | sparc64-*-linux-gnu*)
+ test -d /usr/lib64/openmotif && LDFLAGS="-L/usr/lib64/openmotif $LDFLAGS"
+ ;;
+ *)
+ test -d /usr/lib/openmotif && LDFLAGS="-L/usr/lib/openmotif $LDFLAGS"
+ esac
+ else
+ emacs_cv_openmotif=no
+ fi
+ AC_CACHE_CHECK(for (Open)Motif version 2.1, emacs_cv_motif_version_2_1,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <Xm/Xm.h>]],
[[#if XmVERSION > 2 || (XmVERSION == 2 && XmREVISION >= 1)
int x = 5;
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)
+ if test x$emacs_cv_openmotif = xyes; then
+ REAL_CPPFLAGS="-I/usr/include/openmotif $REAL_CPPFLAGS"
+ fi
else
AC_CACHE_CHECK(for LessTif where some systems put it, emacs_cv_lesstif,
# We put this in CFLAGS temporarily to precede other -I options
AC_DEFINE(HAVE_H_ERRNO, 1, [Define to 1 if netdb.h declares h_errno.])
fi
-# fmod, logb, and frexp are found in -lm on most systems.
-# On HPUX 9.01, -lm does not contain logb, so check for sqrt.
+# sqrt and other floating-point functions such as fmod and frexp
+# are found in -lm on most systems.
AC_CHECK_LIB(m, sqrt)
# Check for mail-locking functions in a "mail" library. Probably this should
AC_CHECK_FUNCS(gethostname \
closedir getrusage get_current_dir_name \
-lrand48 logb frexp fmod cbrt setsid \
+lrand48 setsid \
fpathconf select euidaccess getpagesize setlocale \
utimes getrlimit setrlimit setpgid getcwd shutdown getaddrinfo \
__fpending strsignal setitimer \
cfmakeraw cfsetspeed copysign __executable_start)
dnl getwd appears to be buggy on SVR4.2, so we don't use it.
-if test $opsys != unixware; then
+if test $opsys = unixware; then
+ dnl In case some other test ends up checking for getwd.
+ AC_DEFINE(BROKEN_GETWD, 1, [Define if getwd should not be used.])
+else
AC_CHECK_FUNCS(getwd)
fi
## version number A.09.05.
## You can fix the math library by installing patch number PHSS_4630.
## But we can fix it more reliably for Emacs by just not using rint.
-## We also skip HAVE_RANDOM - see comments in src/s/hpux10-20.h.
+## We also skip HAVE_RANDOM - see comments in src/conf_post.h.
case $opsys in
hpux*) : ;;
*) AC_CHECK_FUNCS(random rint) ;;
AC_CHECK_FUNCS(grantpt)
# PTY-related GNU extensions.
-AC_CHECK_FUNCS(getpt)
+AC_CHECK_FUNCS(getpt posix_openpt)
# Check this now, so that we will NOT find the above functions in ncurses.
# That is because we have not set up to link ncurses in lib-src.
AC_MSG_RESULT(no)
fi
+dnl Check for a Solaris 2.4 vfork bug that Autoconf misses (through 2.69).
+dnl This can be removed once we assume Autoconf 2.70.
+case $canonical in
+ *-solaris2.4 | *-solaris2.4.*)
+ dnl Disable the Autoconf-generated vfork test.
+ : ${ac_cv_func_vfork_works=no};;
+esac
+
AC_FUNC_FORK
AC_CHECK_FUNCS(snprintf)
dnl AC_DEFINE(HAVE_TCATTR, 1, [Define to 1 if you have tcgetattr and tcsetattr.])
dnl fi
+dnl Turned on June 1996 supposing nobody will mind it.
+AC_DEFINE(AMPERSAND_FULL_NAME, 1, [Define to use the convention that &
+ in the full name stands for the login id.])
+
dnl Every platform that uses configure (ie every non-MS platform)
dnl supports this. There is a create-lockfiles option you can
dnl customize if you do not want the lock files to be written.
AC_DEFINE(HAVE_SOCKETS, 1, [Define if the system supports
4.2-compatible sockets.])
+AH_TEMPLATE(INTERNAL_TERMINAL, [This is substituted when $TERM is "internal".])
+
+AC_DEFINE(NULL_DEVICE, ["/dev/null"], [Name of the file to open to get
+ a null file, or a data sink.])
+
+AC_DEFINE(SEPCHAR, [':'], [Character that separates PATH elements.])
+
+dnl Everybody supports this, except MS-DOS.
+AC_DEFINE(subprocesses, 1, [Define to enable asynchronous subprocesses.])
+
+AC_DEFINE(USER_FULL_NAME, [pw->pw_gecos], [How to get a user's full name.])
+
+
+AC_DEFINE(DIRECTORY_SEP, ['/'],
+ [Character that separates directories in a file name.])
+
+dnl Only used on MS platforms.
+AH_TEMPLATE(DEVICE_SEP, [Character that separates a device in a file name.])
+
+AC_DEFINE(IS_DEVICE_SEP(_c_), 0,
+ [Returns true if character is a device separator.])
+
+AC_DEFINE(IS_DIRECTORY_SEP(_c_), [((_c_) == DIRECTORY_SEP)],
+ [Returns true if character is a directory separator.])
+
+dnl On MS, this also accepts IS_DEVICE_SEP.
+AC_DEFINE(IS_ANY_SEP(_c_), [(IS_DIRECTORY_SEP (_c_))],
+ [Returns true if character is any form of separator.])
+
+
+AH_TEMPLATE(NO_EDITRES, [Define if XEditRes should not be used.])
case $opsys in
- darwin | gnu | hpux* | *bsd )
- AC_DEFINE(NO_TERMIO, 1, [Define if termio.h should not be included.])
- ;;
+ aix4-2)
+ dnl Unfortunately without libXmu we cannot support EditRes.
+ if test x$ac_cv_lib_Xmu_XmuConvertStandardSelection != xyes; then
+ AC_DEFINE(NO_EDITRES, 1)
+ fi
+ ;;
+
+ hpux*)
+ dnl Assar Westerlund <assar@sics.se> says this is necessary for
+ dnl HP-UX 10.20, and that it works for HP-UX 0 as well.
+ AC_DEFINE(NO_EDITRES, 1)
+ ;;
esac
-dnl SIGIO exists, but the feature doesn't work in the way Emacs needs.
-dnl See eg <http://article.gmane.org/gmane.os.openbsd.ports/46831>.
+
case $opsys in
+ irix6-5 | sol2* | unixware )
+ dnl Some SVr4s don't define NSIG in sys/signal.h for ANSI environments;
+ dnl instead, there's a system variable _sys_nsig. Unfortunately, we
+ dnl need the constant to dimension an array. So wire in the appropriate
+ dnl value here.
+ AC_DEFINE(NSIG_MINIMUM, 32, [Minimum value of NSIG.])
+ ;;
+esac
+
+emacs_broken_SIGIO=no
+
+case $opsys in
+ dnl SIGIO exists, but the feature doesn't work in the way Emacs needs.
+ dnl See eg <http://article.gmane.org/gmane.os.openbsd.ports/46831>.
hpux* | irix6-5 | openbsd | sol2* | unixware )
- AC_DEFINE(BROKEN_SIGIO, 1, [Define if SIGIO should not be used.])
- ;;
+ emacs_broken_SIGIO=yes
+ ;;
+
+ aix4-2)
+ dnl On AIX Emacs uses the gmalloc.c malloc implementation. But given
+ dnl the way this system works, libc functions that return malloced
+ dnl memory use the libc malloc implementation. Calling xfree or
+ dnl xrealloc on the results of such functions results in a crash.
+ dnl
+ dnl One solution for this could be to define SYSTEM_MALLOC in configure,
+ dnl but that does not currently work on this system.
+ dnl
+ dnl It is possible to completely override the malloc implementation on
+ dnl AIX, but that involves putting the malloc functions in a shared
+ dnl library and setting the MALLOCTYPE environment variable to point to
+ dnl that shared library.
+ dnl
+ dnl Emacs currently calls xrealloc on the results of get_current_dir name,
+ dnl to avoid a crash just use the Emacs implementation for that function.
+ dnl
+ dnl FIXME We could change the AC_CHECK_FUNCS call near the start
+ dnl of this file, so that we do not check for get_current_dir_name
+ dnl on AIX. But that might be fragile if something else ends
+ dnl up testing for get_current_dir_name as a dependency.
+ AC_DEFINE(BROKEN_GET_CURRENT_DIR_NAME, 1, [Define if
+ get_current_dir_name should not be used.])
+ ;;
+
+ freebsd)
+ dnl Circumvent a bug in FreeBSD. In the following sequence of
+ dnl writes/reads on a PTY, read(2) returns bogus data:
+ dnl
+ dnl write(2) 1022 bytes
+ dnl write(2) 954 bytes, get EAGAIN
+ dnl read(2) 1024 bytes in process_read_output
+ dnl read(2) 11 bytes in process_read_output
+ dnl
+ dnl That is, read(2) returns more bytes than have ever been written
+ dnl successfully. The 1033 bytes read are the 1022 bytes written
+ dnl successfully after processing (for example with CRs added if the
+ dnl terminal is set up that way which it is here). The same bytes will
+ dnl be seen again in a later read(2), without the CRs.
+ AC_DEFINE(BROKEN_PTY_READ_AFTER_EAGAIN, 1, [Define on FreeBSD to
+ work around an issue when reading from a PTY.])
+ ;;
esac
case $opsys in
dnl
dnl Define INTERRUPT_INPUT to make interrupt_input = 1 the default (use SIGIO)
dnl
-dnl Emacs uses the presence or absence of the SIGIO and BROKEN_SIGIO macros
+dnl Emacs uses the presence of the USABLE_SIGIO macro
dnl to indicate whether or not signal-driven I/O is possible. It uses
dnl INTERRUPT_INPUT to decide whether to use it by default.
dnl
esac
+dnl Used in process.c, this must be a loop, even if it only runs once.
+dnl (Except on SGI; see below. Take that, clarity and consistency!)
+AH_TEMPLATE(PTY_ITERATION, [How to iterate over PTYs.])
+dnl Only used if !PTY_ITERATION. Iterate from FIRST_PTY_LETTER to z,
+dnl trying suffixes 0-16.
+AH_TEMPLATE(FIRST_PTY_LETTER, [Letter to use in finding device name of
+ first PTY, if PTYs are supported.])
+AH_TEMPLATE(PTY_OPEN, [How to open a PTY, if non-standard.])
+AH_TEMPLATE(PTY_NAME_SPRINTF, [How to get the device name of the control
+ end of a PTY, if non-standard.])
+AH_TEMPLATE(PTY_TTY_NAME_SPRINTF, [How to get device name of the tty
+ end of a PTY, if non-standard.])
+
+case $opsys in
+ aix4-2 )
+ AC_DEFINE(PTY_ITERATION, [int c; for (c = 0; !c ; c++)])
+ dnl You allocate a pty by opening /dev/ptc to get the master side.
+ dnl To get the name of the slave side, you just ttyname() the master side.
+ AC_DEFINE(PTY_NAME_SPRINTF, [strcpy (pty_name, "/dev/ptc");])
+ AC_DEFINE(PTY_TTY_NAME_SPRINTF, [strcpy (pty_name, ttyname (fd));])
+ ;;
+
+ cygwin )
+ AC_DEFINE(PTY_ITERATION, [int i; for (i = 0; i < 1; i++)])
+ dnl multi-line AC_DEFINEs are hard. :(
+ AC_DEFINE(PTY_OPEN, [ do { int dummy; sigset_t blocked, procmask; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, &procmask); if (-1 == openpty (&fd, &dummy, pty_name, 0, 0)) fd = -1; pthread_sigmask (SIG_SETMASK, &procmask, 0); if (fd >= 0) emacs_close (dummy); } while (0)])
+ AC_DEFINE(PTY_NAME_SPRINTF, [])
+ 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 (0)])
+ AC_DEFINE(PTY_NAME_SPRINTF, [])
+ AC_DEFINE(PTY_TTY_NAME_SPRINTF, [])
+ ;;
+
+ gnu | openbsd )
+ AC_DEFINE(FIRST_PTY_LETTER, ['p'])
+ ;;
+
+ gnu-linux | gnu-kfreebsd | freebsd | netbsd )
+ 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.])
+ AC_DEFINE(PTY_ITERATION, [int i; for (i = 0; i < 1; i++)])
+ dnl Note that grantpt and unlockpt may fork. We must block SIGCHLD
+ dnl to prevent sigchld_handler from intercepting the child's death.
+ AC_DEFINE(PTY_TTY_NAME_SPRINTF, [{ char *ptyname = 0; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); if (grantpt (fd) != -1 && unlockpt (fd) != -1) ptyname = ptsname(fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (!ptyname) { close (fd); return -1; } snprintf (pty_name, sizeof pty_name, "%s", ptyname); }])
+ dnl if HAVE_POSIX_OPENPT
+ if test "x$ac_cv_func_posix_openpt" = xyes; then
+ AC_DEFINE(PTY_OPEN, [fd = posix_openpt (O_RDWR | O_NOCTTY)])
+ AC_DEFINE(PTY_NAME_SPRINTF, [])
+ dnl if HAVE_GETPT
+ elif test "x$ac_cv_func_getpt" = xyes; then
+ AC_DEFINE(PTY_OPEN, [fd = getpt ()])
+ AC_DEFINE(PTY_NAME_SPRINTF, [])
+ else
+ AC_DEFINE(PTY_NAME_SPRINTF, [strcpy (pty_name, "/dev/ptmx");])
+ fi
+ else
+ AC_DEFINE(FIRST_PTY_LETTER, ['p'])
+ fi
+ ;;
+
+ hpux*)
+ AC_DEFINE(FIRST_PTY_LETTER, ['p'])
+ AC_DEFINE(PTY_NAME_SPRINTF, [sprintf (pty_name, "/dev/ptym/pty%c%x", c, i);])
+ AC_DEFINE(PTY_TTY_NAME_SPRINTF, [sprintf (pty_name, "/dev/pty/tty%c%x", c, i);])
+ ;;
+
+ irix6-5 )
+ dnl It looks like this cannot be right, because it is not a loop.
+ dnl However, process.c actually does this:
+ dnl # ifndef __sgi
+ dnl continue;
+ dnl # else
+ dnl return -1;
+ dnl # endif
+ dnl which presumably makes it OK, since irix == sgi (?).
+ dnl FIXME it seems like this special treatment is unnecessary?
+ dnl Why can't irix use a single-trip loop like eg cygwin?
+ AC_DEFINE(PTY_ITERATION, [])
+ dnl Not used, because PTY_ITERATION is defined.
+ AC_DEFINE(FIRST_PTY_LETTER, ['q'])
+ AC_DEFINE(PTY_OPEN, [ { struct sigaction ocstat, cstat; struct stat stb; char * name; sigemptyset(&cstat.sa_mask); cstat.sa_handler = SIG_DFL; cstat.sa_flags = 0; sigaction(SIGCLD, &cstat, &ocstat); name = _getpty (&fd, O_RDWR | O_NDELAY, 0600, 0); sigaction(SIGCLD, &ocstat, (struct sigaction *)0); if (name == 0) return -1; if (fd < 0) return -1; if (fstat (fd, &stb) < 0) return -1; strcpy (pty_name, name); }])
+ dnl No need to get the pty name at all.
+ AC_DEFINE(PTY_NAME_SPRINTF, [])
+ dnl No need to use sprintf to get the tty name--we get that from _getpty.
+ AC_DEFINE(PTY_TTY_NAME_SPRINTF, [])
+ ;;
+
+ sol2* )
+ dnl On SysVr4, grantpt(3) forks a subprocess, so keep sigchld_handler()
+ dnl from intercepting that death. If any child but grantpt's should die
+ dnl within, it should be caught after sigrelse(2).
+ AC_DEFINE(PTY_TTY_NAME_SPRINTF, [{ char *ptsname (int), *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1 || unlockpt (fd) == -1 || !(ptyname = ptsname (fd))) { emacs_close (fd); return -1; } snprintf (pty_name, sizeof pty_name, "%s", ptyname); }])
+ ;;
+
+ unixware )
+ dnl Comments are as per sol2*.
+ AC_DEFINE(PTY_TTY_NAME_SPRINTF, [{ char *ptsname (int), *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1) fatal("could not grant slave pty"); if (unlockpt(fd) == -1) fatal("could not unlock slave pty"); if (!(ptyname = ptsname(fd))) fatal ("could not enable slave pty"); snprintf (pty_name, sizeof pty_name, "%s", ptyname); }])
+ ;;
+esac
+
+
+case $opsys in
+ sol2* | unixware )
+ dnl This change means that we don't loop through allocate_pty too
+ dnl many times in the (rare) event of a failure.
+ AC_DEFINE(FIRST_PTY_LETTER, ['z'])
+ AC_DEFINE(PTY_NAME_SPRINTF, [strcpy (pty_name, "/dev/ptmx");])
+ dnl Push various streams modules onto a PTY channel. Used in process.c.
+ AC_DEFINE(SETUP_SLAVE_PTY, [if (ioctl (xforkin, I_PUSH, "ptem") == -1) fatal ("ioctl I_PUSH ptem"); if (ioctl (xforkin, I_PUSH, "ldterm") == -1) fatal ("ioctl I_PUSH ldterm"); if (ioctl (xforkin, I_PUSH, "ttcompat") == -1) fatal ("ioctl I_PUSH ttcompat");], [How to set up a slave PTY, if needed.])
+ ;;
+esac
+
+
AH_TEMPLATE(SIGNALS_VIA_CHARACTERS, [Make process_send_signal work by
"typing" a signal character on the pty.])
AC_DEFINE(SIGNALS_VIA_CHARACTERS, 1)
;;
- dnl 21 Jun 06: Eric Hanchrow <offby1@blarg.net> says this works.
+ dnl 21 Jun 06: Eric Hanchrow <offby1@blarg.net> says this works.
dnl FIXME Does gnu-kfreebsd have linux/version.h? It seems unlikely...
gnu-linux | gnu-kfreebsd )
dnl Used in dispnew.c
AH_TEMPLATE(PENDING_OUTPUT_COUNT, [Number of chars of output in the
-buffer of a stdio stream.])
+ buffer of a stdio stream.])
-dnl FIXME just PENDING_OUTPUT_COUNT should suffice.
-AH_TEMPLATE(GNU_LIBRARY_PENDING_OUTPUT_COUNT, [Value of
-PENDING_OUTPUT_COUNT if using the GNU C library.])
+AC_MSG_CHECKING([whether we are using the GNU C library])
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
+#include <features.h>
+#ifndef __GNU_LIBRARY__
+# error "this is not the GNU C library"
+#endif
+ ]], [[]])], emacs_glibc=yes, emacs_glibc=no)
+AC_MSG_RESULT([$emacs_glibc])
-case $opsys in
- cygwin | darwin | freebsd | netbsd | openbsd )
- AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->_p - (FILE)->_bf._base)])
- ;;
+if test $emacs_glibc = yes; then
- unixware)
- AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->__ptr - (FILE)->__base)])
- ;;
+ emacs_pending_output=unknown
- gnu | gnu-linux | gnu-kfreebsd )
- AC_MSG_CHECKING([for style of pending output formalism])
- dnl In autoconf 2.67 (?) and later, we could use a single test
- dnl since the preprocessed output is accessible in "conftest.i".
- AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
+ case $opsys in
+ gnu | gnu-linux | gnu-kfreebsd )
+ AC_MSG_CHECKING([for style of pending output formalism])
+ dnl In autoconf 2.67 and later, we could use a single test
+ dnl since the preprocessed output is accessible in "conftest.i".
+ AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
#include <stdio.h>
#if !defined (_IO_STDIO_H) && !defined (_STDIO_USES_IOSTREAM)
# error "stdio definitions not found"
#endif
- ]], [[]])], emacs_pending_output=new, emacs_pending_output=unknown)
+ ]], [[]])], emacs_pending_output=new, [])
if test $emacs_pending_output = unknown; then
case $opsys in
case $emacs_pending_output in
new)
dnl New C libio names.
- AC_DEFINE(GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE),
+ AC_DEFINE(PENDING_OUTPUT_COUNT(FILE),
[((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)])
;;
uclibc)
dnl Using the uClibc library.
- AC_DEFINE(GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE),
+ AC_DEFINE(PENDING_OUTPUT_COUNT(FILE),
[((FILE)->__bufpos - (FILE)->__bufstart)])
;;
old)
dnl Old C++ iostream names.
- AC_DEFINE(GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE),
+ AC_DEFINE(PENDING_OUTPUT_COUNT(FILE),
[((FILE)->_pptr - (FILE)->_pbase)])
;;
esac
;;
-esac
+ esac dnl opsys
+
+ if test $emacs_pending_output = unknown; then
+ AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->__bufp - (FILE)->__buffer)])
+ fi
+
+else dnl !emacs_glibc
+
+ case $opsys in
+ cygwin | darwin | freebsd | netbsd | openbsd )
+ AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->_p - (FILE)->_bf._base)])
+ ;;
+
+ unixware)
+ AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->__ptr - (FILE)->__base)])
+ ;;
+
+ *)
+ dnl HAVE_STDIO_EXT_H && HAVE___FPENDING
+ if test x$ac_cv_header_stdio_ext_h = xyes && \
+ test x$ac_cv_func___fpending = xyes; then
+ AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [__fpending (FILE)])
+ AC_DEFINE(DISPNEW_NEEDS_STDIO_EXT, 1,
+ [Define if dispnew.c should include stdio_ext.h.])
+ else
+ AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->_ptr - (FILE)->_base)])
+ fi
+ ;;
+ esac
+fi dnl emacs_glibc
dnl Used in vm-limit.c
;;
esac
+
+AH_TEMPLATE(ULIMIT_BREAK_VALUE, [Undocumented.])
+AH_TEMPLATE(TAB3, [Undocumented.])
+
case $opsys in
- gnu) opsysfile="s/bsd-common.h" ;;
-
- gnu-kfreebsd) opsysfile="s/gnu-linux.h" ;;
-
- hpux11)
- dnl See comments in sysdep.c:sys_signal.
- dnl SA_RESTART resets the timeout of `select' on hpux11.
- dnl Defining BROKEN_SA_RESTART is not the same as undef'ing SA_RESTART.
- AC_DEFINE(BROKEN_SA_RESTART, 1, [Define if SA_RESTART should only
- be used in batch mode.])
- dnl It works to open the pty's tty in the parent (Emacs), then
- dnl close and reopen it in the child.
- AC_DEFINE(USG_SUBTTY_WORKS, 1, [Define for USG systems where it
- works to open a pty's tty in the parent process, then close and
- reopen it in the child.])
-
- opsysfile="s/hpux10-20.h"
- ;;
+ darwin) AC_DEFINE(TAB3, OXTABS) ;;
- openbsd) opsysfile="s/netbsd.h" ;;
+ gnu | freebsd | netbsd | openbsd )
+ AC_DEFINE(TABDLY, OXTABS, [Undocumented.])
+ AC_DEFINE(TAB3, OXTABS)
+ ;;
- sol2-10)
- AC_DEFINE(_STRUCTURED_PROC, 1, [Needed for system_process_attributes
- on Solaris.])
- opsysfile="s/sol2-6.h"
- ;;
+ gnu-linux | gnu-kfreebsd )
+ dnl libc-linux/sysdeps/linux/i386/ulimit.c says that due to shared
+ dnl library, we cannot get the maximum address for brk.
+ AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
+#ifndef __i386__
+# error "not i386"
+#endif
+ ]], [[]])], AC_DEFINE(ULIMIT_BREAK_VALUE, [(32*1024*1024)]), [])
+
+ AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
+#ifndef __ia64__
+# error "not ia64"
+#endif
+ ]], [[]])], AC_DEFINE(GC_MARK_SECONDARY_STACK(),
+ [do { extern void *__libc_ia64_register_backing_store_base; __builtin_ia64_flushrs (); mark_memory (__libc_ia64_register_backing_store_base, __builtin_ia64_bsp ());} while (0)],
+ [Mark a secondary stack, like the register stack on the ia64.]), [])
+ ;;
+
+ hpux*)
+ AC_DEFINE(RUN_TIME_REMAP, 1, [Define if emacs.c needs to call
+ run_time_remap; for HPUX.])
+ ;;
+
+ irix6-5)
+ dnl Ulimit(UL_GMEMLIM) is busted...
+ AC_DEFINE(ULIMIT_BREAK_VALUE, [0x14000000])
+ ;;
+esac
+
+
+dnl These won't be used automatically yet. We also need to know, at least,
+dnl that the stack is continuous.
+AH_TEMPLATE(GC_SETJMP_WORKS, [Define if setjmp is known to save all
+ registers relevant for conservative garbage collection in the jmp_buf.])
+
+AH_TEMPLATE(GC_MARK_STACK, [Define to GC_USE_GCPROS_AS_BEFORE if
+ conservative garbage collection is not known to work.])
+
+
+case $opsys in
+ aix4-2 | hpux* | unixware)
+ dnl Conservative garbage collection has not been tested, so for now
+ dnl play it safe and stick with the old-fashioned way of marking.
+ AC_DEFINE(GC_MARK_STACK, [GC_USE_GCPROS_AS_BEFORE])
+ ;;
+
+ dnl Not all the architectures are tested, but there are Debian packages
+ dnl for SCM and/or Guile on them, so the technique must work. See also
+ dnl comments in alloc.c concerning setjmp and gcc.
+ dnl Fixme: it's probably safe to just use the GCC conditional below.
+ gnu-linux | gnu-kfreebsd )
+ AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
+#if defined __i386__ || defined __sparc__ || defined __mc68000__ \
+ || defined __alpha__ || defined __mips__ || defined __s390__ \
+ || defined __arm__ || defined __powerpc__ || defined __amd64__ \
+ || defined __ia64__ || defined __sh__
+/* ok */
+#else
+# error "setjmp not known to work on this arch"
+#endif
+ ]], [[]])], AC_DEFINE(GC_SETJMP_WORKS, 1),
+ AC_DEFINE(GC_MARK_STACK, [GC_USE_GCPROS_AS_BEFORE]) )
+ ;;
+esac
+
+
+if test x$GCC = xyes; then
+ dnl GC_SETJMP_WORKS is nearly always appropriate for GCC.
+ AC_DEFINE(GC_SETJMP_WORKS, 1)
+else
+ case $opsys in
+ dnl irix: Tested on Irix 6.5. SCM worked on earlier versions.
+ freebsd | netbsd | openbsd | irix6-5 | sol2* )
+ AC_DEFINE(GC_SETJMP_WORKS, 1)
+ ;;
+ esac
+fi dnl GCC?
+
+AC_CACHE_CHECK([for _setjmp], [emacs_cv_func__setjmp],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <setjmp.h>
+ ]],
+ [[jmp_buf j;
+ if (! _setjmp (j))
+ _longjmp (j, 1);]])],
+ [emacs_cv_func__setjmp=yes],
+ [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
+
+case $opsys in
+ sol2* | unixware )
+ dnl TIOCGPGRP is broken in SysVr4, so we can't send signals to PTY
+ dnl subprocesses the usual way. But TIOCSIGNAL does work for PTYs,
+ dnl and this is all we need.
+ AC_DEFINE(TIOCSIGSEND, TIOCSIGNAL, [Some platforms redefine this.])
+ ;;
+esac
+
+
+case $opsys in
+ hpux* | sol2* )
+ dnl Used in xfaces.c.
+ AC_DEFINE(XOS_NEEDS_TIME_H, 1, [Compensate for a bug in Xos.h on
+ some systems, where it requires time.h.])
+ ;;
+esac
+
+
+dnl Define symbols to identify the version of Unix this is.
+dnl Define all the symbols that apply correctly.
+AH_TEMPLATE(BSD4_2, [Define if the system is compatible with BSD 4.2.])
+AH_TEMPLATE(BSD_SYSTEM, [Define if the system is compatible with BSD 4.2.])
+AH_TEMPLATE(DOS_NT, [Define if the system is MS DOS or MS Windows.])
+AH_TEMPLATE(MSDOS, [Define if the system is MS DOS.])
+AH_TEMPLATE(USG, [Define if the system is compatible with System III.])
+AH_TEMPLATE(USG5, [Define if the system is compatible with System V.])
+AH_TEMPLATE(USG5_4, [Define if the system is compatible with System V Release 4.])
+
+case $opsys in
+ aix4-2)
+ AC_DEFINE(USG, [])
+ AC_DEFINE(USG5, [])
+ dnl This symbol should be defined on AIX Version 3 ???????
+ AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
+#ifndef _AIX
+# error "_AIX not defined"
+#endif
+ ]], [[]])], [], AC_DEFINE(_AIX, [], [Define if the system is AIX.]))
+ ;;
+
+ cygwin)
+ AC_DEFINE(CYGWIN, 1, [Define if the system is Cygwin.])
+ ;;
+
+ darwin)
+ dnl BSD4_3 and BSD4_4 are already defined in sys/param.h.
+ AC_DEFINE(BSD4_2, [])
+ AC_DEFINE(BSD_SYSTEM, [])
+ dnl More specific than the above two. We cannot use __APPLE__ as this
+ dnl may not be defined on non-OSX Darwin, and we cannot define DARWIN
+ dnl here because Panther and lower CoreFoundation.h uses DARWIN to
+ dnl distinguish OS X from pure Darwin.
+ AC_DEFINE(DARWIN_OS, [], [Define if the system is Darwin.])
+ ;;
+
+ freebsd)
+ AC_DEFINE(BSD4_2, [])
+ dnl Hack to avoid calling AC_PREPROC_IFELSE multiple times.
+ dnl Would not be needed with autoconf >= 2.67, where the
+ dnl preprocessed output is accessible in "conftest.i".
+ AC_DEFINE(BSD_SYSTEM_AHB, 1, [Define if AH_BOTTOM should change BSD_SYSTEM.])
+ ;;
+
+ gnu | netbsd | openbsd )
+ AC_DEFINE(BSD4_2, [])
+ AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
+#ifndef BSD_SYSTEM
+# error "BSD_SYSTEM not defined"
+#endif
+ ]], [[]])], [], AC_DEFINE(BSD_SYSTEM, 43) )
+ ;;
+
+ gnu-linux | gnu-kfreebsd )
+ AC_DEFINE(USG, [])
+ AC_DEFINE(GNU_LINUX, [], [Define if ths system is compatible with GNU/Linux.])
+ ;;
+
+ hpux*)
+ AC_DEFINE(USG, [])
+ AC_DEFINE(USG5, [])
+ AC_DEFINE(HPUX, [], [Define if the system is HPUX.])
+ ;;
+
+ irix6-5)
+ AC_DEFINE(USG, [])
+ AC_DEFINE(USG5, [])
+ AC_DEFINE(USG5_4, [])
+ AC_DEFINE(IRIX6_5, [], [Define if the system is IRIX.])
+ ;;
+
+ sol2*)
+ AC_DEFINE(USG, [])
+ AC_DEFINE(USG5, [])
+ AC_DEFINE(USG5_4, [])
+ AC_DEFINE(SOLARIS2, [], [Define if the system is Solaris.])
+ ;;
+
+ unixware)
+ AC_DEFINE(USG, [])
+ AC_DEFINE(USG5, [])
+ AC_DEFINE(USG5_4, [])
+ ;;
+esac
+
+AC_CACHE_CHECK([for usable FIONREAD], [emacs_cv_usable_FIONREAD],
+ [case $opsys in
+ aix4-2)
+ dnl BUILD 9008 - FIONREAD problem still exists in X-Windows.
+ emacs_cv_usable_FIONREAD=no
+ ;;
+
+ *)
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <sys/types.h>
+ #include <sys/ioctl.h>
+ #ifdef USG5_4
+ # include <sys/filio.h>
+ #endif
+ ]],
+ [[int foo = ioctl (0, FIONREAD, &foo);]])],
+ [emacs_cv_usable_FIONREAD=yes],
+ [emacs_cv_usable_FIONREAD=no])
+ ;;
+ esac])
+if test $emacs_cv_usable_FIONREAD = yes; then
+ AC_DEFINE([USABLE_FIONREAD], [1], [Define to 1 if FIONREAD is usable.])
+
+ if test $emacs_broken_SIGIO = no; then
+ AC_CACHE_CHECK([for usable SIGIO], [emacs_cv_usable_SIGIO],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <fcntl.h>
+ #include <signal.h>
+ ]],
+ [[int foo = SIGIO | F_SETFL | FASYNC;]])],
+ [emacs_cv_usable_SIGIO=yes],
+ [emacs_cv_usable_SIGIO=no])],
+ [emacs_cv_usable_SIGIO=yes],
+ [emacs_cv_usable_SIGIO=no])
+ if test $emacs_cv_usable_SIGIO = yes; then
+ AC_DEFINE([USABLE_SIGIO], [1], [Define to 1 if SIGIO is usable.])
+ fi
+ fi
+fi
+
+
+case $opsys in
+ dnl Emacs supplies its own malloc, but glib (part of Gtk+) calls
+ dnl memalign and on Cygwin, that becomes the Cygwin-supplied memalign.
+ dnl As malloc is not the Cygwin malloc, the Cygwin memalign always
+ dnl returns ENOSYS. A workaround is to set G_SLICE=always-malloc. */
+ cygwin)
+ AC_DEFINE(G_SLICE_ALWAYS_MALLOC, 1, [Define to set the
+ G_SLICE environment variable to "always-malloc" at startup, if
+ using GTK.])
+ ;;
+
+ hpux11)
+ dnl It works to open the pty's tty in the parent (Emacs), then
+ dnl close and reopen it in the child.
+ AC_DEFINE(USG_SUBTTY_WORKS, 1, [Define for USG systems where it
+ works to open a pty's tty in the parent process, then close and
+ reopen it in the child.])
+ ;;
+
+ irix6-5)
+ AC_DEFINE(PREFER_VSUSP, 1, [Define if process_send_signal should
+ use VSUSP instead of VSWTCH.])
+ AC_DEFINE(SETPGRP_RELEASES_CTTY, 1, [Define if process.c:child_setup
+ should not call setpgrp.])
+ ;;
+
+ sol2-10)
+ AC_DEFINE(_STRUCTURED_PROC, 1, [Needed for system_process_attributes
+ on Solaris.])
+ ;;
esac
# Set up the CFLAGS for real compilation, so we can substitute it.
version=$PACKAGE_VERSION
+copyright="Copyright (C) 2012 Free Software Foundation, Inc."
+AC_DEFINE_UNQUOTED(COPYRIGHT, ["$copyright"],
+ [Short copyright string for this version of Emacs.])
+AC_SUBST(copyright)
+
### Specify what sort of things we'll be editing into Makefile and config.h.
### Use configuration here uncanonicalized to avoid exceeding size limits.
AC_SUBST(version)
AC_SUBST(CFLAGS)
## Used in lwlib/Makefile.in.
AC_SUBST(X_TOOLKIT_TYPE)
-if test -n "${opsysfile}"; then
- S_FILE="\$(srcdir)/${opsysfile}"
-else
- S_FILE=
-fi
-AC_SUBST(S_FILE)
AC_SUBST(ns_appdir)
AC_SUBST(ns_appbindir)
AC_SUBST(ns_appresdir)
AC_SUBST(GNU_OBJC_CFLAGS)
AC_SUBST(OTHER_FILES)
+if test -n "${term_header}"; then
+ AC_DEFINE_UNQUOTED(TERM_HEADER, "${term_header}",
+ [Define to the header for the built-in window system.])
+fi
+
AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "${canonical}",
[Define to the canonical Emacs configuration name.])
AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${ac_configure_args}",
[Define to the options passed to configure.])
-if test -n "$opsysfile"; then
- AC_DEFINE_UNQUOTED(config_opsysfile, "${opsysfile}",
- [Define to the used os dependent file.])
-fi
+AH_TEMPLATE(config_opsysfile, [Some platforms that do not use configure
+ define this to include extra configuration information.])
XMENU_OBJ=
XOBJ=
AC_DEFINE(HAVE_X_WINDOWS, 1,
[Define to 1 if you want to use the X window system.])
XMENU_OBJ=xmenu.o
- XOBJ="xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o xsettings.o xgselect.o"
+ XOBJ="xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o xgselect.o"
FONT_OBJ=xfont.o
if test "$HAVE_XFT" = "yes"; then
FONT_OBJ="$FONT_OBJ ftfont.o xftfont.o ftxfont.o"
AC_SUBST(PRE_ALLOC_OBJ)
AC_SUBST(POST_ALLOC_OBJ)
+# 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
+# pkg-config stuff) and lib-src (which does not). For example, gnulib
+# may need to determine whether LIB_CLOCK_GETTIME should contain -lrt,
+# and it therefore needs to run in an environment where LIBS does not
+# already contain -lrt merely because 'pkg-config --libs' printed '-lrt'
+# for some package unrelated to lib-src.
+SAVE_CFLAGS=$CFLAGS
+SAVE_LIBS=$LIBS
+CFLAGS=$pre_PKG_CONFIG_CFLAGS
+LIBS="$LIB_PTHREAD $pre_PKG_CONFIG_LIBS"
+gl_ASSERT_NO_GNULIB_POSIXCHECK
+gl_ASSERT_NO_GNULIB_TESTS
+gl_INIT
+CFLAGS=$SAVE_CFLAGS
+LIBS=$SAVE_LIBS
+
case "$opsys" in
aix4-2) LD_SWITCH_SYSTEM_TEMACS="-Wl,-bnodelcsect" ;;
fi dnl if $GCC
AC_SUBST(LIB_GCC)
-
-## If we're using X11/GNUstep, define some consequences.
-if test "$HAVE_X_WINDOWS" = "yes" || test "$HAVE_NS" = "yes"; then
+## Common for all window systems
+if test "$window_system" != "none"; 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.])
+ WINDOW_SYSTEM_OBJ="fontset.o fringe.o image.o"
fi
+AC_SUBST(WINDOW_SYSTEM_OBJ)
AH_TOP([/* GNU Emacs site configuration template file.
#define EMACS_CONFIG_H
])dnl
-AH_BOTTOM([
-/* On AIX 3 this must be included before any other include file. */
-#include <alloca.h>
-#if ! HAVE_ALLOCA
-# error "alloca not available on this machine"
-#endif
-
-/* Define AMPERSAND_FULL_NAME if you use the convention
- that & in the full name stands for the login id. */
-/* Turned on June 1996 supposing nobody will mind it. */
-#define AMPERSAND_FULL_NAME
-
-/* `subprocesses' should be defined if you want to
- have code for asynchronous subprocesses
- (as used in M-x compile and M-x shell).
- Only MSDOS does not support this (it overrides
- this in its config_opsysfile below). */
-
-#define subprocesses
-
-/* Include the os dependent file. */
-#ifdef config_opsysfile
-# include config_opsysfile
-#endif
-
-/* GNUstep needs a bit more pure memory. Of the existing knobs,
- SYSTEM_PURESIZE_EXTRA seems like the least likely to cause problems.
- (There is probably a better place to do this, but right now the
- Cocoa side does this in s/darwin.h and we cannot parallel this
- exactly since GNUstep is multi-OS. */
-#if defined HAVE_NS && defined NS_IMPL_GNUSTEP
-# define SYSTEM_PURESIZE_EXTRA 30000
-#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
-#define RE_TRANSLATE(TBL, C) CHAR_TABLE_TRANSLATE (TBL, C)
-#ifdef make_number
-/* If make_number is a macro, use it. */
-#define RE_TRANSLATE_P(TBL) (!EQ (TBL, make_number (0)))
-#else
-/* If make_number is a function, avoid it. */
-#define RE_TRANSLATE_P(TBL) (!(INTEGERP (TBL) && XINT (TBL) == 0))
-#endif
-#endif
-
-#include <string.h>
-#include <stdlib.h>
-
-#if __GNUC__ >= 3 /* On GCC 3.0 we might get a warning. */
-#define NO_INLINE __attribute__((noinline))
-#else
-#define NO_INLINE
-#endif
-
-#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))
-#define EXTERNALLY_VISIBLE __attribute__((externally_visible))
-#else
-#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
-
-#define ATTRIBUTE_CONST _GL_ATTRIBUTE_CONST
-
-/* Some versions of GNU/Linux define noinline in their headers. */
-#ifdef noinline
-#undef noinline
-#endif
-
-/* These won't be used automatically yet. We also need to know, at least,
- that the stack is continuous. */
-#ifdef __GNUC__
-# ifndef GC_SETJMP_WORKS
- /* GC_SETJMP_WORKS is nearly always appropriate for GCC. */
-# define GC_SETJMP_WORKS 1
-# endif
-#endif
+AH_BOTTOM([#include <conf_post.h>
#endif /* EMACS_CONFIG_H */
Configured for \`${canonical}'.
Where should the build process find the source code? ${srcdir}
- What operating system file should Emacs use? ${opsysfile-none}
What compiler should emacs be built with? ${CC} ${CFLAGS}
Should Emacs use the GNU version of malloc? ${GNU_MALLOC}${GNU_MALLOC_reason}
Should Emacs use a relocating allocator for buffers? ${REL_ALLOC}
test "${exec_prefix}" != NONE &&
exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`]
+if test "$HAVE_NS" = "yes"; then
+ if test "$NS_IMPL_GNUSTEP" = yes; then
+ AC_CONFIG_FILES([nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist:nextstep/templates/Info-gnustep.plist.in \
+ nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop:nextstep/templates/Emacs.desktop.in])
+ else
+ AC_CONFIG_FILES([nextstep/Cocoa/Emacs.base/Contents/Info.plist:nextstep/templates/Info.plist.in \
+ nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings:nextstep/templates/InfoPlist.strings.in])
+ fi
+fi
+
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 (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"
+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 nextstep/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])
+ leim/Makefile nextstep/Makefile])
dnl test/ is not present in release tarfiles.
opt_makefile=test/automated/Makefile
dnl the use of force in the `epaths-force' rule in Makefile.in.
AC_CONFIG_COMMANDS([epaths], [
echo creating src/epaths.h
-${MAKE-make} epaths-force
+${MAKE-make} MAKEFILE_NAME=do-not-make-Makefile epaths-force
], [GCC="$GCC" CPPFLAGS="$CPPFLAGS"])
AC_CONFIG_COMMANDS([gdbinit], [