Skip to content
This repository was archived by the owner on Aug 26, 2023. It is now read-only.

Commit f6a7412

Browse files
authored
Merge pull request #174 from rubys/flavorjones-fix-modern-nokogiri-detection
fix: only check for the header unless Nokogiri provides LDFLAGS
2 parents 3f75205 + 5043381 commit f6a7412

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ext/nokogumbo/extconf.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ def modern_nokogiri?
7575
if modern_nokogiri?
7676
append_cflags(Nokogiri::VERSION_INFO["nokogiri"]["cppflags"])
7777
append_ldflags(Nokogiri::VERSION_INFO["nokogiri"]["ldflags"]) # may be nil for nokogiri pre-1.11.2
78-
have_libxml2 = have_func("xmlNewDoc", "libxml/tree.h")
78+
have_libxml2 = if Nokogiri::VERSION_INFO["nokogiri"]["ldflags"].empty?
79+
have_header('libxml/tree.h')
80+
else
81+
have_func("xmlNewDoc", "libxml/tree.h")
82+
end
7983
end
8084

8185
if !have_libxml2

0 commit comments

Comments
 (0)