Change 16436 by jhi@alpha on 2002/05/06 21:05:20
Subject: two and a half steps further for WinCE cross-build
From: "Vadim Konovalov" <[EMAIL PROTECTED]>
Date: Mon, 6 May 2002 23:54:24 +0400
Message-ID: <022001c1f537$d2dd4f10$cb5cc3d9@vad>
Affected files ...
.... //depot/perl/MANIFEST#878 edit
.... //depot/perl/configpm#34 edit
.... //depot/perl/wince/Makefile.ce#14 edit
.... //depot/perl/wince/README.compile#3 edit
.... //depot/perl/wince/config.h#9 delete
Differences ...
==== //depot/perl/MANIFEST#878 (text) ====
Index: perl/MANIFEST
--- perl/MANIFEST#877~16428~ Mon May 6 05:12:59 2002
+++ perl/MANIFEST Mon May 6 14:05:20 2002
@@ -2746,7 +2746,6 @@
wince/compile.bat WinCE port
wince/comp.pl WinCE port
wince/config.ce WinCE port
-wince/config.h WinCE port
wince/config_H.ce WinCE port
wince/config_h.PL WinCE port
wince/config_sh.PL WinCE port
==== //depot/perl/configpm#34 (xtext) ====
Index: perl/configpm
--- perl/configpm#33~16407~ Sat May 4 18:05:17 2002
+++ perl/configpm Mon May 6 14:05:20 2002
@@ -527,12 +527,26 @@
# Now create Cross.pm if needed
if ($opts{cross}) {
open CROSS, ">lib/Cross.pm" or die "Can not open >lib/Cross.pm: $!";
- print CROSS <<"EOS";
-sub BEGIN {
- \@INC = map {/\\blib\\b/?(do{local
\$_=\$_;s/\\blib\\b/xlib\\/$opts{cross}/;\$_},\$_):(\$_)} \@INC;
+ my $cross = <<'EOS';
+# typical invocation:
+# perl -MCross Makefile.PL
+# perl -MCross=wince -V:cc
+package Cross;
+
+sub import {
+ my ($package,$platform) = @_;
+ unless (defined $platform) {
+ # if $platform is not specified, then use last one when
+ # 'configpm; was invoked with --cross option
+ $platform = '***replace-marker***';
+ }
+ @INC = map {/\blib\b/?(do{local $_=$_;s/\blib\b/xlib\/$platform/;$_},$_):($_)} @INC;
}
+
1;
EOS
+ $cross =~ s/\*\*\*replace-marker\*\*\*/$opts{cross}/g;
+ print CROSS $cross;
close CROSS;
}
==== //depot/perl/wince/Makefile.ce#14 (text) ====
Index: perl/wince/Makefile.ce
--- perl/wince/Makefile.ce#13~16407~ Sat May 4 18:05:17 2002
+++ perl/wince/Makefile.ce Mon May 6 14:05:20 2002
@@ -428,6 +428,10 @@
BUILDOPT = $(BUILDOPT) -DUSE_PERLIO
!ENDIF
+!IF "$(CROSS_NAME)" == ""
+CROSS_NAME = wince
+!ENDIF
+
# new option - automatically defined in perl.h...
#BUILDOPT = $(BUILDOPT) -DUSE_ENVIRON_ARRAY
@@ -757,7 +761,7 @@
$(CONFIGPM): config.h ..\config.sh ..\minimod.pl
cd .. && $(HPERL) configpm
- cd .. && $(HPERL) configpm --cross=wince --no-glossary
+ cd .. && $(HPERL) configpm --cross=$(CROSS_NAME) --no-glossary
-mkdir $(COREDIR)
$(XCOPY) ..\*.h $(COREDIR)\*.*
$(XCOPY) *.h $(COREDIR)\*.*
@@ -1026,7 +1030,7 @@
{$(SRCDIR)/wince}.c{$(DLLDIR)}.obj:
$(CC) -c $(CFLAGS) -DPERL_EXTERNAL_GLOB -Fo$(DLLDIR)\ $<
-perldll.def : $(HPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ...\makedef.pl
+perldll.def : $(HPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ..\makedef.pl
$(HPERL) -w ..\makedef.pl PLATFORM=wince $(OPTIMIZE) $(DEFINES) $(BUILDOPT) \
CCTYPE=$(CCTYPE) -DPERL_DLL=$(PERLDLL) > perldll.def
@@ -1107,6 +1111,11 @@
..\miniperl.exe:
cd ../win32
set PATH=$(CCHOME)\bin;$(PATH)
- $(MAKE) -f Makefile "CCHOME=$(MSVCDIR)" "CCINCDIR=$(CCHOME)\include"
"CCLIBDIR=$(CCHOME)\lib" "INCLUDE=$(CCHOME)\include" "LIB=$(CCHOME)\lib" "LINK_FLAGS="
..\config.h ..\miniperl.exe
+ $(MAKE) -f Makefile "CCHOME=$(MSVCDIR)" "CCINCDIR=$(CCHOME)\include"
+"CCLIBDIR=$(CCHOME)\lib" "INCLUDE=$(CCHOME)\include" "LIB=$(CCHOME)\lib"
+"LINK_FLAGS=" .\config.h ..\miniperl.exe
cd ../wince
+host-install:
+ perl -MConfig -MExtUtils::Install -we "install({'../lib/CORE',
+qq#$$Config{installprefixexp}/xlib/$(CROSS_NAME)/CORE#},1)"
+ perl -MConfig -MExtUtils::Install -we "install({'../xlib/$(CROSS_NAME)',
+qq#$$Config{installprefixexp}/xlib/$(CROSS_NAME)#},1)"
+ perl -MConfig -MFile::Copy -we "copy qq#./$(MACHINE)/perl$(PV).lib#,
+qq#$$Config{installprefixexp}/xlib/$(CROSS_NAME)/CORE#"
+ perl -MConfig -MFile::Copy -we "copy qq#../lib/Cross.pm#,
+qq#$$Config{installprefixexp}/lib#"
==== //depot/perl/wince/README.compile#3 (text) ====
Index: perl/wince/README.compile
--- perl/wince/README.compile#2~11665~ Tue Aug 14 05:27:58 2001
+++ perl/wince/README.compile Mon May 6 14:05:20 2002
@@ -11,6 +11,34 @@
The sequence for building a new target is:
-make clean # clean up
-make all # build for target
+make -f Makefile.ce clean # clean up
+make -f Makefile.ce all # build for target
+CROSS_NAME macro is provided to name your current cross compilation.
+It is "wince" by default, but may be any other identifier to
+differentiate and co-exist miscellaneous configurations.
+So your command often will be
+
+make -f Makefile.ce all CROSS_NAME=[my-cross-name]
+
+It is implemented an easy way to build most of module extensions.
+First, you need to do
+
+ nmake host-install CROSS_NAME=[my-cross-name]
+
+This command will install a set of files into your perl directory.
+That will allow you to do cross-compiling for your CE device.
+Those files are C libraries, h-files, Cross.pm, Config.pm. Note
+that it will use first found perl in your path. You should think about
+your PATH variable and change it at your will before copying such files.
+
+After that to do cross-compiling you need to invoke
+
+ perl -MCross Makefile.PL
+
+or
+
+ perl -MCross=[my-cross-name] Makefile.PL
+
+to prepare Makefile, and then nmake, nmake install, as usually you do.
+'test' tartget is still not ready.
End of Patch.