kwo pushed a commit to branch master. http://git.enlightenment.org/e16/e16-epplets.git/commit/?id=bb351a06653b9d7f232d62edf4d0c955e1bda9e0
commit bb351a06653b9d7f232d62edf4d0c955e1bda9e0 Author: Kim Woelders <[email protected]> Date: Sun Feb 23 09:18:41 2014 +0100 Autofoo update (warnings). --- api/Makefile.am | 6 ++++-- configure.ac | 2 ++ epplets/Makefile.am | 2 +- m4/ec_warnflags.m4 | 29 +++++++++++++++++++++++++++++ 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/api/Makefile.am b/api/Makefile.am index e4dc1a6..11083ca 100644 --- a/api/Makefile.am +++ b/api/Makefile.am @@ -7,17 +7,19 @@ if BUILD_GLX EPPLET_LIB_GLX = libepplet_glx.la endif +AM_CPPFLAGS = -I$(top_builddir) $(CWARNFLAGS) + lib_LTLIBRARIES = libepplet.la $(EPPLET_LIB_GLX) include_HEADERS = epplet.h libepplet_la_SOURCES = epplet.c $(SRCS_SNPRINTF) -libepplet_la_CPPFLAGS = -I$(top_srcdir) $(IMLIB2_CFLAGS) $(X_CFLAGS) -D ENLIGHTENMENT_ROOT=\"$(datadir)/e16\" +libepplet_la_CPPFLAGS = $(AM_CPPFLAGS) $(IMLIB2_CFLAGS) $(X_CFLAGS) -D ENLIGHTENMENT_ROOT=\"$(datadir)/e16\" libepplet_la_LIBADD = $(IMLIB2_LIBS) $(X_LIBS) -lXext -lX11 -lm libepplet_la_LDFLAGS = -version-info 3:0:0 libepplet_glx_la_SOURCES = epplet_glx.c -libepplet_glx_la_CPPFLAGS = -I$(top_srcdir) $(X_CFLAGS) +libepplet_glx_la_CPPFLAGS = $(AM_CPPFLAGS) $(X_CFLAGS) libepplet_glx_la_LIBADD = libepplet.la $(GLX_LIBS) libepplet_glx_la_LDFLAGS = -version-info 3:0:0 diff --git a/configure.ac b/configure.ac index b5e3556..e6d0c12 100644 --- a/configure.ac +++ b/configure.ac @@ -154,6 +154,8 @@ if test -n "$EJECT"; then AC_DEFINE(HAVE_EJECT, 1, [Have eject]) fi +EC_C_WARNINGS() + AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([ Makefile diff --git a/epplets/Makefile.am b/epplets/Makefile.am index 95624d3..79fff61 100644 --- a/epplets/Makefile.am +++ b/epplets/Makefile.am @@ -15,7 +15,7 @@ EXTRA_PROGRAMS = EppletTest.epplet EppletConfigTest.epplet E-Mixer.epplet \ Emix.epplet E-PlayCD.epplet E-OpenGL-Demo.epplet \ E-SD.epplet -AM_CPPFLAGS = -I$(top_builddir) -I$(top_builddir)/api $(IMLIB2_CFLAGS) $(X_CFLAGS) $(LIBGTOP_CFLAGS) +AM_CPPFLAGS = -I$(top_builddir) -I$(top_builddir)/api $(IMLIB2_CFLAGS) $(X_CFLAGS) $(LIBGTOP_CFLAGS) $(CWARNFLAGS) LDADD = $(top_builddir)/api/libepplet.la $(X_LIBS) $(KSTAT_LIBS) ################ Conditional Builds ################ diff --git a/m4/ec_warnflags.m4 b/m4/ec_warnflags.m4 new file mode 100644 index 0000000..813bf15 --- /dev/null +++ b/m4/ec_warnflags.m4 @@ -0,0 +1,29 @@ +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 in CWARNFLAGS + +dnl Provides configure argument --enable-werror to stop compilation on warnings + +dnl Usage: EC_C_WARNINGS([LANG]) +dnl Set LANG to 'cpp' when compiling for C++ + +AC_DEFUN([EC_C_WARNINGS], [ + define(ec_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" + ifelse(ec_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) +]) --
