aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoam Postavsky2017-04-08 20:58:20 -0400
committerNoam Postavsky2017-08-14 20:19:12 -0400
commite88bbd22c5ffb1d6008c0c7e18a36043b0f397dd (patch)
treea04e4dc88eb2a7895139ae61c464b72bfd73bce7
parent13a846823a92447d5cf0c2ce2bb401c5cdcb9ee4 (diff)
downloademacs-e88bbd22c5ffb1d6008c0c7e18a36043b0f397dd.tar.gz
emacs-e88bbd22c5ffb1d6008c0c7e18a36043b0f397dd.zip
Speed up ./configure with more caching (Bug#27960)
* configure.ac: Cache the 'GTK compiles', 'GSettings is in gio', 'LN_S', '-znocombreloc', 'sysinfo', 'gcc autodepends', '-b link', 'Xkb', 'Xpm preprocessor', 'tputs library' 'GLib', 'signals via characters', and 'Windows API header' checks. Remove pause after warning about GTK bug.
-rw-r--r--configure.ac219
1 files changed, 104 insertions, 115 deletions
diff --git a/configure.ac b/configure.ac
index 86d5b3e94f9..443344de4c2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1137,36 +1137,31 @@ dnl hosted on AFS, both examples where simple links work, but links to
1137dnl directories fail. We use a cut-down version instead. 1137dnl directories fail. We use a cut-down version instead.
1138dnl AC_PROG_LN_S 1138dnl AC_PROG_LN_S
1139 1139
1140AC_MSG_CHECKING([whether ln -s works for files in the same directory]) 1140AC_CACHE_CHECK([command to symlink files in the same directory], [emacs_cv_ln_s_fileonly],
1141rm -f conf$$ conf$$.file 1141[rm -f conf$$ conf$$.file
1142 1142
1143LN_S_FILEONLY='cp -p' 1143emacs_cv_ln_s_fileonly='cp -p'
1144 1144
1145dnl On MinGW, ensure we will call the MSYS /bin/ln.exe, not some 1145dnl On MinGW, ensure we will call the MSYS /bin/ln.exe, not some
1146dnl random program in the current directory. 1146dnl random program in the current directory.
1147if (echo >conf$$.file) 2>/dev/null; then 1147if (echo >conf$$.file) 2>/dev/null; then
1148 if ln -s conf$$.file conf$$ 2>/dev/null; then 1148 if ln -s conf$$.file conf$$ 2>/dev/null; then
1149 if test "$opsys" = "mingw32"; then 1149 if test "$opsys" = "mingw32"; then
1150 LN_S_FILEONLY='/bin/ln -s' 1150 emacs_cv_ln_s_fileonly='/bin/ln -s'
1151 else 1151 else
1152 LN_S_FILEONLY='ln -s' 1152 emacs_cv_ln_s_fileonly='ln -s'
1153 fi 1153 fi
1154 elif ln conf$$.file conf$$ 2>/dev/null; then 1154 elif ln conf$$.file conf$$ 2>/dev/null; then
1155 if test "$opsys" = "mingw32"; then 1155 if test "$opsys" = "mingw32"; then
1156 LN_S_FILEONLY=/bin/ln 1156 emacs_cv_ln_s_fileonly=/bin/ln
1157 else 1157 else
1158 LN_S_FILEONLY=ln 1158 emacs_cv_ln_s_fileonly=ln
1159 fi 1159 fi
1160 fi 1160 fi
1161fi 1161fi
1162 1162
1163rm -f conf$$ conf$$.file 1163rm -f conf$$ conf$$.file])
1164 1164LN_S_FILEONLY=$emacs_cv_ln_s_fileonly
1165if test "$LN_S_FILEONLY" = "ln -s"; then
1166 AC_MSG_RESULT([yes])
1167else
1168 AC_MSG_RESULT([no, using $LN_S_FILEONLY])
1169fi
1170 1165
1171AC_SUBST(LN_S_FILEONLY) 1166AC_SUBST(LN_S_FILEONLY)
1172 1167
@@ -1322,22 +1317,25 @@ dnl http://bugs.debian.org/684788
1322dnl * unnecessary, since temacs is the only thing that actually needs it. 1317dnl * unnecessary, since temacs is the only thing that actually needs it.
1323dnl Indeed this is where it was originally, prior to: 1318dnl Indeed this is where it was originally, prior to:
1324dnl http://lists.gnu.org/archive/html/emacs-pretest-bug/2004-03/msg00170.html 1319dnl http://lists.gnu.org/archive/html/emacs-pretest-bug/2004-03/msg00170.html
1325late_LDFLAGS="$LDFLAGS"
1326if test x$GCC = xyes; then 1320if test x$GCC = xyes; then
1327 LDFLAGS_NOCOMBRELOC="-Wl,-znocombreloc" 1321 LDFLAGS_NOCOMBRELOC="-Wl,-znocombreloc"
1328else 1322else
1329 LDFLAGS_NOCOMBRELOC="-znocombreloc" 1323 LDFLAGS_NOCOMBRELOC="-znocombreloc"
1330fi 1324fi
1331 1325
1326AC_CACHE_CHECK([for -znocombreloc], [emacs_cv_znocombreloc],
1327[late_LDFLAGS="$LDFLAGS"
1332LDFLAGS="$LDFLAGS $LDFLAGS_NOCOMBRELOC" 1328LDFLAGS="$LDFLAGS $LDFLAGS_NOCOMBRELOC"
1333 1329
1334AC_MSG_CHECKING([for -znocombreloc])
1335AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], 1330AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
1336 [AC_MSG_RESULT(yes)], 1331 [emacs_cv_znocombreloc=yes], [emacs_cv_znocombreloc=no])
1332
1333LDFLAGS="$late_LDFLAGS"])
1334
1335if test x$emacs_cv_znocombreloc = xno; then
1337 LDFLAGS_NOCOMBRELOC= 1336 LDFLAGS_NOCOMBRELOC=
1338 [AC_MSG_RESULT(no)]) 1337fi
1339 1338
1340LDFLAGS="$late_LDFLAGS"
1341 1339
1342AC_CACHE_CHECK([whether addresses are sanitized], 1340AC_CACHE_CHECK([whether addresses are sanitized],
1343 [emacs_cv_sanitize_address], 1341 [emacs_cv_sanitize_address],
@@ -1700,13 +1698,13 @@ fi
1700# sysinfo as well. To make sure that we're using GNU/Linux 1698# sysinfo as well. To make sure that we're using GNU/Linux
1701# sysinfo, we explicitly set one of its fields. 1699# sysinfo, we explicitly set one of its fields.
1702if test "$ac_cv_header_sys_sysinfo_h" = yes; then 1700if test "$ac_cv_header_sys_sysinfo_h" = yes; then
1703 AC_MSG_CHECKING([if Linux sysinfo may be used]) 1701 AC_CACHE_CHECK([if Linux sysinfo may be used], [emacs_cv_linux_sysinfo],
1704 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/sysinfo.h>]], 1702 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/sysinfo.h>]],
1705 [[struct sysinfo si; 1703 [[struct sysinfo si;
1706 si.totalram = 0; 1704 si.totalram = 0;
1707 sysinfo (&si)]])], 1705 sysinfo (&si)]])],
1708 emacs_cv_linux_sysinfo=yes, emacs_cv_linux_sysinfo=no) 1706 emacs_cv_linux_sysinfo=yes, emacs_cv_linux_sysinfo=no)])
1709 AC_MSG_RESULT($emacs_cv_linux_sysinfo) 1707
1710 if test $emacs_cv_linux_sysinfo = yes; then 1708 if test $emacs_cv_linux_sysinfo = yes; then
1711 AC_DEFINE([HAVE_LINUX_SYSINFO], 1, [Define to 1 if you have Linux sysinfo function.]) 1709 AC_DEFINE([HAVE_LINUX_SYSINFO], 1, [Define to 1 if you have Linux sysinfo function.])
1712 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/sysinfo.h>]], 1710 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/sysinfo.h>]],
@@ -1765,15 +1763,15 @@ AUTO_DEPEND=no
1765AUTODEPEND_PARENTS='lib src' 1763AUTODEPEND_PARENTS='lib src'
1766dnl check if we have GCC and autodepend is on. 1764dnl check if we have GCC and autodepend is on.
1767if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then 1765if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then
1768 AC_MSG_CHECKING([whether gcc understands -MMD -MF]) 1766 AC_CACHE_CHECK([whether gcc understands -MMD -MF], [emacs_cv_autodepend],
1769 SAVE_CFLAGS="$CFLAGS" 1767 [SAVE_CFLAGS="$CFLAGS"
1770 CFLAGS="$CFLAGS -MMD -MF deps.d -MP" 1768 CFLAGS="$CFLAGS -MMD -MF deps.d -MP"
1771 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], , ac_enable_autodepend=no) 1769 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
1770 [emacs_cv_autodepend=yes], [emacs_cv_autodepend=no])
1772 CFLAGS="$SAVE_CFLAGS" 1771 CFLAGS="$SAVE_CFLAGS"
1773 test -f deps.d || ac_enable_autodepend=no 1772 test -f deps.d || emacs_cv_autodepend=no
1774 rm -rf deps.d 1773 rm -rf deps.d])
1775 AC_MSG_RESULT([$ac_enable_autodepend]) 1774 if test $emacs_cv_autodepend = yes; then
1776 if test $ac_enable_autodepend = yes; then
1777 AUTO_DEPEND=yes 1775 AUTO_DEPEND=yes
1778 fi 1776 fi
1779fi 1777fi
@@ -2037,19 +2035,17 @@ if test "${with_w32}" != no; then
2037fi 2035fi
2038 2036
2039if test "${opsys}" = "mingw32"; then 2037if test "${opsys}" = "mingw32"; then
2040 AC_MSG_CHECKING([whether Windows API headers are recent enough]) 2038 AC_CACHE_CHECK([whether Windows API headers are recent enough], [emacs_cv_w32api],
2041 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 2039 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2042 #include <windows.h> 2040 #include <windows.h>
2043 #include <usp10.h>]], 2041 #include <usp10.h>]],
2044 [[PIMAGE_NT_HEADERS pHeader; 2042 [[PIMAGE_NT_HEADERS pHeader;
2045 PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader)]])], 2043 PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader)]])],
2046 [emacs_cv_w32api=yes 2044 [emacs_cv_w32api=yes], [emacs_cv_w32api=no])])
2047 HAVE_W32=yes],
2048 emacs_cv_w32api=no)
2049 AC_MSG_RESULT($emacs_cv_w32api)
2050 if test "${emacs_cv_w32api}" = "no"; then 2045 if test "${emacs_cv_w32api}" = "no"; then
2051 AC_MSG_ERROR([the Windows API headers are too old to support this build.]) 2046 AC_MSG_ERROR([the Windows API headers are too old to support this build.])
2052 fi 2047 fi
2048 HAVE_W32=${emacs_cv_w32api}
2053fi 2049fi
2054 2050
2055FIRSTFILE_OBJ= 2051FIRSTFILE_OBJ=
@@ -2412,8 +2408,8 @@ if test "${HAVE_X11}" = "yes"; then
2412 fi 2408 fi
2413 2409
2414 if test "${opsys}" = "gnu-linux"; then 2410 if test "${opsys}" = "gnu-linux"; then
2415 AC_MSG_CHECKING(whether X on GNU/Linux needs -b to link) 2411 AC_CACHE_CHECK([whether X on GNU/Linux needs -b to link], [emacs_cv_b_link],
2416 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], 2412 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
2417 [[XOpenDisplay ("foo");]])], 2413 [[XOpenDisplay ("foo");]])],
2418 [xgnu_linux_first_failure=no], 2414 [xgnu_linux_first_failure=no],
2419 [xgnu_linux_first_failure=yes]) 2415 [xgnu_linux_first_failure=yes])
@@ -2429,28 +2425,29 @@ if test "${HAVE_X11}" = "yes"; then
2429 if test "${xgnu_linux_second_failure}" = "yes"; then 2425 if test "${xgnu_linux_second_failure}" = "yes"; then
2430 # If we get the same failure with -b, there is no use adding -b. 2426 # If we get the same failure with -b, there is no use adding -b.
2431 # So leave it out. This plays safe. 2427 # So leave it out. This plays safe.
2432 AC_MSG_RESULT(no) 2428 emacs_cv_b_link=no
2433 else 2429 else
2434 LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -b i486-linuxaout" 2430 emacs_cv_b_link=yes
2435 C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout"
2436 AC_MSG_RESULT(yes)
2437 fi 2431 fi
2438 CPPFLAGS=$OLD_CPPFLAGS 2432 CPPFLAGS=$OLD_CPPFLAGS
2439 LIBS=$OLD_LIBS 2433 LIBS=$OLD_LIBS
2440 else 2434 else
2441 AC_MSG_RESULT(no) 2435 emacs_cv_b_link=no
2436 fi])
2437 if test "x$emacs_cv_b_link" = xyes ; then
2438 LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -b i486-linuxaout"
2439 C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout"
2442 fi 2440 fi
2443 fi 2441 fi
2444 2442
2445 # Reportedly, some broken Solaris systems have XKBlib.h but are missing 2443 # Reportedly, some broken Solaris systems have XKBlib.h but are missing
2446 # header files included from there. 2444 # header files included from there.
2447 AC_MSG_CHECKING(for Xkb) 2445 AC_CACHE_CHECK([for Xkb], [emacs_cv_xkb],
2448 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h> 2446 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h>
2449#include <X11/XKBlib.h>]], 2447#include <X11/XKBlib.h>]],
2450 [[XkbDescPtr kb = XkbGetKeyboard (0, XkbAllComponentsMask, XkbUseCoreKbd);]])], 2448 [[XkbDescPtr kb = XkbGetKeyboard (0, XkbAllComponentsMask, XkbUseCoreKbd);]])],
2451 emacs_xkb=yes, emacs_xkb=no) 2449 emacs_cv_xkb=yes, emacs_cv_xkb=no)])
2452 AC_MSG_RESULT($emacs_xkb) 2450 if test $emacs_cv_xkb = yes; then
2453 if test $emacs_xkb = yes; then
2454 AC_DEFINE(HAVE_XKB, 1, [Define to 1 if you have the Xkb extension.]) 2451 AC_DEFINE(HAVE_XKB, 1, [Define to 1 if you have the Xkb extension.])
2455 fi 2452 fi
2456 2453
@@ -2611,9 +2608,8 @@ if test x"$pkg_check_gtk" = xyes; then
2611 CFLAGS="$CFLAGS $GTK_CFLAGS" 2608 CFLAGS="$CFLAGS $GTK_CFLAGS"
2612 LIBS="$GTK_LIBS $LIBS" 2609 LIBS="$GTK_LIBS $LIBS"
2613 dnl Try to compile a simple GTK program. 2610 dnl Try to compile a simple GTK program.
2614 AC_MSG_CHECKING([whether GTK compiles]) 2611 AC_CACHE_CHECK([whether GTK compiles], [emacs_cv_gtk_compiles],
2615 GTK_COMPILES=no 2612 [AC_LINK_IFELSE(
2616 AC_LINK_IFELSE(
2617 [AC_LANG_PROGRAM( 2613 [AC_LANG_PROGRAM(
2618 [[/* Check the Gtk and Glib APIs. */ 2614 [[/* Check the Gtk and Glib APIs. */
2619 #include <gtk/gtk.h> 2615 #include <gtk/gtk.h>
@@ -2631,9 +2627,8 @@ if test x"$pkg_check_gtk" = xyes; then
2631 0, 0, 0, G_CALLBACK (callback), 0)) 2627 0, 0, 0, G_CALLBACK (callback), 0))
2632 gtk_main_iteration (); 2628 gtk_main_iteration ();
2633 ]])], 2629 ]])],
2634 [GTK_COMPILES=yes]) 2630 [emacs_cv_gtk_compiles=yes], [emacs_cv_gtk_compiles=no])])
2635 AC_MSG_RESULT([$GTK_COMPILES]) 2631 if test "${emacs_cv_gtk_compiles}" != "yes"; then
2636 if test "${GTK_COMPILES}" != "yes"; then
2637 GTK_OBJ= 2632 GTK_OBJ=
2638 if test "$USE_X_TOOLKIT" != "maybe"; then 2633 if test "$USE_X_TOOLKIT" != "maybe"; then
2639 AC_MSG_ERROR([Gtk+ wanted, but it does not compile, see config.log. Maybe some x11-devel files missing?]); 2634 AC_MSG_ERROR([Gtk+ wanted, but it does not compile, see config.log. Maybe some x11-devel files missing?]);
@@ -2650,7 +2645,6 @@ if test x"$pkg_check_gtk" = xyes; then
2650 one display, but if you use more than one and close one of them 2645 one display, but if you use more than one and close one of them
2651 Emacs may crash. 2646 Emacs may crash.
2652 See http://bugzilla.gnome.org/show_bug.cgi?id=85715]]) 2647 See http://bugzilla.gnome.org/show_bug.cgi?id=85715]])
2653 sleep 3
2654 fi 2648 fi
2655 2649
2656fi 2650fi
@@ -2764,8 +2758,8 @@ if test "${HAVE_X11}" = "yes" && test "${with_gsettings}" = "yes"; then
2764 CFLAGS="$CFLAGS $GSETTINGS_CFLAGS" 2758 CFLAGS="$CFLAGS $GSETTINGS_CFLAGS"
2765 old_LIBS=$LIBS 2759 old_LIBS=$LIBS
2766 LIBS="$LIBS $GSETTINGS_LIBS" 2760 LIBS="$LIBS $GSETTINGS_LIBS"
2767 AC_MSG_CHECKING([whether GSettings is in gio]) 2761 AC_CACHE_CHECK([whether GSettings is in gio], [emacs_cv_gsettings_in_gio],
2768 AC_LINK_IFELSE( 2762 [AC_LINK_IFELSE(
2769 [AC_LANG_PROGRAM( 2763 [AC_LANG_PROGRAM(
2770 [[/* Check that gsettings really is present. */ 2764 [[/* Check that gsettings really is present. */
2771 #include <glib-object.h> 2765 #include <glib-object.h>
@@ -2775,10 +2769,9 @@ if test "${HAVE_X11}" = "yes" && test "${with_gsettings}" = "yes"; then
2775 GSettings *settings; 2769 GSettings *settings;
2776 GVariant *val = g_settings_get_value (settings, ""); 2770 GVariant *val = g_settings_get_value (settings, "");
2777 ]])], 2771 ]])],
2778 [], HAVE_GSETTINGS=no) 2772 [emacs_cv_gsettings_in_gio=yes], [emacs_cv_gsettings_in_gio=no])])
2779 AC_MSG_RESULT([$HAVE_GSETTINGS])
2780 2773
2781 if test "$HAVE_GSETTINGS" = "yes"; then 2774 if test "$emacs_cv_gsettings_in_gio" = "yes"; then
2782 AC_DEFINE(HAVE_GSETTINGS, 1, [Define to 1 if using GSettings.]) 2775 AC_DEFINE(HAVE_GSETTINGS, 1, [Define to 1 if using GSettings.])
2783 SETTINGS_CFLAGS="$GSETTINGS_CFLAGS" 2776 SETTINGS_CFLAGS="$GSETTINGS_CFLAGS"
2784 SETTINGS_LIBS="$GSETTINGS_LIBS" 2777 SETTINGS_LIBS="$GSETTINGS_LIBS"
@@ -3341,18 +3334,18 @@ if test "${HAVE_W32}" = "yes" && test "${opsys}" = "cygwin"; then
3341 AC_CHECK_HEADER(noX/xpm.h, 3334 AC_CHECK_HEADER(noX/xpm.h,
3342 [AC_CHECK_LIB(Xpm, XpmReadFileToImage, HAVE_XPM=yes)]) 3335 [AC_CHECK_LIB(Xpm, XpmReadFileToImage, HAVE_XPM=yes)])
3343 if test "${HAVE_XPM}" = "yes"; then 3336 if test "${HAVE_XPM}" = "yes"; then
3344 AC_MSG_CHECKING(for XpmReturnAllocPixels preprocessor define) 3337 AC_CACHE_CHECK([for XpmReturnAllocPixels preprocessor define],
3345 AC_EGREP_CPP(no_return_alloc_pixels, 3338 [emacs_cv_cpp_xpm_return_alloc_pixels],
3339 [AC_EGREP_CPP(no_return_alloc_pixels,
3346 [#include "noX/xpm.h" 3340 [#include "noX/xpm.h"
3347#ifndef XpmReturnAllocPixels 3341#ifndef XpmReturnAllocPixels
3348no_return_alloc_pixels 3342no_return_alloc_pixels
3349#endif 3343#endif
3350 ], HAVE_XPM=no, HAVE_XPM=yes) 3344 ], emacs_cv_cpp_xpm_return_alloc_pixels=no,
3345 emacs_cv_cpp_xpm_return_alloc_pixels=yes)])
3351 3346
3352 if test "${HAVE_XPM}" = "yes"; then 3347 if test "$emacs_cv_cpp_xpm_return_alloc_pixels" = "no"; then
3353 AC_MSG_RESULT(yes) 3348 HAVE_XPM=no
3354 else
3355 AC_MSG_RESULT(no)
3356 LDFLAGS="$SAVE_LDFLAGS" 3349 LDFLAGS="$SAVE_LDFLAGS"
3357 fi 3350 fi
3358 fi 3351 fi
@@ -3372,18 +3365,18 @@ if test "${HAVE_X11}" = "yes"; then
3372 AC_CHECK_HEADER(X11/xpm.h, 3365 AC_CHECK_HEADER(X11/xpm.h,
3373 [AC_CHECK_LIB(Xpm, XpmReadFileToPixmap, HAVE_XPM=yes, , -lX11)]) 3366 [AC_CHECK_LIB(Xpm, XpmReadFileToPixmap, HAVE_XPM=yes, , -lX11)])
3374 if test "${HAVE_XPM}" = "yes"; then 3367 if test "${HAVE_XPM}" = "yes"; then
3375 AC_MSG_CHECKING(for XpmReturnAllocPixels preprocessor define) 3368 AC_CACHE_CHECK([for XpmReturnAllocPixels preprocessor define],
3376 AC_EGREP_CPP(no_return_alloc_pixels, 3369 [emacs_cv_cpp_xpm_return_alloc_pixels],
3377 [#include "X11/xpm.h" 3370 [AC_EGREP_CPP(no_return_alloc_pixels,
3371 [#include "noX/xpm.h"
3378#ifndef XpmReturnAllocPixels 3372#ifndef XpmReturnAllocPixels
3379no_return_alloc_pixels 3373no_return_alloc_pixels
3380#endif 3374#endif
3381 ], HAVE_XPM=no, HAVE_XPM=yes) 3375 ], emacs_cv_cpp_xpm_return_alloc_pixels=no,
3376 emacs_cv_cpp_xpm_return_alloc_pixels=yes)])
3382 3377
3383 if test "${HAVE_XPM}" = "yes"; then 3378 if test "$emacs_cv_cpp_xpm_return_alloc_pixels" = "no"; then
3384 AC_MSG_RESULT(yes) 3379 HAVE_XPM=no
3385 else
3386 AC_MSG_RESULT(no)
3387 fi 3380 fi
3388 fi 3381 fi
3389 fi 3382 fi
@@ -3985,17 +3978,11 @@ AC_CHECK_FUNCS(grantpt)
3985# PTY-related GNU extensions. 3978# PTY-related GNU extensions.
3986AC_CHECK_FUNCS(getpt posix_openpt) 3979AC_CHECK_FUNCS(getpt posix_openpt)
3987 3980
3988# Check this now, so that we will NOT find the above functions in ncurses. 3981dnl Run a test program that contains a call to tputs, a call that is
3989# That is because we have not set up to link ncurses in lib-src. 3982dnl never executed. This tests whether a pre-'main' dynamic linker
3990# It's better to believe a function is not available 3983dnl works with the library. It's too much trouble to actually call
3991# than to expect to find it in ncurses. 3984dnl tputs in the test program, due to portability hassles. When
3992# Also we need tputs and friends to be able to build at all. 3985dnl cross-compiling, assume the test program will run if it links.
3993AC_MSG_CHECKING([for library containing tputs])
3994# Run a test program that contains a call to tputs, a call that is
3995# never executed. This tests whether a pre-'main' dynamic linker
3996# works with the library. It's too much trouble to actually call
3997# tputs in the test program, due to portability hassles. When
3998# cross-compiling, assume the test program will run if it links.
3999AC_DEFUN([tputs_link_source], [ 3986AC_DEFUN([tputs_link_source], [
4000 AC_LANG_SOURCE( 3987 AC_LANG_SOURCE(
4001 [[extern void tputs (const char *, int, int (*)(int)); 3988 [[extern void tputs (const char *, int, int (*)(int));
@@ -4006,38 +3993,42 @@ AC_DEFUN([tputs_link_source], [
4006 return 0; 3993 return 0;
4007 }]]) 3994 }]])
4008]) 3995])
4009if test "${opsys}" = "mingw32"; then 3996# Check this now, so that we will NOT find the above functions in ncurses.
4010 msg='none required' 3997# That is because we have not set up to link ncurses in lib-src.
3998# It's better to believe a function is not available
3999# than to expect to find it in ncurses.
4000# Also we need tputs and friends to be able to build at all.
4001AC_CACHE_CHECK([for library containing tputs], [emacs_cv_tputs_lib],
4002[if test "${opsys}" = "mingw32"; then
4003 emacs_cv_tputs_lib='none required'
4011else 4004else
4012 # Maybe curses should be tried earlier? 4005 # Maybe curses should be tried earlier?
4013 # See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9736#35 4006 # See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9736#35
4014 for tputs_library in '' tinfo ncurses terminfo termcap curses; do 4007 for tputs_library in '' tinfo ncurses terminfo termcap curses; do
4015 OLIBS=$LIBS 4008 OLIBS=$LIBS
4016 if test -z "$tputs_library"; then 4009 if test -z "$tputs_library"; then
4017 LIBS_TERMCAP= 4010 emacs_cv_tputs_lib='none required'
4018 msg='none required'
4019 else 4011 else
4020 LIBS_TERMCAP=-l$tputs_library 4012 emacs_cv_tputs_lib=-l$tputs_library
4021 msg=$LIBS_TERMCAP 4013 LIBS="$emacs_cv_tputs_lib $LIBS"
4022 LIBS="$LIBS_TERMCAP $LIBS"
4023 fi 4014 fi
4024 AC_RUN_IFELSE([tputs_link_source], [], [msg=no], 4015 AC_RUN_IFELSE([tputs_link_source], [], [emacs_cv_tputs_lib=no],
4025 [AC_LINK_IFELSE([tputs_link_source], [], [msg=no])]) 4016 [AC_LINK_IFELSE([tputs_link_source], [], [emacs_cv_tputs_lib=no])])
4026 LIBS=$OLIBS 4017 LIBS=$OLIBS
4027 if test "X$msg" != Xno; then 4018 if test "X$emacs_cv_tputs_lib" != Xno; then
4028 break 4019 break
4029 fi 4020 fi
4030 done 4021 done
4031fi 4022fi])
4032AC_MSG_RESULT([$msg]) 4023AS_CASE(["$emacs_cv_tputs_lib"],
4033if test "X$msg" = Xno; then 4024 [no], [AC_MSG_ERROR([The required function 'tputs' was not found in any library.
4034 AC_MSG_ERROR([The required function 'tputs' was not found in any library.
4035The following libraries were tried (in order): 4025The following libraries were tried (in order):
4036 libtinfo, libncurses, libterminfo, libtermcap, libcurses 4026 libtinfo, libncurses, libterminfo, libtermcap, libcurses
4037Please try installing whichever of these libraries is most appropriate 4027Please try installing whichever of these libraries is most appropriate
4038for your system, together with its header files. 4028for your system, together with its header files.
4039For example, a libncurses-dev(el) or similar package.]) 4029For example, a libncurses-dev(el) or similar package.])],
4040fi 4030 [-l*], [LIBS_TERMCAP=$emacs_cv_tputs_lib],
4031 [*], [LIBS_TERMCAP=])
4041 4032
4042## Use termcap instead of terminfo? 4033## Use termcap instead of terminfo?
4043## Only true for: freebsd < 40000, ms-w32, msdos, netbsd < 599002500. 4034## Only true for: freebsd < 40000, ms-w32, msdos, netbsd < 599002500.
@@ -4273,28 +4264,27 @@ dnl glib at a low level.
4273dnl 4264dnl
4274dnl Check this late, since it depends on $GTK_CFLAGS etc. 4265dnl Check this late, since it depends on $GTK_CFLAGS etc.
4275XGSELOBJ= 4266XGSELOBJ=
4276OLDCFLAGS="$CFLAGS" 4267AC_CACHE_CHECK([whether GLib is linked in], [emacs_cv_links_glib],
4268[OLDCFLAGS="$CFLAGS"
4277OLDLIBS="$LIBS" 4269OLDLIBS="$LIBS"
4278CFLAGS="$CFLAGS $GTK_CFLAGS $RSVG_CFLAGS $DBUS_CFLAGS $SETTINGS_CFLAGS" 4270CFLAGS="$CFLAGS $GTK_CFLAGS $RSVG_CFLAGS $DBUS_CFLAGS $SETTINGS_CFLAGS"
4279LIBS="$LIBS $GTK_LIBS $RSVG_LIBS $DBUS_LIBS $SETTINGS_LIBS" 4271LIBS="$LIBS $GTK_LIBS $RSVG_LIBS $DBUS_LIBS $SETTINGS_LIBS"
4280CFLAGS="$CFLAGS $NOTIFY_CFLAGS $CAIRO_CFLAGS" 4272CFLAGS="$CFLAGS $NOTIFY_CFLAGS $CAIRO_CFLAGS"
4281LIBS="$LIBS $NOTIFY_LIBS $CAIRO_LIBS" 4273LIBS="$LIBS $NOTIFY_LIBS $CAIRO_LIBS"
4282AC_MSG_CHECKING([whether GLib is linked in])
4283AC_LINK_IFELSE([AC_LANG_PROGRAM( 4274AC_LINK_IFELSE([AC_LANG_PROGRAM(
4284 [[#include <glib.h> 4275 [[#include <glib.h>
4285 ]], 4276 ]],
4286 [[g_print ("Hello world");]])], 4277 [[g_print ("Hello world");]])],
4287 [links_glib=yes], 4278 [emacs_cv_links_glib=yes],
4288 [links_glib=no]) 4279 [emacs_cv_links_glib=no])
4289AC_MSG_RESULT([$links_glib]) 4280CFLAGS="$OLDCFLAGS"
4290if test "${links_glib}" = "yes"; then 4281LIBS="$OLDLIBS"])
4282if test "${emacs_cv_links_glib}" = "yes"; then
4291 AC_DEFINE(HAVE_GLIB, 1, [Define to 1 if GLib is linked in.]) 4283 AC_DEFINE(HAVE_GLIB, 1, [Define to 1 if GLib is linked in.])
4292 if test "$HAVE_NS" = no;then 4284 if test "$HAVE_NS" = no;then
4293 XGSELOBJ=xgselect.o 4285 XGSELOBJ=xgselect.o
4294 fi 4286 fi
4295fi 4287fi
4296CFLAGS="$OLDCFLAGS"
4297LIBS="$OLDLIBS"
4298AC_SUBST(XGSELOBJ) 4288AC_SUBST(XGSELOBJ)
4299 4289
4300dnl Adapted from Haible's version. 4290dnl Adapted from Haible's version.
@@ -4660,16 +4650,15 @@ case $opsys in
4660 dnl FIXME Does gnu-kfreebsd have linux/version.h? It seems unlikely... 4650 dnl FIXME Does gnu-kfreebsd have linux/version.h? It seems unlikely...
4661 gnu-linux | gnu-kfreebsd ) 4651 gnu-linux | gnu-kfreebsd )
4662 4652
4663 AC_MSG_CHECKING([for signals via characters]) 4653 AC_CACHE_CHECK([for signals via characters], [emacs_cv_signals_via_chars],
4664 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ 4654 [AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
4665#include <linux/version.h> 4655#include <linux/version.h>
4666#if LINUX_VERSION_CODE < 0x20400 4656#if LINUX_VERSION_CODE < 0x20400
4667# error "Linux version too old" 4657# error "Linux version too old"
4668#endif 4658#endif
4669 ]], [[]])], emacs_signals_via_chars=yes, emacs_signals_via_chars=no) 4659 ]], [[]])], emacs_cv_signals_via_chars=yes, emacs_cv_signals_via_chars=no)])
4670 4660
4671 AC_MSG_RESULT([$emacs_signals_via_chars]) 4661 test "$emacs_cv_signals_via_chars" = yes && AC_DEFINE(SIGNALS_VIA_CHARACTERS, 1)
4672 test $emacs_signals_via_chars = yes && AC_DEFINE(SIGNALS_VIA_CHARACTERS, 1)
4673 ;; 4662 ;;
4674esac 4663esac
4675 4664