Re: PATCH 1/5: Use pkg-config for libxml

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 18, 2007 at 03:32:35AM -0400, Daniel Veillard wrote:
> On Tue, Sep 18, 2007 at 02:29:50AM +0100, Daniel P. Berrange wrote:
> > Currently if you have a configured working directory and you touch some
> > file that would cause autoconf to re-run configure it'll crash & burn with
> > an error like
> > 
> > 
> > $ make
> > cd . && /bin/sh /home/berrange/src/xen/libvirt/missing --run aclocal-1.9 -I m4
> > cd . && /bin/sh /home/berrange/src/xen/libvirt/missing --run automake-1.9 --gnu 
> > cd . && /bin/sh /home/berrange/src/xen/libvirt/missing --run autoconf
> > configure.in:268: error: possibly undefined macro: PKG_CONFIG_ENABLED
> >       If this token and others are legitimate, please use m4_pattern_allow.
> >       See the Autoconf documentation.
> > 
> > 
> > This is due to this bit of configure where we reference an env variable
> > which doesn't exist:
> > 
> > 
> > if test "z$with_libxml" = "zno" ; then 
> >     AC_MSG_CHECKING(for libxml2 libraries >= $LIBXML_MIN_VERSION) 
> >     AC_MSG_ERROR(libxml2 >= $LIBXML_MIN_VERSION is required for $XMLSEC_PACKAGE)
> > elif test "z$with_libxml" = "z" -a "z$PKG_CONFIG_ENABLED" = "zyes" ; then
> >     PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_MIN_VERSION,
> >         [LIBXML_FOUND=yes],
> >         [LIBXML_FOUND=no])
> > fi
> > 
> > 
> > The whole test for libxml is overly complex and can be reduced to a single
> > call to PKG_CHECK_MODULES. There is no need to have special configure 
> > script --with_libxml args to override the location, since pkg-config already
> > gives you two ways todo that - either use PKG_CONFIG_PATH to point to your
> > alternative install, or use  LIBXML_CFLAGS and LIBXML_LIBS env vars to set
> > the explicitly flags.
> 
>   IMHO this severely reduces the set of OSes where configure will wok as a
> result. Not everything ships with all libraries registered with pkg-config.
> I would like to hear what the non-Linux users think. xml2-config is part of
> libxml2 distribution, pkg-config is not, so the pkg-config check will work
> only if the OS integration decided to make it work. To me the goal of configure
> is to get maximum portability (otherwise honnestly, why bother with the 
> auto*, right ?)

pkg-config is trivial to install on any common OS & is widely used by all 
modern libraries. The whole point is to increase portability & reliability
of package configuration and give developers a standard way to override 
what versions of an library you build against. Only having to worry about
pkg-config, instead of a multitude of different library specific XXX-config
scripts is a more pleasant proposition. It also increases the clarity of
the configure scripts.

>   In the case of libvirt though we may conclude that we target only OSes
> where pkg-config is set up, could someone clarify to me the status of
> pkg-config (at least for libxml2) on:
>      - Solaris (I guess yes)
>      - OS-X
>      - cygwin

http://pkg-config.freedesktop.org/wiki/

  "pkg-config works on multiple platforms: Linux and other UNIX-like 
   operating systems, Mac OS X and Windows. It does not require anything 
   but a reasonably well working C compiler and a C library"


Any recent library is using pkg-config for build integration - we provide a
pkgconfig script ourselves in libvirt. It is the defacto standard as can be
seen from the listof pkg-config files installed even on FC6....

