Skip to content
Snippets Groups Projects
Commit 67d58e68270e authored by Nick Wellnhofer's avatar Nick Wellnhofer
Browse files

autotools: Use AM_CFLAGS consistently

Don't pollute CFLAGS. Always add LIBXML_CFLAGS and LIBXSLT_CFLAGS.
parent d02800290fd6
No related branches found
No related tags found
No related merge requests found
......@@ -337,6 +337,6 @@
if test "${GCC}" != "yes" ; then
case "${host}" in
*-*-hpux* )
CFLAGS="${CFLAGS} -Wp,-H30000"
AM_CFLAGS="${AM_CFLAGS} -Wp,-H30000"
;;
*-dec-osf* )
......@@ -341,6 +341,6 @@
;;
*-dec-osf* )
CFLAGS="${CFLAGS} -ieee"
AM_CFLAGS="${AM_CFLAGS} -ieee"
;;
esac
else
......@@ -344,6 +344,6 @@
;;
esac
else
CFLAGS="${CFLAGS} -Wall -Wextra -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls"
AM_CFLAGS="${AM_CFLAGS} -Wall -Wextra -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls"
case "${host}" in
alpha*-*-linux* )
......@@ -348,5 +348,5 @@
case "${host}" in
alpha*-*-linux* )
CFLAGS="${CFLAGS} -mieee"
AM_CFLAGS="${AM_CFLAGS} -mieee"
;;
alpha*-*-osf* )
......@@ -351,6 +351,6 @@
;;
alpha*-*-osf* )
CFLAGS="${CFLAGS} -mieee"
AM_CFLAGS="${AM_CFLAGS} -mieee"
;;
esac
fi
......@@ -443,6 +443,8 @@
AC_MSG_ERROR([Could not find libxml2 anywhere.])
fi
AM_CFLAGS="$AM_CFLAGS $LIBXML_CFLAGS"
AC_ARG_WITH(plugins,
[ --with-plugins Add plugin extension support (on)])
......@@ -508,9 +510,9 @@
case ${host} in
*-*-mingw* | *-*-cygwin* | *-*-msvc* )
# If the host is Windows, and shared libraries are disabled, we
# need to add -DLIBXML_STATIC to EXTRA_CFLAGS in order for linking to
# need to add -DLIBXML_STATIC to AM_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
LIBXSLT_CFLAGS="$LIBXSLT_CFLAGS -DLIBXSLT_STATIC -DLIBEXSLT_STATIC"
......@@ -512,10 +514,11 @@
# 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
LIBXSLT_CFLAGS="$LIBXSLT_CFLAGS -DLIBXSLT_STATIC -DLIBEXSLT_STATIC"
AM_CFLAGS="$AM_CFLAGS -DLIBXSLT_STATIC -DLIBEXSLT_STATIC"
fi
;;
esac
AC_SUBST(LIBXSLT_CFLAGS)
......@@ -517,8 +520,10 @@
fi
;;
esac
AC_SUBST(LIBXSLT_CFLAGS)
AC_SUBST(AM_CFLAGS)
EXSLT_LIBDIR='-L${libdir}'
EXSLT_INCLUDEDIR='-I${includedir}'
EXSLT_PRIVATE_LIBS="$XSLT_PRIVATE_LIBS $LIBGCRYPT_LIBS"
......
......@@ -2,8 +2,6 @@
-I$(top_builddir) -I$(top_builddir)/libxslt \
-I$(top_builddir)/libexslt
AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(LIBXML_CFLAGS) $(LIBXSLT_CFLAGS)
lib_LTLIBRARIES = libexslt.la
exsltincdir = $(includedir)/libexslt
......@@ -27,6 +25,7 @@
libexslt.h \
dynamic.c
libexslt_la_CFLAGS = $(AM_CFLAGS) $(LIBGCRYPT_CFLAGS)
libexslt_la_LIBADD = $(top_builddir)/libxslt/libxslt.la $(LIBXML_LIBS) $(EXTRA_LIBS) $(LIBGCRYPT_LIBS) $(LIBM)
libexslt_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined \
-version-info $(LIBEXSLT_VERSION_INFO)
......
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/libxslt
AM_CFLAGS = $(LIBXML_CFLAGS) $(LIBXSLT_CFLAGS)
lib_LTLIBRARIES = libxslt.la
xsltincdir = $(includedir)/libxslt
......
......@@ -18,8 +18,8 @@
libxsltmod_la_CPPFLAGS = \
-I$(top_srcdir)/libxslt \
-I$(top_srcdir) \
-I../libexslt \
$(PYTHON_CFLAGS) $(LIBXML_CFLAGS) $(LIBXSLT_CFLAGS)
-I../libexslt
libxsltmod_la_CFLAGS = $(AM_CFLAGS) $(PYTHON_CFLAGS)
libxsltmod_la_SOURCES = libxslt.c types.c
nodist_libxsltmod_la_SOURCES = libxslt-py.c
libxsltmod_la_LIBADD = \
......
......@@ -6,7 +6,6 @@
EXTRA_DIST = xpath.dict xpath.xml xslt.dict xslt.xml seed
CLEANFILES = $(EXTRA_PROGRAMS)
AM_CPPFLAGS = -I$(top_srcdir)
AM_CFLAGS = $(LIBXML_CFLAGS) $(LIBXSLT_CFLAGS)
DEPENDENCIES = $(LIBXSLT_LIBS)
LDADD = $(LIBXSLT_LIBS) \
$(LIBXML_LIBS) $(EXTRA_LIBS) $(LIBM)
......
......@@ -18,7 +18,7 @@
plugindir = $(abs_builddir)/.libs
xmlsoft_org_xslt_testplugin_la_CFLAGS = -DMODULE_COMPILE $(LIBXML_CFLAGS) $(LIBXSLT_CFLAGS)
xmlsoft_org_xslt_testplugin_la_CFLAGS = $(AM_CFLAGS) -DMODULE_COMPILE
xmlsoft_org_xslt_testplugin_la_SOURCES = testplugin.c
xmlsoft_org_xslt_testplugin_la_LIBADD = $(top_builddir)/libxslt/libxslt.la $(EXTRA_LIBS)
xmlsoft_org_xslt_testplugin_la_LDFLAGS = \
......
......@@ -7,8 +7,6 @@
noinst_PROGRAMS=testThreads
AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(LIBXML_CFLAGS) $(LIBXSLT_CFLAGS)
xsltproc_SOURCES = xsltproc.c
xsltproc_LDFLAGS =
xsltproc_DEPENDENCIES = $(DEPS)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment