Richard W.M. Jones
2017-Mar-01 12:18 UTC
[Libguestfs] [PATCH supermin 0/2] Use AC_HEADER_MAJOR to find definitions of major, minor, makedev.
Quite a complex fix in the end, see the comment in the second commit. Rich.
Richard W.M. Jones
2017-Mar-01 12:18 UTC
[Libguestfs] [PATCH supermin 1/2] Update gnulib to latest.
--- .gitignore | 1 + .gnulib | 2 +- lib/.gitignore | 12 +++++++++--- m4/.gitignore | 23 ++++++++++++++--------- m4/gnulib-cache.m4 | 4 ++-- 5 files changed, 27 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 288950e..0983349 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ Makefile.in pod2htm?.tmp /aclocal.m4 +/ar-lib /arg-nonnull.h /autom4te.cache /c++defs.h diff --git a/.gnulib b/.gnulib index a10acfb..a59926b 160000 --- a/.gnulib +++ b/.gnulib @@ -1 +1 @@ -Subproject commit a10acfb1d2118f9a180181d3fed5399dbbe1df3c +Subproject commit a59926b805d7708b2ecc5fdcd7743810e963e859 diff --git a/lib/.gitignore b/lib/.gitignore index 7d1ca72..2ea81a0 100644 --- a/lib/.gitignore +++ b/lib/.gitignore @@ -1,8 +1,14 @@ + + +/assure.h /*.c +/flexmember.h +/getprogname.c +/getprogname.h /*.h /*.h.in -/*.valgrind - +/limits.in.h /Makefile.am - +/stdalign.in.h /sys +/*.valgrind diff --git a/m4/.gitignore b/m4/.gitignore index 549b679..55e07cc 100644 --- a/m4/.gitignore +++ b/m4/.gitignore @@ -1,40 +1,43 @@ /00gnulib.m4 /absolute-header.m4 /chdir-long.m4 -/close.m4 /closedir.m4 +/close.m4 /cycle-check.m4 /d-ino.m4 -/d-type.m4 -/dirent-safer.m4 /dirent_h.m4 +/dirent-safer.m4 /dirfd.m4 /dirname.m4 /double-slash-root.m4 -/dup.m4 +/d-type.m4 /dup2.m4 +/dup.m4 /errno_h.m4 /error.m4 /extensions.m4 /extern-inline.m4 /fchdir.m4 +/fcntl_h.m4 +/fcntl.m4 /fcntl-o.m4 /fcntl-safer.m4 -/fcntl.m4 -/fcntl_h.m4 /fdopendir.m4 /filenamecat.m4 +/flexmember.m4 /fstat.m4 /fts.m4 /getcwd.m4 /getdtablesize.m4 +/getprogname.m4 /gettimeofday.m4 /gnulib-common.m4 /gnulib-comp.m4 /gnulib-tool.m4 -/i-ring.m4 /include_next.m4 +/i-ring.m4 /largefile.m4 +/limits-h.m4 /longlong.m4 /lstat.m4 /malloc.m4 @@ -48,15 +51,16 @@ /multiarch.m4 /off_t.m4 /onceonly.m4 -/open.m4 /openat.m4 /opendir.m4 +/open.m4 /pathmax.m4 /readdir.m4 /realloc.m4 /save-cwd.m4 /ssize_t.m4 /stat.m4 +/stdalign.m4 /stdbool.m4 /stddef_h.m4 /stdint.m4 @@ -70,7 +74,8 @@ /sys_time_h.m4 /sys_types_h.m4 /time_h.m4 -/unistd-safer.m4 /unistd_h.m4 +/unistd-safer.m4 /warn-on-use.m4 /wchar_t.m4 +/wint_t.m4 diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4 index 61de60f..2abd246 100644 --- a/m4/gnulib-cache.m4 +++ b/m4/gnulib-cache.m4 @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# Copyright (C) 2002-2017 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -27,7 +27,7 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --no-conditional-dependencies --no-libtool --macro-prefix=gl fts +# gnulib-tool --import --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --no-conditional-dependencies --no-libtool --macro-prefix=gl fts sys_types # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([]) -- 2.9.3
Richard W.M. Jones
2017-Mar-01 12:18 UTC
[Libguestfs] [PATCH supermin 2/2] Use AC_HEADER_MAJOR to find definitions of major, minor, makedev.
Note this requires either the following fix in autoconf: http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=e17a30e98 OR gnulib sys_types module plus gnulib commit a512e041120e9012e69afa2f5c3adc196ec4999a (any gnulib more recent than Sep 2016) which corrects the AC_HEADER_MAJOR macro in a similar way. --- configure.ac | 3 +++ init/init.c | 6 ++++++ m4/gnulib-cache.m4 | 1 + src/ext2fs-c.c | 6 ++++++ 4 files changed, 16 insertions(+) diff --git a/configure.ac b/configure.ac index 72ffb92..24c0dcd 100644 --- a/configure.ac +++ b/configure.ac @@ -42,6 +42,9 @@ AC_SYS_LARGEFILE dnl Enable GNU stuff. AC_USE_SYSTEM_EXTENSIONS +dnl Which header file defines major, minor, makedev. +AC_HEADER_MAJOR + dnl Define the host CPU architecture (defines host_cpu). AC_CANONICAL_HOST diff --git a/init/init.c b/init/init.c index ef74332..e6fd0e6 100644 --- a/init/init.c +++ b/init/init.c @@ -40,7 +40,13 @@ #include <sys/mount.h> #include <sys/stat.h> #include <sys/wait.h> + +#if MAJOR_IN_MKDEV +#include <sys/mkdev.h> +#elif MAJOR_IN_SYSMACROS #include <sys/sysmacros.h> +/* else it's in sys/types.h, included above */ +#endif /* Maximum time to wait for the root device to appear (seconds). * diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4 index 2abd246..9a0a802 100644 --- a/m4/gnulib-cache.m4 +++ b/m4/gnulib-cache.m4 @@ -33,6 +33,7 @@ gl_LOCAL_DIR([]) gl_MODULES([ fts + sys_types ]) gl_AVOID([]) gl_SOURCE_BASE([lib]) diff --git a/src/ext2fs-c.c b/src/ext2fs-c.c index 733c901..2743da7 100644 --- a/src/ext2fs-c.c +++ b/src/ext2fs-c.c @@ -32,7 +32,13 @@ #include <errno.h> #include <assert.h> #include <inttypes.h> + +#if MAJOR_IN_MKDEV +#include <sys/mkdev.h> +#elif MAJOR_IN_SYSMACROS #include <sys/sysmacros.h> +/* else it's in sys/types.h, included above */ +#endif /* Inlining is broken in the ext2fs header file. Disable it by * defining the following: -- 2.9.3
Pino Toscano
2017-Mar-03 14:39 UTC
[Libguestfs] [PATCH supermin 0/2] Use AC_HEADER_MAJOR to find definitions of major, minor, makedev.
On Wednesday, 1 March 2017 13:18:56 CET Richard W.M. Jones wrote:> Quite a complex fix in the end, see the comment in the second commit.LGTM. Thanks, -- Pino Toscano -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: This is a digitally signed message part. URL: <http://listman.redhat.com/archives/libguestfs/attachments/20170303/7bc55bf0/attachment.sig>
Apparently Analagous Threads
- [PATCH libguestfs] Use AC_HEADER_MAJOR to find definitions of major, minor, makedev.
- Re: [PATCH libguestfs] Use AC_HEADER_MAJOR to find definitions of major, minor, makedev.
- [PATCH] build: remove unused gnulib modules
- [PATCH v2 0/5] remove unused gnulib modules
- [PATCH v2 0/2] builder: Choose better weights in the planner.