aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2012-11-23 17:22:47 +0200
committerEli Zaretskii2012-11-23 17:22:47 +0200
commitfb0862b2cdc9adca81238329d20b460fe4fc9303 (patch)
tree1ac91715250abdb6ee33e25e9a0ef2e9d459c9c0
parent1235f93957aaf92f6248d6f8e1a1cc47c5ad3c66 (diff)
downloademacs-fb0862b2cdc9adca81238329d20b460fe4fc9303.tar.gz
emacs-fb0862b2cdc9adca81238329d20b460fe4fc9303.zip
configure.ac done, not tested yet.
-rw-r--r--configure.ac311
1 files changed, 225 insertions, 86 deletions
diff --git a/configure.ac b/configure.ac
index 3094a10a5fc..0db26fb2d9f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -524,7 +524,10 @@ case "${canonical}" in
524 case "${canonical}" in 524 case "${canonical}" in
525 *-cygwin ) opsys=cygwin ;; 525 *-cygwin ) opsys=cygwin ;;
526 *-darwin* ) opsys=darwin ;; 526 *-darwin* ) opsys=darwin ;;
527 *-mingw32 ) opsys=mingw32 ;; 527 *-mingw32 )
528 opsys=mingw32
529 CFLAGS="-mtune=pentium4 $CFLAGS"
530 ;;
528 *-sysv4.2uw* ) opsys=unixware ;; 531 *-sysv4.2uw* ) opsys=unixware ;;
529 *-sysv5uw* ) opsys=unixware ;; 532 *-sysv5uw* ) opsys=unixware ;;
530 *-sysv5OpenUNIX* ) opsys=unixware ;; 533 *-sysv5OpenUNIX* ) opsys=unixware ;;
@@ -1598,25 +1601,29 @@ W32_OBJ=
1598W32_LIBS= 1601W32_LIBS=
1599if test "${with_w32}" != no; then 1602if test "${with_w32}" != no; then
1600 if test "${opsys}" != "cygwin"; then 1603 if test "${opsys}" != "cygwin"; then
1601 AC_MSG_ERROR([Using w32 with an autotools build is only supported for Cygwin.]) 1604 if test "${opsys}" != "mingw32"; then
1605 AC_MSG_ERROR([Using w32 with an autotools build is only supported for Cygwin and MinGW32.])
1606 fi
1602 fi 1607 fi
1603 AC_CHECK_HEADER([windows.h], [HAVE_W32=yes], 1608 AC_CHECK_HEADER([windows.h], [HAVE_W32=yes],
1604 [AC_MSG_ERROR([`--with-w32' was specified, but windows.h 1609 [AC_MSG_ERROR([`--with-w32' was specified, but windows.h
1605 cannot be found.])]) 1610 cannot be found.])])
1606fi 1611fi
1607if test "${opsys}" = "mingw32"; then 1612if test "${opsys}" = "mingw32"; then
1608 HAVE_W32=yes 1613 AC_CHECK_HEADER([windows.h], [HAVE_W32=yes],
1614 [AC_MSG_ERROR([The windows.h header file is required,
1615 but cannot be found.])])
1609fi 1616fi
1610 1617
1611if test "${HAVE_W32}" = "yes"; then 1618if test "${HAVE_W32}" = "yes"; then
1612 AC_DEFINE(HAVE_NTGUI, 1, [Define to use native MS Windows GUI.]) 1619 AC_DEFINE(HAVE_NTGUI, 1, [Define to use native MS Windows GUI.])
1613 W32_OBJ="w32fns.o w32menu.o w32reg.o w32font.o w32term.o" 1620 W32_OBJ="w32fns.o w32menu.o w32reg.o w32font.o w32term.o"
1614 W32_OBJ="$W32_OBJ w32xfns.o w32select.o w32uniscribe.o" 1621 W32_OBJ="$W32_OBJ w32xfns.o w32select.o w32uniscribe.o"
1615 if test "${opsys}" != "cygwin"; then 1622 if test "${opsys}" = "cygwin"; then
1616 W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32" 1623 W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32"
1617 W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool" 1624 W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool"
1618 else 1625 else
1619 ## FIXME: set W32_OBJ 1626 W32_OBJ="$W32_OBJ w32.o w32console.o w32heap.o w32inevt.o w32proc.o"
1620 W32_LIBS="$W32_LIBS -lwinmm -ladvapi32 -lgdi32 -lcomdlg32 -luser32" 1627 W32_LIBS="$W32_LIBS -lwinmm -ladvapi32 -lgdi32 -lcomdlg32 -luser32"
1621 W32_LIBS="$W32_LIBS -lmpr -lshell32 -lwinspool -lole32 -lcomctl32 -lusp10" 1628 W32_LIBS="$W32_LIBS -lmpr -lshell32 -lwinspool -lole32 -lcomctl32 -lusp10"
1622 fi 1629 fi
@@ -1938,7 +1945,7 @@ fi
1938 1945
1939### Use -lrsvg-2 if available, unless `--with-rsvg=no' is specified. 1946### Use -lrsvg-2 if available, unless `--with-rsvg=no' is specified.
1940HAVE_RSVG=no 1947HAVE_RSVG=no
1941if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes"; then 1948if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" || test "${opsys}" = "mingw32"; then
1942 if test "${with_rsvg}" != "no"; then 1949 if test "${with_rsvg}" != "no"; then
1943 RSVG_REQUIRED=2.11.0 1950 RSVG_REQUIRED=2.11.0
1944 RSVG_MODULE="librsvg-2.0 >= $RSVG_REQUIRED" 1951 RSVG_MODULE="librsvg-2.0 >= $RSVG_REQUIRED"
@@ -1980,40 +1987,42 @@ HAVE_GTK=no
1980GTK_OBJ= 1987GTK_OBJ=
1981check_gtk2=no 1988check_gtk2=no
1982gtk3_pkg_errors= 1989gtk3_pkg_errors=
1983if test "${with_gtk3}" = "yes" || test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then 1990if test "${opsys}" != "mingw32"; then
1984 GLIB_REQUIRED=2.28 1991 if test "${with_gtk3}" = "yes" || test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then
1985 GTK_REQUIRED=3.0 1992 GLIB_REQUIRED=2.28
1986 GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED" 1993 GTK_REQUIRED=3.0
1987 1994 GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
1988 dnl Checks for libraries. 1995
1989 PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no) 1996 dnl Checks for libraries.
1990 if test "$pkg_check_gtk" = "no" && test "$with_gtk3" = "yes"; then 1997 PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no)
1991 AC_MSG_ERROR($GTK_PKG_ERRORS) 1998 if test "$pkg_check_gtk" = "no" && test "$with_gtk3" = "yes"; then
1992 fi 1999 AC_MSG_ERROR($GTK_PKG_ERRORS)
1993 if test "$pkg_check_gtk" = "yes"; then 2000 fi
1994 AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.]) 2001 if test "$pkg_check_gtk" = "yes"; then
1995 GTK_OBJ=emacsgtkfixed.o 2002 AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.])
1996 term_header=gtkutil.h 2003 GTK_OBJ=emacsgtkfixed.o
1997 USE_GTK_TOOLKIT="GTK3" 2004 term_header=gtkutil.h
1998 else 2005 USE_GTK_TOOLKIT="GTK3"
1999 check_gtk2=yes 2006 else
2000 gtk3_pkg_errors="$GTK_PKG_ERRORS " 2007 check_gtk2=yes
2008 gtk3_pkg_errors="$GTK_PKG_ERRORS "
2009 fi
2001 fi 2010 fi
2002fi
2003 2011
2004if test "${with_gtk2}" = "yes" || test "$check_gtk2" = "yes"; then 2012 if test "${with_gtk2}" = "yes" || test "$check_gtk2" = "yes"; then
2005 GLIB_REQUIRED=2.10 2013 GLIB_REQUIRED=2.10
2006 GTK_REQUIRED=2.10 2014 GTK_REQUIRED=2.10
2007 GTK_MODULES="gtk+-2.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED" 2015 GTK_MODULES="gtk+-2.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
2008 2016
2009 dnl Checks for libraries. 2017 dnl Checks for libraries.
2010 PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no) 2018 PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no)
2011 if test "$pkg_check_gtk" = "no" && 2019 if test "$pkg_check_gtk" = "no" &&
2012 { test "$with_gtk" = yes || test "$with_gtk2" = "yes"; } 2020 { test "$with_gtk" = yes || test "$with_gtk2" = "yes"; }
2013 then 2021 then
2014 AC_MSG_ERROR($gtk3_pkg_errors$GTK_PKG_ERRORS) 2022 AC_MSG_ERROR($gtk3_pkg_errors$GTK_PKG_ERRORS)
2023 fi
2024 test "$pkg_check_gtk" = "yes" && USE_GTK_TOOLKIT="GTK2"
2015 fi 2025 fi
2016 test "$pkg_check_gtk" = "yes" && USE_GTK_TOOLKIT="GTK2"
2017fi 2026fi
2018 2027
2019if test x"$pkg_check_gtk" = xyes; then 2028if test x"$pkg_check_gtk" = xyes; then
@@ -2277,6 +2286,9 @@ case $opsys in
2277 hpux* | aix4-2 ) 2286 hpux* | aix4-2 )
2278 test "X$ac_cv_lib_Xmu_XmuConvertStandardSelection" != "Xyes" && LIBXMU= 2287 test "X$ac_cv_lib_Xmu_XmuConvertStandardSelection" != "Xyes" && LIBXMU=
2279 ;; 2288 ;;
2289 mingw32 )
2290 LIBXMU=
2291 ;;
2280esac 2292esac
2281AC_SUBST(LIBXMU) 2293AC_SUBST(LIBXMU)
2282 2294
@@ -2535,10 +2547,11 @@ AC_SUBST(M17N_FLT_CFLAGS)
2535AC_SUBST(M17N_FLT_LIBS) 2547AC_SUBST(M17N_FLT_LIBS)
2536 2548
2537### Use -lXpm if available, unless `--with-xpm=no'. 2549### Use -lXpm if available, unless `--with-xpm=no'.
2550### mingw32 doesn't use -lXpm, since it loads the library dynamically.
2538HAVE_XPM=no 2551HAVE_XPM=no
2539LIBXPM= 2552LIBXPM=
2540 2553
2541if test "${HAVE_W32}" = "yes"; then 2554if test "${HAVE_W32}" = "yes" && test "${opsys}" = "cygwin"; then
2542 if test "${with_xpm}" != "no"; then 2555 if test "${with_xpm}" != "no"; then
2543 SAVE_CPPFLAGS="$CPPFLAGS" 2556 SAVE_CPPFLAGS="$CPPFLAGS"
2544 SAVE_LDFLAGS="$LDFLAGS" 2557 SAVE_LDFLAGS="$LDFLAGS"
@@ -2599,19 +2612,35 @@ no_return_alloc_pixels
2599 fi 2612 fi
2600fi 2613fi
2601 2614
2615if test "${opsys}" = "mingw32"; then
2616 if test "${with_xpm}" != "no"; then
2617 AC_CHECK_HEADER(X11/xpm.h, HAVE_XPM=yes, HAVE_XPM=no, [
2618#define FOR_MSW 1])
2619 if test "${HAVE_XPM}" = "yes"; then
2620 AC_MSG_RESULT(yes)
2621 else
2622 AC_MSG_RESULT(no)
2623 fi
2624 fi
2625 fi
2626
2627 if test "${HAVE_XPM}" = "yes"; then
2628 AC_DEFINE(HAVE_XPM, 1, [Define to 1 if you have the Xpm library (-lXpm).])
2629 fi
2630fi
2631
2602AC_SUBST(LIBXPM) 2632AC_SUBST(LIBXPM)
2603 2633
2604### Use -ljpeg if available, unless `--with-jpeg=no'. 2634### Use -ljpeg if available, unless `--with-jpeg=no'.
2635### mingw32 doesn't use -ljpeg, since it loads the library dynamically.
2605HAVE_JPEG=no 2636HAVE_JPEG=no
2606LIBJPEG= 2637LIBJPEG=
2607if test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then 2638if test "${opsys}" = "mingw32"; then
2608 if test "${with_jpeg}" != "no"; then 2639 if test "${with_jpeg}" != "no"; then
2609 dnl Checking for jpeglib.h can lose because of a redefinition of 2640 dnl Checking for jpeglib.h can lose because of a redefinition of
2610 dnl HAVE_STDLIB_H. 2641 dnl HAVE_STDLIB_H.
2611 AC_CHECK_HEADER(jerror.h, 2642 AC_CHECK_HEADER(jerror.h, HAVE_JPEG=yes, HAVE_JPEG=no)
2612 [AC_CHECK_LIB(jpeg, jpeg_destroy_compress, HAVE_JPEG=yes)])
2613 fi 2643 fi
2614
2615 AH_TEMPLATE(HAVE_JPEG, [Define to 1 if you have the jpeg library (-ljpeg).])dnl 2644 AH_TEMPLATE(HAVE_JPEG, [Define to 1 if you have the jpeg library (-ljpeg).])dnl
2616 if test "${HAVE_JPEG}" = "yes"; then 2645 if test "${HAVE_JPEG}" = "yes"; then
2617 AC_DEFINE(HAVE_JPEG) 2646 AC_DEFINE(HAVE_JPEG)
@@ -2623,6 +2652,25 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
2623 [AC_MSG_WARN([libjpeg found, but not version 6b or later]) 2652 [AC_MSG_WARN([libjpeg found, but not version 6b or later])
2624 HAVE_JPEG=no]) 2653 HAVE_JPEG=no])
2625 fi 2654 fi
2655elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
2656 if test "${with_jpeg}" != "no"; then
2657 dnl Checking for jpeglib.h can lose because of a redefinition of
2658 dnl HAVE_STDLIB_H.
2659 AC_CHECK_HEADER(jerror.h,
2660 [AC_CHECK_LIB(jpeg, jpeg_destroy_compress, HAVE_JPEG=yes)])
2661 fi
2662
2663 AH_TEMPLATE(HAVE_JPEG, [Define to 1 if you have the jpeg library (-ljpeg).])dnl
2664 if test "${HAVE_JPEG}" = "yes"; then
2665 AC_DEFINE(HAVE_JPEG)
2666 AC_EGREP_CPP([version= *(6[2-9]|[7-9][0-9])],
2667 [#include <jpeglib.h>
2668 version=JPEG_LIB_VERSION
2669],
2670 [AC_DEFINE(HAVE_JPEG)],
2671 [AC_MSG_WARN([libjpeg found, but not version 6b or later])
2672 HAVE_JPEG=no])
2673 fi
2626 if test "${HAVE_JPEG}" = "yes"; then 2674 if test "${HAVE_JPEG}" = "yes"; then
2627 LIBJPEG=-ljpeg 2675 LIBJPEG=-ljpeg
2628 fi 2676 fi
@@ -2630,9 +2678,30 @@ fi
2630AC_SUBST(LIBJPEG) 2678AC_SUBST(LIBJPEG)
2631 2679
2632### Use -lpng if available, unless `--with-png=no'. 2680### Use -lpng if available, unless `--with-png=no'.
2681### mingw32 doesn't use -lpng, since it loads the library dynamically.
2633HAVE_PNG=no 2682HAVE_PNG=no
2634LIBPNG= 2683LIBPNG=
2635if test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then 2684if test "${opsys}" = "mingw32"; then
2685 if test "${with_png}" != "no"; then
2686 AC_CHECK_HEADER(png.h, HAVE_PNG=yes, HAVE_PNG=no)
2687 fi
2688 if test "${HAVE_PNG}" = "yes"; then
2689 AC_DEFINE(HAVE_PNG, 1, [Define to 1 if you have the png library (-lpng).])
2690
2691 AC_CHECK_DECL(png_longjmp,
2692 [],
2693 [AC_DEFINE(PNG_DEPSTRUCT, [],
2694 [Define to empty to suppress deprecation warnings when building
2695 with --enable-gcc-warnings and with libpng versions before 1.5,
2696 which lack png_longjmp.])],
2697 [[#ifdef HAVE_LIBPNG_PNG_H
2698 # include <libpng/png.h>
2699 #else
2700 # include <png.h>
2701 #endif
2702 ]])
2703 fi
2704elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
2636 if test "${with_png}" != "no"; then 2705 if test "${with_png}" != "no"; then
2637 # Debian unstable as of July 2003 has multiple libpngs, and puts png.h 2706 # Debian unstable as of July 2003 has multiple libpngs, and puts png.h
2638 # in /usr/include/libpng. 2707 # in /usr/include/libpng.
@@ -2663,9 +2732,17 @@ fi
2663AC_SUBST(LIBPNG) 2732AC_SUBST(LIBPNG)
2664 2733
2665### Use -ltiff if available, unless `--with-tiff=no'. 2734### Use -ltiff if available, unless `--with-tiff=no'.
2735### mingw32 doesn't use -ltiff, since it loads the library dynamically.
2666HAVE_TIFF=no 2736HAVE_TIFF=no
2667LIBTIFF= 2737LIBTIFF=
2668if test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then 2738if test "${opsys}" = "mingw32"; then
2739 if test "${with_tiff}" != "no"; then
2740 AC_CHECK_HEADER(tiffio.h, HAVE_TIFF=yes, HAVE_TIFF=no)
2741 fi
2742 if test "${HAVE_TIFF}" = "yes"; then
2743 AC_DEFINE(HAVE_TIFF, 1, [Define to 1 if you have the tiff library (-ltiff).])
2744 fi
2745elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
2669 if test "${with_tiff}" != "no"; then 2746 if test "${with_tiff}" != "no"; then
2670 AC_CHECK_HEADER(tiffio.h, 2747 AC_CHECK_HEADER(tiffio.h,
2671 [tifflibs="-lz -lm" 2748 [tifflibs="-lz -lm"
@@ -2683,9 +2760,17 @@ fi
2683AC_SUBST(LIBTIFF) 2760AC_SUBST(LIBTIFF)
2684 2761
2685### Use -lgif or -lungif if available, unless `--with-gif=no'. 2762### Use -lgif or -lungif if available, unless `--with-gif=no'.
2763### mingw32 doesn't use -lgif/-lungif, since it loads the library dynamically.
2686HAVE_GIF=no 2764HAVE_GIF=no
2687LIBGIF= 2765LIBGIF=
2688if test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no" \ 2766if test "${opsys}" = "mingw32"; then
2767 if test "${with_gif}" != "no"; then
2768 AC_CHECK_HEADER(gif_lib.h, HAVE_GIF=yes, HAVE_GIF=no)
2769 fi
2770 if test "${HAVE_GIF}" = "yes"; then
2771 AC_DEFINE(HAVE_GIF, 1, [Define to 1 if you have a gif (or ungif) library.])
2772 fi
2773elif test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no" \
2689 || test "${HAVE_W32}" = "yes"; then 2774 || test "${HAVE_W32}" = "yes"; then
2690 AC_CHECK_HEADER(gif_lib.h, 2775 AC_CHECK_HEADER(gif_lib.h,
2691# EGifPutExtensionLast only exists from version libungif-4.1.0b1. 2776# EGifPutExtensionLast only exists from version libungif-4.1.0b1.
@@ -2791,13 +2876,16 @@ fi
2791AC_SUBST(LIBXSM) 2876AC_SUBST(LIBXSM)
2792 2877
2793### Use libxml (-lxml2) if available 2878### Use libxml (-lxml2) if available
2879### mingw32 doesn't use -lxml2, since it loads the library dynamically.
2794HAVE_LIBXML2=no 2880HAVE_LIBXML2=no
2795if test "${with_xml2}" != "no"; then 2881if test "${with_xml2}" != "no"; then
2796 ### I'm not sure what the version number should be, so I just guessed. 2882 ### I'm not sure what the version number should be, so I just guessed.
2797 PKG_CHECK_MODULES(LIBXML2, libxml-2.0 > 2.6.17, HAVE_LIBXML2=yes, HAVE_LIBXML2=no) 2883 PKG_CHECK_MODULES(LIBXML2, libxml-2.0 > 2.6.17, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
2798 if test "${HAVE_LIBXML2}" = "yes"; then 2884 if test "${HAVE_LIBXML2}" = "yes"; then
2799 LIBS="$LIBXML2_LIBS $LIBS" 2885 if test "${opsys}" != "mingw32"; then
2800 AC_CHECK_LIB(xml2, htmlReadMemory, HAVE_LIBXML2=yes, HAVE_LIBXML2=no) 2886 LIBS="$LIBXML2_LIBS $LIBS"
2887 AC_CHECK_LIB(xml2, htmlReadMemory, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
2888 fi
2801 if test "${HAVE_LIBXML2}" = "yes"; then 2889 if test "${HAVE_LIBXML2}" = "yes"; then
2802 AC_DEFINE(HAVE_LIBXML2, 1, [Define to 1 if you have the libxml library (-lxml2).]) 2890 AC_DEFINE(HAVE_LIBXML2, 1, [Define to 1 if you have the libxml library (-lxml2).])
2803 else 2891 else
@@ -2810,6 +2898,10 @@ AC_SUBST(LIBXML2_LIBS)
2810AC_SUBST(LIBXML2_CFLAGS) 2898AC_SUBST(LIBXML2_CFLAGS)
2811 2899
2812# If netdb.h doesn't declare h_errno, we must declare it by hand. 2900# If netdb.h doesn't declare h_errno, we must declare it by hand.
2901# On MinGW, that is provided by nt/inc/sys/socket.h.
2902if test "${opsys}" = "mingw32"; then
2903 emacs_cv_netdb_declares_h_errno=yes
2904fi
2813AC_CACHE_CHECK(whether netdb declares h_errno, 2905AC_CACHE_CHECK(whether netdb declares h_errno,
2814 emacs_cv_netdb_declares_h_errno, 2906 emacs_cv_netdb_declares_h_errno,
2815[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]], 2907[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]],
@@ -2820,8 +2912,10 @@ if test $emacs_cv_netdb_declares_h_errno = yes; then
2820fi 2912fi
2821 2913
2822# sqrt and other floating-point functions such as fmod and frexp 2914# sqrt and other floating-point functions such as fmod and frexp
2823# are found in -lm on most systems. 2915# are found in -lm on most systems, but mingw32 doesn't use -lm.
2824AC_CHECK_LIB(m, sqrt) 2916if test "${opsys}" != "mingw32"; then
2917 AC_CHECK_LIB(m, sqrt)
2918fi
2825 2919
2826# Check for mail-locking functions in a "mail" library. Probably this should 2920# Check for mail-locking functions in a "mail" library. Probably this should
2827# have the same check as for liblockfile below. 2921# have the same check as for liblockfile below.
@@ -2972,25 +3066,29 @@ AC_DEFUN([tputs_link_source], [
2972 return 0; 3066 return 0;
2973 }]]) 3067 }]])
2974]) 3068])
2975# Maybe curses should be tried earlier? 3069if test "${opsys} = "mingw32"; then
2976# See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9736#35 3070 msg='none required'
2977for tputs_library in '' tinfo ncurses terminfo termcap curses; do 3071else
2978 OLIBS=$LIBS 3072 # Maybe curses should be tried earlier?
2979 if test -z "$tputs_library"; then 3073 # See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9736#35
2980 LIBS_TERMCAP= 3074 for tputs_library in '' tinfo ncurses terminfo termcap curses; do
2981 msg='none required' 3075 OLIBS=$LIBS
2982 else 3076 if test -z "$tputs_library"; then
2983 LIBS_TERMCAP=-l$tputs_library 3077 LIBS_TERMCAP=
2984 msg=$LIBS_TERMCAP 3078 msg='none required'
2985 LIBS="$LIBS_TERMCAP $LIBS" 3079 else
2986 fi 3080 LIBS_TERMCAP=-l$tputs_library
2987 AC_RUN_IFELSE([tputs_link_source], [], [msg=no], 3081 msg=$LIBS_TERMCAP
2988 [AC_LINK_IFELSE([tputs_link_source], [], [msg=no])]) 3082 LIBS="$LIBS_TERMCAP $LIBS"
2989 LIBS=$OLIBS 3083 fi
2990 if test "X$msg" != Xno; then 3084 AC_RUN_IFELSE([tputs_link_source], [], [msg=no],
2991 break 3085 [AC_LINK_IFELSE([tputs_link_source], [], [msg=no])])
2992 fi 3086 LIBS=$OLIBS
2993done 3087 if test "X$msg" != Xno; then
3088 break
3089 fi
3090 done
3091fi
2994AC_MSG_RESULT([$msg]) 3092AC_MSG_RESULT([$msg])
2995if test "X$msg" = Xno; then 3093if test "X$msg" = Xno; then
2996 AC_MSG_ERROR([The required function `tputs' was not found in any library. 3094 AC_MSG_ERROR([The required function `tputs' was not found in any library.
@@ -3036,6 +3134,11 @@ fail;
3036 fi 3134 fi
3037 ;; 3135 ;;
3038 3136
3137 mingw32)
3138 TERMINFO=no
3139 LIBS_TERMCAP=
3140 ;;
3141
3039 netbsd) 3142 netbsd)
3040 if test "x$LIBS_TERMCAP" != "x-lterminfo"; then 3143 if test "x$LIBS_TERMCAP" != "x-lterminfo"; then
3041 TERMINFO=no 3144 TERMINFO=no
@@ -3328,18 +3431,22 @@ dnl Turned on June 1996 supposing nobody will mind it.
3328AC_DEFINE(AMPERSAND_FULL_NAME, 1, [Define to use the convention that & 3431AC_DEFINE(AMPERSAND_FULL_NAME, 1, [Define to use the convention that &
3329 in the full name stands for the login id.]) 3432 in the full name stands for the login id.])
3330 3433
3331dnl Every platform that uses configure (ie every non-MS platform) 3434dnl Every platform that uses configure, except MinGW,
3332dnl supports this. There is a create-lockfiles option you can 3435dnl supports this. There is a create-lockfiles option you can
3333dnl customize if you do not want the lock files to be written. 3436dnl customize if you do not want the lock files to be written.
3334dnl So it is not clear that this #define still needs to exist. 3437dnl So it is not clear that this #define still needs to exist.
3335AC_DEFINE(CLASH_DETECTION, 1, [Define if you want lock files to be written, 3438if test "${opsys}" != "mingw32"; then
3336 so that Emacs can tell instantly when you try to modify a file that 3439 AC_DEFINE(CLASH_DETECTION, 1, [Define if you want lock files to be written,
3337 someone else has modified in his/her Emacs.]) 3440 so that Emacs can tell instantly when you try to modify a file that
3441 someone else has modified in his/her Emacs.])
3442fi
3338 3443
3339dnl Everybody supports this, except MS. 3444dnl Everybody supports this, except MS.
3340dnl Seems like the kind of thing we should be testing for, though. 3445dnl Seems like the kind of thing we should be testing for, though.
3341## Note: PTYs are broken on darwin <6. Use at your own risk. 3446## Note: PTYs are broken on darwin <6. Use at your own risk.
3342AC_DEFINE(HAVE_PTYS, 1, [Define if the system supports pty devices.]) 3447if test "${opsys}" != "mingw32"; then
3448 AC_DEFINE(HAVE_PTYS, 1, [Define if the system supports pty devices.])
3449fi
3343 3450
3344dnl Everybody supports this, except MS-DOS. 3451dnl Everybody supports this, except MS-DOS.
3345dnl Seems like the kind of thing we should be testing for, though. 3452dnl Seems like the kind of thing we should be testing for, though.
@@ -3349,10 +3456,19 @@ AC_DEFINE(HAVE_SOCKETS, 1, [Define if the system supports
3349 3456
3350AH_TEMPLATE(INTERNAL_TERMINAL, [This is substituted when $TERM is "internal".]) 3457AH_TEMPLATE(INTERNAL_TERMINAL, [This is substituted when $TERM is "internal".])
3351 3458
3352AC_DEFINE(NULL_DEVICE, ["/dev/null"], [Name of the file to open to get 3459if test "${opsys}" = "mingw32"; then
3353 a null file, or a data sink.]) 3460 AC_DEFINE(NULL_DEVICE, ["NUL:"], [Name of the file to open to get
3461 a null file, or a data sink.])
3462else
3463 AC_DEFINE(NULL_DEVICE, ["/dev/null"], [Name of the file to open to get
3464 a null file, or a data sink.])
3465fi
3354 3466
3355AC_DEFINE(SEPCHAR, [':'], [Character that separates PATH elements.]) 3467if test "${opsys}" = "mingw32"; then
3468 AC_DEFINE(SEPCHAR, [';'], [Character that separates PATH elements.])
3469else
3470 AC_DEFINE(SEPCHAR, [':'], [Character that separates PATH elements.])
3471fi
3356 3472
3357dnl Everybody supports this, except MS-DOS. 3473dnl Everybody supports this, except MS-DOS.
3358AC_DEFINE(subprocesses, 1, [Define to enable asynchronous subprocesses.]) 3474AC_DEFINE(subprocesses, 1, [Define to enable asynchronous subprocesses.])
@@ -3363,19 +3479,29 @@ AC_DEFINE(USER_FULL_NAME, [pw->pw_gecos], [How to get a user's full name.])
3363AC_DEFINE(DIRECTORY_SEP, ['/'], 3479AC_DEFINE(DIRECTORY_SEP, ['/'],
3364 [Character that separates directories in a file name.]) 3480 [Character that separates directories in a file name.])
3365 3481
3366dnl Only used on MS platforms. 3482if test "${opsys}" = "mingw32"; then
3367AH_TEMPLATE(DEVICE_SEP, [Character that separates a device in a file name.]) 3483 dnl Only used on MS platforms.
3484 AC_DEFINE(DEVICE_SEP, ':', [Character that separates a device in a file name.])
3485 AC_DEFINE(IS_DEVICE_SEP(_c_), [((_c_) == DEVICE_SEP)],
3486 [Returns true if character is a device separator.])
3368 3487
3369AC_DEFINE(IS_DEVICE_SEP(_c_), 0, 3488 AC_DEFINE(IS_DIRECTORY_SEP(_c_), [((_c_) == '/' || (_c_) == '\\')],
3370 [Returns true if character is a device separator.]) 3489 [Returns true if character is a directory separator.])
3371 3490
3372AC_DEFINE(IS_DIRECTORY_SEP(_c_), [((_c_) == DIRECTORY_SEP)], 3491 AC_DEFINE(IS_ANY_SEP(_c_), [(IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP(_c_))],
3373 [Returns true if character is a directory separator.]) 3492 [Returns true if character is any form of separator.])
3493else
3494 AH_TEMPLATE(DEVICE_SEP, [Character that separates a device in a file name.])
3374 3495
3375dnl On MS, this also accepts IS_DEVICE_SEP. 3496 AC_DEFINE(IS_DEVICE_SEP(_c_), 0,
3376AC_DEFINE(IS_ANY_SEP(_c_), [(IS_DIRECTORY_SEP (_c_))], 3497 [Returns true if character is a device separator.])
3377 [Returns true if character is any form of separator.])
3378 3498
3499 AC_DEFINE(IS_DIRECTORY_SEP(_c_), [((_c_) == DIRECTORY_SEP)],
3500 [Returns true if character is a directory separator.])
3501
3502 AC_DEFINE(IS_ANY_SEP(_c_), [(IS_DIRECTORY_SEP (_c_))],
3503 [Returns true if character is any form of separator.])
3504fi
3379 3505
3380AH_TEMPLATE(NO_EDITRES, [Define if XEditRes should not be used.]) 3506AH_TEMPLATE(NO_EDITRES, [Define if XEditRes should not be used.])
3381 3507
@@ -3914,6 +4040,11 @@ case $opsys in
3914 AC_DEFINE(IRIX6_5, [], [Define if the system is IRIX.]) 4040 AC_DEFINE(IRIX6_5, [], [Define if the system is IRIX.])
3915 ;; 4041 ;;
3916 4042
4043 mingw32)
4044 AC_DEFINE(DOS_NT, [])
4045 AC_DEFINE(WINDOWSNT, 1, [Define if compiling for native MS Windows.])
4046 ;;
4047
3917 sol2*) 4048 sol2*)
3918 AC_DEFINE(USG, []) 4049 AC_DEFINE(USG, [])
3919 AC_DEFINE(USG5, []) 4050 AC_DEFINE(USG5, [])
@@ -3935,6 +4066,10 @@ AC_CACHE_CHECK([for usable FIONREAD], [emacs_cv_usable_FIONREAD],
3935 emacs_cv_usable_FIONREAD=no 4066 emacs_cv_usable_FIONREAD=no
3936 ;; 4067 ;;
3937 4068
4069 mingw32)
4070 emacs_cv_usable_FIONREAD=yes
4071 ;;
4072
3938 *) 4073 *)
3939 AC_COMPILE_IFELSE( 4074 AC_COMPILE_IFELSE(
3940 [AC_LANG_PROGRAM([[#include <sys/types.h> 4075 [AC_LANG_PROGRAM([[#include <sys/types.h>
@@ -4212,6 +4347,10 @@ if test "$opsys" = "cygwin"; then
4212 ## Cygwin differs because of its unexec(). 4347 ## Cygwin differs because of its unexec().
4213 PRE_ALLOC_OBJ= 4348 PRE_ALLOC_OBJ=
4214 POST_ALLOC_OBJ=lastfile.o 4349 POST_ALLOC_OBJ=lastfile.o
4350elif test "$opsys" = "mingw32"; then
4351 CYGWIN_OBJ=
4352 PRE_ALLOC_OBJ=
4353 POST_ALLOC_OBJ=lastfile.o
4215else 4354else
4216 CYGWIN_OBJ= 4355 CYGWIN_OBJ=
4217 PRE_ALLOC_OBJ=lastfile.o 4356 PRE_ALLOC_OBJ=lastfile.o
@@ -4293,7 +4432,7 @@ LD_FIRSTFLAG=
4293ORDINARY_LINK= 4432ORDINARY_LINK=
4294case "$opsys" in 4433case "$opsys" in
4295 ## gnu: GNU needs its own crt0. 4434 ## gnu: GNU needs its own crt0.
4296 aix4-2|cygwin|darwin|gnu|hpux*|irix6-5|sol2*|unixware) ORDINARY_LINK=yes ;; 4435 aix4-2|cygwin|darwin|gnu|hpux*|irix6-5|mingw32|sol2*|unixware) ORDINARY_LINK=yes ;;
4297 4436
4298 ## On post 1.3 releases of NetBSD, gcc -nostdlib also clears the 4437 ## On post 1.3 releases of NetBSD, gcc -nostdlib also clears the
4299 ## library search parth, i.e. it won't search /usr/lib for libc and 4438 ## library search parth, i.e. it won't search /usr/lib for libc and