diff --git a/ac-header-major.patch b/ac-header-major.patch new file mode 100644 index 0000000..61538e2 --- /dev/null +++ b/ac-header-major.patch @@ -0,0 +1,145 @@ +From e17a30e987d7ee695fb4294a82d987ec3dc9b974 Mon Sep 17 00:00:00 2001 +From: Eric Blake +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 +injecting major(), minor(), and makedev() into the compilation +environment, with a warning that insists that users include + 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) : Expand +details on usage, and on workarounds for non-updated projects. + +Signed-off-by: Eric Blake +--- + doc/autoconf.texi | 35 +++++++++++++++++++++++++++++++---- + lib/autoconf/headers.m4 | 30 ++++++++++++++---------------- + 2 files changed, 45 insertions(+), 20 deletions(-) + +diff --git a/doc/autoconf.texi b/doc/autoconf.texi +index 9ad7dc1c5f..4f041bd4ed 100644 +--- a/doc/autoconf.texi ++++ b/doc/autoconf.texi +@@ -5970,10 +5970,37 @@ Particular Headers + @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 ++#ifdef MAJOR_IN_MKDEV ++# include ++#elif defined MAJOR_IN_SYSMACROS ++# include ++#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 +diff --git a/lib/autoconf/headers.m4 b/lib/autoconf/headers.m4 +index 0c44973b0c..72262c1eb1 100644 +--- a/lib/autoconf/headers.m4 ++++ b/lib/autoconf/headers.m4 +@@ -427,31 +427,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 compiles. ++# If compiles, assume it provides major/minor/makedev. ++# Otherwise, if compiles, assume it provides the macros. ++# Otherwise, either the macros were provided by , 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 ]], +- [[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 .])]) +- +- 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 .])]) +- 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 .])]) + fi + ])# AC_HEADER_MAJOR + +-- +2.18.0 + diff --git a/autoconf-el.changes b/autoconf-el.changes index aa33b87..d3b17d6 100644 --- a/autoconf-el.changes +++ b/autoconf-el.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Aug 6 09:59:34 UTC 2018 - schwab@suse.de + +- ac-header-major.patch: port AC_HEADER_MAJOR to glibc 2.25 +- Use %license for COPYING + ------------------------------------------------------------------- Wed Mar 15 12:29:24 UTC 2017 - dimstar@opensuse.org diff --git a/autoconf-el.spec b/autoconf-el.spec index 62ad2d0..7d868d0 100644 --- a/autoconf-el.spec +++ b/autoconf-el.spec @@ -1,7 +1,7 @@ # # spec file for package autoconf-el # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -23,7 +23,7 @@ BuildRequires: xz Version: 2.69 Release: 0 Summary: Emacs mode for editing GNU Autoconf scripts -License: GPL-3.0+ +License: GPL-3.0-or-later Group: Productivity/Editors/Emacs Url: http://www.gnu.org/software/autoconf BuildRoot: %{_tmppath}/%{name}-%{version}-build diff --git a/autoconf-testsuite.changes b/autoconf-testsuite.changes index aa33b87..d3b17d6 100644 --- a/autoconf-testsuite.changes +++ b/autoconf-testsuite.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Aug 6 09:59:34 UTC 2018 - schwab@suse.de + +- ac-header-major.patch: port AC_HEADER_MAJOR to glibc 2.25 +- Use %license for COPYING + ------------------------------------------------------------------- Wed Mar 15 12:29:24 UTC 2017 - dimstar@opensuse.org diff --git a/autoconf-testsuite.spec b/autoconf-testsuite.spec index 2eb89a0..106bdf0 100644 --- a/autoconf-testsuite.spec +++ b/autoconf-testsuite.spec @@ -1,7 +1,7 @@ # # spec file for package autoconf-testsuite # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,7 +20,7 @@ Name: autoconf-testsuite Version: 2.69 Release: 0 Summary: A GNU Tool for Automatically Configuring Source Code -License: GPL-3.0+ +License: GPL-3.0-or-later Group: Development/Tools/Building Url: http://www.gnu.org/software/autoconf Source0: http://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.gz @@ -29,6 +29,8 @@ Source2: %{name}.keyring Patch0: autoreconf-ltdl.diff # PATCH-FIX-UPSTREAM autoconf-perl-5.17-fixes.patch dimstar@opensuse.org -- autoscan: port to perl 5.17 (with perl 5.22, it is now fatal). Patch1: autoconf-perl-5.17-fixes.patch +# PATCH-FIX-UPSTREAM AC_HEADER_MAJOR: port to glibc 2.25 +Patch2: ac-header-major.patch BuildRequires: help2man BuildRequires: m4 >= 1.4.6 Requires: info @@ -56,6 +58,7 @@ only required for the generation of the scripts, not their use. %setup -q -n autoconf-%{version} %patch0 %patch1 -p1 +%patch2 -p1 %build %configure @@ -84,7 +87,8 @@ rm -rf %{buildroot}%{_infodir}/dir %if "%{name}" == "autoconf" %files %defattr(-,root,root) -%doc AUTHORS COPYING NEWS README TODO +%doc AUTHORS NEWS README TODO +%license COPYING %{_bindir}/* %{_datadir}/autoconf %doc %{_infodir}/*.gz diff --git a/autoconf.changes b/autoconf.changes index aa33b87..d3b17d6 100644 --- a/autoconf.changes +++ b/autoconf.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Aug 6 09:59:34 UTC 2018 - schwab@suse.de + +- ac-header-major.patch: port AC_HEADER_MAJOR to glibc 2.25 +- Use %license for COPYING + ------------------------------------------------------------------- Wed Mar 15 12:29:24 UTC 2017 - dimstar@opensuse.org diff --git a/autoconf.spec b/autoconf.spec index 9149480..4323809 100644 --- a/autoconf.spec +++ b/autoconf.spec @@ -1,7 +1,7 @@ # # spec file for package autoconf # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,7 +20,7 @@ Name: autoconf Version: 2.69 Release: 0 Summary: A GNU Tool for Automatically Configuring Source Code -License: GPL-3.0+ +License: GPL-3.0-or-later Group: Development/Tools/Building Url: http://www.gnu.org/software/autoconf Source0: http://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.gz @@ -29,6 +29,8 @@ Source2: %{name}.keyring Patch0: autoreconf-ltdl.diff # PATCH-FIX-UPSTREAM autoconf-perl-5.17-fixes.patch dimstar@opensuse.org -- autoscan: port to perl 5.17 (with perl 5.22, it is now fatal). Patch1: autoconf-perl-5.17-fixes.patch +# PATCH-FIX-UPSTREAM AC_HEADER_MAJOR: port to glibc 2.25 +Patch2: ac-header-major.patch BuildRequires: help2man BuildRequires: m4 >= 1.4.6 Requires: info @@ -56,6 +58,7 @@ only required for the generation of the scripts, not their use. %setup -q -n autoconf-%{version} %patch0 %patch1 -p1 +%patch2 -p1 %build %configure @@ -84,7 +87,8 @@ rm -rf %{buildroot}%{_infodir}/dir %if "%{name}" == "autoconf" %files %defattr(-,root,root) -%doc AUTHORS COPYING NEWS README TODO +%doc AUTHORS NEWS README TODO +%license COPYING %{_bindir}/* %{_datadir}/autoconf %doc %{_infodir}/*.gz