This centralizes the setting so there's no duplication anymore,
makes sure the user supplied variables are never overridden, and
are only set when using gcc.
Reported-by: Samuli Suominen <ssuominen@gentoo.org>
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
[AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
+# Check and store if we got user supplied variables
+user_CFLAGS=${CFLAGS-unset}
+
# Checks for operating system services and capabilities.
AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE
AC_PROG_INSTALL
AC_PROG_LN_S
+# Set default compiler variables
+if test "$user_CFLAGS" = unset && test "$GCC" = yes; then
+ CFLAGS="$CFLAGS -Wall -Wextra -Wno-unused-variable -Wno-unused-parameter"
+fi
+
# Checks for libraries.
# Checks for header files.
## Process this file with automake to produce Makefile.in
-# Set default values for user variables
-CFLAGS = -Wall -Wextra -Wno-unused-variable -Wno-unused-parameter
-
AM_CPPFLAGS = \
-I$(top_builddir) \
-isystem $(top_srcdir)/include/bsd/ \
## Process this file with automake to produce Makefile.in
-# Set default values for user variables
-CFLAGS = -Wall -Wextra -Wno-unused-variable -Wno-unused-parameter
-
AM_CPPFLAGS = \
-I$(top_builddir) \
-isystem $(top_srcdir)/include/bsd/ \