summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in57
1 files changed, 57 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 815da2009..bee9b7030 100644
--- a/configure.in
+++ b/configure.in
@@ -166,6 +166,29 @@ AC_ARG_ENABLE(
#
+# LTO
+#
+AC_ARG_ENABLE(
+ [lto],
+ AC_HELP_STRING(
+ [--enable-lto],
+ [
+ Enables or Disables Linktime Code Optimization (LTO is enabled by default)
+ ]
+ ),
+ [
+ enable_lto="$enableval"
+ case $enableval in
+ "no");;
+ "yes");;
+ *) AC_MSG_ERROR([[invalid argument --enable-lto=$disableval... stopping]]);;
+ esac
+ ],
+ [enable_lto="yes"]
+)
+
+
+#
# Optionally specify the path to mysql_config
#
AC_ARG_WITH(
@@ -327,6 +350,40 @@ AC_COMPILE_IFELSE(
)
+#
+# LTO Support test
+#
+if test "$enable_lto" != "no" ; then
+
+ OLD_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -flto"
+
+ OLD_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -flto"
+
+ AC_MSG_CHECKING([whether $CC supports -flto])
+ AC_RUN_IFELSE(
+ [
+ int main(int argc, char **argv){
+ return 0;
+ }
+ ],
+ [
+ AC_MSG_RESULT([yes])
+ ],
+ [
+ AC_MSG_RESULT([no])
+ CFLAGS="$OLD_CFLAGS"
+ LDFLAGS="$OLD_LDFLAGS"
+ ],
+ [
+ AC_MSG_RESULT([guessing no])
+ ]
+ )
+fi
+
+
+
AC_MSG_CHECKING([whether $CC supports -Wno-pointer-sign])
OLD_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wno-pointer-sign"