summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaël Bonithon <gael@xfce.org>2021-01-26 10:22:57 +0100
committerGaël Bonithon <gael@xfce.org>2021-04-22 11:17:43 +0200
commit5f372ab304353bcbb44a5807248cb494cb3024c4 (patch)
treec0ebebdf0c21edd248be4e2d46984138941399c7
parentdba4b975a67bd39835c49069b1ebb5dc151eb981 (diff)
downloadxfce4-dev-tools-5f372ab304353bcbb44a5807248cb494cb3024c4.tar.gz
xdt-features.m4: Always enable compilation warnings
Fixes #44.
-rw-r--r--m4macros/xdt-features.m461
1 files changed, 29 insertions, 32 deletions
diff --git a/m4macros/xdt-features.m4 b/m4macros/xdt-features.m4
index 6f46f77..cddd578 100644
--- a/m4macros/xdt-features.m4
+++ b/m4macros/xdt-features.m4
@@ -62,57 +62,38 @@ AC_DEFUN([XDT_FEATURE_DEBUG],
AS_HELP_STRING([--disable-debug],[Include no debugging support]),
[enable_debug=$enableval], [enable_debug=m4_default([$1], [minimum])])
+ dnl enable most warnings regardless of debug level
+ xdt_cv_additional_CFLAGS="-Wall -Wextra \
+ -Wno-missing-field-initializers \
+ -Wno-unused-parameter -Wold-style-definition \
+ -Wdeclaration-after-statement \
+ -Wmissing-declarations \
+ -Wmissing-noreturn -Wpointer-arith \
+ -Wcast-align -Wformat -Wformat-security -Wformat-y2k \
+ -Winit-self -Wmissing-include-dirs -Wundef \
+ -Wnested-externs -Wredundant-decls"
+
AC_MSG_CHECKING([whether to build with debugging support])
if test x"$enable_debug" = x"full" -o x"$enable_debug" = x"yes"; then
AC_DEFINE([DEBUG], [1], [Define for debugging support])
- xdt_cv_additional_CFLAGS="-DXFCE_DISABLE_DEPRECATED \
- -Wall -Wextra \
- -Wno-missing-field-initializers \
- -Wno-unused-parameter -Wold-style-definition \
- -Wdeclaration-after-statement \
- -Wmissing-declarations \
- -Wmissing-noreturn -Wpointer-arith \
- -Wcast-align -Wformat -Wformat-security -Wformat-y2k \
- -Winit-self -Wmissing-include-dirs -Wundef \
- -Wnested-externs"
CPPFLAGS="$CPPFLAGS"
if test x`uname` = x"Linux"; then
xdt_cv_additional_CFLAGS="$xdt_cv_additional_CFLAGS -fstack-protector"
fi
- dnl # signal.h inline is crapy on openbsd
- if test x`uname` != x"OpenBSD"; then
- xdt_cv_additional_CFLAGS="$xdt_cv_additional_CFLAGS -Wredundant-decls"
- fi
-
if test x"$enable_debug" = x"full"; then
AC_DEFINE([DEBUG_TRACE], [1], [Define for tracing support])
- xdt_cv_additional_CFLAGS="$xdt_cv_additional_CFLAGS -O0 -g -Werror"
+ xdt_cv_additional_CFLAGS="$xdt_cv_additional_CFLAGS -O0 -g"
CPPFLAGS="$CPPFLAGS -DG_ENABLE_DEBUG"
AC_MSG_RESULT([full])
else
xdt_cv_additional_CFLAGS="$xdt_cv_additional_CFLAGS -g -Wshadow"
AC_MSG_RESULT([yes])
fi
-
- XDT_SUPPORTED_FLAGS([supported_CFLAGS], [$xdt_cv_additional_CFLAGS])
-
- ifelse([$CXX], , , [
- dnl FIXME: should test on c++ compiler, but the following line causes
- dnl autoconf errors for projects that don't check for a
- dnl c++ compiler at all.
- dnl AC_LANG_PUSH([C++])
- dnl XDT_SUPPORTED_FLAGS([supported_CXXFLAGS], [$xdt_cv_additional_CFLAGS])
- dnl AC_LANG_POP()
- dnl instead, just use supported_CFLAGS...
- supported_CXXFLAGS="$supported_CFLAGS"
- ])
-
- CFLAGS="$CFLAGS $supported_CFLAGS"
- CXXFLAGS="$CXXFLAGS $supported_CXXFLAGS"
else
+ xdt_cv_additional_CFLAGS="$xdt_cv_additional_CFLAGS -Wshadow"
CPPFLAGS="$CPPFLAGS -DNDEBUG"
if test x"$enable_debug" = x"no"; then
@@ -122,6 +103,22 @@ AS_HELP_STRING([--disable-debug],[Include no debugging support]),
AC_MSG_RESULT([minimum])
fi
fi
+
+ XDT_SUPPORTED_FLAGS([supported_CFLAGS], [$xdt_cv_additional_CFLAGS])
+
+ ifelse([$CXX], , , [
+ dnl FIXME: should test on c++ compiler, but the following line causes
+ dnl autoconf errors for projects that don't check for a
+ dnl c++ compiler at all.
+ dnl AC_LANG_PUSH([C++])
+ dnl XDT_SUPPORTED_FLAGS([supported_CXXFLAGS], [$xdt_cv_additional_CFLAGS])
+ dnl AC_LANG_POP()
+ dnl instead, just use supported_CFLAGS...
+ supported_CXXFLAGS="$supported_CFLAGS"
+ ])
+
+ CFLAGS="$CFLAGS $supported_CFLAGS"
+ CXXFLAGS="$CXXFLAGS $supported_CXXFLAGS"
])