That's NAME, not TITLE.
[p5sagit/p5-mst-13.2.git] / Cross / README.new
CommitLineData
608969de 1You're reading ./Cross/README.new, describing Perl cross-compilation process.
2NOTE: this file will replace ./Cross/README, after cross-compilation scheme
3will stabilize;
4
5=head1 Cross-compilation for linux
6
7This is second approach to linux cross-compiling, which should allow building
8full perl and entensions for target platform. Cross-compiling for linux
9uses similar approach and share same files as cross-compiling for WINCE.
10
11We refer to HOST as the platform where the build is performed, and to
12TARGET as where final executables will run.
13
14=head2 Basic ideas
15
16=head3 common
17
18Unlike WINCE, output files from GCC cross-compiler are produced in the same
19directory where C files are. All TARGET binaries have different extensions
20so to distinguish HOST and TARGET binaries. Namely, object files for C<arm>
21cross-compilation will have extension C<.armo>, executable files will have
22C<.arm>.
23
24After typical cross-compilation the following files will be built, among
25others:
26
27 sv.c
28 sv.o
29 sv.armo
30 libperl.arma
31
32(this approach may be reconsidered, however.)
33
34=head3 build process
35
36C<miniperl> is built. This executable is intended to run on HOST, and it
37will facilitate the remaining build process; all binaries built after it are
38foreign (TARGET) and should not run locally (HOST).
39
40Unlike HOST build, miniperl will not have C<Config.pm> of HOST within reach;
41it rather will use the C<Config.pm> from the cross-compilation directories.
42In fact, if the build process does have Config.pm within reach, this is only
43an indication of a mistake somewhere in the middle.
44
45 # following command is okay:
46 ./miniperl -Ilib -MCross -MConfig -e 1
47 # following command should cluck, and it is bad if it does not:
48 ./miniperl -Ilib -MConfig -e 1
49
50After C<miniperl> is built, C<configpm> is invoked to create right C<Config.pm>
51in right place and its corresponding Cross.pm.
52
53File C<Cross.pm> is dead simple: for given cross-architecture places in @INC
54a path where perl modules are, and right C<Config.pm> in that place.
55
56That said, C<miniperl -Ilib -MConfig -we 1> should report an error, because
57it can not find C<Config.pm>. If it does not give an error -- wrong C<Config.pm>
58is substituted, and resulting binaries will be a mess.
59
60C<miniperl -MCross -MConfig -we 1> should run okay, and it will provide right
61C<Config.pm> for further compilations.
62
63During extensions build phase, the script C<./ext/util/make_ext_cross> is
64invoked.
65
66All invokes of C<Makefile.PL> are provided with C<-MCross> so to enable cross-
67compile.
68
69=head2 BUILD
70
71=head3 Tools & SDK
72
73For compiling, you need following:
74
75=over 4
76
77=item * TODO
78
79=back
80
81=head1 Things to be done
82
83=over 4
84
85=item * better distinguishing of config.h/xconfig.h, dependancies
86
87=item * object files created in ./xlib/cross-name/ ?
88
89=back