summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDavide Cavalca <davide125@tiscali.it>2016-07-28 20:42:45 -0700
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-07-28 23:42:45 -0400
commit4e3382bdd70a54628ffe030c5d37e06713c329ab (patch)
treeda039e6682865207c63c30605e738cba41572a84 /configure.ac
parent689e4e6a94222b4d58a8b9cb3c51cc2f82268aa9 (diff)
build-sys: conditionally disable LTO if requested (#3823)
This adds a --disable-lto option to ./configure, but does not change the default behavior.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac7
1 files changed, 5 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index cf595e68c0..a86deca471 100644
--- a/configure.ac
+++ b/configure.ac
@@ -211,9 +211,12 @@ AS_CASE([$CC], [*clang*],
-Wno-gnu-variable-sized-type-not-at-end \
])])
+AC_ARG_ENABLE([lto], [AS_HELP_STRING([--disable-lto], [disable -flto])],
+ [], [enable_lto=yes])
AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
- [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
- -flto])],
+ [AS_IF([test "x$enable_lto" = "xyes"],
+ [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [-flto])],
+ [AC_MSG_RESULT([disabling -flto as requested])])],
[AC_MSG_RESULT([skipping -flto, optimization not enabled])])
AC_SUBST([OUR_CFLAGS], "$with_cflags $sanitizer_cflags")