Move compiler warning stuff to m4 macro. Add --enable-werror.
SVN revision: 37666
This commit is contained in:
parent
70bdea29ed
commit
962153d8e3
10
configure.ac
10
configure.ac
|
@ -330,13 +330,9 @@ AC_ARG_ENABLE(gcc-cpp,
|
||||||
if test "x$enable_gcc_cpp" = "xyes"; then
|
if test "x$enable_gcc_cpp" = "xyes"; then
|
||||||
CC="g++"
|
CC="g++"
|
||||||
CPPFLAGS="$CPPFLAGS -x c++"
|
CPPFLAGS="$CPPFLAGS -x c++"
|
||||||
fi
|
AC_C_WARNFLAGS([cpp])
|
||||||
|
else
|
||||||
if test "x$GCC" = "xyes"; then
|
AC_C_WARNFLAGS()
|
||||||
CFLAGS="$CFLAGS -W -Wall -Waggregate-return -Wcast-align -Wpointer-arith -Wshadow -Wwrite-strings"
|
|
||||||
if test "x$enable_gcc_cpp" != "xyes"; then
|
|
||||||
CFLAGS="$CFLAGS -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_DEFINE(_GNU_SOURCE, 1, [Enable extensions])
|
AC_DEFINE(_GNU_SOURCE, 1, [Enable extensions])
|
||||||
|
|
|
@ -7,7 +7,7 @@ bin_PROGRAMS = edox
|
||||||
edox_SOURCES = dox.c dox.h file.c format.c text.c ttfont.c
|
edox_SOURCES = dox.c dox.h file.c format.c text.c ttfont.c
|
||||||
|
|
||||||
edox_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) $(IMLIB2_CFLAGS) $(X_CFLAGS) \
|
edox_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) $(IMLIB2_CFLAGS) $(X_CFLAGS) \
|
||||||
-D ENLIGHTENMENT_ROOT=\"$(pkgdatadir)\"
|
$(CWARNFLAGS) -D ENLIGHTENMENT_ROOT=\"$(pkgdatadir)\"
|
||||||
|
|
||||||
LDADD = $(IMLIB2_LIBS) $(X_LIBS) $(XINERAMA_LIBS) -lX11 -lm
|
LDADD = $(IMLIB2_LIBS) $(X_LIBS) $(XINERAMA_LIBS) -lX11 -lm
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ bin_PROGRAMS = eesh
|
||||||
|
|
||||||
eesh_SOURCES = E.h comms.c main.c
|
eesh_SOURCES = E.h comms.c main.c
|
||||||
|
|
||||||
eesh_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) $(X_CFLAGS)
|
eesh_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) $(X_CFLAGS) $(CWARNFLAGS)
|
||||||
|
|
||||||
LDADD = $(X_LIBS) -lX11
|
LDADD = $(X_LIBS) -lX11
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ epp_SOURCES = \
|
||||||
cpplib.c \
|
cpplib.c \
|
||||||
cppmain.c
|
cppmain.c
|
||||||
|
|
||||||
epp_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir)
|
epp_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) $(CWARNFLAGS)
|
||||||
|
|
||||||
DEFS= \
|
DEFS= \
|
||||||
-DHAVE_STRERROR \
|
-DHAVE_STRERROR \
|
||||||
|
|
|
@ -5,7 +5,7 @@ if BUILD_ROOTHACKLIB
|
||||||
libe16_LTLIBRARIES = libhack.la
|
libe16_LTLIBRARIES = libhack.la
|
||||||
|
|
||||||
libhack_la_SOURCES = e16_hack.c
|
libhack_la_SOURCES = e16_hack.c
|
||||||
libhack_la_CPPFLAGS = -I$(top_srcdir)/src
|
libhack_la_CPPFLAGS = -I$(top_srcdir)/src $(CWARNFLAGS)
|
||||||
|
|
||||||
libhack_la_LIBADD = $(DLOPEN_LIBS)
|
libhack_la_LIBADD = $(DLOPEN_LIBS)
|
||||||
libhack_la_LDFLAGS = -avoid-version
|
libhack_la_LDFLAGS = -avoid-version
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
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"
|
||||||
|
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)
|
||||||
|
])
|
|
@ -119,8 +119,8 @@ e16_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) \
|
||||||
$(ECORE_CFLAGS) \
|
$(ECORE_CFLAGS) \
|
||||||
$(MODULE_CFLAGS) \
|
$(MODULE_CFLAGS) \
|
||||||
$(IMLIB2_CFLAGS) \
|
$(IMLIB2_CFLAGS) \
|
||||||
$(X_CFLAGS) \
|
|
||||||
$(DBUS_CFLAGS) \
|
$(DBUS_CFLAGS) \
|
||||||
|
$(X_CFLAGS) $(CWARNFLAGS) \
|
||||||
-D LOCALEDIR=\"$(datadir)/locale\" \
|
-D LOCALEDIR=\"$(datadir)/locale\" \
|
||||||
-D ENLIGHTENMENT_BIN=\"$(bindir)\" \
|
-D ENLIGHTENMENT_BIN=\"$(bindir)\" \
|
||||||
-D ENLIGHTENMENT_LIB=\"$(pkglibdir)\" \
|
-D ENLIGHTENMENT_LIB=\"$(pkglibdir)\" \
|
||||||
|
@ -152,7 +152,7 @@ libe16_LTLIBRARIES = $(LIBSND_ESD) $(LIBSND_PA) $(LIBFNT_IFT) $(LIBFNT_XFT) $(LI
|
||||||
if USE_LIBESD
|
if USE_LIBESD
|
||||||
LIBSND_ESD = libsound_esd.la
|
LIBSND_ESD = libsound_esd.la
|
||||||
libsound_esd_la_SOURCES = sound_esd.c sound_load.c
|
libsound_esd_la_SOURCES = sound_esd.c sound_load.c
|
||||||
libsound_esd_la_CFLAGS = $(ESD_CFLAGS)
|
libsound_esd_la_CFLAGS = $(ESD_CFLAGS) $(CWARNFLAGS)
|
||||||
libsound_esd_la_LIBADD = $(ESD_LIBS)
|
libsound_esd_la_LIBADD = $(ESD_LIBS)
|
||||||
libsound_esd_la_LDFLAGS = -module -avoid-version
|
libsound_esd_la_LDFLAGS = -module -avoid-version
|
||||||
endif
|
endif
|
||||||
|
@ -160,21 +160,21 @@ endif
|
||||||
if USE_LIBPA
|
if USE_LIBPA
|
||||||
LIBSND_PA = libsound_pa.la
|
LIBSND_PA = libsound_pa.la
|
||||||
libsound_pa_la_SOURCES = sound_pa.c sound_load.c
|
libsound_pa_la_SOURCES = sound_pa.c sound_load.c
|
||||||
libsound_pa_la_CFLAGS = $(PA_CFLAGS)
|
libsound_pa_la_CFLAGS = $(PA_CFLAGS) $(CWARNFLAGS)
|
||||||
libsound_pa_la_LIBADD = $(PA_LIBS)
|
libsound_pa_la_LIBADD = $(PA_LIBS)
|
||||||
libsound_pa_la_LDFLAGS = -module -avoid-version
|
libsound_pa_la_LDFLAGS = -module -avoid-version
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LIBFNT_IFT = libfont_ift.la
|
LIBFNT_IFT = libfont_ift.la
|
||||||
libfont_ift_la_SOURCES = ttfont.c
|
libfont_ift_la_SOURCES = ttfont.c
|
||||||
libfont_ift_la_CFLAGS = $(IMLIB2_CFLAGS)
|
libfont_ift_la_CFLAGS = $(IMLIB2_CFLAGS) $(CWARNFLAGS)
|
||||||
libfont_ift_la_LIBADD = $(IMLIB2_LIBS)
|
libfont_ift_la_LIBADD = $(IMLIB2_LIBS)
|
||||||
libfont_ift_la_LDFLAGS = -module -avoid-version
|
libfont_ift_la_LDFLAGS = -module -avoid-version
|
||||||
|
|
||||||
if USE_LIBXFT
|
if USE_LIBXFT
|
||||||
LIBFNT_XFT = libfont_xft.la
|
LIBFNT_XFT = libfont_xft.la
|
||||||
libfont_xft_la_SOURCES = text_xft.c
|
libfont_xft_la_SOURCES = text_xft.c
|
||||||
libfont_xft_la_CFLAGS = $(XFT_CFLAGS)
|
libfont_xft_la_CFLAGS = $(XFT_CFLAGS) $(CWARNFLAGS)
|
||||||
libfont_xft_la_LIBADD = $(XFT_LIBS)
|
libfont_xft_la_LIBADD = $(XFT_LIBS)
|
||||||
libfont_xft_la_LDFLAGS = -module -avoid-version
|
libfont_xft_la_LDFLAGS = -module -avoid-version
|
||||||
endif
|
endif
|
||||||
|
@ -182,7 +182,7 @@ endif
|
||||||
if USE_LIBPANGO
|
if USE_LIBPANGO
|
||||||
LIBFNT_PANGO = libfont_pango.la
|
LIBFNT_PANGO = libfont_pango.la
|
||||||
libfont_pango_la_SOURCES = text_pango.c
|
libfont_pango_la_SOURCES = text_pango.c
|
||||||
libfont_pango_la_CFLAGS = $(PANGO_CFLAGS)
|
libfont_pango_la_CFLAGS = $(PANGO_CFLAGS) $(CWARNFLAGS)
|
||||||
libfont_pango_la_LIBADD = $(PANGO_LIBS) libfont_xft.la
|
libfont_pango_la_LIBADD = $(PANGO_LIBS) libfont_xft.la
|
||||||
libfont_pango_la_LDFLAGS = -module -avoid-version
|
libfont_pango_la_LDFLAGS = -module -avoid-version
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Reference in New Issue