From: Michael Tremer Date: Mon, 30 Jan 2023 18:54:54 +0000 (+0000) Subject: configure: Drop non-sensical CFLAGS and add more warnings X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a465e68bd8bf11f7cd41089941ad558dbda34f19;hp=9ca8914ef2c65a669aa05e37f2dbe232f54ecbf1;p=people%2Fms%2Fnetwork.git configure: Drop non-sensical CFLAGS and add more warnings Signed-off-by: Michael Tremer --- diff --git a/configure.ac b/configure.ac index ba5967dd..9560838b 100644 --- a/configure.ac +++ b/configure.ac @@ -28,6 +28,8 @@ AC_INIT([network], AC_CONFIG_AUX_DIR([build-aux]) +AC_USE_SYSTEM_EXTENSIONS +AC_SYS_LARGEFILE AC_PREFIX_DEFAULT([/usr]) AM_INIT_AUTOMAKE([ @@ -65,37 +67,21 @@ AC_PROG_CC_C99 AC_PROG_CC_C_O AC_PROG_GCC_TRADITIONAL -AC_USE_SYSTEM_EXTENSIONS - CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\ - -pipe \ -Wall \ - -Wextra \ - -Wno-inline \ - -Wundef \ - "-Wformat=2 -Wformat-security -Wformat-nonliteral" \ - -Wno-unused-parameter \ - -Wno-unused-result \ - -fno-strict-aliasing \ - -ffunction-sections \ - -fdata-sections \ - -fstack-protector-all \ - --param=ssp-buffer-size=4]) -AC_SUBST([OUR_CFLAGS], $with_cflags) + -Wchar-subscripts \ + -Wformat-security \ + -Wmissing-declarations \ + -Wmissing-prototypes \ + -Wnested-externs \ + -Wpointer-arith \ + -Wshadow \ + -Wsign-compare \ + -Wstrict-prototypes \ + -Wtype-limits \ +]) -AS_CASE([$CFLAGS], [*-O[[12345g\ ]]*], - [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], [\ - -Wl,--as-needed \ - -Wl,--no-undefined \ - -Wl,--gc-sections \ - -Wl,-z,relro \ - -Wl,-z,now]) -AC_SUBST([OUR_LDFLAGS], $with_ldflags) +AC_SUBST([OUR_CFLAGS], $with_cflags) # ------------------------------------------------------------------------------