diff mbox series

[1/3] build: add support for libinih for mkfs

Message ID 20200826015634.3974785-2-david@fromorbit.com
State Superseded
Headers show
Series mkfs: Configuration file defined options | expand

Commit Message

Dave Chinner Aug. 26, 2020, 1:56 a.m. UTC
From: Dave Chinner <dchinner@redhat.com>

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>
---
 configure.ac         |  3 +++
 include/builddefs.in |  1 +
 m4/package_inih.m4   | 20 ++++++++++++++++++++
 3 files changed, 24 insertions(+)
 create mode 100644 m4/package_inih.m4

Comments

Eric Sandeen Aug. 26, 2020, 9:51 p.m. UTC | #1
On 8/25/20 8:56 PM, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
> 
> Need to make sure the library is present so we can build mkfs with
> config file support.

Can you add https://github.com/benhoyt/inih to doc/INSTALL as a
dependency?

(that's probably pretty out of date now anyway but it seems worth
documenting any new requirement)

-Eric
Dave Chinner Aug. 26, 2020, 10:05 p.m. UTC | #2
On Wed, Aug 26, 2020 at 04:51:50PM -0500, Eric Sandeen wrote:
> On 8/25/20 8:56 PM, Dave Chinner wrote:
> > From: Dave Chinner <dchinner@redhat.com>
> > 
> > Need to make sure the library is present so we can build mkfs with
> > config file support.
> 
> Can you add https://github.com/benhoyt/inih to doc/INSTALL as a
> dependency?

Distros should be shipping that library, and configure asks you to
install it if it isn't present, just like it does for all the other
libraries xfsprogs depends on. We want users to install distro
libraries, not have to build dependencies from source and install
them...

> (that's probably pretty out of date now anyway but it seems worth
> documenting any new requirement)

Yeah, we need a lot more than just e2fsprogs-devel and UUIDs these
days. I'd prefer that doc/INSTALL just says "the configure script
will prompt you to install missing build dependencies" rather than
iterate them here and have the list be perpetually incomplete....

Cheers,

Dave.
diff mbox series

Patch

diff --git a/configure.ac b/configure.ac
index fe1584e7704b..c0c7badccbdf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
 
diff --git a/include/builddefs.in b/include/builddefs.in
index 30b2727a8db4..e8f447f92baf 100644
--- a/include/builddefs.in
+++ b/include/builddefs.in
@@ -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
index 000000000000..a2775592e09d
--- /dev/null
+++ b/m4/package_inih.m4
@@ -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)
+  ])