I've been trying to get the build/source_scan.pl working
on Win32, and made some progress, but came up against
something. First off, there's a couple of things that
are fixable:
- in lib/Apache/ParseSource.pm, follow => 1 is used
within a File::Find, which doesn't work on Win32;
- in lib/ModPerl/CScan.pm, a different syntax is
needed to run 'cppstdin':
======================================================
Index: lib/ModPerl/CScan.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/lib/ModPerl/CScan.pm,v
retrieving revision 1.3
diff -u -r1.3 CScan.pm
--- lib/ModPerl/CScan.pm 15 Jun 2004 17:50:34 -0000 1.3
+++ lib/ModPerl/CScan.pm 18 Jun 2004 04:32:36 -0000
@@ -3,6 +3,7 @@
require Exporter;
use Config '%Config';
use File::Basename;
+use Apache::Build ();
# NOTE to distributors: this module is needed only for mp2 developers,
# it's not a requirement for mod_perl users
@@ -929,8 +930,9 @@
$addincludes = "-I" . join(" -I", @$Includes)
if defined $Includes and @$Includes;
my($sym) = gensym;
- my $cmd = "echo '\#include \"$filename\"' | $Cpp->{cppstdin} $Defines
$addincludes $Cpp->{cppflags} $Cpp->{cppminus} |";
- #my $cmd = "$Cpp->{cppstdin} $Defines $addincludes $Cpp->{cppflags}
$Cpp->{cppminus} < $filename |";
+ my $cmd = Apache::Build::WIN32 ?
+ "$Cpp->{cppstdin} $Defines $addincludes $Cpp->{cppflags} $filename |" :
+ "echo '\#include \"$filename\"' | $Cpp->{cppstdin} $Defines $addincludes
$Cpp->{cppflags} $Cpp->{cppminus} |";
#my $cmd = "echo '\#include <$filename>' | $Cpp->{cppstdin} $Defines $addincludes
$Cpp->{cppflags} $Cpp->{cppminus} |";
(open($sym, $cmd) or die "Cannot open pipe from `$cmd': $!")
Index: lib/Apache/ParseSource.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/lib/Apache/ParseSource.pm,v
retrieving revision 1.55
diff -u -r1.55 ParseSource.pm
--- lib/Apache/ParseSource.pm 17 May 2004 23:01:22 -0000 1.55
+++ lib/Apache/ParseSource.pm 18 Jun 2004 04:32:38 -0000
@@ -200,7 +200,7 @@
my $dir = $File::Find::dir;
push @includes, "$dir/$_";
},
- follow => 1,
+ (Apache::Build::WIN32 ? '' : follow => 1),
}, $dir);
}
return @includes;
================================================================
(an unrelated problem - on my ActivePerl, $Config{cppstdin}
is defined to be 'cppstdin', which doesn't exist on my
system. I had to change it to 'cl -nologo -E' to get it
to work. But I think this is a Perl configuration issue).
However, with these changes, build/source_scan dies at a
certain point:
========================================================
.apache_includes
D:\unzipped\MODPER~1.0\xs/modperl_xs_sv_convert.h(149) : warning C4005:
'mp_xs_sv2_APR__Table' : macro redefinition
D:\unzipped\MODPER~1.0\xs/modperl_xs_util.h(25) : see previous definition of
'mp_xs_sv2_APR__Table'
D:\unzipped\MODPER~1.0\xs/modperl_xs_sv_convert.h(321) : warning C4005: 'mp_xs_sv2_r'
: macro redefinition
D:\unzipped\MODPER~1.0\xs/modperl_xs_util.h(21) : see previous definition of
'mp_xs_sv2_r'
.apache_includes
D:\unzipped\MODPER~1.0\xs/modperl_xs_sv_convert.h(149) : warning C4005:
'mp_xs_sv2_APR__Table' : macro redefinition
D:\unzipped\MODPER~1.0\xs/modperl_xs_util.h(25) : see previous definition of
'mp_xs_sv2_APR__Table'
D:\unzipped\MODPER~1.0\xs/modperl_xs_sv_convert.h(321) : warning C4005: 'mp_xs_sv2_r'
: macro redefinition
D:\unzipped\MODPER~1.0\xs/modperl_xs_util.h(21) : see previous definition of
'mp_xs_sv2_r'
panic: length mismatch
' void *(__stdcall *apr_thread_start_t)(apr_thread_t*, void*)'
whited-out as
'void '
panic: length mismatch
' ap_filter_t * (_stdcall *modperl_filter_add_t) (const char *, void *,
request_rec *,
conn_rec *)'
whited-out as
'ap_filter_t
'
Expecting parenth after identifier in `EXCEPTION_DISPOSITION __cdecl _except_handler (
struct _EXCEPTION_RECORD *ExceptionRecord, void * EstablisherFrame, struct _CONTEXT
*ContextRecord, void * DispatcherContext )'
after `EXCEPTION_DISPOSITION __cdecl ' at lib/ModPerl/CScan.pm line 809.
ModPerl::CScan::do_declaration('EXCEPTION_DISPOSITION __cdecl _except_handler
(\x{a} struct _E...', 'HASH(0x264c82c)', 'HASH(0x1d3b1a0)') called at
lib/ModPerl/CScan.pm line 752
ModPerl::CScan::do_declarations('ARRAY(0x1d3b644)', 'HASH(0x264c82c)',
'HASH(0x1d3b1a0)') called at D:/Perl/site/lib/Data/Flow.pm line 93
Data::Flow::request('Apache::ParseSource::Scan=ARRAY(0x1d39574)',
'parsed_fdecls') called at D:/Perl/site/lib/Data/Flow.pm line 46
Data::Flow::get('Apache::ParseSource::Scan=ARRAY(0x1d39574)', 'parsed_fdecls')
called at lib/Apache/ParseSource.pm line 65
Apache::ParseSource::Scan::get('Apache::ParseSource::Scan=ARRAY(0x1d39574)',
'parsed_fdecls') called at lib/Apache/ParseSource.pm line 398
Apache::ParseSource::get_functions('Apache::ParseSource=HASH(0x265ad74)')
called at lib/Apache/ParseSource.pm line 494
Apache::ParseSource::write_functions_pm('Apache::ParseSource=HASH(0x265ad74)')
called at build\source_scan.pl line 18
=============================================================================
So the problem seem to be the presence of __cdecl in the
declaration. I'm afraid I couldn't follow the code around
line 809 of lib/ModPerl/CScan.pm enough to know if __cdecl
could just be tested for, and thrown away if found, or
if it would form part of the declaration needed later?
--
best regards,
randy
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]