[prev in list] [next in list] [prev in thread] [next in thread]
List: autoconf
Subject: Re: library version number
From: Philip Herron <herron.philip () googlemail ! com>
Date: 2009-04-15 17:05:13
Message-ID: 49E613C9.7030109 () googlemail ! com
[Download RAW message or body]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Bob Friesenhahn wrote:
> On Wed, 15 Apr 2009, Philip Herron wrote:
>> # Checks for libraries.
>> AC_CHECK_LIB([xml2],[xmlTextReaderGetAttribute])
>> if test "$xml2" = "no"
>> then
>> AC_MSG_ERROR(["libxml2 is needed to be installed for ovf xml
>> reading.. Debian: apt-get intstall libxml2-dev, or SUSE:yast -i
>> libxml2-devel"])
>> else
>> CFLAGS="$CFLAGS -I/usr/include/libxml2"
>> fi
>>
>> It seems to work ok i dont think i am doing it properly because the
>> libxml2 headers are like:
>>
>> /usr/include/libxml2/libxml/*.h
>
> You are confusing different issues. The libxml2 library and headers may
> be somewhere else rather than under /usr. In fact, several libxml2
> installs can exist at once. That is why libxml2 provides a utility to
> find the location of the library and headers.
>
> Any -I options should be put in CPPFLAGS and any -L options should be
> put in LDFLAGS.
>
> Bob
> --
> Bob Friesenhahn
> bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
> GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Hey
Yeah i think your right i didnt really think about that. I now changed
it to:
C_PATH_PROGS([TOOL_XML2_CONFIG], [xml2-config])
AS_IF([test -n "$TOOL_XML2_CONFIG"],
[XML2_CFLAGS=`$TOOL_XML2_CONFIG --cflags`
XML2_LIBS=`$TOOL_XML2_CONFIG --libs`],
[AC_MSG_ERROR([missing program 'xml2-config'; is 'libxml2' or
'libxml2-devel' installed?])])
AC_SUBST([XML2_CFLAGS])
AC_SUBST([XML2_LIBS])
Just what luke@mewburn.net posted earlier! It works pretty well, i just
add to change it a little:
AC_PATH_PROGS([TOOL_XML2_CONFIG], [xml2-config])
AS_IF([test -n "$TOOL_XML2_CONFIG"],
[XML2_CFLAGS=`$TOOL_XML2_CONFIG --cflags`
XML2_LIBS=`$TOOL_XML2_CONFIG --libs`
LIBXML_VERSION=`$TOOL_XML2_CONFIG --version`],
[AC_MSG_ERROR([missing program 'xml2-config'; is 'libxml2' or
'libxml2-devel' installed?])])
AC_SUBST([XML2_CFLAGS])
AC_SUBST([XML2_LIBS])
AC_CHECK_LIB([xml2],[xmlTextReaderGetAttribute])
CFLAGS="$CFLAGS $XML2_CFLAGS"
Thanks very much guys
- -Phil
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAknmE8UACgkQAhcOgIaQQ2FIGwCeMn6fJ9sQTMVBIaQaLpWHCg1+
KEAAoJCKeF/fFPZY2IH5gQ30wKF6BV97
=xsHa
-----END PGP SIGNATURE-----
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic