From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1arfe0-0005Hr-2P for mharc-grub-devel@gnu.org; Sun, 17 Apr 2016 01:53:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1arfdx-0005F1-PE for grub-devel@gnu.org; Sun, 17 Apr 2016 01:53:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1arfdu-00039x-Js for grub-devel@gnu.org; Sun, 17 Apr 2016 01:53:13 -0400 Received: from mail-lf0-x22a.google.com ([2a00:1450:4010:c07::22a]:34947) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1arfdu-00039o-6w for grub-devel@gnu.org; Sun, 17 Apr 2016 01:53:10 -0400 Received: by mail-lf0-x22a.google.com with SMTP id c126so185126805lfb.2 for ; Sat, 16 Apr 2016 22:53:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=wZ7Fs0OfCvG0FGEs9d54A6C+luXjHvGCSZPyH37Ahoc=; b=YGnEaGYKtLgSqQ6LCRdQp83p38NQ6uhbhK6YDPWtk5PcjgNfg9xjRScpF9en5iA+EG LmJBHlatYOnsjFPekkfJbtRDnXwpGMgA3oKeVCxvevXiJxtOHTgtg6mhnPXwAtHputTF zAgTlvyvzTfhGlmxWWa++pvlaCoTlUdwO5i3AMxxnAsNu31gNvza7EgtVwaDsMi0GLT9 MAscnvtw8BETblkyHD4ye7xSa8AfF+nrql/bdbuRjbZwhACBtNkIEsn8/Yx9oFzVKoKO qf3yrmA9kxBIE1Ry1ex2kGp6FPzIIS/EDD0Xw7Lcbbw6SubimzEXQUv2A7gtb1rSLeXI a4PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=wZ7Fs0OfCvG0FGEs9d54A6C+luXjHvGCSZPyH37Ahoc=; b=N8kXS44oBqVf8+egGNRBia/CulFUTSDoBajd2g6PQ3fiGpAQTpH9X5cJ1MHsaqokFX IoFI1d22HqKzZXVd8hCsFDcQ2djkhpWC+XBl0Eel8vSp5eMF65eEKKJwxYdXNr84qR10 sWpIDH7DvdWzrXPryRyX/w7f2BJEaWvz6510wCrZ2BxHtd6/cMrxi70163fIGXgTeUZZ cRp+9lK4zm75guAJb46GSIQHfYaH0DamaeTw3x5m+XQSIhCQajtVfBL7mWkqgSr3jjWO 0wQKwBYmea8xZ3nPKo/qeCrOws/s5CwvoT9vJo4mnOzSnJRX5qves4ldHjjZP/5yuKZO F3hQ== X-Gm-Message-State: AOPr4FXyLff91IHkP3sYR0PQ7lN68CZn3uZj9IweaPfT4lIf+BB8UyLv5WFSjucRm+u6QA== X-Received: by 10.25.82.203 with SMTP id g194mr12849761lfb.1.1460872389279; Sat, 16 Apr 2016 22:53:09 -0700 (PDT) Received: from [192.168.1.42] (ppp109-252-90-50.pppoe.spdop.ru. [109.252.90.50]) by smtp.gmail.com with ESMTPSA id d74sm8995152lfb.49.2016.04.16.22.53.07 for (version=TLSv1/SSLv3 cipher=OTHER); Sat, 16 Apr 2016 22:53:08 -0700 (PDT) Subject: Re: [PATCH] build: Use AC_HEADER_MAJOR to find device macros To: grub-devel@gnu.org References: <1460842498-23914-1-git-send-email-floppym@gentoo.org> From: Andrei Borzenkov X-Enigmail-Draft-Status: N1110 Message-ID: <571324C3.7080605@gmail.com> Date: Sun, 17 Apr 2016 08:53:07 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1460842498-23914-1-git-send-email-floppym@gentoo.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::22a X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 05:53:15 -0000 17.04.2016 00:34, Mike Gilbert пишет: > Depending on the OS/libc, device macros may be found in 3 places: > Mentioning OS and libc versions that have problem would be helpful. > sys/types.h > sys/mkdev.h > sys/sysmacros.h > > glibc currenctly defines the major/minor/makedev macros in sys/sysmacros.h > and includes this from sys/types.h. Based on mailing list discussion, > this may be removed from sys/types.h in a future glibc release. > --- > configure.ac | 3 ++- > grub-core/osdep/devmapper/getroot.c | 6 ++++++ > grub-core/osdep/devmapper/hostdisk.c | 5 +++++ > grub-core/osdep/linux/getroot.c | 6 ++++++ All those files are linux only. Do you mean there are some linux flavors that have these definitions in non-standard place? Could you name them? > grub-core/osdep/unix/getroot.c | 4 +++- > 5 files changed, 22 insertions(+), 2 deletions(-) > > diff --git a/configure.ac b/configure.ac > index 57e1713..9ddfc53 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -388,7 +388,8 @@ fi > > # Check for functions and headers. > AC_CHECK_FUNCS(posix_memalign memalign getextmntent) > -AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h sys/mkdev.h limits.h) > +AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h limits.h) > +AC_HEADER_MAJOR > > AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$ac_includes_default > #include > diff --git a/grub-core/osdep/devmapper/getroot.c b/grub-core/osdep/devmapper/getroot.c > index 05eda50..72e5582 100644 > --- a/grub-core/osdep/devmapper/getroot.c > +++ b/grub-core/osdep/devmapper/getroot.c > @@ -40,6 +40,12 @@ > #include > #endif > > +#if defined(MAJOR_IN_MKDEV) > +#include > +#elif defined(MAJOR_IN_SYSMACROS) > +#include > +#endif > + > #include > > #include > diff --git a/grub-core/osdep/devmapper/hostdisk.c b/grub-core/osdep/devmapper/hostdisk.c > index 19c1101..a697bcb 100644 > --- a/grub-core/osdep/devmapper/hostdisk.c > +++ b/grub-core/osdep/devmapper/hostdisk.c > @@ -24,6 +24,11 @@ > #include > #include > > +#if defined(MAJOR_IN_MKDEV) > +#include > +#elif defined(MAJOR_IN_SYSMACROS) > +#include > +#endif > > #ifdef HAVE_DEVICE_MAPPER > # include > diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c > index 10480b6..09e7e6e 100644 > --- a/grub-core/osdep/linux/getroot.c > +++ b/grub-core/osdep/linux/getroot.c > @@ -35,6 +35,12 @@ > #include > #endif > > +#if defined(MAJOR_IN_MKDEV) > +#include > +#elif defined(MAJOR_IN_SYSMACROS) > +#include > +#endif > + > #include > #include /* ioctl */ > #include > diff --git a/grub-core/osdep/unix/getroot.c b/grub-core/osdep/unix/getroot.c > index 1079a91..4bf37b0 100644 > --- a/grub-core/osdep/unix/getroot.c > +++ b/grub-core/osdep/unix/getroot.c > @@ -51,8 +51,10 @@ > #endif > > #include > -#if defined(HAVE_SYS_MKDEV_H) > +#if defined(MAJOR_IN_MKDEV) > #include > +#elif defined(MAJOR_IN_SYSMACROS) > +#include > #endif > The names are really misleading. All that this macro checks for is whether these headers are present, so it is entirely equivalent to AC_CHECK_HEADERS([sys/mkdev.h sys/sysmacros.h]). Which returns us to the question which systems have sys/sysmacros.h :) > #if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR) >