Clean up warning flag handling.

DEVEL_2_0_BRANCH-1
Petter Reinholdtsen 2001-04-16 17:16:58 +00:00
rodzic 7f1cd21dcc
commit ebf5508966
1 zmienionych plików z 42 dodań i 28 usunięć

Wyświetl plik

@ -12,12 +12,15 @@ V_REV=4
PACKAGE=sane-backends
VERSION=${V_MAJOR}.${V_MINOR}.${V_REV}
PACKAGE_VERSION="$PACKAGE-$VERSION"
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
AC_DEFINE_UNQUOTED(PACKAGE_VERSION, "$PACKAGE_VERSION")
AC_DEFINE_UNQUOTED(SANE_DLL_V_MAJOR, $V_MAJOR)
AC_DEFINE_UNQUOTED(SANE_DLL_V_MINOR, $V_MINOR)
AC_DEFINE_UNQUOTED(SANE_DLL_V_BUILD, $V_REV)
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE",
[Define to the name of the distribution.])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION",
[Define to the version of the distribution.])
AC_DEFINE_UNQUOTED(PACKAGE_VERSION, "$PACKAGE_VERSION",
[The concatenation of the strings PACKAGE, "-", and VERSION.])
AC_DEFINE_UNQUOTED(SANE_DLL_V_MAJOR, $V_MAJOR, [SANE DLL major number])
AC_DEFINE_UNQUOTED(SANE_DLL_V_MINOR, $V_MINOR, [SANE DLL minor number])
AC_DEFINE_UNQUOTED(SANE_DLL_V_BUILD, $V_REV, [SANE DLL revision number])
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AC_SUBST(PACKAGE_VERSION)
@ -38,9 +41,20 @@ INCLUDES="${INCLUDES} -I/usr/local/include"
CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE"
if test "${ac_cv_prog_gcc}" = "yes"; then
NORMAL_CFLAGS="${CFLAGS} -W -Wall"
WARN_CFLAGS="${CFLAGS} -W -Wall -Wstrict-prototypes -Wreturn-type \
-Wcast-align -Wpointer-arith -Wcast-qual -pedantic"
NORMAL_CFLAGS="\
-W \
-Wall"
WARN_CFLAGS="\
-W \
-Wall \
-Wcast-align \
-Wcast-qual \
-Wmissing-declarations \
-Wmissing-prototypes \
-Wpointer-arith \
-Wreturn-type \
-Wstrict-prototypes \
-pedantic"
dnl OS/2 doesn't include some headers with -ansi enabled
AC_CHECK_HEADER(os2.h,,[WARN_CFLAGS="${WARN_CFLAGS} -ansi"])
@ -51,27 +65,27 @@ if test "${ac_cv_prog_gcc}" = "yes"; then
[default=yes]],
[
if eval "test x$enable_warnings = xyes"; then
CFLAGS="${WARN_CFLAGS}"
else
CFLAGS="${NORMAL_CFLAGS}"
for flag in $WARN_CFLAGS; do
JAPHAR_GREP_CFLAGS($flag, [ CFLAGS="$CFLAGS $flag" ])
done
else
for flag in $NORMAL_CFLAGS; do
JAPHAR_GREP_CFLAGS($flag, [ CFLAGS="$CFLAGS $flag" ])
done
fi
],
[CFLAGS="${WARN_CFLAGS}"])
dnl # Warnings disabled by default (release)
dnl AC_ARG_ENABLE(warnings,
dnl [ --enable-warnings turn on tons of compiler warnings (GCC only)
dnl [default=no]],
dnl [
dnl if eval "test x$enable_warnings = xyes"; then
dnl CFLAGS="${WARN_CFLAGS}"
dnl else
dnl CFLAGS="${NORMAL_CFLAGS}"
dnl fi
dnl ],
dnl [CFLAGS="${NORMAL_CFLAGS}"])
fi
[if true; then # release (false) or development (true)
# Warnings enabled by default (development)
for flag in $WARN_CFLAGS; do
JAPHAR_GREP_CFLAGS($flag, [ CFLAGS="$CFLAGS $flag" ])
done
else
# Warnings disabled by default (release)
for flag in $NORMAL_CFLAGS; do
JAPHAR_GREP_CFLAGS($flag, [ CFLAGS="$CFLAGS $flag" ])
done
fi])
fi # ac_cv_prog_gcc
dnl Checks for header files.
AC_HEADER_STDC