]> git.ipfire.org Git - network.git/commitdiff
configure: Drop non-sensical CFLAGS and add more warnings
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 30 Jan 2023 18:54:54 +0000 (18:54 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 30 Jan 2023 18:54:54 +0000 (18:54 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
configure.ac

index ba5967dd1dfa68fc1eacc1cc3240584147bd6064..9560838b485f4b19fc387e20d95fc1357e42f0af 100644 (file)
@@ -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)
 
 # ------------------------------------------------------------------------------