summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/perl/perl-5.12.3/generate-sh.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/perl/perl-5.12.3/generate-sh.patch')
-rw-r--r--meta/recipes-devtools/perl/perl-5.12.3/generate-sh.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/meta/recipes-devtools/perl/perl-5.12.3/generate-sh.patch b/meta/recipes-devtools/perl/perl-5.12.3/generate-sh.patch
new file mode 100644
index 0000000000..47f91c56d3
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl-5.12.3/generate-sh.patch
@@ -0,0 +1,48 @@
1Upstream-Status:Inappropriate [embedded specific]
2
3Use the ld flags from the supplied configuration file. For sh we need the
4flags that specify to build PIC code so that the shared libraries work.
5
6Index: perl-5.8.8/Cross/generate_config_sh
7===================================================================
8--- perl-5.8.8.orig/Cross/generate_config_sh 2003-09-05 18:31:08.000000000 +1000
9+++ perl-5.8.8/Cross/generate_config_sh 2007-05-30 09:12:50.000000000 +1000
10@@ -19,10 +19,10 @@
11 $callbacks->{'ar'} = [\&simple_process, ["AR", "arm-linux-ar"]];
12 $callbacks->{'archname'} = [\&simple_process, ["SYS", "armv4l-linux"]];
13 $callbacks->{'cc'} = [\&simple_process, ["CC", "arm-linux-gcc"]];
14-$callbacks->{'cccdlflags'} = [\&simple_process, ["CFLAGS", ""]];
15-$callbacks->{'ccdlflags'} = [\&simple_process, ["CFLAGS", ""]];
16-$callbacks->{'ccflags'} = [\&simple_process, ["CFLAGS", "-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"]];
17-$callbacks->{'ccflags_uselargefiles'} = [\&simple_process, ["CFLAGS", "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"]];
18+#$callbacks->{'cccdlflags'} = [\&simple_process, ["CFLAGS", ""]];
19+#$callbacks->{'ccdlflags'} = [\&simple_process, ["CFLAGS", ""]];
20+$callbacks->{'ccflags'} = [\&simple_process_insert, ["CFLAGS", "-fno-strict-aliasing -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"]];
21+$callbacks->{'ccflags_uselargefiles'} = [\&simple_process_insert, ["CFLAGS", "-D_GNU_SOURCE -DTHREADS_HAVE_PIDS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"]];
22 $callbacks->{'ccname'} = [\&simple_process, ["CC", "arm-linux-gcc"]];
23 $callbacks->{'cpp'} = [\&simple_process, ["CCP", "arm-linux-cpp"]];
24 $callbacks->{'cppflags'} = [\&simple_process, ["CCPFLAGS", "-fno-strict-aliasing"]];
25@@ -105,6 +105,23 @@
26
27 }
28
29+# Insert env var into the variables value
30+sub simple_process_insert {
31+ my $key = shift;
32+ my $value = shift;
33+ my $envvar = $callbacks->{$key}->[1][0];
34+
35+ if ($ENV{$envvar}) {
36+ # Strip quotes from value
37+ $value =~ s/^\'//;
38+ $value =~ s/\'$//;
39+ # Remove -I/usr/local/... from the value
40+ $value =~ s#\W-I/usr/local/\w+\W# #g;
41+ # Prepend env var (OE setting) to value
42+ print("$key=\'$ENV{$envvar} $value\'\n");
43+ }
44+}
45+
46 sub library_munge {
47 my $key = shift;
48 my $value = shift;