AC_PREREQ(2.65)
AC_INIT(emacs, 24.3.50)
+dnl Set emacs_config_options to the options of 'configure', quoted for the shell,
+dnl and then quoted again for a C string. Separate options with spaces.
+dnl Add some environment variables, if they were passed via the environment
+dnl rather than on the command-line.
+emacs_config_options=
+optsep=
dnl This is the documented way to record the args passed to configure,
dnl rather than $ac_configure_args.
-emacs_config_options="$@"
-## Add some environment variables, if they were passed via the environment
-## rather than on the command-line.
-for var in CFLAGS CPPFLAGS LDFLAGS; do
- case "$emacs_config_options" in
- *$var=*) continue ;;
- esac
- eval val="\$${var}"
- test x"$val" = x && continue
- emacs_config_options="${emacs_config_options}${emacs_config_options:+ }$var=\"$val\""
+for opt in ${1+"$@"} CFLAGS CPPFLAGS LDFLAGS; do
+ case $opt in
+ -n | --no-create | --no-recursion)
+ continue ;;
+ CFLAGS | CPPFLAGS | LDFLAGS)
+ eval 'test "${'$opt'+set}" = set' || continue
+ case " $*" in
+ *" $opt="*) continue ;;
+ esac
+ eval opt=$opt=\$$opt ;;
+ esac
+
+ emacs_shell_specials=$IFS\''"#$&()*;<>?@<:@\\`{|~'
+ case $opt in
+ *[["$emacs_shell_specials"]]*)
+ case $opt in
+ *\'*)
+ emacs_quote_apostrophes="s/'/'\\\\''/g"
+ opt=`AS_ECHO(["$opt"]) | sed "$emacs_quote_apostrophes"` ;;
+ esac
+ opt="'$opt'"
+ case $opt in
+ *[['"\\']]*)
+ emacs_quote_for_c='s/[["\\]]/\\&/g; $!s/$/\\n\\/'
+ opt=`AS_ECHO(["$opt"]) | sed "$emacs_quote_for_c"` ;;
+ esac ;;
+ esac
+ AS_VAR_APPEND([emacs_config_options], ["$optsep$opt"])
+ optsep=' '
done
AC_CONFIG_HEADER(src/config.h:src/config.in)
lisppath='${locallisppath}:${standardlisppath}'
etcdir='${datadir}/emacs/${version}/etc'
archlibdir='${libexecdir}/emacs/${version}/${configuration}'
-docdir='${datadir}/emacs/${version}/etc'
+etcdocdir='${datadir}/emacs/${version}/etc'
gamedir='${localstatedir}/games/emacs'
dnl Special option to disable the most of other options.
AC_DEFINE_UNQUOTED(MAILHOST, ["$withval"], [String giving fallback POP mail host.]))
AC_ARG_WITH([sound],[AS_HELP_STRING([--with-sound=VALUE],
- [compile with sound support (VALUE one of: yes, ossaudio, alsa, no;
+ [compile with sound support (VALUE one of: yes, alsa, oss, bsd-ossaudio, no;
default yes). Only for GNU/Linux, FreeBSD, NetBSD, MinGW.])],
[ case "${withval}" in
- yes|no|ossaudio|alsa) val=$withval ;;
+ yes|no|alsa|oss|bsd-ossaudio) val=$withval ;;
*) AC_MSG_ERROR([`--with-sound=$withval' is invalid;
-this option's value should be `yes', `no', `ossaudio', or `alsa'.])
+this option's value should be `yes', `no', `alsa', `oss', or `bsd-ossaudio'.])
;;
esac
with_sound=$val
OPTION_DEFAULT_ON([gsettings],[don't compile with GSettings support])
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])
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)])],
## This is an option because I do not know if all info/man support
## compressed files, nor how to test if they do so.
-OPTION_DEFAULT_ON([compress-info],[don't compress the installed Info pages])
-if test $with_compress_info = yes; then
- GZIP_INFO=yes
-else
- GZIP_INFO=
-fi
-AC_SUBST(GZIP_INFO)
+OPTION_DEFAULT_ON([compress-install],
+ [don't compress some files (.el, .info, etc.) when installing. Equivalent to:
+make GZIP_PROG= install])
AC_ARG_WITH([pkg-config-prog],dnl
[AS_HELP_STRING([--with-pkg-config-prog=FILENAME],
# The following line should be removable at some point.
nw="$nw -Wsuggest-attribute=pure"
+ # This part is merely for shortening the command line,
+ # since -Wno-FOO needs to be added below regardless.
+ nw="$nw -Wmissing-field-initializers"
+ nw="$nw -Wswitch"
+ nw="$nw -Wtype-limits"
+ nw="$nw -Wunused-parameter"
+
# clang is unduly picky about some things.
AC_CACHE_CHECK([whether the compiler is clang], [emacs_cv_clang],
[AC_COMPILE_IFELSE(
dnl Don't use GZIP, which is used by gzip for additional parameters.
AC_PATH_PROG(GZIP_PROG, gzip)
+test $with_compress_install != yes && test -n "$GZIP_PROG" && \
+ GZIP_PROG=" # $GZIP_PROG # (disabled by configure --without-compress-install)"
+
if test $opsys = gnu-linux; then
AC_PATH_PROG(PAXCTL, paxctl,,
[$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/sbin])
AC_SUBST(INFO_EXT)
AC_SUBST(INFO_OPTS)
+if test $opsys = mingw32; then
+ DOCMISC_W32=efaq-w32
+else
+ DOCMISC_W32=
+fi
+AC_SUBST(DOCMISC_W32)
+
dnl Add our options to ac_link now, after it is set up.
if test x$GCC = xyes; then
dnl Treat GCC specially since it just gives a non-fatal `unrecognized option'
dnl if not built to support GNU ld.
-late_LDFLAGS=$LDFLAGS
+dnl For a long time, -znocombreloc was added to LDFLAGS rather than
+dnl LD_SWITCH_SYSTEM_TEMACS. That is:
+dnl * inappropriate, as LDFLAGS is a user option but this is essential.
+dnl Eg "make LDFLAGS=... all" could run into problems,
+dnl http://bugs.debian.org/684788
+dnl * unnecessary, since temacs is the only thing that actually needs it.
+dnl Indeed this is where it was originally, prior to:
+dnl http://lists.gnu.org/archive/html/emacs-pretest-bug/2004-03/msg00170.html
+late_LDFLAGS="$LDFLAGS"
if test x$GCC = xyes; then
- LDFLAGS="$LDFLAGS -Wl,-znocombreloc"
+ LDFLAGS_NOCOMBRELOC="-Wl,-znocombreloc"
else
- LDFLAGS="$LDFLAGS -znocombreloc"
+ LDFLAGS_NOCOMBRELOC="-znocombreloc"
fi
+LDFLAGS="$LDFLAGS $LDFLAGS_NOCOMBRELOC"
+
AC_MSG_CHECKING([for -znocombreloc])
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
[AC_MSG_RESULT(yes)],
- LDFLAGS=$late_LDFLAGS
+ LDFLAGS_NOCOMBRELOC=
[AC_MSG_RESULT(no)])
+LDFLAGS="$late_LDFLAGS"
dnl The function dump-emacs will not be defined and temacs will do
dnl (load "loadup") automatically unless told otherwise.
#include <windows.h>
#endif
])
- if test "${with_sound}" = "ossaudio" || test "${with_sound}" = "yes"; then
+ test "${with_sound}" = "oss" && test "${have_sound_header}" != "yes" && \
+ AC_MSG_ERROR([OSS sound support requested but not found.])
+
+ if test "${with_sound}" = "bsd-ossaudio" || test "${with_sound}" = "yes"; then
# Emulation library used on NetBSD.
AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBSOUND=-lossaudio, LIBSOUND=)
- test "${with_sound}" = "ossaudio" && test -z "$LIBSOUND" && \
- AC_MSG_ERROR([ossaudio sound support requested but not found.])
- dnl FIXME? If we did find ossaudio, should we set with_sound=ossaudio?
+ test "${with_sound}" = "bsd-ossaudio" && test -z "$LIBSOUND" && \
+ AC_MSG_ERROR([bsd-ossaudio sound support requested but not found.])
+ dnl FIXME? If we did find ossaudio, should we set with_sound=bsd-ossaudio?
dnl Traditionally, we go on to check for alsa too. Does that make sense?
fi
AC_SUBST(LIBSOUND)
[AC_MSG_ERROR([`--with-ns' was specified, but the include
files are missing or cannot be compiled.])])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AppKit/AppKit.h>],
+ macfont_file=""
+ if test "${NS_IMPL_COCOA}" = "yes"; then
+ AC_MSG_CHECKING([for OSX 10.4 or newer])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AppKit/AppKit.h>],
[
#ifdef MAC_OS_X_VERSION_MAX_ALLOWED
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
])],
ns_osx_have_104=yes,
ns_osx_have_104=no)
+ AC_MSG_RESULT([$ns_osx_have_104])
+
+ if test $ns_osx_have_104 = no; then
+ AC_MSG_ERROR([`OSX 10.4 or newer is required']);
+ fi
+ AC_MSG_CHECKING([for OSX 10.5 or newer])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AppKit/AppKit.h>],
+ [
+#ifdef MAC_OS_X_VERSION_MAX_ALLOWED
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
+ ; /* OK */
+#else
+#error "OSX 10.5 not found"
+#endif
+#endif
+ ])],
+ ns_osx_have_105=yes,
+ ns_osx_have_105=no)
+ AC_MSG_RESULT([$ns_osx_have_105])
+ if test $ns_osx_have_105 = yes; then
+ macfont_file="macfont.o"
+ fi
+ fi
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <Foundation/NSObjCRuntime.h>],
[NSInteger i;])],
ns_have_nsinteger=yes,
ns_have_nsinteger=no)
- if test $ns_osx_have_104 = no; then
- AC_MSG_ERROR([`OSX 10.4 or newer is required']);
- fi
if test $ns_have_nsinteger = yes; then
AC_DEFINE(NS_HAVE_NSINTEGER, 1, [Define to 1 if `NSInteger' is defined.])
fi
dnl This one isn't really used, only archlibdir is.
libexecdir="\${ns_appbindir}/libexec"
archlibdir="\${ns_appbindir}/libexec"
- docdir="\${ns_appresdir}/etc"
+ etcdocdir="\${ns_appresdir}/etc"
etcdir="\${ns_appresdir}/etc"
dnl FIXME maybe set datarootdir instead.
dnl That would also get applications, icons, man.
leimdir="\${ns_appresdir}/leim"
INSTALL_ARCH_INDEP_EXTRA=
fi
- NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o"
+
+ NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o $macfont_file"
fi
CFLAGS="$tmp_CFLAGS"
CPPFLAGS="$tmp_CPPFLAGS"
## $window_system is now set to the window system we will
## ultimately use.
+if test "$window_system" = none && test "$gl_gcc_warnings" = yes; then
+ # Too many warnings for now.
+ nw=
+ nw="$nw -Wsuggest-attribute=const"
+ nw="$nw -Wsuggest-attribute=noreturn"
+ gl_MANYWARN_COMPLEMENT([WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
+
+ gl_WARN_ADD([-Wno-unused-variable])
+ gl_WARN_ADD([-Wno-unused-but-set-variable])
+ gl_WARN_ADD([-Wno-unused-but-set-parameter])
+fi
+
term_header=
HAVE_X_WINDOWS=no
HAVE_X11=no
SAVE_LIBS="$LIBS"
CFLAGS="$SETTINGS_CFLAGS $CFLAGS"
LIBS="$SETTINGS_LIBS $LIBS"
- AC_CHECK_FUNCS([g_type_init])
CFLAGS="$SAVE_CFLAGS"
LIBS="$SAVE_LIBS"
fi
fi
AC_SUBST(LIBPNG)
+HAVE_ZLIB=no
+LIBZ=
+if test "${with_zlib}" != "no"; then
+ OLIBS=$LIBS
+ AC_SEARCH_LIBS([inflateEnd], [z], [HAVE_ZLIB=yes])
+ LIBS=$OLIBS
+ case $ac_cv_search_inflateEnd in
+ -*) LIBZ=$ac_cv_search_inflateEnd ;;
+ esac
+fi
+if test "${HAVE_ZLIB}" = "yes"; then
+ AC_DEFINE([HAVE_ZLIB], 1, [Define to 1 if you have the zlib library (-lz).])
+ ### mingw32 doesn't use -lz, since it loads the library dynamically.
+ if test "${opsys}" = "mingw32"; then
+ LIBZ=
+ fi
+fi
+AC_SUBST(LIBZ)
+
+
### Use -ltiff if available, unless `--with-tiff=no'.
### mingw32 doesn't use -ltiff, since it loads the library dynamically.
HAVE_TIFF=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 | gnu-kfreebsd )
+ hpux* | irix6-5 | openbsd | sol2* | unixware )
emacs_broken_SIGIO=yes
;;
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) { emacs_close (fd); return -1; } snprintf (pty_name, PTY_NAME_SIZE, "%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_CLOEXEC | O_NOCTTY)])
+ AC_DEFINE(PTY_OPEN, [do { fd = posix_openpt (O_RDWR | O_CLOEXEC | O_NOCTTY); if (fd < 0 && errno == EINVAL) fd = posix_openpt (O_RDWR | O_NOCTTY); } while (0)])
AC_DEFINE(PTY_NAME_SPRINTF, [])
dnl if HAVE_GETPT
elif test "x$ac_cv_func_getpt" = xyes; then
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. */
+ dnl Emacs supplies its own malloc, but glib calls posix_memalign,
+ dnl and on Cygwin prior to version 1.7.24 that becomes the
+ dnl Cygwin-supplied posix_memalign. As malloc is not the Cygwin
+ dnl malloc, the Cygwin posix_memalign always returns ENOSYS. A
+ dnl workaround is to set G_SLICE=always-malloc. This is no longer
+ dnl needed starting with cygwin-1.7.24, and it is no longer
+ dnl effective starting with glib-2.36. */
cygwin)
AC_DEFINE(G_SLICE_ALWAYS_MALLOC, 1, [Define to set the
- G_SLICE environment variable to "always-malloc" at startup, if
- using GTK.])
+ G_SLICE environment variable to "always-malloc" at startup.])
;;
hpux11)
AC_SUBST(x_default_search_path)
AC_SUBST(etcdir)
AC_SUBST(archlibdir)
-AC_SUBST(docdir)
+AC_SUBST(etcdocdir)
AC_SUBST(bitmapdir)
AC_SUBST(gamedir)
AC_SUBST(gameuser)
AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "${canonical}",
[Define to the canonical Emacs configuration name.])
-dnl Replace any embedded " characters (bug#13274).
-emacs_config_options=`echo "$emacs_config_options " | sed -e 's/--no-create //' -e 's/--no-recursion //' -e 's/ *$//' -e "s/\"/'/g"`
AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${emacs_config_options}",
[Define to the options passed to configure.])
AH_TEMPLATE(config_opsysfile, [Some platforms that do not use configure
esac
fi
+LD_SWITCH_SYSTEM_TEMACS="$LDFLAGS_NOCOMBRELOC $LD_SWITCH_SYSTEM_TEMACS"
+
AC_SUBST(LD_SWITCH_SYSTEM_TEMACS)
## MinGW-specific post-link processing of temacs.
echo " Does Emacs use -lm17n-flt? ${HAVE_M17N_FLT}"
echo " Does Emacs use -lotf? ${HAVE_LIBOTF}"
echo " Does Emacs use -lxft? ${HAVE_XFT}"
+echo " Does Emacs directly use zlib? ${HAVE_ZLIB}"
echo " Does Emacs use toolkit scroll bars? ${USE_TOOLKIT_SCROLL_BARS}"
echo
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])
+ ns_check_file=Resources/Info-gnustep.plist
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])
+ ns_check_file=Contents/Info.plist
fi
+ AC_SUBST(ns_check_file)
fi
dnl Obviously there is duplication here wrt $SUBDIR_MAKEFILES.