From: Igor Putovny Date: Fri, 9 May 2025 17:56:24 +0000 (+0200) Subject: Add configure option to independently enable/disable link-time optimization X-Git-Tag: v3.0.3~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=017e3d8223d70c86fd73d57e5f0b0f02ce6dea2c;p=thirdparty%2Fbird.git Add configure option to independently enable/disable link-time optimization --- diff --git a/configure.ac b/configure.ac index 9793f6d33..be8e6716d 100644 --- a/configure.ac +++ b/configure.ac @@ -18,6 +18,12 @@ AC_ARG_ENABLE([debug], [enable_debug=no] ) +AC_ARG_ENABLE([lto], + [AS_HELP_STRING([--enable-lto], [enable link-time optimization @<:@no@:>@])], + [], + [enable_lto=auto] +) + AC_ARG_ENABLE([debug-generated], [AS_HELP_STRING([--enable-debug-generated], [enable this to abstain from generating #line @<:@no@:>@])], [], @@ -149,8 +155,15 @@ if test "$bird_cflags_default" = yes ; then BIRD_CHECK_GCC_OPTION([bird_cv_c_option_wno_missing_init], [-Wno-missing-field-initializers], [-Wall -Wextra]) BIRD_CHECK_GCC_OPTION([bird_cv_c_option_watomic_implicit_seq_cst], [-Watomic-implicit-seq-cst], [-Wall -Wextra]) - if test "$enable_debug" = no; then + if test "$enable_lto" = no || (test "$enable_debug" = yes && test "$enable_lto" = auto); then + # LTO is not configured at all + true + else BIRD_CHECK_LTO + + if test "$enable_lto" = yes && test "$bird_cv_c_lto" = no; then + AC_MSG_ERROR([LTO not available.]) + fi fi if test "$bird_cv_c_lto" = yes; then @@ -508,6 +521,7 @@ AC_MSG_RESULT([ Object directory: $objdir]) AC_MSG_RESULT([ Iproute2 directory: $iproutedir]) AC_MSG_RESULT([ System configuration: $sysdesc]) AC_MSG_RESULT([ Debugging: $enable_debug]) +AC_MSG_RESULT([ Link-time optimization: $enable_lto]) AC_MSG_RESULT([ Compact tries: $enable_compact_tries]) AC_MSG_RESULT([ Routing protocols: $protocols]) AC_MSG_RESULT([ LibSSH support in RPKI: $enable_libssh])