summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@gmail.com>2011-08-19 23:06:13 +0200
committerMatúš Kukan <matus.kukan@gmail.com>2011-08-22 12:54:53 +0200
commitfc41132306cf8ff523fb26518154c1c99c3ca388 (patch)
tree0bd638f2f7f4dd799aeb38b271e45b5741bc8c94 /configure.in
parent63eef1c1cf203aa75093b479a1e8dd24593546e7 (diff)
enable using link-time optimization
This commit enables LTO for all shared libraries. Build takes much longer. Use just with gcc-4.5 or later.
Diffstat (limited to 'configure.in')
-rwxr-xr-xconfigure.in19
1 files changed, 19 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 536ca8ba5e27..87522f7ac525 100755
--- a/configure.in
+++ b/configure.in
@@ -244,6 +244,13 @@ AC_ARG_ENABLE(dbgutil,
[Include additional debugging utilities, such as assertions, object
counting, etc. Larger build. Independent from --enable-debug]))
+AC_ARG_ENABLE(lto,
+ AS_HELP_STRING([--enable-lto],
+ [Enable link-time optimization. Suitable for product builds.
+ Building takes longer but libraries are optimized for speed.
+ (possible only with gcc-4.5 or later,
+ better to use gcc-4.6 and 'gold' as linker)]))
+
AC_ARG_ENABLE(crashdump,
AS_HELP_STRING([--enable-crashdump],
[Enable the crashdump feature.]))
@@ -2229,6 +2236,18 @@ AC_SUBST(PRODUCT)
AC_SUBST(PROFULLSWITCH)
AC_SUBST(PROEXT)
+# Set the ENABLE_LTO variable
+# ===================================================================
+AC_MSG_CHECKING([whether to use link-time optimization])
+if test -n "$enable_lto" -a "$enable_lto" != "no"; then
+ ENABLE_LTO="TRUE"
+ AC_MSG_RESULT([yes])
+else
+ ENABLE_LTO=""
+ AC_MSG_RESULT([no])
+fi
+AC_SUBST(ENABLE_LTO)
+
dnl whether to include symbols into final build.
dnl ===================================================================
AC_MSG_CHECKING([whether to include symbols])