XML-LibXSLT

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

        }
    }
}

if ($config{LIBS} !~ /\-l(lib)?xslt\b/) {
    # in this case we are not able to run xml2-config. therefore we need to
    # expand the libz as well.
    if ($::is_Win32) {
        if( $ENV{ACTIVEPERL_MINGW} ) {
            $config{LIBS} .= ' -llibxslt.lib -llibxml2.lib';
        } else {
            $config{LIBS} .= ' -llibxslt -llibxml2';
        }
    } else {
        $config{LIBS} .= ' -lxml2 -lxslt -lz';
    }
}

if ($config{LIBS} !~ /\-lz(lib)?\b/ and !($::is_Win32 && $config{LIBS} !~ /\-lzlib\b/)) {
    # note if libxml2 has not -lz within its cflags, we should not use
    # it! We should trust libxml2 and assume libz is not available on the
    # current system (this is ofcourse not true with win32 systems.
    # $config{LIBS} .= $::is_Win32 ? ' -lzlib' :' -lz';
    if ( $config{DEBUG} ) {
        warn "zlib was not configured\n";
        warn "set zlib\n" if $::is_Win32;
    }
    if ($::is_Win32) {
        if( $ENV{ACTIVEPERL_MINGW} ) {
            $config{LIBS} .= '';
        } else {
            $config{LIBS} .= ' -lzlib';
        }
    } else {
        $config{LIBS} .= ' -lz';
    }
}

if ($config{LIBS} !~ /\-lm\b/) {
    # math support is important, but is not available separately in W32
    $config{LIBS} .= $::is_Win32 ? '' :' -lm';
}

if (!have_library($::is_Win32 ? "libxslt" : "xslt")) {
    print STDERR <<"DEATH";
libxslt not found
Try setting LIBS and INC values on the command line
Or get libxslt and libxml2 from
  http://www.libxml.org/
If you install via RPMs, make sure you also install the -devel
RPMs, as this is where the headers (.h files) are.
DEATH
exit 0; # 0 recommended by http://cpantest.grango.org (Notes for CPAN Authors)
}


if (have_library($::is_Win32 ? "libexslt" : "exslt")) {
    if (! $HAVE_USER_DEFINED) {
        my $exslt_defaults = $::is_Win32 ?
        ($ENV{ACTIVEPERL_MINGW} ? q/-llibexslt.lib/ : q/-llibexslt/) :
        q/-lexslt/; # -lgcrypt -lgpg-error/;
        my $exsltcfg = 'pkg-config libexslt';
        my ($exslt_libs,$exslt_inc);
        eval {
            print "running $exsltcfg... ";
            $exslt_libs = backtick("$exsltcfg --libs");
            $exslt_inc = backtick("$exsltcfg --cflags");
            $exslt_libs =~ s/-l(xml2|xslt|z|m)\s+//g;
            print "ok\n";
        };
        if ($@) {
            print "failed\n";
            warn "*** ", $@ if $DEBUG;
            warn "using fallback values for LIBS and INC\n";
            # backtick fails if gnome-config didn't exist...
            $exslt_libs  = $exslt_defaults;
            $exslt_inc   = '';
        }
        $config{LIBS} .= ' '.$exslt_libs;
        $config{INC} .= ' '.$exslt_inc;
    }
    $config{DEFINE} .= " -DHAVE_EXSLT"
}

if ($DEBUG) {
    print "LIBS: $config{LIBS}\n";
    print "INC: $config{INC}\n";
}

my $ldflags = delete $config{LDFLAGS};
if ($ldflags) {
    $config{dynamic_lib} = { OTHERLDFLAGS => " $ldflags " };
}

# Avoid possible shared library name conflict. On Win32 systems
# the name of system DLL libxlst.dll clashes with module's LibXSLT.dll.
# To handle this we are gonna rename module's DLL to LibXSLT.xs.dll.
if ($::is_Win32)
{
    # Fix for RT #94516 :
    # https://rt.cpan.org/Ticket/Display.html?id=94516
    $config{DLEXT} = 'xs.'.$Config{dlext};
}

WriteMakefile(
    'NAME'	=> 'XML::LibXSLT',
    'VERSION_FROM' => 'lib/XML/LibXSLT.pm', # finds $VERSION
    'AUTHOR'    => 'Matt Sergeant',
    'ABSTRACT'  => 'Interface to GNOME libxslt library',
    'LICENSE'   => 'perl_5',
    'PREREQ_PM' =>
    {
        'Encode' => 0,
        'File::Path' => "2.06",
        'XML::LibXML' => "1.70",
        'strict' => 0,
        'warnings' => 0,
    },
    'OBJECT'     => '$(O_FILES)',
    (($ExtUtils::MakeMaker::VERSION >= 6.52)
        ? (



( run in 0.496 second using v1.01-cache-2.11-cpan-df04353d9ac )