]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Configure: CFLAGS update
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Tue, 6 Aug 2019 12:53:02 +0000 (14:53 +0200)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Tue, 6 Aug 2019 12:54:36 +0000 (14:54 +0200)
 - add -flto only to default CFLAGS
 - add -fno-strict-aliasing, -fno-strict-overflow always
 - remove -Wno-implicit-fallthrough

configure.ac

index 14dbcd52a4f14fd11dbcf1b15719ec2f2b510972..7e8578ab48c4ead2687cb6a453a3c51295afefbd 100644 (file)
@@ -137,27 +137,27 @@ if test "$enable_pthreads" != no ; then
   fi
 fi
 
+# This is assumed to be necessary for proper BIRD build
+CFLAGS="$CFLAGS -fno-strict-aliasing -fno-strict-overflow"
+
 if test "$bird_cflags_default" = yes ; then
   BIRD_CHECK_GCC_OPTION([bird_cv_c_option_wno_pointer_sign], [-Wno-pointer-sign], [-Wall])
   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_fno_strict_aliasing], [-fno-strict-aliasing])
-  BIRD_CHECK_GCC_OPTION([bird_cv_c_option_fno_strict_overflow], [-fno-strict-overflow])
+
+  if test "$enable_debug" = no; then
+    BIRD_CHECK_LTO
+  fi
+
+  if test "$bird_cv_c_lto" = yes; then
+    CFLAGS="$CFLAGS -flto"
+    LDFLAGS="$LDFLAGS -flto=4"
+  fi
 
   CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes -Wno-parentheses"
   BIRD_ADD_GCC_OPTION([bird_cv_c_option_wno_pointer_sign], [-Wno-pointer-sign])
   BIRD_ADD_GCC_OPTION([bird_cv_c_option_wno_missing_init], [-Wno-missing-field-initializers])
-  BIRD_ADD_GCC_OPTION([bird_cv_c_option_fno_strict_aliasing], [-fno-strict-aliasing])
-  BIRD_ADD_GCC_OPTION([bird_cv_c_option_fno_strict_overflow], [-fno-strict-overflow])
 fi
 
-if test "$enable_debug" = no; then
-  BIRD_CHECK_LTO
-fi
-
-if test "$bird_cv_c_lto" = yes; then
-  CFLAGS="$CFLAGS -flto"
-  LDFLAGS="$LDFLAGS -flto=4"
-fi
 
 AC_MSG_CHECKING([CFLAGS])
 AC_MSG_RESULT([$CFLAGS])
@@ -387,9 +387,6 @@ if test "$enable_debug" = yes ; then
       AC_CHECK_LIB([efence], [malloc])
     fi
   fi
-else
-  BIRD_CHECK_GCC_OPTION([bird_cv_c_option_wno_implicit_fallthrough], [-Wno-implicit-fallthrough])
-  BIRD_ADD_GCC_OPTION([bird_cv_c_option_wno_implicit_fallthrough], [-Wno-implicit-fallthrough])
 fi
 
 CLIENT=birdcl