1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-08-24 09:49:22 +03:00

Don't touch CFLAGS in configure.ac

CFLAGS shouldn't be touched by configure.ac. The variable is supplied by
the user and must come after other flags, so flags like warning options
can be overridden.

Rename CFLAGS to EXTRA_CFLAGS and add the value to AM_CFLAGS. This also
makes it possible to override flags for each Automake program or library.
This commit is contained in:
Nick Wellnhofer
2017-11-12 18:22:23 +01:00
parent 00859f9118
commit 8cb8e31773
2 changed files with 14 additions and 14 deletions

View File

@ -8,7 +8,7 @@ DIST_SUBDIRS = include . doc example python xstc
AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/include
AM_CFLAGS = $(THREAD_CFLAGS) $(Z_CFLAGS) $(LZMA_CFLAGS)
AM_CFLAGS = $(EXTRA_CFLAGS) $(THREAD_CFLAGS) $(Z_CFLAGS) $(LZMA_CFLAGS)
check_PROGRAMS=testSchemas testRelax testSAX testHTML testXPath testURI \
testThreads testC14N testAutomata testRegexp \

View File

@ -771,13 +771,13 @@ dnl
if test "${GCC}" != "yes" ; then
case "${host}" in
hppa*-*-hpux* )
CFLAGS="${CFLAGS} -Wp,-H30000"
EXTRA_CFLAGS="${EXTRA_CFLAGS} -Wp,-H30000"
;;
*-dec-osf* )
CFLAGS="${CFLAGS} -ieee"
EXTRA_CFLAGS="${EXTRA_CFLAGS} -ieee"
;;
alpha*-*-linux* )
CFLAGS="${CFLAGS} -ieee"
EXTRA_CFLAGS="${EXTRA_CFLAGS} -ieee"
;;
esac
else
@ -787,19 +787,19 @@ else
# Not activated by default because this inflates the code size
# Used to allow propagation of C++ exceptions through the library
#
CFLAGS="${CFLAGS} -fexceptions"
EXTRA_CFLAGS="${EXTRA_CFLAGS} -fexceptions"
fi
# warnings we'd like to see
CFLAGS="${CFLAGS} -pedantic -W -Wformat -Wno-format-extra-args -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls"
EXTRA_CFLAGS="${EXTRA_CFLAGS} -pedantic -W -Wformat -Wno-format-extra-args -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls"
# warnings we'd like to supress
CFLAGS="${CFLAGS} -Wno-long-long"
EXTRA_CFLAGS="${EXTRA_CFLAGS} -Wno-long-long"
case "${host}" in
alpha*-*-linux* )
CFLAGS="${CFLAGS} -mieee"
EXTRA_CFLAGS="${EXTRA_CFLAGS} -mieee"
;;
alpha*-*-osf* )
CFLAGS="${CFLAGS} -mieee"
EXTRA_CFLAGS="${EXTRA_CFLAGS} -mieee"
;;
esac
fi
@ -812,13 +812,13 @@ case ${host} in
;;
*-*-mingw* | *-*-cygwin* | *-*-msvc* )
# If the host is Windows, and shared libraries are disabled, we
# need to add -DLIBXML_STATIC to CFLAGS in order for linking to
# need to add -DLIBXML_STATIC to EXTRA_CFLAGS in order for linking to
# work properly (without it, xmlexports.h would force the use of
# DLL imports, which obviously aren't present in a static
# library).
if test "x$enable_shared" = "xno"; then
XML_CFLAGS="$XML_CFLAGS -DLIBXML_STATIC"
CFLAGS="$CFLAGS -DLIBXML_STATIC"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DLIBXML_STATIC"
fi
;;
esac
@ -1010,7 +1010,7 @@ if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
fi
fi
if test "${GCC}" = "yes" ; then
CFLAGS="-g -O -pedantic -W -Wformat -Wno-format-extra-args -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wall"
EXTRA_CFLAGS="-g -O -pedantic -W -Wformat -Wno-format-extra-args -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wall"
fi
STATIC_BINARIES="-static"
dnl -Wcast-qual -ansi
@ -1680,14 +1680,14 @@ AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscan
if test "$with_coverage" = "yes" -a "${GCC}" = "yes"
then
echo Enabling code coverage for GCC
CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
EXTRA_CFLAGS="$EXTRA_CFLAGS -fprofile-arcs -ftest-coverage"
LDFLAGS="$LDFLAGS -fprofile-arcs -ftest-coverage"
else
echo Disabling code coverage for GCC
fi
AC_SUBST(CPPFLAGS)
AC_SUBST(CFLAGS)
AC_SUBST(EXTRA_CFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(XML_CFLAGS)