summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorSerhii Popovych <spopovyc@cisco.com>2017-03-31 11:46:57 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-04-01 23:28:20 +0100
commite44946bff10e04cc52c3871a65830e83ff4a2c41 (patch)
tree29b894573b6baeff6759ddb14000ab1bd998aefd /meta/recipes-devtools
parent034702f52070c495415db83e18e77fbe6632e54e (diff)
downloadpoky-e44946bff10e04cc52c3871a65830e83ff4a2c41.tar.gz
autoconf: 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 autoconf 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 autoconf to replace -w option in shebang line with modern way to enable warnings on perl (i.e. "use warnings"). Also add nativesdk-m4 and nativesdk-gnu-config 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 autoconf 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 autoconf-native. Cc: XE-Linux <xe-linux-external@cisco.com> (From OE-Core rev: 443d2d31732fa5700aa00ff020a0d79ab245c114) 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/autoconf/autoconf.inc7
-rw-r--r--meta/recipes-devtools/autoconf/autoconf/autoconf-replace-w-option-in-shebangs-with-modern-use-warnings.patch120
-rw-r--r--meta/recipes-devtools/autoconf/autoconf_2.69.bb1
3 files changed, 127 insertions, 1 deletions
diff --git a/meta/recipes-devtools/autoconf/autoconf.inc b/meta/recipes-devtools/autoconf/autoconf.inc
index b4e33569a6..f1b2dfca7a 100644
--- a/meta/recipes-devtools/autoconf/autoconf.inc
+++ b/meta/recipes-devtools/autoconf/autoconf.inc
@@ -27,13 +27,18 @@ RDEPENDS_${PN} = "m4 gnu-config \
27 perl-module-data-dumper \ 27 perl-module-data-dumper \
28 " 28 "
29RDEPENDS_${PN}_class-native = "m4-native gnu-config-native" 29RDEPENDS_${PN}_class-native = "m4-native gnu-config-native"
30RDEPENDS_${PN}_class-nativesdk = "nativesdk-m4 nativesdk-gnu-config"
30 31
31SRC_URI = "${GNU_MIRROR}/autoconf/autoconf-${PV}.tar.gz \ 32SRC_URI = "${GNU_MIRROR}/autoconf/autoconf-${PV}.tar.gz \
32 file://program_prefix.patch" 33 file://program_prefix.patch"
33 34
34inherit autotools texinfo 35inherit autotools texinfo
35 36
36CACHED_CONFIGUREVARS += "ac_cv_path_PERL=${USRBINPATH}/perl" 37PERL = "${USRBINPATH}/perl"
38PERL_class-native = "/usr/bin/env perl"
39PERL_class-nativesdk = "/usr/bin/env perl"
40
41CACHED_CONFIGUREVARS += "ac_cv_path_PERL='${PERL}'"
37 42
38do_configure() { 43do_configure() {
39 oe_runconf 44 oe_runconf
diff --git a/meta/recipes-devtools/autoconf/autoconf/autoconf-replace-w-option-in-shebangs-with-modern-use-warnings.patch b/meta/recipes-devtools/autoconf/autoconf/autoconf-replace-w-option-in-shebangs-with-modern-use-warnings.patch
new file mode 100644
index 0000000000..ae0e3825f6
--- /dev/null
+++ b/meta/recipes-devtools/autoconf/autoconf/autoconf-replace-w-option-in-shebangs-with-modern-use-warnings.patch
@@ -0,0 +1,120 @@
1From 236552ff5b9f1ebf666d8d0e9850007dcce03d26 Mon Sep 17 00:00:00 2001
2From: Serhii Popovych <spopovyc@cisco.com>
3Date: Wed, 10 Feb 2016 16:32:44 +0000
4Subject: [PATCH] perl: Replace -w option in shebangs with modern "use
5 warnings"
6
7In some builds we might provide ac_cv_path_PERL as /usr/bin/env perl
8to use newer version of the perl from users PATH rather than
9older from standard system path.
10
11However using /usr/bin/env perl -w from shebang line isn't
12possible because it translates to something like
13/usr/bin/env -w perl and env complains about illegal option.
14
15To address this we can remove -w option from perl shebang
16line and add "use warnings" statement.
17
18Upstream-Status: Pending
19Signed-off-by: Serhii Popovych <spopovyc@cisco.com>
20---
21 bin/autom4te.in | 3 ++-
22 bin/autoreconf.in | 3 ++-
23 bin/autoscan.in | 3 ++-
24 bin/autoupdate.in | 3 ++-
25 bin/ifnames.in | 3 ++-
26 5 files changed, 10 insertions(+), 5 deletions(-)
27
28diff --git a/bin/autom4te.in b/bin/autom4te.in
29index 11773c9..a8f5e41 100644
30--- a/bin/autom4te.in
31+++ b/bin/autom4te.in
32@@ -1,4 +1,4 @@
33-#! @PERL@ -w
34+#! @PERL@
35 # -*- perl -*-
36 # @configure_input@
37
38@@ -42,6 +42,7 @@ use Autom4te::General;
39 use Autom4te::XFile;
40 use File::Basename;
41 use strict;
42+use warnings;
43
44 # Data directory.
45 my $pkgdatadir = $ENV{'AC_MACRODIR'} || '@pkgdatadir@';
46diff --git a/bin/autoreconf.in b/bin/autoreconf.in
47index e245db4..1a318cb 100644
48--- a/bin/autoreconf.in
49+++ b/bin/autoreconf.in
50@@ -1,4 +1,4 @@
51-#! @PERL@ -w
52+#! @PERL@
53 # -*- perl -*-
54 # @configure_input@
55
56@@ -45,6 +45,7 @@ use Autom4te::XFile;
57 # Do not use Cwd::chdir, since it might hang.
58 use Cwd 'cwd';
59 use strict;
60+use warnings;
61
62 ## ----------- ##
63 ## Variables. ##
64diff --git a/bin/autoscan.in b/bin/autoscan.in
65index a67c48d..b931249 100644
66--- a/bin/autoscan.in
67+++ b/bin/autoscan.in
68@@ -1,4 +1,4 @@
69-#! @PERL@ -w
70+#! @PERL@
71 # -*- perl -*-
72 # @configure_input@
73
74@@ -43,6 +43,7 @@ use Autom4te::XFile;
75 use File::Basename;
76 use File::Find;
77 use strict;
78+use warnings;
79
80 use vars qw(@cfiles @makefiles @shfiles @subdirs %printed);
81
82diff --git a/bin/autoupdate.in b/bin/autoupdate.in
83index 9737d49..92cb147 100644
84--- a/bin/autoupdate.in
85+++ b/bin/autoupdate.in
86@@ -1,4 +1,4 @@
87-#! @PERL@ -w
88+#! @PERL@
89 # -*- perl -*-
90 # @configure_input@
91
92@@ -44,6 +44,7 @@ use Autom4te::General;
93 use Autom4te::XFile;
94 use File::Basename;
95 use strict;
96+use warnings;
97
98 # Lib files.
99 my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
100diff --git a/bin/ifnames.in b/bin/ifnames.in
101index ba2cd05..74b0278 100644
102--- a/bin/ifnames.in
103+++ b/bin/ifnames.in
104@@ -1,4 +1,4 @@
105-#! @PERL@ -w
106+#! @PERL@
107 # -*- perl -*-
108 # @configure_input@
109
110@@ -44,6 +44,7 @@ BEGIN
111 use Autom4te::General;
112 use Autom4te::XFile;
113 use Autom4te::FileUtils;
114+use warnings;
115
116 # $HELP
117 # -----
118--
1192.3.0
120
diff --git a/meta/recipes-devtools/autoconf/autoconf_2.69.bb b/meta/recipes-devtools/autoconf/autoconf_2.69.bb
index fd01585441..8e67f4b829 100644
--- a/meta/recipes-devtools/autoconf/autoconf_2.69.bb
+++ b/meta/recipes-devtools/autoconf/autoconf_2.69.bb
@@ -15,6 +15,7 @@ SRC_URI += "file://check-automake-cross-warning.patch \
15 file://add_musl_config.patch \ 15 file://add_musl_config.patch \
16 file://performance.patch \ 16 file://performance.patch \
17 file://AC_HEADER_MAJOR-port-to-glibc-2.25.patch \ 17 file://AC_HEADER_MAJOR-port-to-glibc-2.25.patch \
18 file://autoconf-replace-w-option-in-shebangs-with-modern-use-warnings.patch \
18 " 19 "
19 20
20SRC_URI[md5sum] = "82d05e03b93e45f5a39b828dc9c6c29b" 21SRC_URI[md5sum] = "82d05e03b93e45f5a39b828dc9c6c29b"