You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ja...@apache.org on 2001/08/02 04:40:10 UTC

cvs commit: xml-xerces/perl Makefile.PL

jasons      01/08/01 19:40:10

  Modified:    perl     Makefile.PL
  Log:
  	* Makefile.PL (Repository):
  	-lpthread is now back, w/o this caused compile fails on RedHat7
  	Xerces-C minor version numbers are now supported
  	removed local *STD{OUT,ERR} this caused segfault sometimes, so we
  	   just have to deal with Liblist::ext spewage
  	Solaris gets -DHAS_BOOL
  	We no longer assume find is called 'find' (e.g. Cygwin)
  	We now build Handler.a and not Handler.so
  
  Revision  Changes    Path
  1.18      +56 -35    xml-xerces/perl/Makefile.PL
  
  Index: Makefile.PL
  ===================================================================
  RCS file: /home/cvs/xml-xerces/perl/Makefile.PL,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Makefile.PL	2001/07/10 17:35:33	1.17
  +++ Makefile.PL	2001/08/02 02:40:10	1.18
  @@ -11,7 +11,7 @@
     $XERCES_LIB = "$XERCESCROOT/lib\n";
   } 
   
  -my $LIBS = '';
  +my $LIBS = '-lpthread';
   $INCLUDES = '-I. -IHandler';
   if (defined $XERCES_LIB) {
     print STDERR "Using XERCES_LIB = $XERCES_LIB";
  @@ -45,11 +45,15 @@
   EOW
   }
   
  -# We need to know which version of libxerces we are to use
  +# We need to know which version of libxerces we are to use. 
  +# As of Xerces-C 1.5.1, minor version numbers are used
   my $XERCES_MAJOR_VERSION = '1.5';
  +my $XERCES_MINOR_VERSION = '1';
  +my $XERCES_LIB_VERSION = "$XERCES_MAJOR_VERSION.$XERCES_MINOR_VERSION";
  +my $XERCES_VERSION = "$XERCES_LIB_VERSION";
  +
   # this substitution will yield '1_4' from '1.4' to be used by 'LIBS'
  -my $XERCES_LIB_VERSION = $XERCES_MAJOR_VERSION;
  -$XERCES_LIB_VERSION =~ s/\./_/;
  +$XERCES_LIB_VERSION =~ s/\./_/g;
   my $LIBXERCES = "-lxerces-c$XERCES_LIB_VERSION";
   $LIBS .= " $LIBXERCES";
   
  @@ -57,14 +61,8 @@
   # if not we die()
   print STDERR "Checking to see if libxerces is in your library path...";
   my $lib;
  -{
  -  # suppress any messages from Liblist::ext()
  -  local *STDOUT;
  -  local *STDERR;
  -  open(STDERR, ">/dev/null");
  -  open(STDOUT, ">/dev/null");
  -  ($lib) = ExtUtils::Liblist::ext(MM->new(),$LIBS);
  -}
  +($lib) = MM->new->ExtUtils::Liblist::ext($LIBS);
  +
   die <<EOE unless $lib;
   
   
  @@ -82,28 +80,52 @@
   print STDERR "Success!!\n";
   
   # give some nice feedback for the user
  -print STDERR "Using Xerces-C version: $XERCES_MAJOR_VERSION\n";
  +print STDERR "Using Xerces-C version: $XERCES_VERSION\n";
  +
  +my $HANDLER_LIB = '$(INST_ARCHLIB)/auto/Handler/Handler$(LIB_EXT)';
  +
  +sub MY_postamble {
  +qq[
  +
  +$HANDLER_LIB:
  +	cd Handler && make static
  +];
  +
  +}
  +*MY::postamble = \&MY_postamble;
  +
  +my @MACRO;
  +my $CFLAGS = '-D_REENTRANT';
  +
  +# gcc on solaris needs HAS_BOOL, RedHat fails with this defined
  +$CFLAGS .= ' -DHAS_BOOL' if $^O eq 'solaris';
   
  -# replace this with an absolute path if needed
  -my @handler_headers;
  -chomp(@handler_headers = `find Handler -name "*.swig.hpp"`);
  -
  -sub Xerces_postamble {
  -  chomp(my @header_files = `find Xerces_headers -name "*.hpp"`);
  -  push(@header_files,@handler_headers);
  -  local $" = ' ';
  -  <<TERMINUS;
  +# until I get ahold of Detect::OS, I assume all linux is debian
  +$CFLAGS .= ' -DDEBIAN' if $^O eq 'linux';
  +
  +# we only consider using SWIG if we are a Xerces Developer
  +if ($XERCES_DEVEL) {
  +  # replace this with the path to your Unix compatible find application
  +  my $FIND = 'find';
  +  my @handler_headers;
  +  chomp(@handler_headers = `$FIND Handler -name "*.swig.hpp"`);
  +
  +  sub Xerces_postamble {
  +    chomp(my @header_files = `$FIND Xerces_headers -name "*.hpp"`);
  +    push(@header_files,@handler_headers);
  +    local $" = ' ';
  +    <<TERMINUS;
   Xerces.C Xerces.pm: Xerces.i @header_files postSource.pl postModule.pl
   	\$(SWIG) -I. -ILib -ILib/perl5 \$(INC) -D\$(SWIG_VERSION) -package XML::Xerces -perl5 -c++ -shadow -o Xerces.C Xerces.i
   	perl postSource.pl Xerces.C
   	perl postModule.pl Xerces.pm
  +
  +
  +$HANDLER_LIB:
  +	cd Handler && make static
   TERMINUS
  -}
  +  }
   
  -# we only consider using SWIG if we are a Xerces Developer
  -my @MACRO;
  -my $CFLAGS = '-D_REENTRANT -DDEBIAN';
  -if ($XERCES_DEVEL) {
     print STDERR "Welcome Xerces Developer!\n";
     # if we're to use SWIG, we need to know which version is available
     my $swig = $SWIG || 'swig';
  @@ -117,10 +139,8 @@
     *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);
  +# set up the list of object files to include in Xerces\$(OBJ_EXT)
  +my $OBJS = 'Xerces$(OBJ_EXT)';
   
   # write the makefile
   WriteMakefile(
  @@ -132,12 +152,13 @@
       'DOMParse/DOMParse.pm' => '$(INST_LIB)/XML/Xerces/DOMParse.pm',
     },
     'INC'         => $INCLUDES,
  +  'MYEXTLIB'    => $HANDLER_LIB,
     'LIBS'        => [$LIBS],
  -#  'LIBS'        => '-lpthread',
     'NAME'        => 'XML::Xerces',
  +#  'OPTIMIZE'        => '-g',
     'OBJECT'      => $OBJS,
  -#  'OPTIMIZE'    => '-g',
  -  'DIR'         => ['DOMParse', 'Handler'],
  -  'VERSION'     => "$XERCES_MAJOR_VERSION.2",
  +  'DIR'         => ['DOMParse'],
  +  'VERSION'     => "$XERCES_MAJOR_VERSION.4",
     @MACRO
   );
  +
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org