alsa.pc                       libgsf-gnome-1.pc
aspell.pc                     libgtop-2.0.pc
atk.pc                        libgvc.pc
audiofile.pc                  libIDL-2.0.pc
bigreqsproto.pc               libidn.pc
blkid.pc                      libloginhelper-1.0.pc
bonobo-activation-2.0.pc      libmetacity-private.pc
cairo-ft.pc                   libnfsidmap.pc
cairo.pc                      libnm-util.pc
cairo-pdf.pc                  libpanelapplet-2.0.pc
cairo-png.pc                  libpathplan.pc
cairo-ps.pc                   libpng12.pc
cairo-svg.pc                  libpng.pc
cairo-xlib.pc                 librpcsecgss.pc
cairo-xlib-xrender.pc         librsvg-2.0.pc
com_err.pc                    libspi-1.0.pc
compositeproto.pc             libssl.pc
cspi-1.0.pc                   libstartup-notification-1.0.pc
damageproto.pc                libstatgrab.pc
dbus-1.pc                     libuser.pc
dbus-glib-1.pc                libvirt.pc
devmapper.pc                  libwnck-1.0.pc
dmxproto.pc                   libxml-2.0.pc
e2p.pc                        libxslt.pc
eel-2.0.pc                    loudmouth-1.0.pc
esound.pc                     neon.pc
evieproto.pc                  NetworkManager.pc
ext2fs.pc                     nspr.pc
firefox-gtkmozembed.pc        nss.pc
firefox-js.pc                 ogg.pc
firefox-plugin.pc             openssl.pc
firefox-xpcom.pc              ORBit-2.0.pc
fixesproto.pc                 ORBit-CosNaming-2.0.pc
fontcacheproto.pc             ORBit-idl-2.0.pc
fontconfig.pc                 ORBit-imodule-2.0.pc
fontenc.pc                    pangocairo.pc
fontsproto.pc                 pangoft2.pc
fontutil.pc                   pango.pc
freetype2.pc                  pangoxft.pc
gail.pc                       pangox.pc
gconf-2.0.pc                  pycairo.pc
gdk-2.0.pc                    pygobject-2.0.pc
gdk-pixbuf-2.0.pc             pygtk-2.0.pc
gdk-pixbuf-xlib-2.0.pc        randrproto.pc
gdk-x11-2.0.pc                recordproto.pc
gdlib.pc                      renderproto.pc
glib-2.0.pc                   resourceproto.pc
glproto.pc                    scrnsaverproto.pc
gmime-sharp.pc                sdl.pc
gmodule-2.0.pc                shared-mime-info.pc
gmodule-export-2.0.pc         sm.pc
gmodule-no-export-2.0.pc      sqlite3.pc
gnet-2.0.pc                   ss.pc
gnome-desktop-2.0.pc          tomboy-plugins.pc
gnome-keyring-1.pc            trapproto.pc
gnome-mime-data-2.0.pc        uuid.pc
gnome-pilot-2.0.pc            valgrind.pc
gnome-python-desktop-2.0.pc   videoproto.pc
gnome-python-extras-2.0.pc    vorbisenc.pc
gnome-screensaver.pc          vorbisfile.pc
gnome-settings-daemon.pc      vorbis.pc
gnome-vfs-2.0.pc              vte.pc
gnome-vfs-module-2.0.pc       x11.pc
gnome-window-settings-2.0.pc  xau.pc
gnutls-extra.pc               xaw6.pc
gnutls.pc                     xaw7.pc
gobject-2.0.pc                xcmiscproto.pc
gswitchit.pc                  xcomposite.pc
gthread-2.0.pc                xcursor.pc
gtk+-2.0.pc                   xdamage.pc
gtk-engines-2.pc              xdmcp.pc
gtksourceview-1.0.pc          xevie.pc
gtk+-unix-print-2.0.pc        xext.pc
gtk-vnc-1.0.pc                xextproto.pc
gtk+-x11-2.0.pc               xf86bigfontproto.pc
gweather.pc                   xf86dgaproto.pc
hal.pc                        xf86driproto.pc
hal-storage.pc                xf86miscproto.pc
ice.pc                        xf86rushproto.pc
inputproto.pc                 xf86vidmodeproto.pc
kbproto.pc                    xfixes.pc
libagraph.pc                  xfontcache.pc
libart-2.0.pc                 xfont.pc
libbonobo-2.0.pc              xft.pc
libbonoboui-2.0.pc            xinerama.pc
libcdt.pc                     xineramaproto.pc
libcroco-0.6.pc               xi.pc
libcrypto.pc                  xmu.pc
libcurl.pc                    xmuu.pc
libdrm.pc                     xorg-server.pc
libexslt.pc                   xpm.pc
libgail-gnome.pc              xproto.pc
libgcj.pc                     xproxymngproto.pc
libglade-2.0.pc               xrandr.pc
libgnome-2.0.pc               xrender.pc

Regards,
Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]