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([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])
+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 ;;
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'
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)]])],
W32_LIBS=
if test "${with_w32}" != no; then
if test "${opsys}" != "cygwin"; then
- AC_MSG_ERROR([Using w32 with an autotools build is only supported for Cygwin.])
+ 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"
- W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32"
- W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool"
+ 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)
### 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
- USE_GTK_TOOLKIT="GTK3"
- 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" &&
- { test "$with_gtk" = yes || test "$with_gtk2" = "yes"; }
- then
- AC_MSG_ERROR($gtk3_pkg_errors$GTK_PKG_ERRORS)
+ 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
- test "$pkg_check_gtk" = "yes" && USE_GTK_TOOLKIT="GTK2"
fi
if test x"$pkg_check_gtk" = xyes; then
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)
hpux* | aix4-2 )
test "X$ac_cv_lib_Xmu_XmuConvertStandardSelection" != "Xyes" && LIBXMU=
;;
+ mingw32 )
+ LIBXMU=
+ ;;
esac
AC_SUBST(LIBXMU)
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"; then
+if test "${HAVE_W32}" = "yes" && test "${opsys}" = "cygwin"; then
if test "${with_xpm}" != "no"; then
SAVE_CPPFLAGS="$CPPFLAGS"
SAVE_LDFLAGS="$LDFLAGS"
fi
if test "${HAVE_XPM}" = "yes"; then
- AC_DEFINE(HAVE_XPM, 1, [Define to 1 if you have the Xpm libary (-lXpm).])
+ AC_DEFINE(HAVE_XPM, 1, [Define to 1 if you have the Xpm library (-lXpm).])
LIBXPM=-lXpm
fi
fi
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" || test "${HAVE_W32}" = "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" || test "${HAVE_W32}" = "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" || test "${HAVE_W32}" = "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" \
+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.
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 \
+getrusage get_current_dir_name \
+lrand48 \
fpathconf select getpagesize setlocale \
-utimes getrlimit setrlimit setpgid getcwd shutdown getaddrinfo \
-__fpending strsignal setitimer \
+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_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_DEVICE_SEP(_c_), 0,
- [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_DIRECTORY_SEP(_c_), [((_c_) == DIRECTORY_SEP)],
- [Returns true if character is a directory 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_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
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>
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)
## 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