cross-plat-dev-utils/fix_epoc32_linux.pl
author Mike Kinghan <mikek@symbian.org>
Wed, 01 Dec 2010 12:02:41 +0000
changeset 42 cf609178ac39
parent 33 667e3f7728f7
permissions -rwxr-xr-x
1) fix_tools_exports.pl need only be run on Windows hosts; was run unnecessarily on Linux too. 2) Need to export modload.pm on Linux as well as Windows hosts.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
     1
#!/usr/bin/perl
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
     2
# Copyright (c) 2010 Symbian Foundation Ltd
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
     3
# This component and the accompanying materials are made available
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
     4
# under the terms of the License "Eclipse Public License v1.0"
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
     5
# which accompanies this distribution, and is available
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
     7
#
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
     8
# Initial Contributors:
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
     9
# Mike Kinghan, mikek@symbian.org for Symbian Foundation Ltd - initial contribution.
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    10
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    11
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    12
# Script to apply fixes to epoc32 tree on Linux so that:-
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    13
# - Case-sensitivity bug #1399 is worked around
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    14
# - Provide a valid pre-include header file to enable
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    15
#	compiling of the tools code with gcc 4.4.x
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    16
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    17
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    18
use strict;
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    19
use File::Spec;
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    20
use apply_patch_file;
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    21
use usage;
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    22
use check_os;
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    23
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    24
require_os_linux();
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    25
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    26
usage(\@ARGV,"This script makes required fixes to epoc32 tree in Linux");
6
787612182dd0 1) Make cross-plat-dev-utils perl scripts independent of the package directory name
mikek
parents: 2
diff changeset
    27
my $epocroot = get_epocroot();
787612182dd0 1) Make cross-plat-dev-utils perl scripts independent of the package directory name
mikek
parents: 2
diff changeset
    28
my $wrong_product_variant_hrh = File::Spec->catfile(get_epoc32_dir(),"include","ProductVariant.hrh");
787612182dd0 1) Make cross-plat-dev-utils perl scripts independent of the package directory name
mikek
parents: 2
diff changeset
    29
my $right_product_variant_hrh = File::Spec->catfile(get_epoc32_dir(),"include","productvariant.hrh");
2
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    30
if (! -f $right_product_variant_hrh and ! -l $right_product_variant_hrh) {
10
b2a53d442fd6 1) Introducing support for 32/64-bit variants of the patch files
mikek
parents: 6
diff changeset
    31
	symlink($wrong_product_variant_hrh,$right_product_variant_hrh) or die $!;
b2a53d442fd6 1) Introducing support for 32/64-bit variants of the patch files
mikek
parents: 6
diff changeset
    32
	print ">>> Created symlink \"$wrong_product_variant_hrh\" -> \"$right_product_variant_hrh\"\n";
2
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    33
	print ">>> (workaround for bug #1399)\n";
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    34
}
6
787612182dd0 1) Make cross-plat-dev-utils perl scripts independent of the package directory name
mikek
parents: 2
diff changeset
    35
my $gcc_include_dir = File::Spec->catfile(get_epoc32_dir(),"include","gcc");
2
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    36
if (! -d $gcc_include_dir) {
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    37
	mkdir $gcc_include_dir or die $!;
10
b2a53d442fd6 1) Introducing support for 32/64-bit variants of the patch files
mikek
parents: 6
diff changeset
    38
	print ">>> Created \"$gcc_include_dir\"\n";
2
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    39
}
29
86492ef8d086 1) Update cross-plat-dev-utils for gcc 4.4.3
Mike Kinghan <mikek@symbian.org>
parents: 10
diff changeset
    40
my $gcc_443_prelinclude_hdr_rel = File::Spec->catfile("epoc32","include","gcc","gcc_4_4_3.h");
86492ef8d086 1) Update cross-plat-dev-utils for gcc 4.4.3
Mike Kinghan <mikek@symbian.org>
parents: 10
diff changeset
    41
my $gcc_443_prelinclude_hdr_abs = File::Spec->catfile("$epocroot","$gcc_443_prelinclude_hdr_rel");
2
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    42
my $gcc_prelinclude_hdr = File::Spec->catfile("$epocroot","epoc32","include","gcc","gcc.h");
29
86492ef8d086 1) Update cross-plat-dev-utils for gcc 4.4.3
Mike Kinghan <mikek@symbian.org>
parents: 10
diff changeset
    43
if (apply_patch_file($gcc_443_prelinclude_hdr_rel)) {
86492ef8d086 1) Update cross-plat-dev-utils for gcc 4.4.3
Mike Kinghan <mikek@symbian.org>
parents: 10
diff changeset
    44
	print ">>> Created \"$gcc_443_prelinclude_hdr_abs\"\n";
2
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    45
	unlink($gcc_prelinclude_hdr)
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    46
}
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    47
if (! -l $gcc_prelinclude_hdr) {
29
86492ef8d086 1) Update cross-plat-dev-utils for gcc 4.4.3
Mike Kinghan <mikek@symbian.org>
parents: 10
diff changeset
    48
	symlink($gcc_443_prelinclude_hdr_abs,$gcc_prelinclude_hdr);
86492ef8d086 1) Update cross-plat-dev-utils for gcc 4.4.3
Mike Kinghan <mikek@symbian.org>
parents: 10
diff changeset
    49
	print ">>> Created symlink \"$gcc_443_prelinclude_hdr_abs\" -> \"$gcc_prelinclude_hdr\"\n";
2
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    50
}
33
667e3f7728f7 1) Make prep_env.pl apply a patch to epoc32/sbs_config/s60_sbs_config.xml to replace the ARM
mikek
parents: 29
diff changeset
    51
my $s60_sbs_config_xml = File::Spec->catfile("epoc32","sbs_config","s60_sbs_config.xml");
667e3f7728f7 1) Make prep_env.pl apply a patch to epoc32/sbs_config/s60_sbs_config.xml to replace the ARM
mikek
parents: 29
diff changeset
    52
apply_patch_file($s60_sbs_config_xml);
667e3f7728f7 1) Make prep_env.pl apply a patch to epoc32/sbs_config/s60_sbs_config.xml to replace the ARM
mikek
parents: 29
diff changeset
    53
2
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    54
exit 0;
39c28ec933dd Removing all prior files. Adding a complete branch of the 'build' package with fixes
mikek
parents:
diff changeset
    55