X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=configure.ac;h=d94af7b3048d7cbf0c4233e37f21cd00f6b3e29a;hb=0591220f339c313761f9a208e88fb719db566993;hp=7a3cd8751123a90439b8d1e9d9b35e2fecc7a68a;hpb=dee4c244254bb49d1ffa8bd7171ae9cce596d2d0;p=elogind.git diff --git a/configure.ac b/configure.ac index 7a3cd8751..d94af7b30 100644 --- a/configure.ac +++ b/configure.ac @@ -129,12 +129,10 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\ -Wextra \ -Wno-inline \ -Wundef \ - -Wformat=2 \ + "-Wformat=2 -Wformat-security -Wformat-nonliteral" \ -Wlogical-op \ -Wsign-compare \ - -Wformat-security \ -Wmissing-include-dirs \ - -Wformat-nonliteral \ -Wold-style-definition \ -Wpointer-arith \ -Winit-self \ @@ -167,8 +165,10 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\ --param=ssp-buffer-size=4]) AC_SUBST([OUR_CFLAGS], $with_cflags) -CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\ - -Wp,-D_FORTIFY_SOURCE=2]) +AS_CASE([$CFLAGS], [*-O[[12345\ ]]*], [ + CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\ + -Wp,-D_FORTIFY_SOURCE=2])], [ + AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])]) AC_SUBST([OUR_CPPFLAGS], $with_cppflags) CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\