I think it's best to check for both... something like this would be ideal
if pkg_config('libxml-2.0')
elsif find_executable('xml2-config')
  $CFLAGS << " #{`xml2-config --cflags`.strip}"
  $LIBS << " #{`xml2-config --libs`.strip}"
elsif !have_library('xml2') or !have_header('libxml/parser.h')
   fail "missing dependencies"
end



On Sat, Dec 13, 2008 at 4:11 AM, Felipe Contreras <
felipe.contre...@gmail.com> wrote:

> 2008/12/13 Charlie Savage <c...@savagexi.com>:
> >
> >
> > David Helder wrote:
> >>
> >> It should just use the xml2-config that's in the path and the output
> just
> >> requires a chop:
> >>  > xml2-config --cflags
> >> -I/opt/local/include/libxml2
> >>  > xml2-config --libs
> >> -L/opt/local/lib -lxml2 -lz -lpthread -liconv -lm
> >>
> >> I don't know mkmf that well,
> >
> > That makes two of us.
> >
> > but I can take a look if I get some time.
> >
> > Cool - thanks.
>
> It's much easier to use pkg-config.
>
> in extconf.rb:
> pkg_config('libxml-2.0')
>
> --
> Felipe Contreras
> _______________________________________________
> libxml-devel mailing list
> libxml-devel@rubyforge.org
> http://rubyforge.org/mailman/listinfo/libxml-devel
>
_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel

Reply via email to