|
1 #!/usr/bin/perl |
|
2 # Copyright (c) 2010 Symbian Foundation Ltd |
|
3 # This component and the accompanying materials are made available |
|
4 # under the terms of the License "Eclipse Public License v1.0" |
|
5 # which accompanies this distribution, and is available |
|
6 # at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 # |
|
8 # Initial Contributors: |
|
9 # Mike Kinghan, mikek@symbian.org for Symbian Foundation Ltd - initial contribution. |
|
10 |
|
11 |
|
12 # Script to apply fixes to epoc32 tree on Linux so that:- |
|
13 # - Case-sensitivity bug #1399 is worked around |
|
14 # - Provide a valid pre-include header file to enable |
|
15 # compiling of the tools code with gcc 4.4.x |
|
16 |
|
17 |
|
18 use strict; |
|
19 use File::Spec; |
|
20 use apply_patch_file; |
|
21 use usage; |
|
22 use check_os; |
|
23 |
|
24 require_os_linux(); |
|
25 |
|
26 usage(\@ARGV,"This script makes required fixes to epoc32 tree in Linux"); |
|
27 set_epocroot(); |
|
28 my $epocroot = $ENV{'EPOCROOT'}; |
|
29 my $wrong_product_variant_hrh = File::Spec->catfile("$epocroot","epoc32","include","ProductVariant.hrh"); |
|
30 my $right_product_variant_hrh = File::Spec->catfile("$epocroot","epoc32","include","productvariant.hrh"); |
|
31 if (! -f $right_product_variant_hrh and ! -l $right_product_variant_hrh) { |
|
32 print ">>> Creating symlink \"$wrong_product_variant_hrh\" -> \"$right_product_variant_hrh\"\n"; |
|
33 print ">>> (workaround for bug #1399)\n"; |
|
34 symlink($wrong_product_variant_hrh,$right_product_variant_hrh) or die $!; |
|
35 } |
|
36 my $gcc_include_dir = File::Spec->catfile("$epocroot","epoc32","include","gcc"); |
|
37 if (! -d $gcc_include_dir) { |
|
38 print ">>> Creating \"$gcc_include_dir\"\n"; |
|
39 mkdir $gcc_include_dir or die $!; |
|
40 } |
|
41 my $gcc_441_prelinclude_hdr_rel = File::Spec->catfile("epoc32","include","gcc","gcc_4_4_1.h"); |
|
42 my $gcc_441_prelinclude_hdr_abs = File::Spec->catfile("$epocroot","$gcc_441_prelinclude_hdr_rel"); |
|
43 my $gcc_prelinclude_hdr = File::Spec->catfile("$epocroot","epoc32","include","gcc","gcc.h"); |
|
44 if (! -f $gcc_441_prelinclude_hdr_abs) { |
|
45 print ">>> Creating \"$gcc_441_prelinclude_hdr_abs\"\n"; |
|
46 apply_patch_file($gcc_441_prelinclude_hdr_rel); |
|
47 unlink($gcc_prelinclude_hdr) |
|
48 } |
|
49 if (! -l $gcc_prelinclude_hdr) { |
|
50 print ">>> Creating symlink \"$gcc_441_prelinclude_hdr_abs\" -> \"$gcc_prelinclude_hdr\"\n"; |
|
51 symlink($gcc_441_prelinclude_hdr_abs,$gcc_prelinclude_hdr); |
|
52 } |
|
53 exit 0; |
|
54 |