summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2015-12-07 15:46:13 -0800
committerKeith Packard <keithp@keithp.com>2015-12-08 20:36:38 -0800
commiteb67d10ae82b364a4324e96ce53baaa4e5e75f97 (patch)
treef02278d58e2326e35dcdc5640ea6f44f02eda909 /configure.ac
parentd6877a7c1c35985f6a75b6cd4e814595e781adc4 (diff)
Add compiler warning flags and fix warnings
Mostly signed vs unsigned comparisons Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac24
1 files changed, 24 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 640cc92..dddef8a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,6 +25,7 @@ AC_INIT([libXfont], [1.5.1],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXfont])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h include/X11/fonts/fontconf.h])
+AC_CONFIG_MACRO_DIR([m4])
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
@@ -57,6 +58,27 @@ AC_CHECK_FUNCS([poll readlink])
# must first be located explicitly.
PKG_PROG_PKG_CONFIG
+with_cflags=""
+if test "x$GCC" = "xyes"; then
+ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
+ -Wall \
+ -Wextra \
+ -Wno-sign-compare \
+ -Wno-missing-field-initializers \
+ -Wno-unused-parameter \
+ -Wstrict-prototypes \
+ -Wmissing-prototypes \
+ -fvisibility=hidden \
+ -pipe \
+ -fno-strict-aliasing \
+ -ffunction-sections \
+ -fdata-sections \
+ -fno-strict-aliasing \
+ -fdiagnostics-show-option \
+ -fno-common])
+fi
+AC_SUBST([GCC_CFLAGS], $with_cflags)
+
#
# select libraries to include
#
@@ -217,6 +239,8 @@ case $host_os in
OS_CFLAGS=
;;
esac
+OS_CFLAGS="$OS_CFLAGS $GCC_CFLAGS"
+
AC_SUBST([OS_CFLAGS])
AC_CONFIG_FILES([Makefile