dnl along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
AC_PREREQ(2.65)
-AC_INIT(emacs, 24.2.50)
+AC_INIT(emacs, 24.3.50)
AC_CONFIG_HEADER(src/config.h:src/config.in)
AC_CONFIG_SRCDIR(src/lisp.h)
AC_CONFIG_AUX_DIR(build-aux)
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
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([w32], [use native MS Windows GUI in a Cygwin build])
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])
## Make sure CDPATH doesn't affect cd (in case PWD is relative).
unset CDPATH
case "${srcdir}" in
- /* ) ;;
+ [[\\/]]* | ?:[[\\/]]*) ;;
. )
## We may be able to use the $PWD environment variable to make this
## absolute. But sometimes PWD is inaccurate.
case "${canonical}" in
*-cygwin ) opsys=cygwin ;;
*-darwin* ) opsys=darwin ;;
+ *-mingw32 )
+ opsys=mingw32
+ CFLAGS="-mtune=pentium4 $CFLAGS"
+ ;;
*-sysv4.2uw* ) opsys=unixware ;;
*-sysv5uw* ) opsys=unixware ;;
*-sysv5OpenUNIX* ) opsys=unixware ;;
test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS"
fi
+# Avoid gnulib's tests for O_NOATIME and O_NOFOLLOW, as we don't use them.
+AC_DEFUN([gl_FCNTL_O_FLAGS])
+# Avoid gnulib's threadlib module, as we do threads our own way.
+AC_DEFUN([gl_THREADLIB])
+
# Initialize gnulib right after choosing the compiler.
+dnl Amongst other things, this sets AR and ARFLAGS.
gl_EARLY
# It's helpful to have C macros available to GDB, so prefer -g3 to -g
if test -n "$emacs_g3_CFLAGS"; then
emacs_save_CFLAGS=$CFLAGS
CFLAGS=$emacs_g3_CFLAGS
+ if test $opsys = mingw32; then
+ CFLAGS="$CFLAGS -gdwarf-2"
+ fi
AC_CACHE_CHECK([whether $CC accepts $emacs_g3_CFLAGS],
[emacs_cv_prog_cc_g3],
[AC_LINK_IFELSE([AC_LANG_PROGRAM()],
AH_VERBATIM([FORTIFY_SOURCE],
[/* Enable compile-time and run-time bounds-checking, and some warnings,
without upsetting glibc 2.15+. */
- #if defined __OPTIMIZE__ && __OPTIMIZE__
+ #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
# define _FORTIFY_SOURCE 2
#endif
])
UNEXEC_OBJ=unexelf.o
case "$opsys" in
# MSDOS uses unexcoff.o
- # MSWindows uses unexw32.o
aix4-2)
UNEXEC_OBJ=unexaix.o
;;
hpux10-20 | hpux11)
UNEXEC_OBJ=unexhp9k800.o
;;
+ mingw32)
+ UNEXEC_OBJ=unexw32.o
+ ;;
sol2-10)
# Use the Solaris dldump() function, called from unexsol.c, to dump
# emacs, instead of the generic ELF dump code found in unexelf.c.
## additional optimization. --nils@exp-math.uni-essen.de
test "$opsys" = "aix4.2" && test "x$GCC" != "xyes" && \
C_SWITCH_SYSTEM="-ma -qmaxmem=4000"
+test "$opsys" = "mingw32" && C_SWITCH_SYSTEM="-DUSE_CRT_DLL=1 -I../nt/inc"
## gnu-linux might need -D_BSD_SOURCE on old libc5 systems.
## It is redundant in glibc2, since we define _GNU_SOURCE.
AC_SUBST(C_SWITCH_SYSTEM)
LIB_STANDARD=-lc
START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o'
;;
+ mingw32 )
+ LIB_MATH=
+ ;;
dnl NB this may be adjusted below.
netbsd | openbsd )
LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o'
$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)
fi
])
+test "$opsys" = "mingw32" && with_sound=no
if test "${with_sound}" != "no"; then
# Sound support for GNU/Linux and the free BSDs.
dnl checks for header files
AC_CHECK_HEADERS_ONCE(
linux/version.h sys/systeminfo.h
- stdio_ext.h fcntl.h coff.h pty.h
+ fcntl.h coff.h pty.h
sys/vlimit.h sys/resource.h
- sys/utsname.h pwd.h utmp.h dirent.h util.h)
+ sys/utsname.h pwd.h utmp.h util.h)
AC_MSG_CHECKING(if personality LINUX32 can be set)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/personality.h>]], [[personality (PER_LINUX32)]])],
dnl it doesn't define `bool'.
AC_CHECK_HEADERS(term.h, , , -)
AC_HEADER_TIME
-AC_CHECK_DECLS([sys_siglist])
+AC_CHECK_DECLS([sys_siglist], [], [], [[#include <signal.h>
+ ]])
if test $ac_cv_have_decl_sys_siglist != yes; then
# For Tru64, at least:
- AC_CHECK_DECLS([__sys_siglist])
+ AC_CHECK_DECLS([__sys_siglist], [], [], [[#include <signal.h>
+ ]])
if test $ac_cv_have_decl___sys_siglist = yes; then
AC_DEFINE(sys_siglist, __sys_siglist,
[Define to any substitute for sys_siglist.])
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)"
AC_CHECK_HEADER([AppKit/AppKit.h], [HAVE_NS=yes],
[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>],
+ [
+#ifdef MAC_OS_X_VERSION_MAX_ALLOWED
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
+ ; /* OK */
+#else
+#error "OSX 10.4 or newer required"
+#endif
+#endif
+ ])],
+ ns_osx_have_104=yes,
+ ns_osx_have_104=no)
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
fi
+
AC_SUBST(TEMACS_LDFLAGS2)
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
leimdir="\${ns_appresdir}/leim"
INSTALL_ARCH_INDEP_EXTRA=
fi
- ns_frag=$srcdir/src/ns.mk
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)
+
+HAVE_W32=no
+W32_OBJ=
+W32_LIBS=
+if test "${with_w32}" != no; then
+ if test "${opsys}" != "cygwin"; then
+ if test "${opsys}" != "mingw32"; then
+ AC_MSG_ERROR([Using w32 with an autotools build is only supported for Cygwin and MinGW32.])
+ fi
+ fi
+ AC_CHECK_HEADER([windows.h], [HAVE_W32=yes],
+ [AC_MSG_ERROR([`--with-w32' was specified, but windows.h
+ cannot be found.])])
+fi
+if test "${opsys}" = "mingw32"; then
+ AC_CHECK_HEADER([windows.h], [HAVE_W32=yes],
+ [AC_MSG_ERROR([The windows.h header file is required,
+ but cannot be found.])])
+fi
+
+if test "${HAVE_W32}" = "yes"; then
+ AC_DEFINE(HAVE_NTGUI, 1, [Define to use native MS Windows GUI.])
+ W32_OBJ="w32fns.o w32menu.o w32reg.o w32font.o w32term.o"
+ W32_OBJ="$W32_OBJ w32xfns.o w32select.o w32uniscribe.o"
+ if test "${opsys}" = "cygwin"; then
+ W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32"
+ W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool"
+ else
+ W32_OBJ="$W32_OBJ w32.o w32console.o w32heap.o w32inevt.o w32proc.o"
+ W32_LIBS="$W32_LIBS -lwinmm -ladvapi32 -lgdi32 -lcomdlg32 -luser32"
+ W32_LIBS="$W32_LIBS -lmpr -lshell32 -lwinspool -lole32 -lcomctl32 -lusp10"
+ fi
+fi
+AC_SUBST(W32_OBJ)
+AC_SUBST(W32_LIBS)
+
+if test "${HAVE_W32}" = "yes"; then
+ window_system=w32
+ with_xft=no
+fi
## $window_system is now set to the window system we will
## ultimately use.
nextstep )
term_header=nsterm.h
;;
+ w32 )
+ term_header=w32term.h
+ ;;
esac
if test -n "${term_header}"; then
### Use -lrsvg-2 if available, unless `--with-rsvg=no' is specified.
HAVE_RSVG=no
-if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes"; then
+if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" || test "${opsys}" = "mingw32"; then
if test "${with_rsvg}" != "no"; then
RSVG_REQUIRED=2.11.0
RSVG_MODULE="librsvg-2.0 >= $RSVG_REQUIRED"
GTK_OBJ=
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 "$with_gtk3" = "yes"; then
- AC_MSG_ERROR($GTK_PKG_ERRORS)
- fi
- 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 "
+if test "${opsys}" != "mingw32"; then
+ 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 "$with_gtk3" = "yes"; then
+ AC_MSG_ERROR($GTK_PKG_ERRORS)
+ fi
+ 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
+ USE_GTK_TOOLKIT="GTK3"
+ else
+ check_gtk2=yes
+ gtk3_pkg_errors="$GTK_PKG_ERRORS "
+ fi
fi
-fi
-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"
+ 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"; then
- if test "$USE_X_TOOLKIT" = "maybe" || test "$with_gtk" = "yes" || test "$with_gtk2" = "yes"; then
- AC_MSG_ERROR($gtk3_pkg_errors$GTK_PKG_ERRORS)
- fi
+ 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 "$with_gtk" = yes || test "$with_gtk2" = "yes"; }
+ then
+ AC_MSG_ERROR($gtk3_pkg_errors$GTK_PKG_ERRORS)
+ fi
+ test "$pkg_check_gtk" = "yes" && USE_GTK_TOOLKIT="GTK2"
fi
fi
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
+
+ # Windows loads GnuTLS dynamically
+ if test "${opsys}" = "mingw32"; then
+ LIBGNUTLS_LIBS=
+ fi
fi
AC_SUBST(LIBGNUTLS_LIBS)
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,
hpux* | aix4-2 )
test "X$ac_cv_lib_Xmu_XmuConvertStandardSelection" != "Xyes" && LIBXMU=
;;
+ mingw32 )
+ LIBXMU=
+ ;;
esac
AC_SUBST(LIBXMU)
elif test "${HAVE_NS}" = "yes"; then
AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
USE_TOOLKIT_SCROLL_BARS=yes
+ elif test "${HAVE_W32}" = "yes"; then
+ AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
+ USE_TOOLKIT_SCROLL_BARS=yes
fi
fi
AC_SUBST(M17N_FLT_LIBS)
### Use -lXpm if available, unless `--with-xpm=no'.
+### mingw32 doesn't use -lXpm, since it loads the library dynamically.
HAVE_XPM=no
LIBXPM=
+if test "${HAVE_W32}" = "yes" && test "${opsys}" = "cygwin"; then
+ if test "${with_xpm}" != "no"; then
+ SAVE_CPPFLAGS="$CPPFLAGS"
+ SAVE_LDFLAGS="$LDFLAGS"
+ CPPFLAGS="$CPPFLAGS -I/usr/include/noX"
+ LDFLAGS="$LDFLAGS -L/usr/lib/noX"
+ AC_CHECK_HEADER(X11/xpm.h,
+ [AC_CHECK_LIB(Xpm, XpmReadFileToImage, HAVE_XPM=yes)])
+ if test "${HAVE_XPM}" = "yes"; then
+ AC_MSG_CHECKING(for XpmReturnAllocPixels preprocessor define)
+ AC_EGREP_CPP(no_return_alloc_pixels,
+ [#include "X11/xpm.h"
+#ifndef XpmReturnAllocPixels
+no_return_alloc_pixels
+#endif
+ ], HAVE_XPM=no, HAVE_XPM=yes)
+
+ if test "${HAVE_XPM}" = "yes"; then
+ REAL_CPPFLAGS="$REAL_CPPFLAGS -I/usr/include/noX"
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ CPPFLAGS="$SAVE_CPPFLAGS"
+ LDFLAGS="$SAVE_LDFLAGS"
+ fi
+ fi
+ fi
+
+ if test "${HAVE_XPM}" = "yes"; then
+ AC_DEFINE(HAVE_XPM, 1, [Define to 1 if you have the Xpm library (-lXpm).])
+ LIBXPM=-lXpm
+ fi
+fi
+
if test "${HAVE_X11}" = "yes"; then
if test "${with_xpm}" != "no"; then
AC_CHECK_HEADER(X11/xpm.h,
LIBXPM=-lXpm
fi
fi
+
+if test "${opsys}" = "mingw32"; then
+ if test "${with_xpm}" != "no"; then
+ AC_CHECK_HEADERS(X11/xpm.h, HAVE_XPM=yes, HAVE_XPM=no, [
+#define FOR_MSW 1])
+ fi
+
+ if test "${HAVE_XPM}" = "yes"; then
+ AC_DEFINE(HAVE_XPM, 1, [Define to 1 if you have the Xpm library (-lXpm).])
+ fi
+fi
+
AC_SUBST(LIBXPM)
### Use -ljpeg if available, unless `--with-jpeg=no'.
+### mingw32 doesn't use -ljpeg, since it loads the library dynamically.
HAVE_JPEG=no
LIBJPEG=
-if test "${HAVE_X11}" = "yes"; then
+if test "${opsys}" = "mingw32"; then
if test "${with_jpeg}" != "no"; then
dnl Checking for jpeglib.h can lose because of a redefinition of
- dnl HAVE_STDLIB_H.
- AC_CHECK_HEADER(jerror.h,
- [AC_CHECK_LIB(jpeg, jpeg_destroy_compress, HAVE_JPEG=yes)])
+ dnl HAVE_STDLIB_H.
+ AC_CHECK_HEADER(jerror.h, HAVE_JPEG=yes, HAVE_JPEG=no)
fi
-
AH_TEMPLATE(HAVE_JPEG, [Define to 1 if you have the jpeg library (-ljpeg).])dnl
if test "${HAVE_JPEG}" = "yes"; then
AC_DEFINE(HAVE_JPEG)
[AC_MSG_WARN([libjpeg found, but not version 6b or later])
HAVE_JPEG=no])
fi
+elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
+ if test "${with_jpeg}" != "no"; then
+ dnl Checking for jpeglib.h can lose because of a redefinition of
+ dnl HAVE_STDLIB_H.
+ AC_CHECK_HEADER(jerror.h,
+ [AC_CHECK_LIB(jpeg, jpeg_destroy_compress, HAVE_JPEG=yes)])
+ fi
+
+ AH_TEMPLATE(HAVE_JPEG, [Define to 1 if you have the jpeg library (-ljpeg).])dnl
+ if test "${HAVE_JPEG}" = "yes"; then
+ AC_DEFINE(HAVE_JPEG)
+ AC_EGREP_CPP([version= *(6[2-9]|[7-9][0-9])],
+ [#include <jpeglib.h>
+ version=JPEG_LIB_VERSION
+],
+ [AC_DEFINE(HAVE_JPEG)],
+ [AC_MSG_WARN([libjpeg found, but not version 6b or later])
+ HAVE_JPEG=no])
+ fi
if test "${HAVE_JPEG}" = "yes"; then
LIBJPEG=-ljpeg
fi
AC_SUBST(LIBJPEG)
### Use -lpng if available, unless `--with-png=no'.
+### mingw32 doesn't use -lpng, since it loads the library dynamically.
HAVE_PNG=no
LIBPNG=
-if test "${HAVE_X11}" = "yes"; then
+if test "${opsys}" = "mingw32"; then
+ if test "${with_png}" != "no"; then
+ AC_CHECK_HEADER(png.h, HAVE_PNG=yes, HAVE_PNG=no)
+ fi
+ if test "${HAVE_PNG}" = "yes"; then
+ AC_DEFINE(HAVE_PNG, 1, [Define to 1 if you have the png library (-lpng).])
+
+ AC_CHECK_DECL(png_longjmp,
+ [],
+ [AC_DEFINE(PNG_DEPSTRUCT, [],
+ [Define to empty to suppress deprecation warnings when building
+ with --enable-gcc-warnings and with libpng versions before 1.5,
+ which lack png_longjmp.])],
+ [[#ifdef HAVE_LIBPNG_PNG_H
+ # include <libpng/png.h>
+ #else
+ # include <png.h>
+ #endif
+ ]])
+ fi
+elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
if test "${with_png}" != "no"; then
# Debian unstable as of July 2003 has multiple libpngs, and puts png.h
# in /usr/include/libpng.
AC_SUBST(LIBPNG)
### Use -ltiff if available, unless `--with-tiff=no'.
+### mingw32 doesn't use -ltiff, since it loads the library dynamically.
HAVE_TIFF=no
LIBTIFF=
-if test "${HAVE_X11}" = "yes"; then
+if test "${opsys}" = "mingw32"; then
+ if test "${with_tiff}" != "no"; then
+ AC_CHECK_HEADER(tiffio.h, HAVE_TIFF=yes, HAVE_TIFF=no)
+ fi
+ if test "${HAVE_TIFF}" = "yes"; then
+ AC_DEFINE(HAVE_TIFF, 1, [Define to 1 if you have the tiff library (-ltiff).])
+ fi
+elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
if test "${with_tiff}" != "no"; then
AC_CHECK_HEADER(tiffio.h,
[tifflibs="-lz -lm"
AC_SUBST(LIBTIFF)
### Use -lgif or -lungif if available, unless `--with-gif=no'.
+### mingw32 doesn't use -lgif/-lungif, since it loads the library dynamically.
HAVE_GIF=no
LIBGIF=
-if test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no"; then
+if test "${opsys}" = "mingw32"; then
+ if test "${with_gif}" != "no"; then
+ AC_CHECK_HEADER(gif_lib.h, HAVE_GIF=yes, HAVE_GIF=no)
+ fi
+ if test "${HAVE_GIF}" = "yes"; then
+ AC_DEFINE(HAVE_GIF, 1, [Define to 1 if you have a gif (or ungif) library.])
+ fi
+elif test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no" \
+ || test "${HAVE_W32}" = "yes"; then
AC_CHECK_HEADER(gif_lib.h,
# EGifPutExtensionLast only exists from version libungif-4.1.0b1.
# Earlier versions can crash Emacs.
OTHER_FILES=ns-app
fi
+if test "${HAVE_W32}" = "yes"; then
+ HAVE_MENUS=yes
+fi
### Use session management (-lSM -lICE) if available
HAVE_X_SM=no
AC_SUBST(LIBXSM)
### Use libxml (-lxml2) if available
+### mingw32 doesn't use -lxml2, since it loads the library dynamically.
HAVE_LIBXML2=no
if test "${with_xml2}" != "no"; then
### I'm not sure what the version number should be, so I just guessed.
PKG_CHECK_MODULES(LIBXML2, libxml-2.0 > 2.6.17, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
if test "${HAVE_LIBXML2}" = "yes"; then
- LIBS="$LIBXML2_LIBS $LIBS"
- AC_CHECK_LIB(xml2, htmlReadMemory, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
+ if test "${opsys}" != "mingw32"; then
+ LIBS="$LIBXML2_LIBS $LIBS"
+ AC_CHECK_LIB(xml2, htmlReadMemory, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
+ else
+ LIBXML2_LIBS=""
+ fi
if test "${HAVE_LIBXML2}" = "yes"; then
AC_DEFINE(HAVE_LIBXML2, 1, [Define to 1 if you have the libxml library (-lxml2).])
else
AC_SUBST(LIBXML2_CFLAGS)
# If netdb.h doesn't declare h_errno, we must declare it by hand.
+# On MinGW, that is provided by nt/inc/sys/socket.h.
+if test "${opsys}" = "mingw32"; then
+ emacs_cv_netdb_declares_h_errno=yes
+fi
AC_CACHE_CHECK(whether netdb declares h_errno,
emacs_cv_netdb_declares_h_errno,
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]],
fi
# sqrt and other floating-point functions such as fmod and frexp
-# are found in -lm on most systems.
-AC_CHECK_LIB(m, sqrt)
+# are found in -lm on most systems, but mingw32 doesn't use -lm.
+if test "${opsys}" != "mingw32"; then
+ AC_CHECK_LIB(m, sqrt)
+fi
# Check for mail-locking functions in a "mail" library. Probably this should
# have the same check as for liblockfile below.
AC_CHECK_FUNCS(gethostname \
-closedir getrusage get_current_dir_name \
-lrand48 setsid \
-fpathconf select euidaccess getpagesize setlocale \
-utimes getrlimit setrlimit setpgid getcwd shutdown getaddrinfo \
-__fpending strsignal setitimer \
+getrusage get_current_dir_name \
+lrand48 \
+fpathconf select getpagesize setlocale \
+utimes getrlimit setrlimit getcwd shutdown getaddrinfo \
+strsignal setitimer \
sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \
gai_strerror mkstemp getline getdelim fsync sync \
difftime posix_memalign \
AC_FUNC_FSEEKO
-AC_FUNC_GETPGRP
-
# UNIX98 PTYs.
AC_CHECK_FUNCS(grantpt)
return 0;
}]])
])
-# Maybe curses should be tried earlier?
-# See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9736#35
-for tputs_library in '' tinfo ncurses terminfo termcap curses; do
- OLIBS=$LIBS
- if test -z "$tputs_library"; then
- LIBS_TERMCAP=
- msg='none required'
- else
- LIBS_TERMCAP=-l$tputs_library
- msg=$LIBS_TERMCAP
- LIBS="$LIBS_TERMCAP $LIBS"
- fi
- AC_RUN_IFELSE([tputs_link_source], [], [msg=no],
- [AC_LINK_IFELSE([tputs_link_source], [], [msg=no])])
- LIBS=$OLIBS
- if test "X$msg" != Xno; then
- break
- fi
-done
+if test "${opsys}" = "mingw32"; then
+ msg='none required'
+else
+ # Maybe curses should be tried earlier?
+ # See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9736#35
+ for tputs_library in '' tinfo ncurses terminfo termcap curses; do
+ OLIBS=$LIBS
+ if test -z "$tputs_library"; then
+ LIBS_TERMCAP=
+ msg='none required'
+ else
+ LIBS_TERMCAP=-l$tputs_library
+ msg=$LIBS_TERMCAP
+ LIBS="$LIBS_TERMCAP $LIBS"
+ fi
+ AC_RUN_IFELSE([tputs_link_source], [], [msg=no],
+ [AC_LINK_IFELSE([tputs_link_source], [], [msg=no])])
+ LIBS=$OLIBS
+ if test "X$msg" != Xno; then
+ break
+ fi
+ done
+fi
AC_MSG_RESULT([$msg])
if test "X$msg" = Xno; then
AC_MSG_ERROR([The required function `tputs' was not found in any library.
fi
;;
+ mingw32)
+ TERMINFO=no
+ LIBS_TERMCAP=
+ ;;
+
netbsd)
if test "x$LIBS_TERMCAP" != "x-lterminfo"; then
TERMINFO=no
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)
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 Every platform that uses configure, except MinGW,
dnl supports this. There is a create-lockfiles option you can
dnl customize if you do not want the lock files to be written.
dnl So it is not clear that this #define still needs to exist.
-AC_DEFINE(CLASH_DETECTION, 1, [Define if you want lock files to be written,
- so that Emacs can tell instantly when you try to modify a file that
- someone else has modified in his/her Emacs.])
+if test "${opsys}" != "mingw32"; then
+ AC_DEFINE(CLASH_DETECTION, 1, [Define if you want lock files to be written,
+ so that Emacs can tell instantly when you try to modify a file that
+ someone else has modified in his/her Emacs.])
+fi
dnl Everybody supports this, except MS.
dnl Seems like the kind of thing we should be testing for, though.
## Note: PTYs are broken on darwin <6. Use at your own risk.
-AC_DEFINE(HAVE_PTYS, 1, [Define if the system supports pty devices.])
+if test "${opsys}" != "mingw32"; then
+ AC_DEFINE(HAVE_PTYS, 1, [Define if the system supports pty devices.])
+fi
dnl Everybody supports this, except MS-DOS.
dnl Seems like the kind of thing we should be testing for, though.
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.])
+if test "${opsys}" = "mingw32"; then
+ AC_DEFINE(NULL_DEVICE, ["NUL:"], [Name of the file to open to get
+ a null file, or a data sink.])
+else
+ AC_DEFINE(NULL_DEVICE, ["/dev/null"], [Name of the file to open to get
+ a null file, or a data sink.])
+fi
-AC_DEFINE(SEPCHAR, [':'], [Character that separates PATH elements.])
+if test "${opsys}" = "mingw32"; then
+ AC_DEFINE(SEPCHAR, [';'], [Character that separates PATH elements.])
+else
+ AC_DEFINE(SEPCHAR, [':'], [Character that separates PATH elements.])
+fi
dnl Everybody supports this, except MS-DOS.
AC_DEFINE(subprocesses, 1, [Define to enable asynchronous subprocesses.])
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.])
+if test "${opsys}" = "mingw32"; then
+ dnl Only used on MS platforms.
+ AC_DEFINE(DEVICE_SEP, ':', [Character that separates a device in a file name.])
+ AC_DEFINE(IS_DEVICE_SEP(_c_), [((_c_) == DEVICE_SEP)],
+ [Returns true if character is a device separator.])
+
+ AC_DEFINE(IS_DIRECTORY_SEP(_c_), [((_c_) == '/' || (_c_) == '\\')],
+ [Returns true if character is a directory separator.])
-AC_DEFINE(IS_DEVICE_SEP(_c_), 0,
- [Returns true if character is a device separator.])
+ AC_DEFINE(IS_ANY_SEP(_c_), [(IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP(_c_))],
+ [Returns true if character is any form of separator.])
+else
+ AH_TEMPLATE(DEVICE_SEP, [Character that separates a device in a file name.])
-AC_DEFINE(IS_DIRECTORY_SEP(_c_), [((_c_) == DIRECTORY_SEP)],
- [Returns true if character is a directory separator.])
+ AC_DEFINE(IS_DEVICE_SEP(_c_), 0,
+ [Returns true if character is a device 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.])
+ AC_DEFINE(IS_DIRECTORY_SEP(_c_), [((_c_) == DIRECTORY_SEP)],
+ [Returns true if character is a directory separator.])
+ AC_DEFINE(IS_ANY_SEP(_c_), [(IS_DIRECTORY_SEP (_c_))],
+ [Returns true if character is any form of separator.])
+fi
AH_TEMPLATE(NO_EDITRES, [Define if XEditRes should not be used.])
esac
-dnl Used in dispnew.c
-AH_TEMPLATE(PENDING_OUTPUT_COUNT, [Number of chars of output in the
- buffer of a stdio stream.])
-
-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])
-
-if test $emacs_glibc = yes; then
-
- emacs_pending_output=unknown
-
- 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, [])
-
- if test $emacs_pending_output = unknown; then
- case $opsys in
- gnu-linux | gnu-kfreebsd)
- AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
-#include <stdio.h>
-#ifndef __UCLIBC__
-# error "not using uclibc"
-#endif
- ]], [[]])], emacs_pending_output=uclibc, emacs_pending_output=old)
- ;;
- esac
- fi
-
- AC_MSG_RESULT([$emacs_pending_output])
-
- case $emacs_pending_output in
- new)
- dnl New C libio names.
- AC_DEFINE(PENDING_OUTPUT_COUNT(FILE),
- [((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)])
- ;;
- uclibc)
- dnl Using the uClibc library.
- AC_DEFINE(PENDING_OUTPUT_COUNT(FILE),
- [((FILE)->__bufpos - (FILE)->__bufstart)])
- ;;
- old)
- dnl Old C++ iostream names.
- AC_DEFINE(PENDING_OUTPUT_COUNT(FILE),
- [((FILE)->_pptr - (FILE)->_pbase)])
- ;;
- 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
AH_TEMPLATE(DATA_START, [Address of the start of the data segment.])
dnl Used in lisp.h, emacs.c, mem-limits.h
_longjmp (j, 1);]])],
[emacs_cv_func__setjmp=yes],
[emacs_cv_func__setjmp=no])])
-if test $emacs_cv_func__setjmp = no; then
- AC_DEFINE([_setjmp], [setjmp],
- [Define to setjmp if _setjmp and _longjmp do not work. See _longjmp.])
- AC_DEFINE([_longjmp], [longjmp],
- [Define to longjmp if _setjmp and _longjmp do not work.
- Because longjmp may alter signal masks, callers of _longjmp
- should not assume that it leaves signal masks alone.])
+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
AC_DEFINE(IRIX6_5, [], [Define if the system is IRIX.])
;;
+ mingw32)
+ AC_DEFINE(DOS_NT, [])
+ AC_DEFINE(WINDOWSNT, 1, [Define if compiling for native MS Windows.])
+ ;;
+
sol2*)
AC_DEFINE(USG, [])
AC_DEFINE(USG5, [])
emacs_cv_usable_FIONREAD=no
;;
+ mingw32)
+ emacs_cv_usable_FIONREAD=yes
+ ;;
+
*)
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <sys/types.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
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)
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(RALLOC_OBJ)
if test "$opsys" = "cygwin"; then
- CYGWIN_OBJ="sheap.o"
+ CYGWIN_OBJ="sheap.o cygw32.o"
## Cygwin differs because of its unexec().
PRE_ALLOC_OBJ=
POST_ALLOC_OBJ=lastfile.o
+elif test "$opsys" = "mingw32"; then
+ CYGWIN_OBJ=
+ PRE_ALLOC_OBJ=
+ POST_ALLOC_OBJ=lastfile.o
else
CYGWIN_OBJ=
PRE_ALLOC_OBJ=lastfile.o
## It seems clearer therefore to put this piece in LD_SWITCH_SYSTEM_TEMACS.
gnu*) LD_SWITCH_SYSTEM_TEMACS="\$(LD_SWITCH_X_SITE_RPATH)" ;;
+ mingw32)
+ LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000 -Wl,-heap,0x00100000 -Wl,-image-base,0x01000000 -Wl,-subsystem,console -Wl,-entry,__start -Wl,-Map,./temacs.map"
+ ;;
+
*) LD_SWITCH_SYSTEM_TEMACS= ;;
esac
ORDINARY_LINK=
case "$opsys" in
## gnu: GNU needs its own crt0.
- aix4-2|cygwin|darwin|gnu|hpux*|irix6-5|sol2*|unixware) ORDINARY_LINK=yes ;;
+ aix4-2|cygwin|darwin|gnu|hpux*|irix6-5|mingw32|sol2*|unixware) ORDINARY_LINK=yes ;;
## On post 1.3 releases of NetBSD, gcc -nostdlib also clears the
## library search parth, i.e. it won't search /usr/lib for libc and
#### It makes printing result more understandable as using GTK sets
#### toolkit_scroll_bars to yes by default.
if test "${HAVE_GTK}" = "yes"; then
- if test "${with_gtk3}" = "yes"; then
- USE_X_TOOLKIT=GTK3
- else
- USE_X_TOOLKIT=GTK
- fi
+ USE_X_TOOLKIT="$USE_GTK_TOOLKIT"
fi
echo "
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