]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
build: add support for libinih for mkfs
authorDave Chinner <dchinner@redhat.com>
Fri, 20 Nov 2020 22:03:29 +0000 (17:03 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Fri, 20 Nov 2020 22:03:29 +0000 (17:03 -0500)
Need to make sure the library is present so we can build mkfs with
config file support.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
configure.ac
doc/INSTALL
include/builddefs.in
m4/package_inih.m4 [new file with mode: 0644]

index c70784be2f9a13a4e3b876e078662f2034eb11e5..645e45723c21a1816647fed69d1aeba5fb5a6a6e 100644 (file)
@@ -145,6 +145,9 @@ AC_PACKAGE_UTILITIES(xfsprogs)
 AC_MULTILIB($enable_lib64)
 AC_RT($enable_librt)
 
+AC_PACKAGE_NEED_INI_H
+AC_PACKAGE_NEED_LIBINIH
+
 AC_PACKAGE_NEED_UUID_H
 AC_PACKAGE_NEED_UUIDCOMPARE
 
index d4395eefa834ba299f642343d5d2dacdc326ce24..2b04f9cfe10815bca391f3b3392985822a1d0687 100644 (file)
@@ -28,6 +28,11 @@ Linux Instructions
    (on an RPM based system) or the uuid-dev package (on a Debian system)
    as some of the commands make use of the UUID library provided by these.
 
+   If your distro does not provide a libinih package, you can download and build
+   it from source from the upstream repository found at:
+
+       https://github.com/benhoyt/inih
+
    To build the package and install it manually, use the following steps:
 
        # make
index 30b2727a8db403f2aa287c942fd6f9ede2ac6c9e..e8f447f92baf3b8d510e5eca198b816617a5cfa1 100644 (file)
@@ -27,6 +27,7 @@ LIBTERMCAP = @libtermcap@
 LIBEDITLINE = @libeditline@
 LIBBLKID = @libblkid@
 LIBDEVMAPPER = @libdevmapper@
+LIBINIH = @libinih@
 LIBXFS = $(TOPDIR)/libxfs/libxfs.la
 LIBFROG = $(TOPDIR)/libfrog/libfrog.la
 LIBXCMD = $(TOPDIR)/libxcmd/libxcmd.la
diff --git a/m4/package_inih.m4 b/m4/package_inih.m4
new file mode 100644 (file)
index 0000000..a277559
--- /dev/null
@@ -0,0 +1,20 @@
+AC_DEFUN([AC_PACKAGE_NEED_INI_H],
+  [ AC_CHECK_HEADERS([ini.h])
+    if test $ac_cv_header_ini_h = no; then
+       echo
+       echo 'FATAL ERROR: could not find a valid ini.h header.'
+       echo 'Install the libinih development package.'
+       exit 1
+    fi
+  ])
+
+AC_DEFUN([AC_PACKAGE_NEED_LIBINIH],
+  [ AC_CHECK_LIB(inih, ini_parse,, [
+       echo
+       echo 'FATAL ERROR: could not find a valid inih library.'
+       echo 'Install the libinih library package.'
+       exit 1
+    ])
+    libinih=-linih
+    AC_SUBST(libinih)
+  ])