diff options
author | Serhii Popovych <spopovyc@cisco.com> | 2017-03-31 11:46:58 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-04-01 23:28:20 +0100 |
commit | 4aa21211a3051b95ef9a67c62646e016114eac30 (patch) | |
tree | 83de7d3d28efca6c36e96d8dc87b4988f9332e3d /meta/recipes-devtools | |
parent | e44946bff10e04cc52c3871a65830e83ff4a2c41 (diff) | |
download | poky-4aa21211a3051b95ef9a67c62646e016114eac30.tar.gz |
automake: Adjust shebang lines to remove interpreter path hardcode
If build host perl (and other tools) is old and we use some kind
of toolchain to provide recent perl/python/etc to the OE build
we still locked to use build host perl due to hardcoded shebang
lines in automake scripts.
Behaviour was observed with Enterprise Linux 6 and devtoolset
toolchain from SCL (Software Collections) used to provide recent
version of perl (not provided with default buildtools-tarball).
Pass /usr/bin/env perl in ac_cv_path_PERL configuration variables
for class-native and class-nativesdk. Use patch to automake to replace
-w option in shebang line with modern way to enable warnings on perl
(i.e. "use warnings").
Also add nativesdk-autoconf to RDEPENDS to bring runtime dependencies
inline with other targets.
Note that ac_cv_path_PERL must be valid perl interpreter path
since configure will check perl version and Flock implementation.
It is not possible currently to use nativeperl from native
sysroot because automake does not DEPENDS on perl-native (and
doing so fails due to circular dependencies). Only possible
solution is to overwrite shebangs with nativeperl somewhere at
do_install() and update RDEPENDS for class-native. Or add perl
symlinks to nativeperl in sysroot.
For now it seems good to use perl found by /usr/bin/env from
automake-native.
Cc: XE-Linux <xe-linux-external@cisco.com>
(From OE-Core rev: 3b7111b30dbd9a4cdd141b594164da18c15ae970)
Signed-off-by: Serhii Popovych <spopovyc@cisco.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r-- | meta/recipes-devtools/automake/automake/automake-replace-w-option-in-shebangs-with-modern-use-warnings.patch | 99 | ||||
-rw-r--r-- | meta/recipes-devtools/automake/automake_1.15.bb | 13 |
2 files changed, 109 insertions, 3 deletions
diff --git a/meta/recipes-devtools/automake/automake/automake-replace-w-option-in-shebangs-with-modern-use-warnings.patch b/meta/recipes-devtools/automake/automake/automake-replace-w-option-in-shebangs-with-modern-use-warnings.patch new file mode 100644 index 0000000000..64eb253a6e --- /dev/null +++ b/meta/recipes-devtools/automake/automake/automake-replace-w-option-in-shebangs-with-modern-use-warnings.patch | |||
@@ -0,0 +1,99 @@ | |||
1 | From 41e06b7a354774913dcd2e32a35440e407843357 Mon Sep 17 00:00:00 2001 | ||
2 | From: Serhii Popovych <spopovyc@cisco.com> | ||
3 | Date: Wed, 10 Feb 2016 17:07:32 +0000 | ||
4 | Subject: [PATCH] perl: Replace -w option in shebangs with modern "use | ||
5 | warnings" In some builds we might provide ac_cv_path_PERL as /usr/bin/env | ||
6 | perl to use newer version of the perl from users PATH rather than older from | ||
7 | standard system path. | ||
8 | |||
9 | However using /usr/bin/env perl -w from shebang line isn't | ||
10 | possible because it translates to something like | ||
11 | /usr/bin/env -w perl and env complains about illegal option. | ||
12 | |||
13 | To address this we can remove -w option from perl shebang | ||
14 | line and add "use warnings" statement. | ||
15 | |||
16 | Upstream-Status: Pending | ||
17 | Signed-off-by: Serhii Popovych <spopovyc@cisco.com> | ||
18 | --- | ||
19 | bin/aclocal.in | 3 ++- | ||
20 | bin/automake.in | 3 ++- | ||
21 | t/wrap/aclocal.in | 3 ++- | ||
22 | t/wrap/automake.in | 3 ++- | ||
23 | 4 files changed, 8 insertions(+), 4 deletions(-) | ||
24 | |||
25 | diff --git a/bin/aclocal.in b/bin/aclocal.in | ||
26 | index 349f24a..50cb8d3 100644 | ||
27 | --- a/bin/aclocal.in | ||
28 | +++ b/bin/aclocal.in | ||
29 | @@ -1,4 +1,4 @@ | ||
30 | -#!@PERL@ -w | ||
31 | +#!@PERL@ | ||
32 | # -*- perl -*- | ||
33 | # @configure_input@ | ||
34 | |||
35 | @@ -33,6 +33,7 @@ BEGIN | ||
36 | } | ||
37 | |||
38 | use strict; | ||
39 | +use warnings; | ||
40 | |||
41 | use Automake::Config; | ||
42 | use Automake::General; | ||
43 | diff --git a/bin/automake.in b/bin/automake.in | ||
44 | index eedc8bc..e0a01cf 100644 | ||
45 | --- a/bin/automake.in | ||
46 | +++ b/bin/automake.in | ||
47 | @@ -1,4 +1,4 @@ | ||
48 | -#!@PERL@ -w | ||
49 | +#!@PERL@ | ||
50 | # -*- perl -*- | ||
51 | # @configure_input@ | ||
52 | |||
53 | @@ -28,6 +28,7 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac' | ||
54 | package Automake; | ||
55 | |||
56 | use strict; | ||
57 | +use warnings; | ||
58 | |||
59 | BEGIN | ||
60 | { | ||
61 | diff --git a/t/wrap/aclocal.in b/t/wrap/aclocal.in | ||
62 | index e64b546..9996899 100644 | ||
63 | --- a/t/wrap/aclocal.in | ||
64 | +++ b/t/wrap/aclocal.in | ||
65 | @@ -1,4 +1,4 @@ | ||
66 | -#!@PERL@ -w | ||
67 | +#!@PERL@ | ||
68 | # @configure_input@ | ||
69 | |||
70 | # Copyright (C) 2012-2014 Free Software Foundation, Inc. | ||
71 | @@ -19,6 +19,7 @@ | ||
72 | BEGIN | ||
73 | { | ||
74 | use strict; | ||
75 | + use warnings; | ||
76 | @Aclocal::perl_libdirs = ('@abs_top_srcdir@/lib'); | ||
77 | unshift @Aclocal::perl_libdirs, '@abs_top_builddir@/lib' | ||
78 | if '@srcdir@' ne '.'; | ||
79 | diff --git a/t/wrap/automake.in b/t/wrap/automake.in | ||
80 | index 8b943b1..be61226 100644 | ||
81 | --- a/t/wrap/automake.in | ||
82 | +++ b/t/wrap/automake.in | ||
83 | @@ -1,4 +1,4 @@ | ||
84 | -#!@PERL@ -w | ||
85 | +#!@PERL@ | ||
86 | # @configure_input@ | ||
87 | |||
88 | # Copyright (C) 2012-2014 Free Software Foundation, Inc. | ||
89 | @@ -19,6 +19,7 @@ | ||
90 | BEGIN | ||
91 | { | ||
92 | use strict; | ||
93 | + use warnings; | ||
94 | @Automake::perl_libdirs = ('@abs_top_srcdir@/lib'); | ||
95 | unshift @Automake::perl_libdirs, '@abs_top_builddir@/lib' | ||
96 | if '@srcdir@' ne '.'; | ||
97 | -- | ||
98 | 2.3.0 | ||
99 | |||
diff --git a/meta/recipes-devtools/automake/automake_1.15.bb b/meta/recipes-devtools/automake/automake_1.15.bb index a3c72fd334..a6904c8a91 100644 --- a/meta/recipes-devtools/automake/automake_1.15.bb +++ b/meta/recipes-devtools/automake/automake_1.15.bb | |||
@@ -17,16 +17,23 @@ RDEPENDS_${PN} += "\ | |||
17 | perl-module-vars " | 17 | perl-module-vars " |
18 | 18 | ||
19 | RDEPENDS_${PN}_class-native = "autoconf-native hostperl-runtime-native" | 19 | RDEPENDS_${PN}_class-native = "autoconf-native hostperl-runtime-native" |
20 | RDEPENDS_${PN}_class-nativesdk = "nativesdk-autoconf" | ||
20 | 21 | ||
21 | SRC_URI += " file://python-libdir.patch \ | 22 | SRC_URI += "file://python-libdir.patch \ |
22 | file://buildtest.patch \ | 23 | file://buildtest.patch \ |
23 | file://performance.patch \ | 24 | file://performance.patch \ |
24 | file://new_rt_path_for_test-driver.patch" | 25 | file://new_rt_path_for_test-driver.patch \ |
26 | file://automake-replace-w-option-in-shebangs-with-modern-use-warnings.patch \ | ||
27 | " | ||
25 | 28 | ||
26 | SRC_URI[md5sum] = "716946a105ca228ab545fc37a70df3a3" | 29 | SRC_URI[md5sum] = "716946a105ca228ab545fc37a70df3a3" |
27 | SRC_URI[sha256sum] = "7946e945a96e28152ba5a6beb0625ca715c6e32ac55f2e353ef54def0c8ed924" | 30 | SRC_URI[sha256sum] = "7946e945a96e28152ba5a6beb0625ca715c6e32ac55f2e353ef54def0c8ed924" |
28 | 31 | ||
29 | CACHED_CONFIGUREVARS += "ac_cv_path_PERL=${USRBINPATH}/perl" | 32 | PERL = "${USRBINPATH}/perl" |
33 | PERL_class-native = "${USRBINPATH}/env perl" | ||
34 | PERL_class-nativesdk = "${USRBINPATH}/env perl" | ||
35 | |||
36 | CACHED_CONFIGUREVARS += "ac_cv_path_PERL='${PERL}'" | ||
30 | 37 | ||
31 | do_install_append () { | 38 | do_install_append () { |
32 | install -d ${D}${datadir} | 39 | install -d ${D}${datadir} |