summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--INSTALL7
-rw-r--r--configure.in44
3 files changed, 44 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 877fbcc7e15..4c568a8c664 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
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.
(GLYPH_DEBUG): Define if glyphs debugging is enabled.
diff --git a/INSTALL b/INSTALL
index c41bdd9f7cd..5c6bc0b97dd 100644
--- 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
diff --git a/configure.in b/configure.in
index 393d87fd721..5c38b041dec 100644
--- a/configure.in
+++ b/configure.in
@@ -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