

$win32 = ($^O eq 'MSWin32') ;

my $prefix  ;
my $prefix2  ;
my $libs  ;
my $libs2  ;
my $cflags  ;
my $cflags2  ;
my $version ;
my $version2 ;

if (!$win32)
    {
    if (!open (C, "xml2-config --version|"))
        {
        print "Cannot execute xml2-config ($!). libxml2 and libxslt will not be linked into Embperl\n" ;
        return undef ;
        }
    chomp ($version = <C>)  or die ("Cannot execute xml2-config to get version.") ;
    close C ;

    open C, "xml2-config --prefix --libs --cflags|" or die ("Cannot execute xml2-config ($!).") ;
    chomp ($prefix = <C>) ;
    chomp ($libs = <C>) ;
    chomp ($cflags = <C>) ;
    close C ;

    print "Found libxml2 $version installed under $prefix\n" ;

    if (!open (C, "xslt-config --version|"))
        {
        print "Cannot execute xslt-config ($!). libxml2 and libxslt will not be linked into Embperl\n" ;
        return undef ;
        }
    chomp ($version2 = <C>)  or die ("Cannot execute xslt-config to get version.") ;
    close C ;

    open C, "xslt-config --prefix --libs |" or die ("Cannot execute xslt-config ($!).") ;
    chomp ($prefix2 = <C>) ;
    chomp ($libs2 = <C>) ;
    close C ;

    open C, "xslt-config --cflags|" or die ("Cannot execute xslt-config ($!).") ;
    chomp ($cflags2 = <C>) ;
    close C ;

    print "Found libxslt $version2 installed under $prefix2\n" ;
    
    
    return { cflags => "$cflags $cflags2", 
             libs => "$libs $libs2", 
             inc => $prefix eq $prefix2?"-I$prefix/include":"-I$prefix/include -I$prefix2/include",
             defines => '-DLIBXSLT',
             objects => 'driver/eplibxslt$(OBJ_EXT)',
             save    => { '$LIBXSLTVERSION' => $version2 }} ;
    }

print "libxml2/libxslt is currently not supported on Win32\n" ;
return undef ;

