Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make sure if the linker accepts -Wl,-Bstatic before using it.

  • Loading branch information...
commit 05ae0e00f13820c0082a44fab982c63c1b672e26 1 parent 180f600
@knu knu authored
Showing with 18 additions and 8 deletions.
  1. +18 −8 ext/nokogiri/extconf.rb
View
26 ext/nokogiri/extconf.rb
@@ -262,14 +262,24 @@ def process_recipe(name, version)
}
if static_p
- $libs.replace($libs.shellsplit.flat_map { |arg|
- case arg
- when '-lxml2', '-lxslt', '-lexslt'
- ['-Wl,-Bstatic', arg, '-Wl,-Bdynamic']
- else
- arg
- end
- }.shelljoin)
+ message 'checking for linker flags for static linking... '
+
+ case
+ when try_link('int main(void) { return 0; }',
+ ['-Wl,-Bstatic', '-lxml2', '-Wl,-Bdynamic'].shelljoin)
+ message "-Wl,-Bstatic\n"
+
+ $libs.replace($libs.shellsplit.flat_map { |arg|
+ case arg
+ when '-lxml2', '-lxslt', '-lexslt'
+ ['-Wl,-Bstatic', arg, '-Wl,-Bdynamic']
+ else
+ arg
+ end
+ }.shelljoin)
+ else
+ message "NONE\n"
+ end
# xslt-config --libs or pkg-config libxslt --libs does not include
# -llzma, so we need to add it manually when linking statically.
Please sign in to comment.
Something went wrong with that request. Please try again.