Set warning options when using gcc.

This commit is contained in:
Kim Woelders 2013-07-02 06:57:19 +02:00
parent 41dc2bb98b
commit 6e41fe2e1a
8 changed files with 41 additions and 2 deletions

1
.gitignore vendored
View File

@ -15,6 +15,7 @@
/ltmain.sh
/missing
/stamp-h1
/m4/*.m4
/imlib2-config
/imlib2.pc

View File

@ -1,5 +1,7 @@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src data doc
MAINTAINERCLEANFILES = aclocal.m4 config.guess config.h.in \

View File

@ -3,7 +3,7 @@
rm -rf autom4te.cache
rm -f aclocal.m4 ltmain.sh
echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS || exit 1
echo "Running aclocal..." ; aclocal -I m4 $ACLOCAL_FLAGS || exit 1
echo "Running autoheader..." ; autoheader || exit 1
echo "Running autoconf..." ; autoconf || exit 1
echo "Running libtoolize..." ; (libtoolize --copy --automake $LIBTOOL_FLAGS || glibtoolize --automake) || exit 1

View File

@ -3,7 +3,7 @@ rm -f config.cache
AC_INIT([imlib2], [1.4.5], [enlightenment-devel@lists.sourceforge.net])
AC_CONFIG_SRCDIR(configure.ac)
dnl#AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
@ -501,6 +501,8 @@ fi
AM_CONDITIONAL(BUILD_ID3_LOADER, test "$id3_ok" = yes)
AC_SUBST(ID3LIBS)
AC_C_WARNFLAGS()
if test "x$enable_visibility_hiding" = xyes ; then
CPPFLAGS="$CPPFLAGS -fvisibility=hidden"
fi

31
m4/ac_warnflags.m4 Normal file
View File

@ -0,0 +1,31 @@
dnl Copyright (C) 2008 Kim Woelders
dnl This code is public domain and can be freely used or copied.
dnl Macro to set compiler warning flags
dnl Provides configure argument --enable-werror to stop compilation on warnings
dnl Usage: AC_C_WARNFLAGS([LANG])
dnl Set LANG to 'cpp' when compiling for C++
AC_DEFUN([AC_C_WARNFLAGS], [
define(ac_c_compile_cpp, ifelse([$1], [cpp], [yes], [no]))
AC_ARG_ENABLE(werror,
[ --enable-werror treat compiler warnings as errors @<:@default=no@:>@],,
enable_werror=no)
if test "x$GCC" = "xyes"; then
CWARNFLAGS="-W -Wall -Waggregate-return -Wcast-align -Wpointer-arith -Wshadow -Wwrite-strings"
dnl # ignore some warnings for now...
CWARNFLAGS="$CWARNFLAGS -Wno-unused-parameter"
ifelse(ac_c_compile_cpp, no, [
CWARNFLAGS="$CWARNFLAGS -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes"
],)
if test "x$enable_werror" = "xyes"; then
CWARNFLAGS="$CWARNFLAGS -Werror"
fi
fi
AC_SUBST(CWARNFLAGS)
])

View File

@ -1,5 +1,6 @@
AUTOMAKE_OPTIONS = 1.4 foreign
MAINTAINERCLEANFILES = Makefile.in
AM_CFLAGS = $(CWARNFLAGS)
AM_CPPFLAGS = @my_includes@ -I. -I$(top_srcdir) -I$(top_builddir) -DPACKAGE_LIB_DIR=\"$(libdir)\"
# Older automakes (<1.10) do not use INCLUDES when compiling .S files
AM_CCASFLAGS = -I$(top_builddir)

View File

@ -1,6 +1,7 @@
MAINTAINERCLEANFILES = Makefile.in
AUTOMAKE_OPTIONS = 1.4 foreign
AM_CFLAGS = $(CWARNFLAGS)
AM_CPPFLAGS = -I. \
-I$(top_srcdir) \
-I$(top_srcdir)/src/lib \

View File

@ -1,6 +1,7 @@
MAINTAINERCLEANFILES = Makefile.in
AUTOMAKE_OPTIONS = 1.4 foreign
AM_CFLAGS = $(CWARNFLAGS)
AM_CPPFLAGS = -I. \
-I$(top_srcdir) \
-I$(top_srcdir)/src/lib \