summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorChristos Zoulas <christos@zoulas.com>2008-07-15 17:45:13 +0000
committerChristos Zoulas <christos@zoulas.com>2008-07-15 17:45:13 +0000
commitcf88077239885d122957b916f227fcf600fd99d8 (patch)
tree958ba1ac3f393d8d57899439337fd7ed150815ee /configure.ac
parent4797bad3aa6222c34287f0db32f4b23d442ef4b8 (diff)
downloadfile-git-cf88077239885d122957b916f227fcf600fd99d8.tar.gz
deal with gcc'ismsFILE4_25
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac27
1 files changed, 27 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 9fd15bde..bcea5c7b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,8 +45,11 @@ fi], [
AC_MSG_RESULT(no)
fsect=4
])
+
AC_SUBST(fsect)
AM_CONDITIONAL(FSECT5, test x$fsect = x5)
+
+AC_SUBST(WARNINGS)
AC_GNU_SOURCE
dnl Checks for programs.
@@ -108,6 +111,30 @@ typedef long int64_t;
#endif
])
+AC_MSG_CHECKING(for gcc compiler warnings)
+AC_ARG_ENABLE(warnings,
+[ --disable-warnings disable compiler warnings],
+[if test "${enableval}" = no -o $GCC = no; then
+ AC_MSG_RESULT(no)
+ WARNINGS=
+else
+ AC_MSG_RESULT(yes)
+ WARNINGS="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \
+ -Wmissing-declarations -Wredundant-decls -Wnested-externs \
+ -Wsign-compare -Wreturn-type -Wswitch -Wshadow \
+ -Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter"
+fi], [
+if test $GCC = no; then
+ WARNINGS=
+ AC_MSG_RESULT(no)
+else
+ AC_MSG_RESULT(yes)
+ WARNINGS="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \
+ -Wmissing-declarations -Wredundant-decls -Wnested-externs \
+ -Wsign-compare -Wreturn-type -Wswitch -Wshadow \
+ -Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter"
+fi])
+
dnl Checks for functions
AC_CHECK_FUNCS(mmap strerror strndup strtoul mbrtowc mkstemp utimes utime wcwidth strtof)