#!/usr/bin/ruby -w # See the LICENSE file for copyright and distribution information require "mkmf" $LIBPATH.push(Config::CONFIG['libdir']) def crash(str) printf(" extconf failure: %s\n", str) exit 1 end #dir_config('xml2') #unless have_library('m', 'atan') # crash('need libm') #end #unless have_library("z", "inflate") # crash("need zlib") #else # $defs.push('-DHAVE_ZLIB_H') #end if dir_config( "xml2" ) != [nil, nil] inc, lib = dir_config( 'xml2' ) $LDFLAGS << " -L#{lib} -lxml2 -lz -lpthread -liconv -lm" $CFLAGS << " -I#{inc}" elsif ex = find_executable( "xml2-config" ) $LDFLAGS << ' ' + `#{ex} --libs`.chomp $CFLAGS << ' ' + `#{ex} --cflags`.chomp else crash(<