diff options
Diffstat (limited to 'meta/recipes-devtools/autoconf')
7 files changed, 380 insertions, 17 deletions
diff --git a/meta/recipes-devtools/autoconf/autoconf.inc b/meta/recipes-devtools/autoconf/autoconf.inc index 78b77e8c98..f1b2dfca7a 100644 --- a/meta/recipes-devtools/autoconf/autoconf.inc +++ b/meta/recipes-devtools/autoconf/autoconf.inc @@ -20,19 +20,25 @@ RDEPENDS_${PN} = "m4 gnu-config \ perl-module-file-glob \ perl-module-file-path \ perl-module-file-stat \ + perl-module-file-find \ perl-module-getopt-long \ perl-module-io-file \ perl-module-posix \ perl-module-data-dumper \ " RDEPENDS_${PN}_class-native = "m4-native gnu-config-native" +RDEPENDS_${PN}_class-nativesdk = "nativesdk-m4 nativesdk-gnu-config" SRC_URI = "${GNU_MIRROR}/autoconf/autoconf-${PV}.tar.gz \ file://program_prefix.patch" inherit autotools texinfo -CACHED_CONFIGUREVARS += "ac_cv_path_PERL=${USRBINPATH}/perl" +PERL = "${USRBINPATH}/perl" +PERL_class-native = "/usr/bin/env perl" +PERL_class-nativesdk = "/usr/bin/env perl" + +CACHED_CONFIGUREVARS += "ac_cv_path_PERL='${PERL}'" do_configure() { oe_runconf diff --git a/meta/recipes-devtools/autoconf/autoconf/AC_HEADER_MAJOR-port-to-glibc-2.25.patch b/meta/recipes-devtools/autoconf/autoconf/AC_HEADER_MAJOR-port-to-glibc-2.25.patch new file mode 100644 index 0000000000..fc37236bf8 --- /dev/null +++ b/meta/recipes-devtools/autoconf/autoconf/AC_HEADER_MAJOR-port-to-glibc-2.25.patch @@ -0,0 +1,162 @@ +From e17a30e987d7ee695fb4294a82d987ec3dc9b974 Mon Sep 17 00:00:00 2001 +From: Eric Blake <eblake@redhat.com> +Date: Wed, 14 Sep 2016 08:17:06 -0500 +Subject: [PATCH] AC_HEADER_MAJOR: port to glibc 2.25 + +glibc 2.25 is deprecating the namespace pollution of <sys/types.h> +injecting major(), minor(), and makedev() into the compilation +environment, with a warning that insists that users include +<sys/sysmacros.h> instead. However, because the expansion of +AC_HEADER_MAJOR didn't bother checking sys/sysmacros.h until +after probing whether sys/types.h pollutes the namespace, it was +not defining MAJOR_IN_SYSMACROS, with the result that code +compiled with -Werror chokes on the deprecation warnings because +it was not including sysmacros.h. + +In addition to fixing autoconf (which only benefits projects +that rebuild configure after this fix is released), we can also +give a hint to distros on how they can populate config.site with +a cache variable to force pre-existing configure scripts without +the updated macro to behave sanely in the presence of glibc 2.25 +(the documentation is especially useful since that cache variable +is no longer present in autoconf after this patch). + +Note that mingw lacks major/minor/makedev in any of its standard +headers; for that platform, the behavior of this macro is unchanged +(code using the recommended include formula will get a compile error +when trying to use major(), whether before or after this patch); but +for now, it is assumed that programs actually concerned with +creating devices are not worried about portability to mingw. If +desired, a later patch could tighten AC_HEADER_MAJOR to fail at +configure time if the macros are unavailable in any of the three +system headers, but that semantic change is not worth mixing into +this patch. + +* lib/autoconf/headers.m4 (AC_HEADER_MAJOR): Drop check for +major within sys/types.h; it interferes with the need to check +sysmacros.h first. +* doc/autoconf.texi (Particular Headers) <AC_HEADER_MAJOR>: Expand +details on usage, and on workarounds for non-updated projects. + +Signed-off-by: Eric Blake <eblake@redhat.com> +--- +Upstream-Status: Backport + + doc/autoconf.texi | 35 +++++++++++++++++++++++++++++++---- + lib/autoconf/headers.m4 | 30 ++++++++++++++---------------- + 2 files changed, 45 insertions(+), 20 deletions(-) + +Index: autoconf-2.69/doc/autoconf.texi +=================================================================== +--- autoconf-2.69.orig/doc/autoconf.texi ++++ autoconf-2.69/doc/autoconf.texi +@@ -15,7 +15,7 @@ + @c The ARG is an optional argument. To be used for macro arguments in + @c their documentation (@defmac). + @macro ovar{varname} +-@r{[}@var{\varname\}@r{]}@c ++@r{[}@var{\varname\}@r{]} + @end macro + + @c @dvar(ARG, DEFAULT) +@@ -23,7 +23,7 @@ + @c The ARG is an optional argument, defaulting to DEFAULT. To be used + @c for macro arguments in their documentation (@defmac). + @macro dvar{varname, default} +-@r{[}@var{\varname\} = @samp{\default\}@r{]}@c ++@r{[}@var{\varname\} = @samp{\default\}@r{]} + @end macro + + @c Handling the indexes with Texinfo yields several different problems. +@@ -5926,10 +5926,37 @@ Also see @code{AC_STRUCT_DIRENT_D_INO} a + @cvindex MAJOR_IN_SYSMACROS + @hdrindex{sys/mkdev.h} + @hdrindex{sys/sysmacros.h} +-If @file{sys/types.h} does not define @code{major}, @code{minor}, and +-@code{makedev}, but @file{sys/mkdev.h} does, define +-@code{MAJOR_IN_MKDEV}; otherwise, if @file{sys/sysmacros.h} does, define +-@code{MAJOR_IN_SYSMACROS}. ++Detect the headers required to use @code{makedev}, @code{major}, and ++@code{minor}. These functions may be defined by @file{sys/mkdev.h}, ++@code{sys/sysmacros.h}, or @file{sys/types.h}. ++ ++@code{AC_HEADER_MAJOR} defines @code{MAJOR_IN_MKDEV} if they are in ++@file{sys/mkdev.h}, or @code{MAJOR_IN_SYSMACROS} if they are in ++@file{sys/sysmacros.h}. If neither macro is defined, they are either in ++@file{sys/types.h} or unavailable. ++ ++To properly use these functions, your code should contain something ++like: ++ ++@verbatim ++#include <sys/types.h> ++#ifdef MAJOR_IN_MKDEV ++# include <sys/mkdev.h> ++#elif defined MAJOR_IN_SYSMACROS ++# include <sys/sysmacros.h> ++#endif ++@end verbatim ++ ++Note: Configure scripts built with Autoconf 2.69 or earlier will not ++detect a problem if @file{sys/types.h} contains definitions of ++@code{major}, @code{minor}, and/or @code{makedev} that trigger compiler ++warnings upon use. This is known to occur with GNU libc 2.25, where ++those definitions are being deprecated to reduce namespace pollution. ++If it is not practical to use Autoconf 2.70 to regenerate the configure ++script of affected software, you can work around the problem by setting ++@samp{ac_cv_header_sys_types_h_makedev=no}, as an argument to ++@command{configure} or as part of a @file{config.site} site default file ++(@pxref{Site Defaults}). + @end defmac + + @defmac AC_HEADER_RESOLV +Index: autoconf-2.69/lib/autoconf/headers.m4 +=================================================================== +--- autoconf-2.69.orig/lib/autoconf/headers.m4 ++++ autoconf-2.69/lib/autoconf/headers.m4 +@@ -502,31 +502,29 @@ fi + + # AC_HEADER_MAJOR + # --------------- ++# Thanks to glibc 2.25 deprecating macros in sys/types.h, coupled with ++# back-compat to autoconf 2.69, we need the following logic: ++# Check whether <sys/types.h> compiles. ++# If <sys/mkdev.h> compiles, assume it provides major/minor/makedev. ++# Otherwise, if <sys/sysmacros.h> compiles, assume it provides the macros. ++# Otherwise, either the macros were provided by <sys/types.h>, or do ++# not exist on the platform. Code trying to use these three macros is ++# assumed to not care about platforms that lack the macros. + AN_FUNCTION([major], [AC_HEADER_MAJOR]) + AN_FUNCTION([makedev], [AC_HEADER_MAJOR]) + AN_FUNCTION([minor], [AC_HEADER_MAJOR]) + AN_HEADER([sys/mkdev.h], [AC_HEADER_MAJOR]) + AC_DEFUN([AC_HEADER_MAJOR], +-[AC_CACHE_CHECK(whether sys/types.h defines makedev, +- ac_cv_header_sys_types_h_makedev, +-[AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include <sys/types.h>]], +- [[return makedev(0, 0);]])], +- [ac_cv_header_sys_types_h_makedev=yes], +- [ac_cv_header_sys_types_h_makedev=no]) +-]) +- +-if test $ac_cv_header_sys_types_h_makedev = no; then ++[AC_CHECK_HEADERS_ONCE([sys/types.h]) + AC_CHECK_HEADER(sys/mkdev.h, + [AC_DEFINE(MAJOR_IN_MKDEV, 1, + [Define to 1 if `major', `minor', and `makedev' are + declared in <mkdev.h>.])]) +- +- if test $ac_cv_header_sys_mkdev_h = no; then +- AC_CHECK_HEADER(sys/sysmacros.h, +- [AC_DEFINE(MAJOR_IN_SYSMACROS, 1, +- [Define to 1 if `major', `minor', and `makedev' +- are declared in <sysmacros.h>.])]) +- fi ++if test $ac_cv_header_sys_mkdev_h = no; then ++ AC_CHECK_HEADER(sys/sysmacros.h, ++ [AC_DEFINE(MAJOR_IN_SYSMACROS, 1, ++ [Define to 1 if `major', `minor', and `makedev' ++ are declared in <sysmacros.h>.])]) + fi + ])# AC_HEADER_MAJOR + diff --git a/meta/recipes-devtools/autoconf/autoconf/add_musl_config.patch b/meta/recipes-devtools/autoconf/autoconf/add_musl_config.patch new file mode 100644 index 0000000000..a9094d2128 --- /dev/null +++ b/meta/recipes-devtools/autoconf/autoconf/add_musl_config.patch @@ -0,0 +1,26 @@ +backport http://git.savannah.gnu.org/cgit/config.git/commit/config.sub?id=062587eaa891396c936555ae51f7e77eeb71a5fe + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Upstream-Status: Backport +Index: autoconf-2.69/build-aux/config.sub +=================================================================== +--- autoconf-2.69.orig/build-aux/config.sub ++++ autoconf-2.69/build-aux/config.sub +@@ -123,7 +123,7 @@ esac + maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` + case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ +- linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ ++ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) +@@ -1360,7 +1360,7 @@ case $os in + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-android* \ +- | -linux-newlib* | -linux-uclibc* \ ++ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ 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 @@ +From 236552ff5b9f1ebf666d8d0e9850007dcce03d26 Mon Sep 17 00:00:00 2001 +From: Serhii Popovych <spopovyc@cisco.com> +Date: Wed, 10 Feb 2016 16:32:44 +0000 +Subject: [PATCH] perl: Replace -w option in shebangs with modern "use + warnings" + +In some builds we might provide ac_cv_path_PERL as /usr/bin/env perl +to use newer version of the perl from users PATH rather than +older from standard system path. + +However using /usr/bin/env perl -w from shebang line isn't +possible because it translates to something like +/usr/bin/env -w perl and env complains about illegal option. + +To address this we can remove -w option from perl shebang +line and add "use warnings" statement. + +Upstream-Status: Pending +Signed-off-by: Serhii Popovych <spopovyc@cisco.com> +--- + bin/autom4te.in | 3 ++- + bin/autoreconf.in | 3 ++- + bin/autoscan.in | 3 ++- + bin/autoupdate.in | 3 ++- + bin/ifnames.in | 3 ++- + 5 files changed, 10 insertions(+), 5 deletions(-) + +diff --git a/bin/autom4te.in b/bin/autom4te.in +index 11773c9..a8f5e41 100644 +--- a/bin/autom4te.in ++++ b/bin/autom4te.in +@@ -1,4 +1,4 @@ +-#! @PERL@ -w ++#! @PERL@ + # -*- perl -*- + # @configure_input@ + +@@ -42,6 +42,7 @@ use Autom4te::General; + use Autom4te::XFile; + use File::Basename; + use strict; ++use warnings; + + # Data directory. + my $pkgdatadir = $ENV{'AC_MACRODIR'} || '@pkgdatadir@'; +diff --git a/bin/autoreconf.in b/bin/autoreconf.in +index e245db4..1a318cb 100644 +--- a/bin/autoreconf.in ++++ b/bin/autoreconf.in +@@ -1,4 +1,4 @@ +-#! @PERL@ -w ++#! @PERL@ + # -*- perl -*- + # @configure_input@ + +@@ -45,6 +45,7 @@ use Autom4te::XFile; + # Do not use Cwd::chdir, since it might hang. + use Cwd 'cwd'; + use strict; ++use warnings; + + ## ----------- ## + ## Variables. ## +diff --git a/bin/autoscan.in b/bin/autoscan.in +index a67c48d..b931249 100644 +--- a/bin/autoscan.in ++++ b/bin/autoscan.in +@@ -1,4 +1,4 @@ +-#! @PERL@ -w ++#! @PERL@ + # -*- perl -*- + # @configure_input@ + +@@ -43,6 +43,7 @@ use Autom4te::XFile; + use File::Basename; + use File::Find; + use strict; ++use warnings; + + use vars qw(@cfiles @makefiles @shfiles @subdirs %printed); + +diff --git a/bin/autoupdate.in b/bin/autoupdate.in +index 9737d49..92cb147 100644 +--- a/bin/autoupdate.in ++++ b/bin/autoupdate.in +@@ -1,4 +1,4 @@ +-#! @PERL@ -w ++#! @PERL@ + # -*- perl -*- + # @configure_input@ + +@@ -44,6 +44,7 @@ use Autom4te::General; + use Autom4te::XFile; + use File::Basename; + use strict; ++use warnings; + + # Lib files. + my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@'; +diff --git a/bin/ifnames.in b/bin/ifnames.in +index ba2cd05..74b0278 100644 +--- a/bin/ifnames.in ++++ b/bin/ifnames.in +@@ -1,4 +1,4 @@ +-#! @PERL@ -w ++#! @PERL@ + # -*- perl -*- + # @configure_input@ + +@@ -44,6 +44,7 @@ BEGIN + use Autom4te::General; + use Autom4te::XFile; + use Autom4te::FileUtils; ++use warnings; + + # $HELP + # ----- +-- +2.3.0 + diff --git a/meta/recipes-devtools/autoconf/autoconf/autoreconf-include.patch b/meta/recipes-devtools/autoconf/autoconf/autoreconf-include.patch deleted file mode 100644 index 31326f0bc8..0000000000 --- a/meta/recipes-devtools/autoconf/autoconf/autoreconf-include.patch +++ /dev/null @@ -1,14 +0,0 @@ -Upstream-Status: Pending - -Index: autoconf-2.63/bin/autoreconf.in -=================================================================== ---- autoconf-2.63.orig/bin/autoreconf.in 2008-08-28 03:08:10.000000000 +0100 -+++ autoconf-2.63/bin/autoreconf.in 2008-12-31 17:38:40.000000000 +0000 -@@ -190,6 +190,7 @@ - $autoconf .= join (' --prepend-include=', '', map { shell_quote ($_) } @prepend_include); - $autoheader .= join (' --include=', '', map { shell_quote ($_) } @include); - $autoheader .= join (' --prepend-include=', '', map { shell_quote ($_) } @prepend_include); -+ $aclocal .= join (' -I ', '', map { shell_quote ($_) } @include); - - # --install and --symlink; - if ($install) diff --git a/meta/recipes-devtools/autoconf/autoconf/performance.patch b/meta/recipes-devtools/autoconf/autoconf/performance.patch new file mode 100644 index 0000000000..1842fe92b7 --- /dev/null +++ b/meta/recipes-devtools/autoconf/autoconf/performance.patch @@ -0,0 +1,60 @@ +The check for solaris 'print' causes significant problems on a linux machine +with dash as /bin/sh since it triggers the execution of "print" which on some +linux systems is a perl script which is part of mailcap. Worse, this perl +script calls "which file" and if successful ignores the path file was found +in and just runs "file" without a path. Each exection causes PATH to be searched. + +Simply assuming the shell's printf function works cuts out all the fork overhead +and when parallel tasks are running, this overhead appears to be significant. + +RP +2015/11/28 +Upstream-Status: Inappropriate + +Index: autoconf-2.69/lib/m4sugar/m4sh.m4 +=================================================================== +--- autoconf-2.69.orig/lib/m4sugar/m4sh.m4 ++++ autoconf-2.69/lib/m4sugar/m4sh.m4 +@@ -1045,40 +1045,8 @@ m4_defun([_AS_ECHO_PREPARE], + [[as_nl=' + ' + export as_nl +-# Printing a long string crashes Solaris 7 /usr/bin/printf. +-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +-# Prefer a ksh shell builtin over an external printf program on Solaris, +-# but without wasting forks for bash or zsh. +-if test -z "$BASH_VERSION$ZSH_VERSION" \ +- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then +- as_echo='print -r --' +- as_echo_n='print -rn --' +-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +- as_echo='printf %s\n' +- as_echo_n='printf %s' +-else +- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then +- as_echo_body='eval /usr/ucb/echo -n "$][1$as_nl"' +- as_echo_n='/usr/ucb/echo -n' +- else +- as_echo_body='eval expr "X$][1" : "X\\(.*\\)"' +- as_echo_n_body='eval +- arg=$][1; +- case $arg in @%:@( +- *"$as_nl"*) +- expr "X$arg" : "X\\(.*\\)$as_nl"; +- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; +- esac; +- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" +- ' +- export as_echo_n_body +- as_echo_n='sh -c $as_echo_n_body as_echo' +- fi +- export as_echo_body +- as_echo='sh -c $as_echo_body as_echo' +-fi ++as_echo='printf %s\n' ++as_echo_n='printf %s' + ]])# _AS_ECHO_PREPARE + + diff --git a/meta/recipes-devtools/autoconf/autoconf_2.69.bb b/meta/recipes-devtools/autoconf/autoconf_2.69.bb index 809007f35d..8e67f4b829 100644 --- a/meta/recipes-devtools/autoconf/autoconf_2.69.bb +++ b/meta/recipes-devtools/autoconf/autoconf_2.69.bb @@ -5,14 +5,17 @@ PR = "r11" LICENSE = "GPLv2 & GPLv3" LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \ file://COPYINGv3;md5=d32239bcb673463ab874e80d47fae504" -SRC_URI += "file://autoreconf-include.patch \ - file://check-automake-cross-warning.patch \ +SRC_URI += "file://check-automake-cross-warning.patch \ file://autoreconf-exclude.patch \ file://autoreconf-gnuconfigize.patch \ file://config_site.patch \ file://remove-usr-local-lib-from-m4.patch \ file://preferbash.patch \ file://autotest-automake-result-format.patch \ + file://add_musl_config.patch \ + file://performance.patch \ + file://AC_HEADER_MAJOR-port-to-glibc-2.25.patch \ + file://autoconf-replace-w-option-in-shebangs-with-modern-use-warnings.patch \ " SRC_URI[md5sum] = "82d05e03b93e45f5a39b828dc9c6c29b" |
