[augeas-devel] Adding to_xml call to the public API

David Lutterkort lutter at redhat.com
Sat Mar 5 00:03:55 UTC 2011


Here's what I had to do to add the dependency on libxml2 to the
automake/autoconf. You can just squash that patch into yours.

We will also need to change augeas.pc; it will need to be generated from
a augeas.pc.in.

David

>From f64012645f96c416463b0ff4be5e74af92d42f55 Mon Sep 17 00:00:00 2001
From: David Lutterkort <lutter at redhat.com>
Date: Fri, 4 Mar 2011 15:05:18 -0800
Subject: [PATCH] Update build infrastructure for the new libxml2 dependency

---
 configure.ac      |    3 +++
 src/Makefile.am   |    9 +++++----
 tests/Makefile.am |   12 ++++++------
 3 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/configure.ac b/configure.ac
index 48dc268..2e46360 100644
--- a/configure.ac
+++ b/configure.ac
@@ -104,6 +104,9 @@ AM_CONDITIONAL([USE_VERSION_SCRIPT], [test -n "$VERSION_SCRIPT_FLAGS"])
 
 gl_INIT
 
+PKG_PROG_PKG_CONFIG
+PKG_CHECK_MODULES([LIBXML], [libxml-2.0])
+
 AC_CHECK_FUNCS([strerror_r fsync])
 
 AC_OUTPUT(Makefile \
diff --git a/src/Makefile.am b/src/Makefile.am
index adfd9bf..427c548 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,7 +1,7 @@
 GNULIB= ../gnulib/lib/libgnu.la
 GNULIB_CFLAGS= -I $(top_srcdir)/gnulib/lib
 
-AM_CFLAGS = @AUGEAS_CFLAGS@ @WARN_CFLAGS@ $(GNULIB_CFLAGS)
+AM_CFLAGS = @AUGEAS_CFLAGS@ @WARN_CFLAGS@ $(GNULIB_CFLAGS) $(LIBXML_CFLAGS)
 
 AM_YFLAGS=-d -p spec_
 
@@ -35,13 +35,14 @@ endif
 
 libaugeas_la_LDFLAGS = $(AUGEAS_VERSION_SCRIPT) \
     -version-info $(LIBAUGEAS_VERSION_INFO)
-libaugeas_la_LIBADD = liblexer.la libfa.la $(LIB_SELINUX) $(GNULIB)
+libaugeas_la_LIBADD = liblexer.la libfa.la $(LIB_SELINUX) $(LIBXML_LIBS) \
+                      $(GNULIB)
 
 augtool_SOURCES = augtool.c
-augtool_LDADD = libaugeas.la $(READLINE_LIBS) $(GNULIB)
+augtool_LDADD = libaugeas.la $(READLINE_LIBS) $(LIBXML_LIBS) $(GNULIB)
 
 augparse_SOURCES = augparse.c
-augparse_LDADD = libaugeas.la $(GNULIB)
+augparse_LDADD = libaugeas.la $(LIBXML_LIBS) $(GNULIB)
 
 libfa_la_SOURCES = fa.c fa.h hash.c hash.h memory.c memory.h ref.h ref.c
 libfa_la_LIBADD = $(LIB_SELINUX) $(GNULIB)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index e6ebb4b..82c74a3 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -2,7 +2,7 @@ GNULIB= ../gnulib/lib/libgnu.la
 GNULIB_CFLAGS= -I $(top_srcdir)/gnulib/lib
 
 AM_CFLAGS = $(AUGEAS_CFLAGS) $(WARN_CFLAGS) $(GNULIB_CFLAGS) \
-	-I $(top_builddir)/src
+	 $(LIBXML_CFLAGS) -I $(top_builddir)/src
 
 valgrind: fatest
 	libtool --mode=execute valgrind --quiet --leak-check=full ./fatest
@@ -153,19 +153,19 @@ TESTS = $(check_SCRIPTS) $(check_PROGRAMS)
 INCLUDES = -I$(top_srcdir)/src
 
 fatest_SOURCES = fatest.c cutest.c cutest.h $(top_srcdir)/src/memory.c $(top_srcdir)/src/memory.h
-fatest_LDADD = $(top_builddir)/src/libaugeas.la $(GNULIB)
+fatest_LDADD = $(top_builddir)/src/libaugeas.la $(LIBXML_LIBS) $(GNULIB)
 
 test_xpath_SOURCES = test-xpath.c $(top_srcdir)/src/memory.c
-test_xpath_LDADD = $(top_builddir)/src/libaugeas.la $(GNULIB)
+test_xpath_LDADD = $(top_builddir)/src/libaugeas.la $(LIBXML_LIBS) $(GNULIB)
 
 test_load_SOURCES = test-load.c cutest.c cutest.h $(top_srcdir)/src/memory.c $(top_srcdir)/src/memory.h
-test_load_LDADD = $(top_builddir)/src/libaugeas.la $(GNULIB)
+test_load_LDADD = $(top_builddir)/src/libaugeas.la $(LIBXML_LIBS) $(GNULIB)
 
 test_save_SOURCES = test-save.c cutest.c cutest.h $(top_srcdir)/src/memory.c $(top_srcdir)/src/memory.h
-test_save_LDADD = $(top_builddir)/src/libaugeas.la $(GNULIB)
+test_save_LDADD = $(top_builddir)/src/libaugeas.la $(LIBXML_LIBS) $(GNULIB)
 
 test_api_SOURCES = test-api.c cutest.c cutest.h $(top_srcdir)/src/memory.c $(top_srcdir)/src/memory.h
-test_api_LDADD = $(top_builddir)/src/libaugeas.la $(GNULIB)
+test_api_LDADD = $(top_builddir)/src/libaugeas.la $(LIBXML_LIBS) $(GNULIB)
 
 FAILMALLOC_START ?= 1
 FAILMALLOC_REP   ?= 20
-- 
1.7.4






More information about the augeas-devel mailing list