richter 01/10/17 06:11:25
Modified: . Tag: Embperl2c Makefile.PL test.pl
driver Tag: Embperl2c epxalan.MAKEPL
Log:
Embperl 2 - better build support for Xalan
Revision Changes Path
No revision
No revision
1.31.4.26 +44 -18 embperl/Makefile.PL
Index: Makefile.PL
===================================================================
RCS file: /home/cvs/embperl/Makefile.PL,v
retrieving revision 1.31.4.25
retrieving revision 1.31.4.26
diff -u -r1.31.4.25 -r1.31.4.26
--- Makefile.PL 2001/09/20 08:23:55 1.31.4.25
+++ Makefile.PL 2001/10/17 13:11:23 1.31.4.26
@@ -3,7 +3,7 @@
#
# (C) 1997-2001 G.Richter ([EMAIL PROTECTED]) / ECOS
#
-# $Id: Makefile.PL,v 1.31.4.25 2001/09/20 08:23:55 richter Exp $
+# $Id: Makefile.PL,v 1.31.4.26 2001/10/17 13:11:23 richter Exp $
#
@@ -183,6 +183,16 @@
my $txt = $self -> MM::c_o (@_) ;
$txt =~ s/\$\*/-o \$*\$(OBJ_EXT) \$*/g ;
+ my @txt = split (/\n/, $txt) ;
+ my $cpp = 0 ;
+ foreach (@txt)
+ {
+ if (/\$\*\.cpp/)
+ {
+ s/\$\(CCCMD\)/\$(CPPCMD) \$(CPPFLAGS)/ ;
+ }
+ }
+ $txt = join ("\n", @txt) ;
return $txt ;
}
@@ -199,6 +209,18 @@
return $txt ;
}
+sub MY::const_cccmd
+ {
+ my $self = shift ;
+
+ my $txt = $self -> MM::const_cccmd (@_) ;
+ my $txt2 = $txt ;
+ $txt2 =~ s/\$\(CC\)/\$(CPP)/ ;
+ $txt2 =~ s/CCCMD/CPPCMD/ ;
+
+ return "$txt\n\n$txt2" ;
+ }
+
sub MY::post_initialize
{
@@ -290,14 +312,14 @@
my ($key, $path) = @_ ;
- open FH, $path or return undef ;
+ open CFGFH, $path or return undef ;
- while (<FH>)
+ while (<CFGFH>)
{
return $1 if (/^$key\s*(?:=|\s)\s*(.*?)$/) ;
}
- close FH ;
+ close CFGFH ;
return undef ;
}
@@ -339,11 +361,11 @@
$cmd =~ s/\//\\/g if ($win32) ;
- open FH, "$cmd|" or die "\nCannot start $cmd\nPlease make sure you have build
Apache and mod_perl before makeing Embperl\n" ;
+ open STFH, "$cmd|" or die "\nCannot start $cmd\nPlease make sure you have build
Apache and mod_perl before makeing Embperl\n" ;
- my @x = <FH> or die "\nCannot start $cmd\nPlease make sure you have build
Apache and mod_perl before makeing Embperl\n" ;
+ my @x = <STFH> or die "\nCannot start $cmd\nPlease make sure you have build
Apache and mod_perl before makeing Embperl\n" ;
- close FH ;
+ close STFH ;
return @x ;
}
@@ -360,13 +382,13 @@
$cmd =~ s/\//\\/g if ($win32) ;
- open FH, "$cmd|" or return 1 ;
+ open STFH, "$cmd|" or return 1 ;
- my @x = <FH> ;
+ my @x = <STFH> ;
#print "@x" ;
- my $code = close FH ;
+ my $code = close STFH ;
#print "Code = $code ; ? = $?\n" ;
return $? ;
@@ -626,9 +648,9 @@
if ($win32 && $apache)
{ # borrowed from mod_perl
- local *FH;
- open FH, ">dirent.h" || die "can't write dirent.h $!";
- print FH <<EOF;
+ local *DEFH;
+ open DEFH, ">dirent.h" || die "can't write dirent.h $!";
+ print DEFH <<EOF;
/* major kludge to workaround conflict(s) between perl's dirent.h and apache's
readdir.h */
#ifdef WIN32
@@ -639,7 +661,7 @@
#endif
EOF
- close FH;
+ close DEFH;
if ($ENV{APACHE_PERL_DLL})
{
@@ -1050,6 +1072,7 @@
# See if we need to link to any other libraries
#
+my $makemacros = {} ;
if ($EP2)
{
opendir DH, "driver" or die "Cannot open directory driver ($!)" ;
@@ -1068,13 +1091,16 @@
}
if (ref $result)
{
- #print "cflags = $result->{cflags}\n\n" ;
- #print "libs = $result->{libs}\n\n" ;
- #print "inc = $result->{inc}\n\n" ;
+ #while (my ($k, $v) = each %$result)
+ # {
+ # print "$k = $v\n" ;
+ # }
$libs .= ' ' . $result->{libs} ;
$i .= ' ' . $result->{cflags} ;
$d .= ' ' . $result->{defines} ;
$o .= ' ' . $result->{objects} ;
+ $makemacros->{CPP} = $result->{cpp} if ($result->{cpp}) ;
+ $makemacros->{CPPFLAGS} = $result->{cppflags} if ($result->{cppflags}) ;
if ($result->{save})
{
while (($k, $v) = each (%{$result->{save}}))
@@ -1108,7 +1134,7 @@
'PREREQ_PM' => { 'File::Spec' => 0.8 },
'ABSTRACT' => 'Embed Perl code in HTML documents',
'AUTHOR' => 'Gerald Richter <[EMAIL PROTECTED]>',
-
+ 'macro' => $makemacros,
);
1.70.4.79 +6 -6 embperl/test.pl
Index: test.pl
===================================================================
RCS file: /home/cvs/embperl/test.pl,v
retrieving revision 1.70.4.78
retrieving revision 1.70.4.79
diff -u -r1.70.4.78 -r1.70.4.79
--- test.pl 2001/10/16 11:51:24 1.70.4.78
+++ test.pl 2001/10/17 13:11:23 1.70.4.79
@@ -11,7 +11,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: test.pl,v 1.70.4.78 2001/10/16 11:51:24 richter Exp $
+# $Id: test.pl,v 1.70.4.79 2001/10/17 13:11:23 richter Exp $
#
###################################################################################
@@ -780,11 +780,11 @@
'condition' => '$LIBXSLTVERSION',
'msg' => ' libxslt',
},
- 'incxmlLibXSLT2.htm' => {
- 'version' => 2,
- 'condition' => '$LIBXSLTVERSION',
- 'msg' => ' libxslt',
- },
+# 'incxmlLibXSLT2.htm' => {
+# 'version' => 2,
+# 'condition' => '$LIBXSLTVERSION',
+# 'msg' => ' libxslt',
+# },
'incxmlXalanXSLT.htm' => {
'version' => 2,
'condition' => '$XALANPATH',
No revision
No revision
1.1.2.7 +30 -3 embperl/driver/Attic/epxalan.MAKEPL
Index: epxalan.MAKEPL
===================================================================
RCS file: /home/cvs/embperl/driver/Attic/epxalan.MAKEPL,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -r1.1.2.6 -r1.1.2.7
--- epxalan.MAKEPL 2001/10/17 11:08:00 1.1.2.6
+++ epxalan.MAKEPL 2001/10/17 13:11:25 1.1.2.7
@@ -62,10 +62,32 @@
"$xalanlib $xerceslib" =~ /^lib(.*?)\.so lib(.*?)\.so$/ ;
- #return { cflags => "-I$path/src -I$xerceslibpath/../include -instances=static
-D_REENTRANT ",
- return { cflags => "-I$path/src -I$xerceslibpath/../include -D_REENTRANT ",
+
+ my $platform ;
+ my $cpp ;
+ my $cppflags ;
+ my $makefile = "$path/src/Makefile" ;
+ if (-f $makefile)
+ {
+ $platform = search_config ('PLATFORM', $makefile) ;
+ $cpp = search_config ('CXX', $makefile) ;
+ $cppflags = search_config ('CXXFLAGS', $makefile) ;
+
+ print "Found XALAN was build for '$platform', C++ Compiler is $cpp, with
flags $cppflags\n" ;
+ }
+ else
+ {
+ print "Makefile for XALAN not found. Assuming prebuild version using
defaults\n" ;
+ print "!!! NOTE: If you get compiler errors when build epxalan.cpp, try to
build\n" ;
+ print "!!! XALAN from the sources. See INSTALL.XALAN.pod\n\n" ;
+ }
+
+
+ return { cflags => "-I$path/src -I$xerceslibpath/../include -D_REENTRANT " ,
+ cpp => $cpp,
+ cppflags => $cppflags,
libs => "-L$xalanlibpath -L$xerceslibpath -l$1 -l$2",
- defines => '-DXALAN',
+ defines => '-DXALAN' . ($platform?" -D$platform":'') ,
objects => 'driver/epxalan$(OBJ_EXT)',
save => { '$XALANPATH' => $path }} ;
}
@@ -93,6 +115,11 @@
sub xerceslib
{
+ if ($File::Find::dir =~ m#/\.#)
+ {
+ $File::Find::prune = 1 ;
+ return ;
+ }
if (/^libxerces.*\.so/)
{
$xerceslibpath = $File::Find::dir ;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]