This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
$! might contain "unknown" if strerror(3) says so
[perl5.git] / symbian / config.pl
CommitLineData
27da23d5
JH
1#!/usr/bin/perl -w
2
3# Copyright (c) 2004-2005 Nokia. All rights reserved.
4
5use strict;
6use lib "symbian";
7
8print "Configuring...\n";
9print "Configuring with: Perl version $] ($^X)\n";
10
11do "sanity.pl";
12
13my %VERSION = %{ do "version.pl" };
14
15printf "Configuring for: Perl version $VERSION{REVISION}.%03d%03d\n",
16 $VERSION{VERSION}, $VERSION{SUBVERSION};
17
18my $VERSION = "$VERSION{REVISION}$VERSION{VERSION}$VERSION{SUBVERSION}";
19my $R_V_SV = "$VERSION{REVISION}.$VERSION{VERSION}.$VERSION{SUBVERSION}";
20
21my $SDK = do "sdk.pl";
22my %PORT = %{ do "port.pl" };
23
24my ( $SYMBIAN_VERSION, $SDK_VERSION ) = ( $SDK =~ m!\\Symbian\\(.+?)\\(.+)$! );
25
26if ($SDK eq 'C:\Symbian\Series60_1_2_CW') {
27 ( $SYMBIAN_VERSION, $SDK_VERSION ) = qw(6.1 1.2);
28}
29
30my $WIN = $ENV{WIN} ; # 'wins', 'winscw' (from sdk.pl)
31my $ARM = 'thumb'; # 'thumb', 'armi'
32my $S60SDK = $ENV{S60SDK}; # qw(1.2 2.0 2.1 2.6) (from sdk.pl)
33
34my $UREL = $ENV{UREL}; # from sdk.pl
35$UREL =~ s/-ARM-/$ARM/;
36my $UARM = $ENV{UARM}; # from sdk.pl
37
38die "$0: SDK not recognized\n"
39 if !defined($SYMBIAN_VERSION) || !defined($SDK_VERSION) || !defined($S60SDK);
40
41die "$0: does not know which Windows compiler to use\n"
42 unless defined $WIN;
43
44print "Symbian $SYMBIAN_VERSION SDK $S60SDK ($WIN) installed at $SDK\n";
45
46my $CWD = do "cwd.pl";
47print "Build directory $CWD\n";
48
49die "$0: '+' in cwd does not work with SDK 1.2\n"
50 if $S60SDK eq '1.2' && $CWD =~ /\+/;
51
52my @unclean;
53my @mmp;
54
55sub create_mmp {
56 my ( $target, $type, @x ) = @_;
57 my $miniperl = $target eq 'miniperl';
58 my $perl = $target eq 'perl';
59 my $mmp = "$target.mmp";
60 my $targetpath = $miniperl
61 || $perl ? "TARGETPATH\t\\System\\Apps\\Perl" : "";
62 if ( open( my $fh, ">$mmp" ) ) {
63 print "\t$mmp\n";
64 push @mmp, $mmp;
65 push @unclean, $mmp;
66 print $fh <<__EOF__;
67TARGET $target.$type
68TARGETTYPE $type
69$targetpath
70EPOCHEAPSIZE 1024 8388608
71EPOCSTACKSIZE 65536
72EXPORTUNFROZEN
73SRCDBG
74__EOF__
75 print $fh "MACRO\t__SERIES60_1X__\n" if $S60SDK =~ /^1\./;
76 print $fh "MACRO\t__SERIES60_2X__\n" if $S60SDK =~ /^2\./;
77 my ( @c, %c );
78 @c = map { glob } qw(*.c); # Find the .c files.
79 @c = map { lc } @c; # Lowercase the names.
80 @c = grep { !/malloc\.c/ } @c; # Use the system malloc.
81 @c = grep { !/main\.c/ } @c; # main.c must be explicit.
82 push @c, map { lc } @x;
83 @c = map { s:^\.\./::; $_ } @c; # Remove the leading ../
84 @c = map { $c{$_}++ } @c; # Uniquefy.
85 @c = sort keys %c; # Beautify.
86
87 for (@c) {
88 print $fh "SOURCE\t\t$_\n";
89 }
90 print $fh <<__EOF__;
91SOURCEPATH $CWD
92USERINCLUDE $CWD
93USERINCLUDE $CWD\\ext\\DynaLoader
94USERINCLUDE $CWD\\symbian
95SYSTEMINCLUDE \\epoc32\\include\\libc
96SYSTEMINCLUDE \\epoc32\\include
97LIBRARY euser.lib
98LIBRARY estlib.lib
99__EOF__
100 if ( $miniperl || $perl || $type eq 'dll' ) {
101 print $fh <<__EOF__;
102LIBRARY charconv.lib
103LIBRARY commonengine.lib
104LIBRARY hal.lib
105LIBRARY estor.lib
106__EOF__
107 }
108 if ( $type eq 'exe' ) {
109 print $fh <<__EOF__;
110STATICLIBRARY ecrt0.lib
111__EOF__
112 }
113 if ($miniperl) {
114 print $fh <<__EOF__;
115MACRO PERL_MINIPERL
116__EOF__
117 }
118 if ($perl) {
119 print $fh <<__EOF__;
120MACRO PERL_PERL
121__EOF__
122 }
123 print $fh <<__EOF__;
124MACRO PERL_CORE
125MACRO MULTIPLICITY
126MACRO PERL_IMPLICIT_CONTEXT
127__EOF__
128 unless ( $miniperl || $perl ) {
129 print $fh <<__EOF__;
130MACRO PERL_GLOBAL_STRUCT
131MACRO PERL_GLOBAL_STRUCT_PRIVATE
132__EOF__
133 }
134 close $fh;
135 }
136 else {
137 warn "$0: failed to open $mmp for writing: $!\n";
138 }
139}
140
141sub create_bld_inf {
142 if ( open( BLD_INF, ">bld.inf" ) ) {
143 print "\tbld.inf\n";
144 push @unclean, "bld.inf";
145 print BLD_INF <<__EOF__;
146PRJ_PLATFORMS
147${WIN} ${ARM}
148PRJ_MMPFILES
149__EOF__
150 for (@mmp) { print BLD_INF $_, "\n" }
151 close BLD_INF;
152 }
153 else {
154 warn "$0: failed to open bld.inf for writing: $!\n";
155 }
156}
157
158my %config;
159
160sub load_config_sh {
161 if ( open( CONFIG_SH, "symbian/config.sh" ) ) {
162 while (<CONFIG_SH>) {
163 if (/^(\w+)=['"]?(.*?)["']?$/) {
164 my ( $var, $val ) = ( $1, $2 );
165 $val =~ s/x.y.z/$R_V_SV/gi;
166 $val =~ s/thumb/$ARM/gi;
167 $val = "'$SYMBIAN_VERSION'" if $var eq 'osvers';
168 $val = "'$SDK_VERSION'" if $var eq 'sdkvers';
169 $config{$var} = $val;
170 }
171 }
172 close CONFIG_SH;
173 }
174 else {
175 warn "$0: failed to open symbian\\config.sh for reading: $!\n";
176 }
177}
178
179sub create_config_h {
180 load_config_sh();
181 if ( open( CONFIG_H, ">config.h" ) ) {
182 print "\tconfig.h\n";
183 push @unclean, "config.h";
184 if ( open( CONFIG_H_SH, "config_h.SH" ) ) {
185 while (<CONFIG_H_SH>) {
186 last if /\#ifndef _config_h_/;
187 }
188 print CONFIG_H <<__EOF__;
189/*
190 * Package name : perl
191 * Source directory : .
192 * Configuration time:
193 * Configured by :
194 * Target system : symbian
195 */
196
197#ifndef _config_h_
198__EOF__
199 while (<CONFIG_H_SH>) {
200 last if /!GROK!THIS/;
201 s/\$(\w+)/exists $config{$1} ? $config{$1} : ""/eg;
202 s/^#undef\s+(\S+).+/#undef $1/g;
203 s:\Q/**/::;
204 print CONFIG_H;
205 }
206 close CONFIG_H_SH;
207 }
208 else {
209 warn "$0: failed to open ../config_h.SH for reading: $!\n";
210 }
211 close CONFIG_H;
212 }
213 else {
214 warn "$0: failed to open config.h for writing: $!\n";
215 }
216}
217
218sub create_DynaLoader_cpp {
219 print "\text\\DynaLoader\\DynaLoader.cpp\n";
220 system(
221q[perl -Ilib lib\ExtUtils\xsubpp ext\DynaLoader\dl_symbian.xs >ext\DynaLoader\DynaLoader.cpp]
222 ) == 0
223 or die "$0: creating DynaLoader.cpp failed: $!\n";
224 push @unclean, 'ext\DynaLoader\DynaLoader.cpp';
225
226}
227
228sub create_symbian_port_h {
229 print "\tsymbian\\symbian_port.h\n";
230 if ( open( SYMBIAN_PORT_H, ">symbian/symbian_port.h" ) ) {
231 $S60SDK =~ /^(\d+)\.(\d+)$/;
232 my ($sdkmajor, $sdkminor) = ($1, $2);
233 print SYMBIAN_PORT_H <<__EOF__;
234/* Copyright (c) 2004-2005, Nokia. All rights reserved. */
235
236#ifndef __symbian_port_h__
237#define __symbian_port_h__
238
239#define PERL_SYMBIANPORT_MAJOR $PORT{dll}->{MAJOR}
240#define PERL_SYMBIANPORT_MINOR $PORT{dll}->{MINOR}
241#define PERL_SYMBIANPORT_PATCH $PORT{dll}->{PATCH}
242
243#define PERL_SYMBIANSDK_FLAVOR L"Series 60"
244#define PERL_SYMBIANSDK_MAJOR $sdkmajor
245#define PERL_SYMBIANSDK_MINOR $sdkminor
246
247#endif /* #ifndef __symbian_port_h__ */
248__EOF__
249 close(SYMBIAN_PORT_H);
250 push @unclean, 'symbian\symbian_port.h';
251 }
252 else {
253 warn "$0: failed to open symbian/symbian_port.h for writing: $!\n";
254 }
255}
256
257sub create_perlmain_c {
258 print "\tperlmain.c\n";
259 system(
260q[perl -ne "print qq[ char *file = __FILE__;\n] if /dXSUB_SYS/;print;print qq[ newXS(\"DynaLoader::boot_DynaLoader\", boot_DynaLoader, file);\n] if /dXSUB_SYS/;print qq[EXTERN_C void boot_DynaLoader (pTHX_ CV* cv);\n] if /Do not delete this line/" miniperlmain.c > perlmain.c]
261 ) == 0
262 or die "$0: Creating perlmain.c failed: $!\n";
263 push @unclean, 'perlmain.c';
264}
265
266sub create_PerlApp_pkg {
267 print "\tsymbian\\PerlApp.pkg\n";
268 if ( open( PERLAPP_PKG, ">symbian\\PerlApp.pkg" ) ) {
269 my $APPS = $UREL;
270 if ($S60SDK ne '1.2' || $SDK =~ m/_CW$/) { # Do only if not in 1.2 VC.
271 $APPS =~ s!\\epoc32\\release\\(.+)\\$UARM$!\\epoc32\\data\\z\\system\\apps\\PerlApp!i;
272 }
273 print PERLAPP_PKG <<__EOF__;
274; !!!!!! DO NOT EDIT THIS FILE !!!!!!
275; This file is built by symbian\\config.pl.
276; Any changes made here will be lost!
277;
278; PerlApp.pkg
279;
280; Note that the demo_pl needs to be run to create the demo .pl scripts.
281;
282; Languages
283&EN;
284
285; Standard SIS file header
286#{"PerlApp"},(0x102015F6),0,1,0
287
288; Supports Series 60 v0.9
289(0x101F6F88), 0, 0, 0, {"Series60ProductID"}
290
291; Files
292"$UREL\\PerlApp.APP"-"!:\\system\\apps\\PerlApp\\PerlApp.app"
293"$UREL\\PerlRecog.mdl"-"!:\\system\\recogs\\PerlRecog.mdl"
294"$APPS\\PerlApp.rsc"-"!:\\system\\apps\\PerlApp\\PerlApp.rsc"
295"$APPS\\PerlApp.aif"-"!:\\system\\apps\\PerlApp\\PerlApp.aif"
296__EOF__
297 if ( open( DEMOS, "perl symbian\\demo_pl list |" ) ) {
298 while (<DEMOS>) {
299 chomp;
300 print PERLAPP_PKG qq["$_"-"!:\\Perl\\$_"\n];
301 }
302 close(DEMOS);
303 }
304 close(PERLAPP_PKG);
305 }
306 else {
307 die "$0: symbian\\PerlApp.pkg: $!\n";
308 }
309 push @unclean, 'symbian\PerlApp.pkg';
310}
311
312print "Creating...\n";
313create_mmp(
314 'miniperl', 'exe',
315 'miniperlmain.c', 'symbian\symbian_stubs.c',
316 'symbian\PerlBase.cpp', 'symbian\symbian_utils.cpp',
317);
318create_mmp(
319 "perl", 'exe',
320 'perlmain.c', 'symbian\symbian_stubs.c',
321 'symbian\symbian_utils.cpp', 'symbian\PerlBase.cpp',
322 'ext\DynaLoader\DynaLoader.cpp',
323);
324
325create_mmp(
326 "perl$VERSION", 'dll',
327 'symbian\symbian_dll.cpp', 'symbian\symbian_stubs.c',
328 'symbian\symbian_utils.cpp', 'symbian\PerlBase.cpp',
329 'ext\DynaLoader\DynaLoader.cpp',
330);
331
332create_bld_inf();
333create_config_h();
334create_perlmain_c();
335create_symbian_port_h();
336create_DynaLoader_cpp();
337create_PerlApp_pkg();
338
339if ( open( PERLAPP_MMP, ">symbian/PerlApp.mmp" ) ) {
340 my @MACRO;
341 push @MACRO, '__SERIES60_1X__' if $S60SDK =~ /^1\./;
342 push @MACRO, '__SERIES60_2X__' if $S60SDK =~ /^2\./;
343 print PERLAPP_MMP <<__EOF__;
344// !!!!!! DO NOT EDIT THIS FILE !!!!!!
345// This file is built by symbian\\config.pl.
346// Any changes made here will be lost!
347TARGET PerlApp.app
348TARGETTYPE app
349UID 0x100039CE 0x102015F6
350TARGETPATH \\system\\apps\\PerlApp
351SRCDBG
352EXPORTUNFROZEN
353SOURCEPATH .
354SOURCE PerlApp.cpp
355
356RESOURCE PerlApp.rss
357
358USERINCLUDE .
359USERINCLUDE ..
360USERINCLUDE \\symbian\\perl\\$R_V_SV\\include
361
362SYSTEMINCLUDE \\epoc32\\include
363SYSTEMINCLUDE \\epoc32\\include\\libc
364
365LIBRARY apparc.lib
366LIBRARY avkon.lib
367LIBRARY bafl.lib
368LIBRARY charconv.lib
369LIBRARY commondialogs.lib
370LIBRARY cone.lib
371LIBRARY efsrv.lib
372LIBRARY eikcore.lib
373LIBRARY estlib.lib
374LIBRARY euser.lib
375LIBRARY perl$VERSION.lib
376
377AIF PerlApp.aif . PerlAppAif.rss
378__EOF__
379 if (@MACRO) {
380 for my $macro (@MACRO) {
381 print PERLAPP_MMP <<__EOF__;
382MACRO $macro
383__EOF__
384 }
385 }
386 close(PERLAPP_MMP);
387 push @unclean, 'symbian\PerlApp.mmp';
388}
389else {
390 warn "$0: failed to create symbian\\PerlApp.mmp";
391}
392
393if ( open( MAKEFILE, ">Makefile" ) ) {
394 my $perl = "perl$VERSION";
395 my $windef1 = "$SDK\\Epoc32\\Build$CWD\\$perl\\$WIN\\$perl.def";
396 my $windef2 = "..\\BWINS\\${perl}u.def";
397 my $armdef1 = "$SDK\\Epoc32\\Build$CWD\\$perl\\$ARM\\$perl.def";
398 my $armdef2 = "..\\BMARM\\${perl}u.def";
399 print "\tMakefile\n";
400 print MAKEFILE <<__EOF__;
401help:
402 \@echo === Perl for Symbian ===
403 \@echo Useful targets:
404 \@echo all win arm clean
405 \@echo perldll.sis perlext.sis perlsdk.zip
406
407WIN = ${WIN}
408ARM = ${ARM}
409
410all: build
411
412build: rename_makedef build_win build_arm
413
414@unclean: symbian\\config.pl
415 perl symbian\\config.pl
416
417build_win: abld.bat win_perl.mf win_miniperl.mf win_${VERSION}.mf perldll_win
418
419build_vc6: abld.bat win_perl.mf win_miniperl.mf win_${VERSION}.mf vc6.mf perldll_win
420
421build_arm: abld.bat perl_arm miniperl_arm arm_${VERSION}.mf perldll_arm
422
423miniperl_win: miniperl.mmp abld.bat win_miniperl.mf rename_makedef
424 abld build \$(WIN) udeb miniperl
425
426miniperl_arm: miniperl.mmp abld.bat arm_miniperl.mf rename_makedef
427 abld build \$(ARM) $UARM miniperl
428
429miniperl: miniperl_win miniperl_arm
430
431perl: perl_win perl_arm
432
433perl_win: perl.mmp abld.bat win_perl.mf rename_makedef
434 abld build \$(WIN) perl
435
436perl_arm: perl.mmp abld.bat arm_perl.mf rename_makedef
437 abld build \$(ARM) $UARM perl
438
439perldll_win: perl${VERSION}_win freeze_win perl${VERSION}_win
440
441perl${VERSION}_win: perl$VERSION.mmp abld.bat rename_makedef
442 abld build \$(WIN) perl$VERSION
443
444perldll_arm: perl${VERSION}_arm freeze_arm perl${VERSION}_arm
445
446perl${VERSION}_arm: perl$VERSION.mmp arm_${VERSION}.mf abld.bat rename_makedef
447 abld build \$(ARM) $UARM perl$VERSION
448
449perldll perl$VERSION: perldll_win perldll_arm
450
451win: miniperl_win perl_win perldll_win
452
453arm: miniperl_arm perl_arm perldll_arm
454
455rename_makedef:
456 -ren makedef.pl nomakedef.pl
457
458# Symbian SDK has a makedef.pl of its own,
459# and we don't need Perl's.
460rerename_makedef:
461 -ren nomakedef.pl makedef.pl
462
463abld.bat abld: bld.inf
464 bldmake bldfiles
465
466makefiles: win.mf arm.mf vc6.mf
467
468vc6: win.mf vc6.mf build_vc6
469
470win_miniperl.mf: abld.bat symbian\\config.pl
471 abld makefile \$(WIN) miniperl
472 echo > win_miniperl.mf
473
474win_perl.mf: abld.bat symbian\\config.pl
475 abld makefile \$(WIN) perl
476 echo > win_perl.mf
477
478win_${VERSION}.mf: abld.bat symbian\\config.pl
479 abld makefile \$(WIN) perl${VERSION}
480 echo > win_${VERSION}.mf
481
482symbian\\win.mf:
483 cd symbian; make win.mf
484
485win.mf: win_miniperl.mf win_perl.mf win_${VERSION}.mf symbian\\win.mf
486
487arm_miniperl.mf: abld.bat symbian\\config.pl
488 abld makefile \$(ARM) miniperl
489 echo > arm_miniperl.mf
490
491arm_perl.mf: abld.bat symbian\\config.pl
492 abld makefile \$(ARM) perl
493 echo > arm_perl.mf
494
495arm_${VERSION}.mf: abld.bat symbian\\config.pl
496 abld makefile \$(ARM) perl${VERSION}
497 echo > arm_${VERSION}.mf
498
499arm.mf: arm_miniperl.mf arm_perl.mf arm_${VERSION}.mf
500
501vc6.mf: abld.bat symbian\\config.pl
502 abld makefile vc6
503 echo > vc6.mf
504
505PM = lib\\Config.pm lib\\Cross.pm lib\\lib.pm ext\\DynaLoader\\DynaLoader.pm ext\\DynaLoader\\XSLoader.pm ext\\Errno\\Errno.pm
506POD = lib\\Config.pod
507
508pm: \$(PM)
509
510XLIB = -Ixlib\\symbian
511
512XSBOPT = --win=\$(WIN) --arm=\$(ARM)
513
514lib\\Config.pm:
515 copy symbian\\config.sh config.sh
516 perl -pi.bak -e "s:x\\.y\\.z+:$R_V_SV:g" config.sh
517 perl \$(XLIB) configpm --cross=symbian
518 copy xlib\\symbian\\Config.pm lib\\Config.pm
519 perl -pi.bak -e "s:x\\.y\\.z:$R_V_SV:g" lib\\Config.pm
520 perl -pi.bak -e "s:5\\.\\d+\\.\\d+:$R_V_SV:g" lib\\Config.pm
521 -perl -pi.bak -e "s:x\\.y\\.z:$R_V_SV:g" xlib\\symbian\\Config_heavy.pl
522
523lib\\lib.pm:
524 perl lib\\lib_pm.PL
525
526ext\\DynaLoader\\DynaLoader.pm:
527 -del /f ext\\DynaLoader\\DynaLoader.pm
528 perl -Ixlib\\symbian ext\\DynaLoader\\DynaLoader_pm.PL
529 perl -pi.bak -e "s/__END__//" DynaLoader.pm
530 copy /y DynaLoader.pm ext\\DynaLoader\\DynaLoader.pm
531 -del /f DynaLoader.pm DynaLoader.pm.bak
532
533ext\\DynaLoader\\XSLoader.pm:
534 perl \$(XLIB) symbian\\xsbuild.pl \$(XSBOPT) XSLoader
535
536ext\\Errno\\Errno.pm:
537 perl \$(XLIB) symbian\\xsbuild.pl \$(XSBOPT) Errno
538
539miniperlexe.sis: miniperl_arm symbian\\makesis.pl
540 perl \$(XLIB) symbian\\makesis.pl miniperl
541
542perlexe.sis: perl_arm symbian\\makesis.pl
543 perl \$(XLIB) symbian\\makesis.pl perl
544
545
546allsis: all miniperlexe.sis perlexe.sis perldll.sis perllib.sis perlext.sis perlapp.sis
547
548perldll.sis perl$VERSION.sis: perldll_arm pm symbian\\makesis.pl
549 perl \$(XLIB) symbian\\makesis.pl perl${VERSION}dll
550
551perllib.sis: \$(PM)
552 perl \$(XLIB) symbian\\makesis.pl perl${VERSION}lib
553
554perlext.sis: perldll_arm buildext_sis
555 perl symbian\\makesis.pl perl${VERSION}ext
556
557EXT = Cwd Data::Dumper Devel::Peek Digest::MD5 Errno Fcntl File::Glob Filter::Util::Call IO List::Util MIME::Base64 PerlIO::scalar PerlIO::via SDBM_File Socket Storable Time::HiRes XSLoader attrs
558
559buildext: perldll symbian\\xsbuild.pl
560 perl \$(XLIB) symbian\\xsbuild.pl \$(XSBOPT) \$(EXT)
561
562buildext_sis: perldll.sis symbian\\xsbuild.pl
563 perl \$(XLIB) symbian\\xsbuild.pl \$(XSBOPT) --sis \$(EXT)
564
565cleanext: symbian\\xsbuild.pl
566 perl \$(XLIB) symbian\\xsbuild.pl \$(XSBOPT) --clean \$(EXT)
567
568distcleanext: symbian\\xsbuild.pl
569 perl \$(XLIB) symbian\\xsbuild.pl \$(XSBOPT) --distclean \$(EXT)
570
571sis makesis: miniperl perl perldll pm buildext perlapp.sis
572 perl \$(XLIB) symbian\\makesis.pl
573
574APIDIR = \\Symbian\\perl\\$R_V_SV
575
576sdkinstall:
577 -mkdir \\Symbian\\perl
578 -mkdir \\Symbian\\perl\\$R_V_SV
579 -mkdir \$(APIDIR)\\include
580 -mkdir \$(APIDIR)\\include\\symbian
581 -mkdir \$(APIDIR)\\lib
582 -mkdir \$(APIDIR)\\lib\\ExtUtils
583 -mkdir \$(APIDIR)\\pod
584 -mkdir \$(APIDIR)\\bin
585 -mkdir \$(BINDIR)
586 copy /y *.h \$(APIDIR)\\include
587 - copy /y *.inc \$(APIDIR)\\include
588 copy /y lib\\ExtUtils\\xsubpp \$(APIDIR)\\lib\\ExtUtils
589 copy /y lib\\ExtUtils\\typemap \$(APIDIR)\\lib\\ExtUtils
590 copy /y symbian\\xsbuild.pl \$(APIDIR)\\bin
591 copy /y symbian\\PerlBase.h \$(APIDIR)\\include
592 copy /y symbian\\symbian*.h \$(APIDIR)\\include\\symbian
593 copy /y symbian\\PerlBase.pod \$(APIDIR)\\pod
594
595RELDIR = $SDK\\epoc32\\release
596RELWIN = \$(RELDIR)\\\$(WIN)\\udeb
597RELARM = \$(RELDIR)\\\$(ARM)\\$UARM
598
599perlsdk.zip: perldll sdkinstall
600 zip -r perl${VERSION}sdk.zip \$(RELWIN)\\perl$VERSION.* \$(RELARM)\\perl$VERSION.* \$(APIDIR)
601 \@echo perl${VERSION}sdk.zip created.
602
603perlapp: sdkinstall perlapp_win perlapp_arm
604
605perlapp_win: config.h
606 cd symbian; make perlapp_win
607
608perlapp_arm: config.h
609 cd symbian; make perlapp_arm
610
611perlapp_demo_extract:
612 cd symbian; make perlapp_demo_extract
613
614perlapp.sis: perlapp_arm
615 cd symbian; make perlapp.sis
616
617perlapp.zip:
618 cd symbian; zip perlapp.zip PerlApp.* PerlRecog.* PerlBase.* demo_pl
619
620zip: perlsdk.zip perlapp.zip
621
622freeze: freeze_win freeze_arm
623
624freeze_win:
625 abld freeze \$(WIN) perl$VERSION
626
627freeze_arm:
628 abld freeze \$(ARM) perl$VERSION
629
630defrost: defrost_win defrost_arm
631
632defrost_win:
633 -del /f $windef1
634 -del /f $windef2
635
636defrost_arm:
637 -del /f $armdef1
638 -del /f $armdef2
639
640clean_win: abld.bat
641 abld clean \$(WIN)
642
643clean_arm: abld.bat
644 abld clean \$(ARM)
645
646clean: clean_win clean_arm rerename_makedef
647 -del /f \$(PM)
648 -del /f \$(POD)
649 -del /f lib\\Config.pm.bak
650 -del /f xlib\\symbian\\Config_heavy.pl
651 -rmdir /s /q xlib
652 -del /f config.sh
653 -del /f DynaLoader.pm ext\\DynaLoader\\DynaLoader.pm
654 -del /f ext\\DynaLoader\\Makefile
655 -del /f ext\\SDBM_File\\sdbm\\Makefile
656 -del /f symbian\\*.lst
657 -del /f abld.bat @unclean *.pkg *.sis *.zip
658 -del /f symbian\\abld.bat symbian\\*.sis symbian\\*.zip
659 -del /f symbian\\perl5*.pkg symbian\\miniperl.pkg
660 -del arm_*.mf win_*.mf vc6*.mf
661 -perl symbian\\xsbuild.pl \$(XSBOPT) --clean \$(EXT)
662 -rmdir /s /q perl${VERSION}_Data
663 -cd symbian; make clean
664
665reallyclean: abld.bat
666 abld reallyclean
667
668distclean: defrost reallyclean clean
669 -perl symbian\\xsbuild.pl \$(XSBOPT) --distclean \$(EXT)
670 -del /f config.h config.sh.bak symbian\\symbian_port.h
671 -del /f Makefile symbian\\PerlApp.mmp
672 -del /f BMARM\\*.def
673 -del /f *.cwlink *.resources *.pref
674 -del /f perl${VERSION}.xml perl${VERSION}.mcp uid.cpp
675 -rmdir /s /q BMARM
676 cd symbian; make distclean
677 -del /f symbian\\Makefile
678__EOF__
679 close MAKEFILE;
680}
681else {
682 warn "$0: failed to create Makefile: $!\n";
683}
684
685if ( open( MAKEFILE, ">symbian/Makefile")) {
686 my $wrap = $S60SDK eq '1.2' && $SDK !~ /_CW$/;
687 my $ABLD = $wrap ? 'perl b.pl': 'abld';
688 print "\tsymbian/Makefile\n";
689 print MAKEFILE <<__EOF__;
690WIN = $WIN
691ARM = $ARM
692ABLD = $ABLD
693
694abld.bat:
695 bldmake bldfiles
696
697perlapp_win: abld.bat ..\\config.h PerlApp.h PerlApp.cpp
698 bldmake bldfiles
699 \$(ABLD) build \$(WIN) udeb
700
701perlapp_arm: ..\\config.h PerlApp.h PerlApp.cpp
702 bldmake bldfiles
703 \$(ABLD) build \$(ARM) $UARM
704
705win.mf:
706 bldmake bldfiles
707 abld makefile vc6
708
709perlapp_demo_extract:
710 perl demo_pl extract
711
712perlapp.sis: perlapp_arm perlapp_demo_extract
713 -del /f perlapp.SIS
714 makesis perlapp.pkg
715 copy /y perlapp.SIS ..\\perlapp.SIS
716
717clean:
718 -perl demo_pl cleanup
719 -del /f perlapp.sis
720 -del /f b.pl
721
722distclean: clean
723 -del /f *.cwlink *.resources *.pref
724 -del /f PerlApp.xml PerlApp.mcp uid.cpp
725 -rmdir /s /q PerlApp_Data
726 -del /f abld.bat
727__EOF__
728 close(MAKEFILE);
729 if ($wrap) {
730 if ( open( B_PL, ">symbian/b.pl")) {
731 print B_PL <<'__EOF__';
732# abld.pl wrapper.
733
734# nmake doesn't like MFLAGS and MAKEFLAGS being set to -w and w.
735delete $ENV{MFLAGS};
736delete $ENV{MAKEFLAGS};
737
738system("abld @ARGV");
739__EOF__
740 close(B_PL);
741 } else {
742 warn "$0: failed to create symbian/b.pl: $!\n";
743 }
744 }
745} else {
746 warn "$0: failed to create symbian/Makefile: $!\n";
747}
748
749print "Deleting...\n";
750for my $config (
751 # Do not delete config.h here.
752 "config.sh",
753 "lib\\Config.pm",
754 "xlib\\symbian\\Config.pm",
755 "xlib\\symbian\\Config_heavy.pl",
756 ) {
757 print "\t$config\n";
758 unlink($config);
759}
760
761print <<__EOM__;
762Configuring done.
763Now you can run:
764 make all
765 make allsis
766__EOM__
767
7681; # Happy End.