From: Vadim Konovalov Date: Thu, 16 May 2002 03:33:23 +0000 (+0400) Subject: good day for WinCE port of perl. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fefd7080dbb7bc74916ad5ba8b63e3bdeeb86c38;p=p5sagit%2Fp5-mst-13.2.git good day for WinCE port of perl. Message-ID: <001301c1fc68$e808e560$a95cc3d9@vad> p4raw-id: //depot/perl@16628 --- diff --git a/MANIFEST b/MANIFEST index d0d33e3..39cd432 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2754,7 +2754,6 @@ wince/config_H.ce WinCE port wince/config_h.PL WinCE port wince/config_sh.PL WinCE port wince/dl_win32.xs WinCE port -wince/FindExt.pm WinCE port wince/include/arpa/inet.h WinCE port wince/include/netdb.h WinCE port wince/include/sys/socket.h WinCE port diff --git a/ext/Encode/Byte/Makefile.PL b/ext/Encode/Byte/Makefile.PL index 5f67d8b..3fe7345 100644 --- a/ext/Encode/Byte/Makefile.PL +++ b/ext/Encode/Byte/Makefile.PL @@ -172,6 +172,7 @@ sub postamble } } my $plib = $self->{PERL_CORE} ? '"-I$(PERL_LIB)"' : ''; + $plib .= " -MCross=$::Cross::platform" if defined $::Cross::platform; my $ucopts = '-"Q" -"O"'; $str .= qq{\n\t\$(PERL) $plib $enc2xs $ucopts -o \$\@ -f $table.fnm\n\n}; diff --git a/ext/Encode/CN/Makefile.PL b/ext/Encode/CN/Makefile.PL index 775a8f5..1dd713a 100644 --- a/ext/Encode/CN/Makefile.PL +++ b/ext/Encode/CN/Makefile.PL @@ -149,6 +149,7 @@ sub postamble } } my $plib = $self->{PERL_CORE} ? '"-I$(PERL_LIB)"' : ''; + $plib .= " -MCross=$::Cross::platform" if defined $::Cross::platform; my $ucopts = '-"Q"'; $str .= qq{\n\t\$(PERL) $plib $enc2xs $ucopts -o \$\@ -f $table.fnm\n\n}; diff --git a/ext/Encode/EBCDIC/Makefile.PL b/ext/Encode/EBCDIC/Makefile.PL index f2113fa..73152ee 100644 --- a/ext/Encode/EBCDIC/Makefile.PL +++ b/ext/Encode/EBCDIC/Makefile.PL @@ -130,6 +130,7 @@ sub postamble } } my $plib = $self->{PERL_CORE} ? '"-I$(PERL_LIB)"' : ''; + $plib .= " -MCross=$::Cross::platform" if defined $::Cross::platform; my $ucopts = '-"Q" -"O"'; $str .= qq{\n\t\$(PERL) $plib $enc2xs $ucopts -o \$\@ -f $table.fnm\n\n}; diff --git a/ext/Encode/JP/Makefile.PL b/ext/Encode/JP/Makefile.PL index a1df35d..b4a4ed0 100644 --- a/ext/Encode/JP/Makefile.PL +++ b/ext/Encode/JP/Makefile.PL @@ -149,6 +149,7 @@ sub postamble } } my $plib = $self->{PERL_CORE} ? '"-I$(PERL_LIB)"' : ''; + $plib .= " -MCross=$::Cross::platform" if defined $::Cross::platform; my $ucopts = '-"Q"'; $str .= qq{\n\t\$(PERL) $plib $enc2xs $ucopts -o \$\@ -f $table.fnm\n\n}; diff --git a/ext/Encode/KR/Makefile.PL b/ext/Encode/KR/Makefile.PL index 4ba99ab..88fce24 100644 --- a/ext/Encode/KR/Makefile.PL +++ b/ext/Encode/KR/Makefile.PL @@ -147,6 +147,7 @@ sub postamble } } my $plib = $self->{PERL_CORE} ? '"-I$(PERL_LIB)"' : ''; + $plib .= " -MCross=$::Cross::platform" if defined $::Cross::platform; my $ucopts = '-"Q"'; $str .= qq{\n\t\$(PERL) $plib $enc2xs $ucopts -o \$\@ -f $table.fnm\n\n}; diff --git a/ext/Encode/Symbol/Makefile.PL b/ext/Encode/Symbol/Makefile.PL index a436b4d..e1fa906 100644 --- a/ext/Encode/Symbol/Makefile.PL +++ b/ext/Encode/Symbol/Makefile.PL @@ -135,6 +135,7 @@ sub postamble } } my $plib = $self->{PERL_CORE} ? '"-I$(PERL_LIB)"' : ''; + $plib .= " -MCross=$::Cross::platform" if defined $::Cross::platform; my $ucopts = '-"Q" -"O"'; $str .= qq{\n\t\$(PERL) $plib $enc2xs $ucopts -o \$\@ -f $table.fnm\n\n}; diff --git a/ext/Encode/TW/Makefile.PL b/ext/Encode/TW/Makefile.PL index 8f12a81..65cc224 100644 --- a/ext/Encode/TW/Makefile.PL +++ b/ext/Encode/TW/Makefile.PL @@ -145,6 +145,7 @@ sub postamble } } my $plib = $self->{PERL_CORE} ? '"-I$(PERL_LIB)"' : ''; + $plib .= " -MCross=$::Cross::platform" if defined $::Cross::platform; my $ucopts = '-"Q"'; $str .= qq{\n\t\$(PERL) $plib $enc2xs $ucopts -o \$\@ -f $table.fnm\n\n}; diff --git a/utf8.c b/utf8.c index efcc602..c2818c8 100644 --- a/utf8.c +++ b/utf8.c @@ -1348,15 +1348,6 @@ Perl_to_utf8_case(pTHX_ U8 *p, U8* ustrp, STRLEN *lenp, SV **swashp, char *norma HE *he; SV *val; -#if defined(UNDER_CE) -/*strange: compiler complaints that I redefine macro UVXf and points where - it was first defined. I copied line from there without any changes. - Nothing should change. - But when I do not do this, there is an error on a line with - Perl_newSVpvf(aTHX_ "%04"UVXf, uv1) -*/ -#define UVXf "lX" /**/ -#endif if ((hv = get_hv(special, FALSE)) && (keysv = sv_2mortal(Perl_newSVpvf(aTHX_ "%04"UVXf, uv1))) && (he = hv_fetch_ent(hv, keysv, FALSE, 0)) && diff --git a/win32/buildext.pl b/win32/buildext.pl index 7125753..65b79be 100644 --- a/win32/buildext.pl +++ b/win32/buildext.pl @@ -4,7 +4,7 @@ buildext.pl - build extensions =head1 SYNOPSIS - buildext.pl make [-make_opts] dep directory [target] + buildext.pl make [-make_opts] dep directory [target] !ext1 !ext2 E.g. @@ -16,11 +16,19 @@ E.g. buildext.pl dmake perldll.def ..\ext clean +Will skip building extensions which are marked with an '!' char. +Mostly because they still not ported to specified platform. + =cut use File::Basename; use Cwd; use FindExt; + +# @ARGV with '!' at first position are exclusions +my %excl = map {$_=>1} map {/^!(.*)$/} @ARGV; +@ARGV = grep {!/^!/} @ARGV; + my $here = getcwd(); my $perl = $^X; $here =~ s,/,\\,g; @@ -36,7 +44,7 @@ my $pl2bat = "$topdir\\win32\\bin\\pl2bat"; unless (-f "$pl2bat.bat") { my @args = ($perl, ("$pl2bat.pl") x 2); print "@args\n"; - system(@args); + system(@args) unless defined $::Cross::platform; } my $make = shift; $make .= " ".shift while $ARGV[0]=~/^-/; @@ -46,12 +54,17 @@ my $dir = shift; chdir($dir) || die "Cannot cd to $dir\n"; my $targ = shift; (my $ext = getcwd()) =~ s,/,\\,g; +my $code; FindExt::scan_ext($ext); my @ext = FindExt::extensions(); foreach my $dir (sort @ext) { + if (exists $excl{$dir}) { + warn "Skipping extension $ext\\$dir, not ported to current platform"; + next; + } if (chdir("$ext\\$dir")) { my $mmod = -M 'Makefile'; @@ -60,8 +73,11 @@ foreach my $dir (sort @ext) print "\nRunning Makefile.PL in $dir\n"; my @perl = ($perl, "-I$here\\..\\lib", 'Makefile.PL', 'INSTALLDIRS=perl', 'PERL_CORE=1'); + if (defined $::Cross::platform) { + @perl = (@perl[0,1],"-MCross=$::Cross::platform",@perl[2..$#perl]); + } print join(' ', @perl), "\n"; - my $code = system(@perl); + $code = system(@perl); warn "$code from $dir's Makefile.PL" if $code; $mmod = -M 'Makefile'; if ($mmod > $dmod) @@ -72,12 +88,14 @@ foreach my $dir (sort @ext) if ($targ) { print "Making $targ in $dir\n$make $targ\n"; - system("$make $targ"); + $code = system("$make $targ"); + die "Unsuccessful make($dir): code=$code" if $code!=0; } else { print "Making $dir\n$make\n"; - system($make); + $code = system($make); + die "Unsuccessful make($dir): code=$code" if $code!=0; } chdir($here) || die "Cannot cd to $here:$!"; } diff --git a/wince/FindExt.pm b/wince/FindExt.pm deleted file mode 100644 index 3039268..0000000 --- a/wince/FindExt.pm +++ /dev/null @@ -1,66 +0,0 @@ -package FindExt; - -our $VERSION = '1.00'; - -use strict; -use File::Find; -use File::Basename; -use Cwd; - -my $no = join('|',qw(DynaLoader GDBM_File ODBM_File NDBM_File DB_File - Syslog SysV Langinfo)); -$no = qr/^(?:$no)$/i; - -my %ext; -my $ext; -sub scan_ext -{ - my $here = getcwd(); - my $dir = shift; - chdir($dir) || die "Cannot cd to $dir\n"; - ($ext = getcwd()) =~ s,/,\\,g; - find(\&find_ext,'.'); - chdir($here) || die "Cannot cd to $here\n"; - my @ext = extensions(); -} - -sub dynamic_extensions -{ - return grep $ext{$_} eq 'dynamic',keys %ext; -} - -sub noxs_extensions -{ - return grep $ext{$_} eq 'nonxs',keys %ext; -} - -sub extensions -{ - return keys %ext; -} - -sub find_ext -{ - if (/^(.*)\.pm$/i || /^(.*)_pm\.PL$/i || /^(.*)\.xs$/i) - { - my $name = $1; - return if $name =~ $no; - my $dir = $File::Find::dir; - $dir =~ s,./,,; - return if exists $ext{$dir}; - return unless -f "$ext/$dir/Makefile.PL"; - if ($dir =~ /$name$/i) - { - if (-f "$ext/$dir/$name.xs") - { - $ext{$dir} = 'dynamic'; - } - else - { - $ext{$dir} = 'nonxs'; - } - } - } -} - -1; diff --git a/wince/Makefile.ce b/wince/Makefile.ce index 272769a..55f9dfe 100644 --- a/wince/Makefile.ce +++ b/wince/Makefile.ce @@ -526,6 +526,12 @@ PERLEXE = $(MACHINE)\perl.exe CONFIGPM = ..\xlib\$(CROSS_NAME)\Config.pm MINIMOD = ..\lib\ExtUtils\Miniperl.pm +# Nominate a target which causes extensions to be re-built +# This used to be $(PERLEXE), but at worst it is the .dll that they depend +# on and really only the interface - i.e. the .def file used to export symbols +# from the .dll +PERLDEP = perldll.def + MAKE = nmake -nologo CFGSH_TMPL = config.ce @@ -534,7 +540,7 @@ CFGH_TMPL = config_H.ce # # filenames given to xsubpp must have forward slashes (since it puts # full pathnames in #line strings) -XSUBPP = $(HPERL) -I..\..\lib -MCross=$(CROSS_NAME) ...\$(EXTUTILSDIR)\xsubpp \ +XSUBPP = $(HPERL) -I..\..\lib -MCross=$(CROSS_NAME) ..\$(EXTUTILSDIR)\xsubpp \ -C++ -prototypes MICROCORE_SRC = \ @@ -760,20 +766,21 @@ all: hostminiperl $(MINIMOD) $(CONFIGPM) $(PERLEXE) $(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c $(CONFIGPM): .\config.h ..\config.sh ..\minimod.pl - cd .. && $(HPERL) configpm --cross=$(CROSS_NAME) --no-glossary + cd .. && $(HPERL) configpm --cross=$(CROSS_NAME) --no-glossary -mkdir $(XCOREDIR) $(XCOPY) ..\*.h $(XCOREDIR)\*.* $(XCOPY) *.h $(XCOREDIR)\*.* $(XCOPY) ..\ext\re\re.pm $(LIBDIR)\*.* $(RCOPY) include $(XCOREDIR)\*.* - $(HPERL) -I..\lib -MCross=$(CROSS_NAME) config_h.PL "INST_VER=$(INST_VER)" "CORE_DIR=$(XCOREDIR)" + -$(HPERL) -I..\lib -MCross=$(CROSS_NAME) config_h.PL "INST_VER=$(INST_VER)" "CORE_DIR=$(XCOREDIR)" + if errorlevel 1 $(MAKE) /$(MAKEFLAGS) $(CONFIGPM) .\config.h: -del /f config.h copy config_H.ce config.h ..\config.sh: config.ce config_sh.PL - $(HPERL) -I..\lib config_sh.PL $(CFG_VARS) config.ce > ..\config.sh + $(HPERL) -I..\lib -I..\win32 config_sh.PL $(CFG_VARS) config.ce > ..\config.sh $(MINIMOD) : ..\minimod.pl cd .. && $(HPERL) minimod.pl > lib\ExtUtils\Miniperl.pm @@ -796,6 +803,16 @@ $(DYNALOADER).c: $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM) $(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs $(COPY) dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs +#---------------------------------------------------------------------------------- +Extensions: ..\win32\buildext.pl $(PERLDEP) $(CONFIGPM) + $(HPERL) -I..\lib -I..\win32 -MCross=$(CROSS_NAME) ..\win32\buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) \ + !Errno !File/Glob !POSIX !Time/HiRes + +Extensions_clean: + -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) clean + +#---------------------------------------------------------------------------------- + $(DUMPER_DLL): $(PERLEXE) $(DUMPER).xs cd $(EXTDIR)\Data\$(*B) $(HPERL) -I..\..\..\lib -MCross Makefile.PL PERL_CORE=1 INSTALLDIRS=perl diff --git a/wince/config.ce b/wince/config.ce index 07eed64..6582c1c 100644 --- a/wince/config.ce +++ b/wince/config.ce @@ -873,6 +873,7 @@ usevendorprefix='undef' usevfork='false' usrinc='/usr/include' uuname='' +uvXUformat='"lX"' uvoformat='"lo"' uvsize='4' uvtype='unsigned long' @@ -888,6 +889,7 @@ vendorlibexp='' vendorprefix='' vendorprefixexp='' version='~VERSION~' +versiononly='undef' vi='' voidflags='15' xlibpth='/usr/lib/386 /lib/386' diff --git a/wince/config_H.ce b/wince/config_H.ce index f447ba1..04c7eb0 100644 --- a/wince/config_H.ce +++ b/wince/config_H.ce @@ -3178,7 +3178,7 @@ #define UVuf "lu" /**/ #define UVof "lo" /**/ #define UVxf "lx" /**/ -#define UVXf undef /**/ +#define UVXf "lX" /**/ #define NVef "e" /**/ #define NVff "f" /**/ #define NVgf "g" /**/