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

Raphaël Pinson raphink at gmail.com
Sat Mar 5 10:11:22 UTC 2011


2011/3/5 Raphaël Pinson <raphink at gmail.com>:
> Thanks, I've added all this to my repository, and it works great.


Just a note though: PKG_PROG_PKG_CONFIG seems to require pkg-config >=
0.16. It failed on Ubuntu distros as recent as Karmic (october 2009),
which means this won't work for a lot of old systems (so far, I was
able to build Augeas on Debian Sarge -- from 2005 without a problem).
Maybe an alternative to this macro would help keep Augeas easy to
backport for people who (like me) have (very) old systems in
production.


Raphaël



>
> 2011/3/5 David Lutterkort <lutter at redhat.com>:
>> 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