]> git.eshelyaron.com Git - emacs.git/commitdiff
* configure.in: Fix previous change. Remove --enable-asserts.
authorDmitry Antipov <dmantipov@yandex.ru>
Thu, 28 Jun 2012 16:34:05 +0000 (20:34 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Thu, 28 Jun 2012 16:34:05 +0000 (20:34 +0400)
(CPPFLAGS): Remove conditional -DXASSERTS=1.
Add --enable-link-time-optimization.
* INSTALL: Mention this.

ChangeLog
INSTALL
configure.in

index 877fbcc7e151f1aeb9680118498e225a64f45cd8..4c568a8c664191f1efd81c61d5ce8176d5497d18 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * configure.in: Fix previous change. Remove --enable-asserts.
+       (CPPFLAGS): Remove conditional -DXASSERTS=1.
+       Add --enable-link-time-optimization.
+       * INSTALL: Mention this.
+
 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
 
        * configure.in: Add glyphs category to --enable-checking option.
diff --git a/INSTALL b/INSTALL
index c41bdd9f7cde871a5d03a16502480f3b098e6b7f..5c6bc0b97dd52bccf0dcd5f84c01eef39ad068e5 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -323,6 +323,13 @@ and is useful with GNU-compatible compilers.  On a recent GNU system
 there should be no warnings; on older and on non-GNU systems the
 generated warnings may still be useful.
 
+Use --enable-link-time-optimization to enable link-time optimizer, which
+is available in GNU compiler since version 4.5.0.  If your compiler is not
+GNU or older than version 4.5.0, this option does nothing.  If `configure'
+can determine number of online CPUS on your system, final link-time
+optimization and code generation is executed in parallel using one job
+per each available online CPU.
+
 The `--prefix=PREFIXDIR' option specifies where the installation process
 should put emacs and its data files.  This defaults to `/usr/local'.
 - Emacs (and the other utilities users run) go in PREFIXDIR/bin
index 393d87fd721194c5c68db95eb922068efbfc8d9e..5c38b041dec470fcbf1391205aebb74307142908 100644 (file)
@@ -230,11 +230,6 @@ AC_ARG_ENABLE(ns-self-contained,
    EN_NS_SELF_CONTAINED=$enableval,
    EN_NS_SELF_CONTAINED=yes)
 
-AC_ARG_ENABLE(asserts,
-[AS_HELP_STRING([--enable-asserts], [compile code with asserts enabled])],
-      USE_XASSERTS=$enableval,
-      USE_XASSERTS=no)
-
 AC_ARG_ENABLE(locallisppath,
 [AS_HELP_STRING([--enable-locallisppath=PATH],
                 [directories Emacs should search for lisp files specific
@@ -265,21 +260,21 @@ do
                        ac_gc_check_string_free_list= ;
                        ac_xmalloc_overrun= ;
                        ac_gc_check_cons_list= ;
-                       ac_check_glyphs= ;;
+                       ac_glyphs_debug= ;;
        all)            ac_enable_checking=1 ;
                        ac_gc_check_stringbytes=1 ;
                        ac_gc_check_string_overrun=1 ;
                        ac_gc_check_string_free_list=1 ;
                        ac_xmalloc_overrun=1 ;
                        ac_gc_check_cons_list=1 ;
-                       ac_check_glyphs=1 ;;
+                       ac_glyphs_debug=1 ;;
        # these enable particular checks
        stringbytes)    ac_gc_check_stringbytes=1 ;;
        stringoverrun)  ac_gc_check_string_overrun=1 ;;
        stringfreelist) ac_gc_check_string_free_list=1 ;;
        xmallocoverrun) ac_xmalloc_overrun=1 ;;
        conslist)       ac_gc_check_cons_list=1 ;;
-       glyphs)         ac_check_glyphs=1 ;;
+       glyphs)         ac_glyphs_debug=1 ;;
        *)      AC_MSG_ERROR(unknown check category $check) ;;
        esac
 done
@@ -311,7 +306,7 @@ if test x$ac_gc_check_cons_list != x ; then
   AC_DEFINE(GC_CHECK_CONS_LIST, 1,
 [Define this to check for errors in cons list.])
 fi
-if test x$ac_check_glyphs != x ; then
+if test x$ac_glyphs_debug != x ; then
   AC_DEFINE(GLYPH_DEBUG, 1,
 [Define this to enable glyphs debugging code.])
 fi
@@ -588,6 +583,32 @@ AC_ARG_ENABLE([gcc-warnings],
   [gl_gcc_warnings=no]
 )
 
+AC_ARG_ENABLE(link-time-optimization,
+[AS_HELP_STRING([--enable-link-time-optimization],
+                [build emacs with link-time optimization.
+                 This is supported only for GCC since 4.5.0.])],
+if test "${enableval}" != "no"; then
+   AC_MSG_CHECKING([whether link-time optimization is supported])
+   ac_lto_supported=no
+   if test x$GCC = xyes; then
+      CPUS=`getconf _NPROCESSORS_ONLN 2>/dev/null`
+      if test x$CPUS != x; then
+        LTO="-flto=$CPUS"
+      else
+        LTO="-flto"
+      fi        
+      old_CFLAGS=$CFLAGS
+      CFLAGS="$CFLAGS $LTO"
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
+       [ac_lto_supported=yes], [ac_lto_supported=no])
+      CFLAGS="$old_CFLAGS"
+   fi
+   AC_MSG_RESULT([$ac_lto_supported])
+   if test "$ac_lto_supported" = "yes"; then
+      CFLAGS="$CFLAGS $LTO"
+   fi
+fi)
+
 # gl_GCC_VERSION_IFELSE([major], [minor], [run-if-found], [run-if-not-found])
 # ------------------------------------------------
 # If $CPP is gcc-MAJOR.MINOR or newer, then run RUN-IF-FOUND.
@@ -3657,11 +3678,6 @@ if test -n "${EMACSDOC}"; then
    echo "  Environment variable EMACSDOC set to:                   $EMACSDOC"
 fi
 
-if test $USE_XASSERTS = yes; then
-   echo "  Compiling with asserts turned on."
-   CPPFLAGS="$CPPFLAGS -DXASSERTS=1"
-fi
-
 echo
 
 if test "$HAVE_NS" = "yes"; then