summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2017-04-08 20:58:20 -0400
committerNoam Postavsky <npostavs@gmail.com>2017-08-14 20:19:12 -0400
commite88bbd22c5ffb1d6008c0c7e18a36043b0f397dd (patch)
treea04e4dc88eb2a7895139ae61c464b72bfd73bce7 /configure.ac
parent13a846823a92447d5cf0c2ce2bb401c5cdcb9ee4 (diff)
downloademacs-e88bbd22c5ffb1d6008c0c7e18a36043b0f397dd.tar.gz
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.
Diffstat (limited to 'configure.ac')
-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
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 +1317,25 @@ dnl http://bugs.debian.org/684788
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 +1698,13 @@ fi
# 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 <sys/sysinfo.h>]],
+ AC_CACHE_CHECK([if Linux sysinfo may be used], [emacs_cv_linux_sysinfo],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/sysinfo.h>]],
[[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 <sys/sysinfo.h>]],
@@ -1765,15 +1763,15 @@ AUTO_DEPEND=no
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
@@ -2037,19 +2035,17 @@ if test "${with_w32}" != no; then
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 <windows.h>
#include <usp10.h>]],
[[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=
@@ -2412,8 +2408,8 @@ if test "${HAVE_X11}" = "yes"; then
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])
@@ -2429,28 +2425,29 @@ if test "${HAVE_X11}" = "yes"; then
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 <X11/Xlib.h>
+ AC_CACHE_CHECK([for Xkb], [emacs_cv_xkb],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h>
#include <X11/XKBlib.h>]],
[[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
@@ -2611,9 +2608,8 @@ if test x"$pkg_check_gtk" = xyes; then
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 <gtk/gtk.h>
@@ -2631,9 +2627,8 @@ if test x"$pkg_check_gtk" = xyes; then
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?]);
@@ -2650,7 +2645,6 @@ if test x"$pkg_check_gtk" = xyes; then
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
fi
fi
@@ -2764,8 +2758,8 @@ if test "${HAVE_X11}" = "yes" && test "${with_gsettings}" = "yes"; then
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 <glib-object.h>
@@ -2775,10 +2769,9 @@ if test "${HAVE_X11}" = "yes" && test "${with_gsettings}" = "yes"; then
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"
@@ -3341,18 +3334,18 @@ if test "${HAVE_W32}" = "yes" && test "${opsys}" = "cygwin"; then
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
@@ -3372,18 +3365,18 @@ if test "${HAVE_X11}" = "yes"; then
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
@@ -3985,17 +3978,11 @@ AC_CHECK_FUNCS(grantpt)
# 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));
@@ -4006,38 +3993,42 @@ AC_DEFUN([tputs_link_source], [
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.
@@ -4273,28 +4264,27 @@ dnl glib at a low level.
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 <glib.h>
]],
[[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.
@@ -4660,16 +4650,15 @@ case $opsys in
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 <linux/version.h>
#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