print "Configuring...\n";
print "Configuring with: Perl version $] ($^X)\n";
-do "sanity.pl";
+do "sanity.pl" or die $@;
-my %VERSION = %{ do "version.pl" };
+my %VERSION = %{ do "version.pl" or die $@ };
printf "Configuring for: Perl version $VERSION{REVISION}.%03d%03d\n",
$VERSION{VERSION}, $VERSION{SUBVERSION};
my $R_V_SV = "$VERSION{REVISION}.$VERSION{VERSION}.$VERSION{SUBVERSION}";
my ($SYMBIAN_ROOT, $SYMBIAN_VERSION, $SDK_NAME, $SDK_VARIANT, $SDK_VERSION) =
- @{ do "sdk.pl" };
-my %PORT = %{ do "port.pl" };
+ @{ do "sdk.pl" or die $@ };
+my %PORT = %{ do "port.pl" or die $@ };
if ($SYMBIAN_ROOT eq 'C:\Symbian\Series60_1_2_CW') {
( $SYMBIAN_VERSION, $SDK_VERSION ) = qw(6.1 1.2);
my $ARM = 'thumb'; # 'thumb', 'armv5'
my $S60SDK = $ENV{S60SDK}; # qw(1.2 2.0 2.1 2.6) (from sdk.pl)
my $S80SDK = $ENV{S80SDK}; # qw(2.0) (from sdk.pl)
+my $S90SDK = $ENV{S90SDK}; # qw(1.1) (from sdk.pl)
my $UIQSDK = $ENV{UIQSDK}; # qw(2.0 2.1) (from sdk.pl)
my $UREL = $ENV{UREL}; # from sdk.pl
die "$0: SDK not recognized\n"
if !defined($SYMBIAN_VERSION) ||
!defined($SDK_VERSION) ||
- (!defined($S60SDK) && !defined($S80SDK) && !defined($UIQSDK));
+ (!defined($S60SDK) && !defined($S80SDK) && !defined($S90SDK) && !defined($UIQSDK));
die "$0: does not know which Windows compiler to use\n"
unless defined $WIN;
print "Symbian $SYMBIAN_VERSION SDK $SDK_VARIANT $SDK_VERSION ($WIN) installed at $SYMBIAN_ROOT\n";
-my $CWD = do "cwd.pl";
+my $CWD = do "cwd.pl" or die $@;
print "Build directory $CWD\n";
die "$0: '+' in cwd does not work with Series 60 SDK 1.2\n"
print $fh "MACRO\t__SERIES80_1X__\n" if $S80SDK =~ /^1\./;
print $fh "MACRO\t__SERIES80_2X__\n" if $S80SDK =~ /^2\./;
}
+ if ($SDK_VARIANT eq 'S90') {
+ print $fh "MACRO\t__SERIES90__\n";
+ }
if ($SDK_VARIANT eq 'UIQ') {
print $fh "MACRO\t__UIQ__\n";
print $fh "MACRO\t__UIQ_1X__\n" if $UIQSDK =~ /^1\./;
@c = map { glob } qw(*.c); # Find the .c files.
@c = map { lc } @c; # Lowercase the names.
@c = grep { !/malloc\.c/ } @c; # Use the system malloc.
+ @c = grep { !/madly\.c/ } @c; # mad is undef.
@c = grep { !/main\.c/ } @c; # main.c must be explicit.
push @c, map { lc } @x;
@c = map { s:^\.\./::; $_ } @c; # Remove the leading ../
SYSTEMINCLUDE \\epoc32\\include
LIBRARY euser.lib
LIBRARY estlib.lib
+LIBRARY eikcore.lib
+LIBRARY cone.lib
+LIBRARY efsrv.lib
__EOF__
if ( $miniperl || $perl || $type eq 'dll' ) {
print $fh <<__EOF__;
LIBRARY estor.lib
__EOF__
}
- if ($SDK_VARIANT =~ /^S[68]0$/) {
+ if ($SDK_VARIANT =~ /^S[689]0$/) {
print $fh <<__EOF__;
LIBRARY commonengine.lib
__EOF__
}
+ if (defined $S60SDK) {
+ print $fh <<__EOF__;
+LIBRARY avkon.lib
+LIBRARY commondialogs.lib
+__EOF__
+ }
+ if ((defined $S80SDK) or (defined $S90SDK)) {
+ print $fh <<__EOF__;
+LIBRARY eikctl.lib
+LIBRARY eikcoctl.lib
+LIBRARY eikdlg.lib
+LIBRARY ckndlg.lib
+__EOF__
+ }
+ if (defined $UIQSDK) {
+ print $fh <<__EOF__;
+LIBRARY eikctl.lib
+LIBRARY eikcoctl.lib
+LIBRARY eikdlg.lib
+LIBRARY qikctl.lib
+__EOF__
+ }
if ( $type eq 'exe' ) {
print $fh <<__EOF__;
STATICLIBRARY ecrt0.lib
print $fh <<__EOF__;
MACRO PERL_GLOBAL_STRUCT
MACRO PERL_GLOBAL_STRUCT_PRIVATE
+RESOURCE symbian\\PerlUi.rss
__EOF__
}
close $fh;
my ( $var, $val ) = ( $1, $2 );
$val =~ s/x.y.z/$R_V_SV/gi;
$val =~ s/thumb/$ARM/gi;
+ $val = "C:$val" if (defined($S90SDK) and ($val =~ /^(\/|\\\\)system[\/\\]/i));
$val = "'$SYMBIAN_VERSION'" if $var eq 'osvers';
$val = "'$SDK_VERSION'" if $var eq 'sdkvers';
$config{$var} = $val;
__EOF__
while (<CONFIG_H_SH>) {
last if /!GROK!THIS/;
- s/\$(\w+)/exists $config{$1} ? $config{$1} : ""/eg;
+ s/\$(\w+)/exists $config{$1} ? $config{$1} : (warn "$0: config.sh missing '$1'\n", "")/eg;
s/^#undef\s+(\S+).+/#undef $1/g;
s:\Q/**/::;
print CONFIG_H;
sub create_DynaLoader_cpp {
print "\text\\DynaLoader\\DynaLoader.cpp\n";
system(
-q[perl -Ilib lib\ExtUtils\xsubpp ext\DynaLoader\dl_symbian.xs >ext\DynaLoader\DynaLoader.cpp]
+q[xsubpp ext\DynaLoader\dl_symbian.xs >ext\DynaLoader\DynaLoader.cpp]
) == 0
or die "$0: creating DynaLoader.cpp failed: $!\n";
push @unclean, 'ext\DynaLoader\DynaLoader.cpp';
$S80SDK =~ /^(\d+)\.(\d+)$/;
($sdkmajor, $sdkminor) = ($1, $2);
}
+ if ($SDK_VARIANT eq 'S90') {
+ $S90SDK =~ /^(\d+)\.(\d+)$/;
+ ($sdkmajor, $sdkminor) = ($1, $2);
+ }
if ($SDK_VARIANT eq 'UIQ') {
$UIQSDK =~ /^(\d+)\.(\d+)$/;
($sdkmajor, $sdkminor) = ($1, $2);
sub create_perlmain_c {
print "\tperlmain.c\n";
system(
-q[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]
+q[perl -ne "print qq[ char *file = __FILE__;\n] if /dXSUB_SYS/;print unless /PERL_UNUSED_CONTEXT/;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]
) == 0
or die "$0: Creating perlmain.c failed: $!\n";
push @unclean, 'perlmain.c';
qq[;Supports Series 60 v0.9\n(0x101F6F88), 0, 0, 0, {"Series60ProductID"}\n] :
defined $S80SDK ?
qq[;Supports Series 80 v2.0\n(0x101F8ED2), 0, 0, 0, {"Series80ProductID"}\n] :
+ defined $S90SDK ?
+qq[;Supports Series 90 v1.1\n(0x101FBE05), 0, 0, 0, {"Series90ProductID"}\n] :
defined $UIQSDK && $SDK_VERSION =~ /^(\d)\.(\d)$/ ?
qq[;Supports UIQ v2.1\n(0x101F617B), $1, $2, 0, {"UIQ21ProductID"}\n] :
";Supports Series NN";
my $APPS = $UREL;
- if (($SDK_VARIANT eq 'S60' && $SDK_VERSION ne '1.2' || $WIN eq 'winscw') || defined $S80SDK) { # Do only if not in S60 1.2 VC.
+ if (($SDK_VARIANT eq 'S60' && $SDK_VERSION ne '1.2' || $WIN eq 'winscw') || defined $S80SDK || defined $S90SDK) { # Do only if not in S60 1.2 VC.
$APPS =~ s!\\epoc32\\release\\(.+)\\$UARM$!\\epoc32\\data\\z\\system\\apps\\PerlApp!i;
}
- # In S60 3.0 there will be no more recognizers.
+ # TODO: in S60 3.0 there will be no more recognizers.
my $mdl = qq["$UREL\\PerlRecog.mdl"-"!:\\system\\recogs\\PerlRecog.mdl";];
+ my $AIF = $SDK_VARIANT =~ /^S[689]0/ ? qq["$APPS\\PerlApp.aif"-"!:\\system\\apps\\PerlApp\\PerlApp.aif"] : "";
print PERLAPP_PKG <<__EOF__;
; !!!!!! DO NOT EDIT THIS FILE !!!!!!
; This file is built by symbian\\config.pl.
"$UREL\\PerlApp.APP"-"!:\\system\\apps\\PerlApp\\PerlApp.app"
$mdl
"$APPS\\PerlApp.rsc"-"!:\\system\\apps\\PerlApp\\PerlApp.rsc"
-"$APPS\\PerlApp.aif"-"!:\\system\\apps\\PerlApp\\PerlApp.aif"
+$AIF
__EOF__
if ( open( DEMOS, "perl symbian\\demo_pl list |" ) ) {
while (<DEMOS>) {
chomp;
- print PERLAPP_PKG qq["$_"-"!:\\Perl\\$_"\n];
+ if (defined $S90SDK) {
+ print PERLAPP_PKG qq["$_"-"!:\\Mydocs\\Perl\\$_"\n];
+ } else {
+ print PERLAPP_PKG qq["$_"-"!:\\Perl\\$_"\n];
+ }
}
close(DEMOS);
}
'miniperl', 'exe',
'miniperlmain.c', 'symbian\symbian_stubs.c',
'symbian\PerlBase.cpp',
+ 'symbian\PerlUi.cpp',
'symbian\PerlUtil.cpp',
'symbian\symbian_utils.cpp',
);
create_mmp(
"perl", 'exe',
'perlmain.c', 'symbian\symbian_stubs.c',
- 'symbian\symbian_utils.cpp', 'symbian\PerlBase.cpp',
+ 'symbian\symbian_utils.cpp',
+ 'symbian\PerlBase.cpp',
+ 'symbian\PerlUi.cpp',
'symbian\PerlUtil.cpp',
'ext\DynaLoader\DynaLoader.cpp',
);
create_mmp(
"perl$VERSION", 'dll',
'symbian\symbian_dll.cpp', 'symbian\symbian_stubs.c',
- 'symbian\symbian_utils.cpp', 'symbian\PerlBase.cpp',
+ 'symbian\symbian_utils.cpp',
+ 'symbian\PerlBase.cpp',
+ 'symbian\PerlUi.cpp',
'symbian\PerlUtil.cpp',
'ext\DynaLoader\DynaLoader.cpp',
);
if ( open( PERLAPP_MMP, ">symbian/PerlApp.mmp" ) ) {
my @MACRO;
my @LIB;
+ push @MACRO, 'PERL_IMPLICIT_CONTEXT';
+ push @MACRO, 'MULTIPLICITY';
if (defined $S60SDK) {
push @MACRO, '__SERIES60__';
push @MACRO, '__SERIES60_1X__' if $S60SDK =~ /^1\./;
LIBRARY ckndlg.lib
__EOF__
}
+ if (defined $S90SDK) {
+ push @MACRO, '__SERIES90__';
+ push @LIB, <<__EOF__;
+LIBRARY eikctl.lib
+LIBRARY eikcoctl.lib
+LIBRARY eikdlg.lib
+LIBRARY ckndlg.lib
+__EOF__
+ }
if (defined $UIQSDK) {
push @MACRO, '__UIQ__';
push @MACRO, '__UIQ_1X__' if $UIQSDK =~ /^1\./;
SOURCEPATH .
SOURCE PerlApp.cpp
-RESOURCE PerlApp.rss
-
USERINCLUDE .
USERINCLUDE ..
USERINCLUDE \\symbian\\perl\\$R_V_SV\\include
LIBRARY apparc.lib
LIBRARY bafl.lib
LIBRARY charconv.lib
-LIBRARY cone.lib
+LIBRARY cone.lib
LIBRARY efsrv.lib
-LIBRARY eikcore.lib
+LIBRARY eikcore.lib
LIBRARY estlib.lib
LIBRARY euser.lib
LIBRARY perl$VERSION.lib
@LIB
-
+RESOURCE perlapp.rss
__EOF__
if (@MACRO) {
for my $macro (@MACRO) {
__EOF__
}
}
- if ($SDK_VARIANT =~ /^S[68]0$/) {
+ if ($SDK_VARIANT =~ /^S[689]0$/) {
print PERLAPP_MMP <<__EOF__;
AIF PerlApp.aif . PerlAppAif.rss
__EOF__
my $windef2 = "..\\BWINS\\${perl}u.def";
my $armdef1 = "$SYMBIAN_ROOT\\Epoc32\\Build$CWD\\$perl\\$ARM\\$perl.def";
my $armdef2 = "..\\BMARM\\${perl}u.def";
+ my $MF = $WIN eq 'wins' ? 'vc6' : $WIN eq 'winscw' ? 'cw_ide' : "UNKNOWN";
print "\tMakefile\n";
print MAKEFILE <<__EOF__;
help:
@unclean: symbian\\config.pl
perl symbian\\config.pl
-build_${WIN}: abld.bat ${WIN}_perl.mf ${WIN}_miniperl.mf ${WIN}_${VERSION}.mf perldll_${WIN}
+build_${WIN}: abld.bat perldll_${WIN}
-build_vc6: abld.bat ${WIN}_perl.mf ${WIN}_miniperl.mf ${WIN}_${VERSION}.mf vc6.mf perldll_wins
+build_vc6: abld.bat perldll_wins
-build_vc7: abld.bat ${WIN}_perl.mf ${WIN}_miniperl.mf ${WIN}_${VERSION}.mf vc7.mf perldll_wins
+build_vc7: abld.bat perldll_wins
-build_cw: abld.bat ${WIN}_perl.mf ${WIN}_miniperl.mf ${WIN}_${VERSION}.mf cw.mf perldll_winscw
+build_cw: abld.bat perldll_winscw
-build_arm: abld.bat perl_arm miniperl_arm arm_${VERSION}.mf perldll_arm
+build_arm: abld.bat perl_arm miniperl_arm perldll_arm
-miniperl_win miniperl_${WIN}: miniperl.mmp abld.bat ${WIN}_miniperl.mf rename_makedef
+miniperl_win miniperl_${WIN}: miniperl.mmp abld.bat rename_makedef
abld build ${WIN} udeb miniperl
-miniperl_arm: miniperl.mmp abld.bat arm_miniperl.mf rename_makedef
+miniperl_arm: miniperl.mmp abld.bat rename_makedef
abld build \$(ARM) $UARM miniperl
miniperl: miniperl_${WIN} miniperl_arm
perl: perl_${WIN} perl_arm
-perl_win perl_${WIN}: perl.mmp abld.bat ${WIN}_perl.mf rename_makedef
+perl_win perl_${WIN}: perl.mmp abld.bat rename_makedef
abld build ${WIN} perl
-perl_arm: perl.mmp abld.bat arm_perl.mf rename_makedef
+perl_arm: perl.mmp abld.bat rename_makedef
abld build \$(ARM) $UARM perl
perldll_win perldll_${WIN}: perl${VERSION}_${WIN} freeze_${WIN} perl${VERSION}_${WIN}
perldll_arm: perl${VERSION}_arm freeze_arm perl${VERSION}_arm
-perl${VERSION}_arm: perl$VERSION.mmp arm_${VERSION}.mf abld.bat rename_makedef
+perl${VERSION}_arm: perl$VERSION.mmp abld.bat rename_makedef
abld build \$(ARM) $UARM perl$VERSION
perldll perl$VERSION: perldll_${WIN} perldll_arm
rerename_makedef:
-ren nomakedef.pl makedef.pl
-abld.bat abld: bld.inf
- bldmake bldfiles
+symbian\\PerlUi.rss: symbian\\PerlUi$SDK_VARIANT.rss
+ copy symbian\\PerlUi$SDK_VARIANT.rss symbian\\PerlUi.rss
-makefiles: win.mf arm.mf vc6 vc7.mf cw.mf
+abld.bat abld: bld.inf symbian\\PerlUi.rss
+ bldmake bldfiles
vc6: win.mf vc6.mf build_vc6
cw: win.mf cw.mf build_cw
${WIN}_miniperl.mf: abld.bat symbian\\config.pl
- abld makefile ${WIN} miniperl
+ abld makefile ${MF} miniperl
echo > ${WIN}_miniperl.mf
${WIN}_perl.mf: abld.bat symbian\\config.pl
- abld makefile ${WIN} perl
+ abld makefile ${MF} perl
echo > ${WIN}_perl.mf
${WIN}_${VERSION}.mf: abld.bat symbian\\config.pl
- abld makefile ${WIN} perl${VERSION}
+ abld makefile ${MF} perl${VERSION}
echo > ${WIN}_${VERSION}.mf
symbian\\${WIN}.mf:
${WIN}.mf: ${WIN}_miniperl.mf ${WIN}_perl.mf ${WIN}_${VERSION}.mf symbian\\${WIN}.mf
arm_miniperl.mf: abld.bat symbian\\config.pl
- abld makefile \$(ARM) miniperl
echo > arm_miniperl.mf
arm_perl.mf: abld.bat symbian\\config.pl
- abld makefile \$(ARM) perl
echo > arm_perl.mf
arm_${VERSION}.mf: abld.bat symbian\\config.pl
- abld makefile \$(ARM) perl${VERSION}
echo > arm_${VERSION}.mf
arm.mf: arm_miniperl.mf arm_perl.mf arm_${VERSION}.mf
lib\\Config.pm:
copy symbian\\config.sh config.sh
+__EOF__
+ if (defined $S90SDK) {
+ print MAKEFILE <<__EOF__;
+ perl -pi.bak -e "s:x\\.y\\.z+:$R_V_SV:g; s!='(\\\\\\\\system)!='C:\\1!" config.sh
+__EOF__
+ } else {
+ print MAKEFILE <<__EOF__;
perl -pi.bak -e "s:x\\.y\\.z+:$R_V_SV:g" config.sh
+__EOF__
+ };
+ print MAKEFILE <<__EOF__;
perl \$(XLIB) configpm --cross=symbian
copy xlib\\symbian\\Config.pm lib\\Config.pm
perl -pi.bak -e "s:x\\.y\\.z:$R_V_SV:g" lib\\Config.pm
perl${VERSION}ext.sis perlext.sis: perldll_arm buildext_sis
perl symbian\\makesis.pl perl${VERSION}ext
-EXT = Compress::Zlib 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
+EXT = Compress::Raw::Zlib 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
buildext: perldll symbian\\xsbuild.pl lib\\Config.pm
perl \$(XLIB) symbian\\xsbuild.pl \$(XSBOPT) \$(EXT)
copy /y symbian\\xsbuild.pl \$(APIDIR)\\bin
copy /y symbian\\sisify.pl \$(APIDIR)\\bin
copy /y symbian\\PerlBase.h \$(APIDIR)\\include
+ copy /y symbian\\PerlUi.h \$(APIDIR)\\include
copy /y symbian\\PerlUtil.h \$(APIDIR)\\include
copy /y symbian\\symbian*.h \$(APIDIR)\\include\\symbian
copy /y symbian\\PerlBase.pod \$(APIDIR)\\pod
-del /f abld.bat @unclean *.pkg *.sis *.zip
-del /f symbian\\abld.bat symbian\\*.sis symbian\\*.zip
-del /f symbian\\perl5*.pkg symbian\\miniperl.pkg
- -del /f symbian\\PerlApp.rss
-del arm_*.mf ${WIN}_*.mf vc*.mf cw*.mf
+ -del symbian\\Makefile
+ -del symbian\\PerlUi.rss symbian\\PerlApp.rss
-del perlappmin.hex perlrscmin.hex
-perl symbian\\xsbuild.pl \$(XSBOPT) --clean \$(EXT)
-rmdir /s /q perl${VERSION}_Data
my $wrap = defined $S60SDK && $S60SDK eq '1.2' && $WIN ne '${WIN}cw';
my $ABLD = $wrap ? 'perl b.pl': 'abld';
print "\tsymbian/Makefile\n";
+ my $MF = $WIN eq 'wins' ? 'vc6' : $WIN eq 'winscw' ? 'cw_ide' : "UNKNOWN";
print MAKEFILE <<__EOF__;
WIN = $WIN
ARM = $ARM
ABLD = $ABLD
+MF = $MF
abld.bat:
bldmake bldfiles
perlapp_${WIN}: abld.bat ..\\config.h PerlApp.h PerlApp.cpp
+ copy PerlUi$SDK_VARIANT.rss PerlApp.rss
bldmake bldfiles
- copy PerlApp$SDK_VARIANT.rss PerlApp.rss
\$(ABLD) build ${WIN} udeb
perlapp_arm: ..\\config.h PerlApp.h PerlApp.cpp
+ copy PerlUi$SDK_VARIANT.rss PerlApp.rss
bldmake bldfiles
- copy PerlApp$SDK_VARIANT.rss PerlApp.rss
\$(ABLD) build ${ARM} $UARM
+$MF:
+ abld makefile $MF
+
win.mf:
bldmake bldfiles
- abld makefile vc6
- abld makefile vc7
- abld makefile cw_ide
+ abld makefile $MF
perlapp_demo_extract:
perl demo_pl extract
-perl demo_pl cleanup
-del /f perlapp.sis
-del /f b.pl
+ -del PerlApp.rss
abld clean $WIN
abld clean thumb
+ -del Makefile
distclean: clean
-del /f *.cwlink *.resources *.pref
"lib\\Config.pm",
"xlib\\symbian\\Config.pm",
"xlib\\symbian\\Config_heavy.pl",
+ "symbian\\PerlUi.rss",
+ "symbian\\PerlApp.rss",
) {
print "\t$config\n";
unlink($config);