aboutsummaryrefslogtreecommitdiffstats
path: root/aclocal.m4
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2019-02-27 14:40:05 +0100
committerMaria Matejka <mq@ucw.cz>2019-02-27 14:40:05 +0100
commita68442e0563f5b756f9a7323cea44a25ce048738 (patch)
treeff6d96f142e5f3b351fc39fb01128107b4190756 /aclocal.m4
parentf249d0b84c840242a084966999a1d228c603b431 (diff)
downloadbird-a68442e0563f5b756f9a7323cea44a25ce048738.tar.gz
Fixed link time optimizer check for FreeBSD
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m424
1 files changed, 24 insertions, 0 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index c401d447..0044adf9 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -131,6 +131,30 @@ AC_DEFUN([BIRD_CHECK_ANDROID_LOG],
)
])
+AC_DEFUN([BIRD_CHECK_LTO],
+[
+ bird_tmp_cflags="$CFLAGS"
+ bird_tmp_ldflags="$CFLAGS"
+ CFLAGS="-flto"
+ LDFLAGS="-flto"
+
+ AC_CACHE_CHECK(
+ [whether link time optimizer is available],
+ [bird_cv_c_lto],
+ [
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM()],
+ [bird_cv_c_lto=yes],
+ [bird_cv_c_lto=no]
+ )
+ ]
+ )
+
+ CFLAGS="$bird_tmp_cflags"
+ LDFLAGS="$bird_tmp_ldflags"
+])
+
+
AC_DEFUN([BIRD_CHECK_GCC_OPTION],
[
bird_tmp_cflags="$CFLAGS"