Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should use 'xml2-config' if it can be found in $PATH to find out libxml2's header and library file locations #584

Closed
aq2-sanger opened this issue Dec 15, 2011 · 2 comments

Comments

@aq2-sanger
Copy link

Hello,

The way libxml2 expects to be used when installed from source is that you call 'xml2-config --cflags --libs' and it outputs the flags needed to pass to GCC so it can find its headers and libraries. That's why libxml2 puts its stuff under 'libxml2/libxml', so even if you install to /usr or /usr/local, you still have to use this to get the header locations.

If Nokogiri used xml2-config to get the locations of the headers/libraries, then many installations of libxml2 would suddenly start working without having to pass in custom header or library file locations when building the Nogokiri gem.

Thanks

@flavorjones
Copy link
Member

Hello!

This seems like a reasonable idea. I'm guessing the proposed behavior would be:

  • if any of the --with-xml2-lib et al arguments are provided on the command line at installation time, use those.
  • else, check if xml2-config is somewhere in the user's $PATH, and if so, use its output
  • else, fall back to the current fallback behavior, which is rather ad-hoc.

Sound about right?

@aq2-sanger
Copy link
Author

That seems about as good as I can think of, yes.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants