build: rename bookmarkfs.pc -> bookmarkfs_util.pc

Also update configure_ext.m4 to support EX_DEP() with underscores
in package name.
This commit is contained in:
CismonX 2025-04-01 12:49:21 +08:00
parent 906769f1f7
commit 81db7a786c
No known key found for this signature in database
GPG key ID: 3094873E29A482FB
5 changed files with 13 additions and 15 deletions

View file

@ -160,7 +160,7 @@ Notes
### Linking to an Existing BookmarkFS Utility Library
If a BookmarkFS utility library is already installed, it can be
specified with `--with-bookmarkfs[=<pkgconfdir>]` during configuration,
specified with `--with-bookmarkfs-util[=<pkgconfdir>]` during configuration,
in the same way as with other dependencies.
In this case, the utility library will not be built from source,

View file

@ -9,4 +9,4 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = doc src tests
pkgconfig_DATA = bookmarkfs.pc
pkgconfig_DATA = bookmarkfs_util.pc

View file

@ -14,8 +14,8 @@ exec_prefix=@exec_prefix@
includedir=@includedir@
libdir=@libdir@
Name: ${package}
Description: BookmarkFS
Name: ${package}_util
Description: BookmarkFS Utility Library
Version: ${version}
URL: https://www.nongnu.org/bookmarkfs/
Cflags: -I${includedir}

View file

@ -9,7 +9,7 @@ dnl
AC_PREREQ([2.70])
AC_INIT([bookmarkfs], [0.1.0], [bug-bookmarkfs@nongnu.org])
AC_CONFIG_SRCDIR([bookmarkfs.pc.in])
AC_CONFIG_SRCDIR([bookmarkfs_util.pc.in])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_TESTDIR([tests])
@ -120,7 +120,7 @@ EX_FEAT([fsck-handler-tcl], [no], [Tcl-based fsck handler])
AX_PTHREAD
EX_DEP([bookmarkfs], [>= 0.1], [BookmarkFS utility library], [
EX_DEP([bookmarkfs_util], [>= 0.1], [BookmarkFS utility library], [
AS_VAR_SET([enable_bookmarkfs_util], [no])
])
@ -219,6 +219,6 @@ AC_CONFIG_FILES([
doc/Makefile
src/Makefile
tests/Makefile tests/atlocal
bookmarkfs.pc
bookmarkfs_util.pc
])
AC_OUTPUT

View file

@ -42,19 +42,18 @@ dnl Check whether a package exists with `pkg-config`,
dnl and provide an option to specify the package's custom install location.
dnl
AC_DEFUN([EX_DEP], [
m4_pushdef([with_var_], [with_]m4_translit([$1], [-], [_]))
AC_ARG_WITH([$1], m4_normalize([
AS_HELP_STRING([--with-$1[[=PKGCONFIGDIR]]],
AS_HELP_STRING([--with-m4_translit([$1], [_], [-])[[=PKGCONFIGDIR]]],
[pkg-config search path for $3])
]), , [
AS_VAR_SET([with_var_], [no])
AS_VAR_SET([with_$1], [no])
m4_foreach([feat_name_], [m4_shiftn(4, $@)], [
AS_VAR_IF([enable_]m4_translit(feat_name_, [-], [_]), [yes], [
AS_VAR_SET([with_var_], [yes])
AS_VAR_SET([with_$1], [yes])
])
])
])
AS_VAR_IF([with_var_], [no], [
AS_VAR_IF([with_$1], [no], [
m4_foreach([feat_name_], [m4_shiftn(4, $@)], [
AS_VAR_IF([enable_]m4_translit(feat_name_, [-], [_]), [yes], [
AC_MSG_ERROR(m4_normalize([
@ -65,14 +64,13 @@ AC_DEFUN([EX_DEP], [
])
], [
AS_VAR_SET([old_pkg_config_path_], ["${PKG_CONFIG_PATH}"])
AS_VAR_IF([with_var_], [yes], , [
AS_VAR_SET([PKG_CONFIG_PATH], ["${with_var_}:${PKG_CONFIG_PATH}"])
AS_VAR_IF([with_$1], [yes], , [
AS_VAR_SET([PKG_CONFIG_PATH], ["${with_$1}:${PKG_CONFIG_PATH}"])
export PKG_CONFIG_PATH
])
PKG_CHECK_MODULES(m4_toupper([$1]), [$1 $2], [$4])
AS_VAR_SET([PKG_CONFIG_PATH], ["${old_pkg_config_path_}"])
])
m4_popdef([with_var_])
])
dnl