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/07/09 19:24:27 UTC
cvs commit: xml-xerces/perl Makefile.PL
jasons 01/07/09 10:24:27
Modified: perl Makefile.PL
Log:
* Makefile.PL (Repository):
Now calls die() if it cannot locate libxerces
No ouptput for SWIG is generate unless $XERCES_DEVEL is set
Revision Changes Path
1.15 +53 -21 xml-xerces/perl/Makefile.PL
Index: Makefile.PL
===================================================================
RCS file: /home/cvs/xml-xerces/perl/Makefile.PL,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- Makefile.PL 2001/06/23 15:05:17 1.14
+++ Makefile.PL 2001/07/09 17:24:22 1.15
@@ -45,6 +45,45 @@
EOW
}
+# We need to know which version of libxerces we are to use
+my $XERCES_MAJOR_VERSION = '1.5';
+# 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/\./_/;
+my $LIBXERCES = "-lxerces-c$XERCES_LIB_VERSION";
+$LIBS .= " $LIBXERCES";
+
+# now we ensure that libxerces is in the library path
+# 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);
+}
+die <<EOE unless $lib;
+
+
+ !!!WHOA!!!
+
+I couldn\'t find $LIBXERCES anywhere in your library path. Begging to
+differ with perl, this is most assuredly *NOT* harmless. This is a
+critical error that will prevent you from running Xerces.pm.
+
+Check your settings of \$XERCES_INCLUDE and \$XERCES_LIB, and rerun
+'perl Makefile.PL'
+
+EOE
+
+print STDERR "Success!!\n";
+
+# give some nice feedback for the user
+print STDERR "Using Xerces-C version: $XERCES_MAJOR_VERSION\n";
+
# replace this with an absolute path if needed
my @handler_headers;
chomp(@handler_headers = `find Handler -name "*.swig.hpp"`);
@@ -62,8 +101,18 @@
}
# we only consider using SWIG if we are a Xerces Developer
+my @MACRO;
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';
+ my ($sv_maj,$sv_min) = qx[$swig -version 2>&1] =~ /(\d+)\.(\d+)/;
+ @MACRO = ('macro' => {
+ 'SWIG' => "$swig",
+ 'SWIG_VERSION' => "SWIG_$ {sv_maj}_$ {sv_min}",
+ });
+
+ print STDERR "Using SWIG version: SWIG_$ {sv_maj}_$ {sv_min}\n";
*MY::postamble = \&Xerces_postamble;
}
@@ -72,21 +121,6 @@
my @handler_objs = @handler_headers;
$OBJS .= join(' ', map {s/\.swig\.hpp/\.o/;$_} @handler_objs);
-# if we're to use SWIG, we need to know which version is available
-my $swig = $SWIG || 'swig';
-my ($sv_maj,$sv_min) = qx[$swig -version 2>&1] =~ /(\d+)\.(\d+)/;
-
-# We need to know which version of libxerces we are to use
-my $XERCES_MAJOR_VERSION = '1.4';
-# 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/\./_/;
-$LIBS .= " -lxerces-c$XERCES_LIB_VERSION -lpthread";
-
-# give some nice feedback for the user
-print STDERR "Using SWIG version: SWIG_$ {sv_maj}_$ {sv_min}\n";
-print STDERR "Using Xerces-C version: $XERCES_MAJOR_VERSION\n";
-
# write the makefile
WriteMakefile(
'AUTHOR' => 'The Xerces-P developers',
@@ -97,14 +131,12 @@
'DOMParse/DOMParse.pm' => '$(INST_LIB)/XML/Xerces/DOMParse.pm',
},
'INC' => $INCLUDES,
- 'LIBS' => $LIBS,
+ 'LIBS' => [$LIBS],
+# 'LIBS' => '-lpthread',
'NAME' => 'XML::Xerces',
'OBJECT' => $OBJS,
# 'OPTIMIZE' => '-g',
'DIR' => ['DOMParse', 'Handler'],
- 'VERSION' => "$XERCES_MAJOR_VERSION.1",
- 'macro' => {
- 'SWIG' => "$swig",
- 'SWIG_VERSION' => "SWIG_$ {sv_maj}_$ {sv_min}",
- },
+ 'VERSION' => "$XERCES_MAJOR_VERSION.0",
+ @MACRO
);
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org