Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

Commit 727000c

Browse files
authored
PR #1845: rm pkg-config dependency at autogen.sh time
1 parent b7fe352 commit 727000c

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

configure.ac

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,6 @@ MKDIR_P=${MKDIR_P:-install -d -m 0755}
6363

6464
AM_INIT_AUTOMAKE([1.13 -Wall -Werror foreign subdir-objects])
6565

66-
# Check for “pkg-config”. It’s here because we use PKG_CHECK_MODULES
67-
# conditionally later and we want to make sure this always happens [1, §3.4].
68-
#
69-
# [1]: https://autotools.info/pkgconfig/pkg_check_modules.html
70-
PKG_PROG_PKG_CONFIG
71-
7266
AC_CONFIG_HEADERS([bin/config.h])
7367
AC_CONFIG_FILES([Makefile
7468
bin/Makefile
@@ -491,17 +485,22 @@ have_libfuse3=n/a
491485
have_libsquashfuse_ll=n/a
492486
have_ll_h=n/a
493487
AS_IF([test $want_libsquashfuse = yes], [
494-
# libfuse3. Must use pkg-config because as of version 0.5.0 SquashFUSE’s
495-
# ll.h won’t build without an appropriate -I [1]. This macro defines some
496-
# variables that we use here; see this third-party documentation [2]. (I
497-
# could not find first-party docs for it.)
488+
# libfuse3. As of version 0.5.0, SquashFUSE’s ll.h won’t build without an
489+
# appropriate -I [1]. Presently we use pkg-config to find it, but see #1844.
490+
#
491+
# We avoid PKG_CHECK_MODULES because it introduces a dependency on
492+
# pkg-config at autogen.sh time, with impressively incomprehensible error
493+
# messages if it’s not met [2]. The approach below also seems simpler [3]?
498494
#
499495
# [1]: https://github.com/vasi/squashfuse/commit/eca5764
500-
# [2]: https://autotools.info/pkgconfig/pkg_check_modules.html
501-
PKG_CHECK_MODULES([fuse3], [fuse3], [
502-
# libfuse3 found
496+
# [2]: https://ae1020.github.io/undefined-macro-pkg-config/
497+
# [3]: https://tirania.org/blog/archive/2012/Oct-20.html
498+
AC_CHECK_PROG(have_pkg_config, pkg-config, yes, no)
499+
AS_IF([test $have_pkg_config != yes],
500+
[AC_MSG_ERROR([need pkg-config to find libfuse3; try --with-libsquashfuse=no or see issue @%:@1844])])
501+
AS_IF([pkg-config --exists fuse3], [
503502
have_libfuse3=yes
504-
CFLAGS="$CFLAGS $fuse3_CFLAGS"
503+
CFLAGS="$CFLAGS $(pkg-config --cflags fuse3)"
505504
# libsquashfuse?
506505
AC_CHECK_LIB([squashfuse_ll], [sqfs_ll_mount],
507506
[have_libsquashfuse_ll=yes],

0 commit comments

Comments
 (0)