use ExtUtils::MakeMaker; use Env qw(XERCES_LIB XERCES_INCLUDE XERCESCROOT XERCES_DEVEL SWIG); use strict; use vars qw($INCLUDES); $XERCESCROOT = "C:/usr/xerces_new"; if (defined $XERCES_LIB || defined $XERCES_INCLUDE) { # this is the default, so do nothing } elsif (defined $XERCESCROOT) { # they are instructing us to use the build directories $XERCES_INCLUDE = "$XERCESCROOT/include\n"; $XERCES_LIB = "$XERCESCROOT/lib\n"; } my $LIBS = ''; $INCLUDES = '-I. -I./Handler'; if (defined $XERCES_LIB) { print STDERR "Using XERCES_LIB = $XERCES_LIB"; $LIBS = "-L$XERCES_LIB "; } if (defined $XERCES_INCLUDE) { print STDERR "Using XERCES_INCLUDE = $XERCES_INCLUDE"; $INCLUDES .= " -I$XERCES_INCLUDE"; } if (!defined $XERCES_LIB && !defined $XERCES_INCLUDE) { print STDERR </dev/null"); # open(STDOUT, ">/dev/null"); # ($lib) = ExtUtils::Liblist::ext(MM->new(),$LIBS); #} die <&1] =~ /(\d+)\.(\d+)/; @MACRO = ('macro' => { 'SWIG' => "$swig", 'SWIG_VERSION' => "SWIG_$ {sv_maj}_$ {sv_min}", }); $CFLAGS .= ' -D$(SWIG_VERSION)'; print STDERR "Using SWIG version: SWIG_$ {sv_maj}_$ {sv_min}\n"; *MY::postamble = \&Xerces_postamble; } # set up the list of object files to include in Xerces.o my $OBJS = "Xerces.o "; my @handler_objs = @handler_headers; $OBJS .= join(' ', map {s/\.swig\.hpp/\.o/;$_} @handler_objs); # write the makefile WriteMakefile( 'AUTHOR' => 'The Xerces-P developers', 'ABSTRACT' => 'Perl Interface for Xerces XML API', 'CCFLAGS' => "$CFLAGS -DWIN32 -DHAS_BOOL", 'PM' => { 'Xerces.pm' => '$(INST_LIB)/XML/Xerces.pm', 'DOMParse/DOMParse.pm' => '$(INST_LIB)/XML/Xerces/DOMParse.pm', }, 'INC' => $INCLUDES, 'LIBS' => [$LIBS], # 'LIBS' => '-lpthread', 'NAME' => 'XML::Xerces', 'OBJECT' => $OBJS, # 'OPTIMIZE' => '-g', 'DIR' => ['DOMParse', 'Handler'], 'VERSION' => "$XERCES_MAJOR_VERSION.3", @MACRO );