From 504338197996572df9add79e45bc20db4cf0c361 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Fri, 19 Mar 2021 07:44:00 -0400 Subject: [PATCH] fix: only check for the header unless Nokogiri provides LDFLAGS in which case, then we verify that we can resolve libxml symbols. Related to a41ab09 which checked symbol resolution on both Linux and Windows; but it fails (and is unnecessary) on Linux, leading to seeing this at installation: > checking for xmlNewDoc() in libxml/tree.h... no --- ext/nokogumbo/extconf.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/nokogumbo/extconf.rb b/ext/nokogumbo/extconf.rb index b33cff6b..af05c165 100644 --- a/ext/nokogumbo/extconf.rb +++ b/ext/nokogumbo/extconf.rb @@ -75,7 +75,11 @@ def modern_nokogiri? if modern_nokogiri? append_cflags(Nokogiri::VERSION_INFO["nokogiri"]["cppflags"]) append_ldflags(Nokogiri::VERSION_INFO["nokogiri"]["ldflags"]) # may be nil for nokogiri pre-1.11.2 - have_libxml2 = have_func("xmlNewDoc", "libxml/tree.h") + have_libxml2 = if Nokogiri::VERSION_INFO["nokogiri"]["ldflags"].empty? + have_header('libxml/tree.h') + else + have_func("xmlNewDoc", "libxml/tree.h") + end end if !have_libxml2