From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#27960: [PATCH] Add more caching in configure Date: Fri, 04 Aug 2017 21:18:59 -0400 Message-ID: <87d18a7qws.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1501895891 29239 195.159.176.226 (5 Aug 2017 01:18:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 5 Aug 2017 01:18:11 +0000 (UTC) To: 27960@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 05 03:18:08 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ddnjD-0007IP-8f for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Aug 2017 03:18:07 +0200 Original-Received: from localhost ([::1]:54946 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddnjH-0004WX-Mp for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 Aug 2017 21:18:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddnjA-0004WJ-W2 for bug-gnu-emacs@gnu.org; Fri, 04 Aug 2017 21:18:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ddnj8-00037x-6g for bug-gnu-emacs@gnu.org; Fri, 04 Aug 2017 21:18:04 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39501) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ddnj8-00037t-1T for bug-gnu-emacs@gnu.org; Fri, 04 Aug 2017 21:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ddnj7-0005Qb-PE for bug-gnu-emacs@gnu.org; Fri, 04 Aug 2017 21:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Aug 2017 01:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 27960 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.150189585820834 (code B ref -1); Sat, 05 Aug 2017 01:18:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Aug 2017 01:17:38 +0000 Original-Received: from localhost ([127.0.0.1]:42178 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ddnij-0005Px-6y for submit@debbugs.gnu.org; Fri, 04 Aug 2017 21:17:37 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:33588) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ddnig-0005Ph-Cs for submit@debbugs.gnu.org; Fri, 04 Aug 2017 21:17:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ddniY-0002ll-Tq for submit@debbugs.gnu.org; Fri, 04 Aug 2017 21:17:29 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:48665) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ddniY-0002lc-PO for submit@debbugs.gnu.org; Fri, 04 Aug 2017 21:17:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddniW-0004Tu-DL for bug-gnu-emacs@gnu.org; Fri, 04 Aug 2017 21:17:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ddniT-0002fA-0m for bug-gnu-emacs@gnu.org; Fri, 04 Aug 2017 21:17:24 -0400 Original-Received: from mail-io0-x234.google.com ([2607:f8b0:4001:c06::234]:36102) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ddniS-0002bI-Ng for bug-gnu-emacs@gnu.org; Fri, 04 Aug 2017 21:17:20 -0400 Original-Received: by mail-io0-x234.google.com with SMTP id g35so11258006ioi.3 for ; Fri, 04 Aug 2017 18:17:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:mime-version; bh=mCKWhY7bUBfU4HdFbJQDk8qJqTg92RqwyFizUPbZ+F4=; b=so4V1zERbIuQfMVhyxphOj8eKOM0/hinJB+RNdS8Tcq1eizLmrO6h8VwVUIbjfa8eZ lQvhQbawy7A++GHASuXpoxQhm9bJxRRfPi+F6+zN7Km0AmbvtY8RqPtf/wuKWilAPZJ/ JXs1D85g7EMSLJV4+dDjx77vsSE9k+E1wtDBqf2xWrUO8xpBOW88BoBBG4bcUOukoOb1 2shtWqRIeSupeIVWgYaqRkqS6r3uRtXAGu6PgPchghPAEO3MDvl5ETTeNVPMtS5TE2Ie +6TYldKx8w/5x1eMq9qcO/k5BDZLiwmVr2ri2jdLeZxnO5PiWdV1qABijpEQOJ1hXNFK JQdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :mime-version; bh=mCKWhY7bUBfU4HdFbJQDk8qJqTg92RqwyFizUPbZ+F4=; b=PZtE911IpB1b4GgNo3toQeo67DrkchepqZkW21p/UP+SrpZ0NpsyLSuUkNu/jehKtg f/M9tQRU+4FdrcVjif4qsui+ex7aSfeJG1GwFQ5oGJ2gO76rfSWq82T4CbJcgeRom9Y5 gqZ2yqfxZkzJ9K5tksqCNEg1s4Garpod8P1F1Yyxv6J/h1eTvZN5hlqYtRO+4W5FWYGj EruZi8iuUctm6/O5qF9CIPv2y0M3d71goR4NWvpyJwCt6w+EmwDsCDyWKN7mn4PiFZLe 5iBxXBZdqSn+UVVETM7TtUK/f9dbHr8/PvB42gQdpaerjZSYR82axxT6MBur8Gl9Umf5 y2+g== X-Gm-Message-State: AHYfb5ibvZbhomdEqBglg+811eUCQVnsFjjB4p+VMf+GUmeJHK4rMT4B ijlxVQSowHiQGymI X-Received: by 10.107.170.39 with SMTP id t39mr4528196ioe.9.1501895838234; Fri, 04 Aug 2017 18:17:18 -0700 (PDT) Original-Received: from zony ([45.2.119.48]) by smtp.googlemail.com with ESMTPSA id i190sm976265itb.3.2017.08.04.18.17.17 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Aug 2017 18:17:17 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:135370 Archived-At: --=-=-= Content-Type: text/plain Severity: wishlist Tags: patch Actually, the thing which triggered this is the pause to show the message about the GTK bug (I didn't notice it was just a pause at first). I've added an option to disable the pause, and I've added more caching wherever it seemed straightforward to do so (some checks are performed inside autoconf macros; I didn't try to open those up). --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Speed-up-.-configure-with-more-caching.patch Content-Description: patch >From e8f8402042388d90add09230a28309c0b4ad6645 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 8 Apr 2017 20:58:20 -0400 Subject: [PATCH] Speed up ./configure with more caching * 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. Add --disable-gtk-bug-message-pause option. --- configure.ac | 226 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 111 insertions(+), 115 deletions(-) diff --git a/configure.ac b/configure.ac index 9f80620a80..998606df4b 100644 --- a/configure.ac +++ b/configure.ac @@ -543,6 +543,10 @@ AC_DEFUN [AS_HELP_STRING([--enable-gtk-deprecation-warnings], [Show Gtk+/Gdk deprecation warnings for Gtk+ >= 3.0])], [ac_enable_gtk_deprecation_warnings="${enableval}"],[]) +AC_ARG_ENABLE(gtk-bug-message-pause, +[AS_HELP_STRING([--disable-gtk-bug-message-pause], + [Don't pause to show warning about the Gtk+ crashing on closing display])], +[ac_gtk_bug_message_pause="${enableval}"],[ac_gtk_bug_message_pause=no]) BUILD_DETAILS= AC_ARG_ENABLE([build-details], @@ -1137,36 +1141,31 @@ AC_DEFUN dnl directories fail. We use a cut-down version instead. dnl AC_PROG_LN_S -AC_MSG_CHECKING([whether ln -s works for files in the same directory]) -rm -f conf$$ conf$$.file +AC_CACHE_CHECK([command to symlink files in the same directory], [emacs_cv_ln_s_fileonly], +[rm -f conf$$ conf$$.file -LN_S_FILEONLY='cp -p' +emacs_cv_ln_s_fileonly='cp -p' dnl On MinGW, ensure we will call the MSYS /bin/ln.exe, not some dnl random program in the current directory. if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then if test "$opsys" = "mingw32"; then - LN_S_FILEONLY='/bin/ln -s' + emacs_cv_ln_s_fileonly='/bin/ln -s' else - LN_S_FILEONLY='ln -s' + emacs_cv_ln_s_fileonly='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then if test "$opsys" = "mingw32"; then - LN_S_FILEONLY=/bin/ln + emacs_cv_ln_s_fileonly=/bin/ln else - LN_S_FILEONLY=ln + emacs_cv_ln_s_fileonly=ln fi fi fi -rm -f conf$$ conf$$.file - -if test "$LN_S_FILEONLY" = "ln -s"; then - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no, using $LN_S_FILEONLY]) -fi +rm -f conf$$ conf$$.file]) +LN_S_FILEONLY=$emacs_cv_ln_s_fileonly AC_SUBST(LN_S_FILEONLY) @@ -1322,22 +1321,25 @@ AC_DEFUN dnl * unnecessary, since temacs is the only thing that actually needs it. dnl Indeed this is where it was originally, prior to: dnl http://lists.gnu.org/archive/html/emacs-pretest-bug/2004-03/msg00170.html -late_LDFLAGS="$LDFLAGS" if test x$GCC = xyes; then LDFLAGS_NOCOMBRELOC="-Wl,-znocombreloc" else LDFLAGS_NOCOMBRELOC="-znocombreloc" fi +AC_CACHE_CHECK([for -znocombreloc], [emacs_cv_znocombreloc], +[late_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $LDFLAGS_NOCOMBRELOC" -AC_MSG_CHECKING([for -znocombreloc]) AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], - [AC_MSG_RESULT(yes)], + [emacs_cv_znocombreloc=yes], [emacs_cv_znocombreloc=no]) + +LDFLAGS="$late_LDFLAGS"]) + +if test x$emacs_cv_znocombreloc = xno; then LDFLAGS_NOCOMBRELOC= - [AC_MSG_RESULT(no)]) +fi -LDFLAGS="$late_LDFLAGS" AC_CACHE_CHECK([whether addresses are sanitized], [emacs_cv_sanitize_address], @@ -1700,13 +1702,13 @@ AC_DEFUN # sysinfo as well. To make sure that we're using GNU/Linux # sysinfo, we explicitly set one of its fields. if test "$ac_cv_header_sys_sysinfo_h" = yes; then - AC_MSG_CHECKING([if Linux sysinfo may be used]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + AC_CACHE_CHECK([if Linux sysinfo may be used], [emacs_cv_linux_sysinfo], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[struct sysinfo si; si.totalram = 0; sysinfo (&si)]])], - emacs_cv_linux_sysinfo=yes, emacs_cv_linux_sysinfo=no) - AC_MSG_RESULT($emacs_cv_linux_sysinfo) + emacs_cv_linux_sysinfo=yes, emacs_cv_linux_sysinfo=no)]) + if test $emacs_cv_linux_sysinfo = yes; then AC_DEFINE([HAVE_LINUX_SYSINFO], 1, [Define to 1 if you have Linux sysinfo function.]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], @@ -1765,15 +1767,15 @@ AC_DEFUN AUTODEPEND_PARENTS='lib src' dnl check if we have GCC and autodepend is on. if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then - AC_MSG_CHECKING([whether gcc understands -MMD -MF]) - SAVE_CFLAGS="$CFLAGS" + AC_CACHE_CHECK([whether gcc understands -MMD -MF], [emacs_cv_autodepend], + [SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -MMD -MF deps.d -MP" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], , ac_enable_autodepend=no) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [emacs_cv_autodepend=yes], [emacs_cv_autodepend=no]) CFLAGS="$SAVE_CFLAGS" - test -f deps.d || ac_enable_autodepend=no - rm -rf deps.d - AC_MSG_RESULT([$ac_enable_autodepend]) - if test $ac_enable_autodepend = yes; then + test -f deps.d || emacs_cv_autodepend=no + rm -rf deps.d]) + if test $emacs_cv_autodepend = yes; then AUTO_DEPEND=yes fi fi @@ -2040,19 +2042,17 @@ AC_DEFUN fi if test "${opsys}" = "mingw32"; then - AC_MSG_CHECKING([whether Windows API headers are recent enough]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + AC_CACHE_CHECK([whether Windows API headers are recent enough], [emacs_cv_w32api], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include ]], [[PIMAGE_NT_HEADERS pHeader; PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader)]])], - [emacs_cv_w32api=yes - HAVE_W32=yes], - emacs_cv_w32api=no) - AC_MSG_RESULT($emacs_cv_w32api) + [emacs_cv_w32api=yes], [emacs_cv_w32api=no])]) if test "${emacs_cv_w32api}" = "no"; then AC_MSG_ERROR([the Windows API headers are too old to support this build.]) fi + HAVE_W32=${emacs_cv_w32api} fi FIRSTFILE_OBJ= @@ -2415,8 +2415,8 @@ AC_DEFUN fi if test "${opsys}" = "gnu-linux"; then - AC_MSG_CHECKING(whether X on GNU/Linux needs -b to link) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], + AC_CACHE_CHECK([whether X on GNU/Linux needs -b to link], [emacs_cv_b_link], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[XOpenDisplay ("foo");]])], [xgnu_linux_first_failure=no], [xgnu_linux_first_failure=yes]) @@ -2432,28 +2432,29 @@ AC_DEFUN if test "${xgnu_linux_second_failure}" = "yes"; then # If we get the same failure with -b, there is no use adding -b. # So leave it out. This plays safe. - AC_MSG_RESULT(no) + emacs_cv_b_link=no else - LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -b i486-linuxaout" - C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout" - AC_MSG_RESULT(yes) + emacs_cv_b_link=yes fi CPPFLAGS=$OLD_CPPFLAGS LIBS=$OLD_LIBS else - AC_MSG_RESULT(no) + emacs_cv_b_link=no + fi]) + if test "x$emacs_cv_b_link" = xyes ; then + LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -b i486-linuxaout" + C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout" fi fi # Reportedly, some broken Solaris systems have XKBlib.h but are missing # header files included from there. - AC_MSG_CHECKING(for Xkb) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include + AC_CACHE_CHECK([for Xkb], [emacs_cv_xkb], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[XkbDescPtr kb = XkbGetKeyboard (0, XkbAllComponentsMask, XkbUseCoreKbd);]])], - emacs_xkb=yes, emacs_xkb=no) - AC_MSG_RESULT($emacs_xkb) - if test $emacs_xkb = yes; then + emacs_cv_xkb=yes, emacs_cv_xkb=no)]) + if test $emacs_cv_xkb = yes; then AC_DEFINE(HAVE_XKB, 1, [Define to 1 if you have the Xkb extension.]) fi @@ -2614,9 +2615,8 @@ AC_DEFUN CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$GTK_LIBS $LIBS" dnl Try to compile a simple GTK program. - AC_MSG_CHECKING([whether GTK compiles]) - GTK_COMPILES=no - AC_LINK_IFELSE( + AC_CACHE_CHECK([whether GTK compiles], [emacs_cv_gtk_compiles], + [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[/* Check the Gtk and Glib APIs. */ #include @@ -2634,9 +2634,8 @@ AC_DEFUN 0, 0, 0, G_CALLBACK (callback), 0)) gtk_main_iteration (); ]])], - [GTK_COMPILES=yes]) - AC_MSG_RESULT([$GTK_COMPILES]) - if test "${GTK_COMPILES}" != "yes"; then + [emacs_cv_gtk_compiles=yes], [emacs_cv_gtk_compiles=no])]) + if test "${emacs_cv_gtk_compiles}" != "yes"; then GTK_OBJ= if test "$USE_X_TOOLKIT" != "maybe"; then AC_MSG_ERROR([Gtk+ wanted, but it does not compile, see config.log. Maybe some x11-devel files missing?]); @@ -2653,7 +2652,9 @@ AC_DEFUN one display, but if you use more than one and close one of them Emacs may crash. See http://bugzilla.gnome.org/show_bug.cgi?id=85715]]) - sleep 3 + if test "${ac_gtk_bug_message_pause}" != "no"; then + sleep 3 + fi fi fi @@ -2767,8 +2768,8 @@ AC_DEFUN CFLAGS="$CFLAGS $GSETTINGS_CFLAGS" old_LIBS=$LIBS LIBS="$LIBS $GSETTINGS_LIBS" - AC_MSG_CHECKING([whether GSettings is in gio]) - AC_LINK_IFELSE( + AC_CACHE_CHECK([whether GSettings is in gio], [emacs_cv_gsettings_in_gio], + [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[/* Check that gsettings really is present. */ #include @@ -2778,10 +2779,9 @@ AC_DEFUN GSettings *settings; GVariant *val = g_settings_get_value (settings, ""); ]])], - [], HAVE_GSETTINGS=no) - AC_MSG_RESULT([$HAVE_GSETTINGS]) + [emacs_cv_gsettings_in_gio=yes], [emacs_cv_gsettings_in_gio=no])]) - if test "$HAVE_GSETTINGS" = "yes"; then + if test "$emacs_cv_gsettings_in_gio" = "yes"; then AC_DEFINE(HAVE_GSETTINGS, 1, [Define to 1 if using GSettings.]) SETTINGS_CFLAGS="$GSETTINGS_CFLAGS" SETTINGS_LIBS="$GSETTINGS_LIBS" @@ -3344,18 +3344,18 @@ AC_DEFUN AC_CHECK_HEADER(noX/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, + AC_CACHE_CHECK([for XpmReturnAllocPixels preprocessor define], + [emacs_cv_cpp_xpm_return_alloc_pixels], + [AC_EGREP_CPP(no_return_alloc_pixels, [#include "noX/xpm.h" #ifndef XpmReturnAllocPixels no_return_alloc_pixels #endif - ], HAVE_XPM=no, HAVE_XPM=yes) + ], emacs_cv_cpp_xpm_return_alloc_pixels=no, + emacs_cv_cpp_xpm_return_alloc_pixels=yes)]) - if test "${HAVE_XPM}" = "yes"; then - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) + if test "$emacs_cv_cpp_xpm_return_alloc_pixels" = "no"; then + HAVE_XPM=no LDFLAGS="$SAVE_LDFLAGS" fi fi @@ -3375,18 +3375,18 @@ AC_DEFUN AC_CHECK_HEADER(X11/xpm.h, [AC_CHECK_LIB(Xpm, XpmReadFileToPixmap, HAVE_XPM=yes, , -lX11)]) if test "${HAVE_XPM}" = "yes"; then - AC_MSG_CHECKING(for XpmReturnAllocPixels preprocessor define) - AC_EGREP_CPP(no_return_alloc_pixels, - [#include "X11/xpm.h" + AC_CACHE_CHECK([for XpmReturnAllocPixels preprocessor define], + [emacs_cv_cpp_xpm_return_alloc_pixels], + [AC_EGREP_CPP(no_return_alloc_pixels, + [#include "noX/xpm.h" #ifndef XpmReturnAllocPixels no_return_alloc_pixels #endif - ], HAVE_XPM=no, HAVE_XPM=yes) + ], emacs_cv_cpp_xpm_return_alloc_pixels=no, + emacs_cv_cpp_xpm_return_alloc_pixels=yes)]) - if test "${HAVE_XPM}" = "yes"; then - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) + if test "$emacs_cv_cpp_xpm_return_alloc_pixels" = "no"; then + HAVE_XPM=no fi fi fi @@ -3988,17 +3988,11 @@ AC_DEFUN # PTY-related GNU extensions. AC_CHECK_FUNCS(getpt posix_openpt) -# Check this now, so that we will NOT find the above functions in ncurses. -# That is because we have not set up to link ncurses in lib-src. -# It's better to believe a function is not available -# than to expect to find it in ncurses. -# Also we need tputs and friends to be able to build at all. -AC_MSG_CHECKING([for library containing tputs]) -# Run a test program that contains a call to tputs, a call that is -# never executed. This tests whether a pre-'main' dynamic linker -# works with the library. It's too much trouble to actually call -# tputs in the test program, due to portability hassles. When -# cross-compiling, assume the test program will run if it links. +dnl Run a test program that contains a call to tputs, a call that is +dnl never executed. This tests whether a pre-'main' dynamic linker +dnl works with the library. It's too much trouble to actually call +dnl tputs in the test program, due to portability hassles. When +dnl cross-compiling, assume the test program will run if it links. AC_DEFUN([tputs_link_source], [ AC_LANG_SOURCE( [[extern void tputs (const char *, int, int (*)(int)); @@ -4009,38 +4003,42 @@ AC_DEFUN return 0; }]]) ]) -if test "${opsys}" = "mingw32"; then - msg='none required' +# Check this now, so that we will NOT find the above functions in ncurses. +# That is because we have not set up to link ncurses in lib-src. +# It's better to believe a function is not available +# than to expect to find it in ncurses. +# Also we need tputs and friends to be able to build at all. +AC_CACHE_CHECK([for library containing tputs], [emacs_cv_tputs_lib], +[if test "${opsys}" = "mingw32"; then + emacs_cv_tputs_lib='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' + emacs_cv_tputs_lib='none required' else - LIBS_TERMCAP=-l$tputs_library - msg=$LIBS_TERMCAP - LIBS="$LIBS_TERMCAP $LIBS" + emacs_cv_tputs_lib=-l$tputs_library + LIBS="$emacs_cv_tputs_lib $LIBS" fi - AC_RUN_IFELSE([tputs_link_source], [], [msg=no], - [AC_LINK_IFELSE([tputs_link_source], [], [msg=no])]) + AC_RUN_IFELSE([tputs_link_source], [], [emacs_cv_tputs_lib=no], + [AC_LINK_IFELSE([tputs_link_source], [], [emacs_cv_tputs_lib=no])]) LIBS=$OLIBS - if test "X$msg" != Xno; then + if test "X$emacs_cv_tputs_lib" != 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]) +AS_CASE(["$emacs_cv_tputs_lib"], + [no], [AC_MSG_ERROR([The required function 'tputs' was not found in any library. The following libraries were tried (in order): libtinfo, libncurses, libterminfo, libtermcap, libcurses Please try installing whichever of these libraries is most appropriate for your system, together with its header files. -For example, a libncurses-dev(el) or similar package.]) -fi +For example, a libncurses-dev(el) or similar package.])], + [-l*], [LIBS_TERMCAP=$emacs_cv_tputs_lib], + [*], [LIBS_TERMCAP=]) ## Use termcap instead of terminfo? ## Only true for: freebsd < 40000, ms-w32, msdos, netbsd < 599002500. @@ -4276,28 +4274,27 @@ AC_DEFUN dnl dnl Check this late, since it depends on $GTK_CFLAGS etc. XGSELOBJ= -OLDCFLAGS="$CFLAGS" +AC_CACHE_CHECK([whether GLib is linked in], [emacs_cv_links_glib], +[OLDCFLAGS="$CFLAGS" OLDLIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS $RSVG_CFLAGS $DBUS_CFLAGS $SETTINGS_CFLAGS" LIBS="$LIBS $GTK_LIBS $RSVG_LIBS $DBUS_LIBS $SETTINGS_LIBS" CFLAGS="$CFLAGS $NOTIFY_CFLAGS $CAIRO_CFLAGS" LIBS="$LIBS $NOTIFY_LIBS $CAIRO_LIBS" -AC_MSG_CHECKING([whether GLib is linked in]) AC_LINK_IFELSE([AC_LANG_PROGRAM( [[#include ]], [[g_print ("Hello world");]])], - [links_glib=yes], - [links_glib=no]) -AC_MSG_RESULT([$links_glib]) -if test "${links_glib}" = "yes"; then + [emacs_cv_links_glib=yes], + [emacs_cv_links_glib=no]) +CFLAGS="$OLDCFLAGS" +LIBS="$OLDLIBS"]) +if test "${emacs_cv_links_glib}" = "yes"; then AC_DEFINE(HAVE_GLIB, 1, [Define to 1 if GLib is linked in.]) if test "$HAVE_NS" = no;then XGSELOBJ=xgselect.o fi fi -CFLAGS="$OLDCFLAGS" -LIBS="$OLDLIBS" AC_SUBST(XGSELOBJ) dnl Adapted from Haible's version. @@ -4663,16 +4660,15 @@ AC_DEFUN dnl FIXME Does gnu-kfreebsd have linux/version.h? It seems unlikely... gnu-linux | gnu-kfreebsd ) - AC_MSG_CHECKING([for signals via characters]) - AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ + AC_CACHE_CHECK([for signals via characters], [emacs_cv_signals_via_chars], + [AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ #include #if LINUX_VERSION_CODE < 0x20400 # error "Linux version too old" #endif - ]], [[]])], emacs_signals_via_chars=yes, emacs_signals_via_chars=no) + ]], [[]])], emacs_cv_signals_via_chars=yes, emacs_cv_signals_via_chars=no)]) - AC_MSG_RESULT([$emacs_signals_via_chars]) - test $emacs_signals_via_chars = yes && AC_DEFINE(SIGNALS_VIA_CHARACTERS, 1) + test "$emacs_cv_signals_via_chars" = yes && AC_DEFINE(SIGNALS_VIA_CHARACTERS, 1) ;; esac -- 2.11.1 --=-=-=--