mirror of
https://git.sr.ht/~cismonx/bookmarkfs
synced 2025-07-23 17:48:52 +00:00
build: misc refactor
EX_DEP(): - Do not generate feature check code if `feat-names` is empty. - Improve docs. others: - Reuse `$host_os` for system type check result.
This commit is contained in:
parent
296b85cbe9
commit
602519db12
2 changed files with 13 additions and 11 deletions
10
configure.ac
10
configure.ac
|
@ -23,11 +23,11 @@ LT_INIT([disable-static dlopen])
|
|||
|
||||
AC_CANONICAL_HOST
|
||||
AS_CASE(["${host_os}"], [linux*], [
|
||||
AS_VAR_SET([host_os_is_linux], [yes])
|
||||
AS_VAR_SET([host_os], [linux])
|
||||
], [freebsd*], [
|
||||
AS_VAR_SET([host_os_is_freebsd], [yes])
|
||||
AS_VAR_SET([host_os], [freebsd])
|
||||
], [
|
||||
AC_MSG_ERROR(m4_normalize([Unsupported platform "${host_os}".]))
|
||||
AC_MSG_ERROR([Unsupported platform "${host_os}".])
|
||||
])
|
||||
|
||||
# -- Checks for programs --
|
||||
|
@ -54,7 +54,7 @@ EX_FEAT([bookmarkfs-mount], [NE], [the mount.bookmarkfs program], [
|
|||
|
||||
EX_FEAT([sandbox], [YDE], [sandboxing])
|
||||
|
||||
AS_VAR_IF([host_os_is_linux], [yes], [
|
||||
AS_VAR_IF([host_os], [linux], [
|
||||
EX_FEAT([sandbox-landlock], [YD], [using Landlock for sandboxing])
|
||||
])
|
||||
|
||||
|
@ -95,7 +95,7 @@ AX_PTHREAD
|
|||
|
||||
EX_DEP([fuse3], [>= 3.5], [fuse3 library], , [bookmarkfs-mount])
|
||||
|
||||
AS_VAR_IF([host_os_is_linux], [yes], [
|
||||
AS_VAR_IF([host_os], [linux], [
|
||||
EX_DEP([libseccomp], [>= 2.5], [libseccomp library], , [sandbox])
|
||||
])
|
||||
|
||||
|
|
|
@ -48,33 +48,35 @@ AC_DEFUN([EX_FEAT], [
|
|||
])
|
||||
|
||||
dnl
|
||||
dnl EX_DEP(pkg-name, version, pkg-desc, [action-if-found],
|
||||
dnl [required-by-features]...)
|
||||
dnl EX_DEP(pkg-name, version, pkg-desc, [action-if-found], [feat-names]...)
|
||||
dnl
|
||||
dnl Check whether a package exists with `pkg-config`,
|
||||
dnl and provide an option to specify the package's custom install location.
|
||||
dnl
|
||||
dnl If at least one feature specified in `feat-names` is enabled,
|
||||
dnl automatically enable checking the package, and fail if not found.
|
||||
dnl
|
||||
AC_DEFUN([EX_DEP], [
|
||||
AC_ARG_WITH([$1], m4_normalize([
|
||||
AS_HELP_STRING([--with-m4_translit([$1], [_], [-])[[=PKGCONFIGDIR]]],
|
||||
[pkg-config search path for $3])
|
||||
]), , [
|
||||
AS_VAR_SET([with_$1], [no])
|
||||
m4_foreach([feat_name_], [m4_shiftn(4, $@)], [
|
||||
m4_ifnblank([$5], m4_foreach([feat_name_], [m4_shiftn(4, $@)], [
|
||||
AS_VAR_IF([enable_]m4_translit(feat_name_, [-], [_]), [yes], [
|
||||
AS_VAR_SET([with_$1], [yes])
|
||||
])
|
||||
])
|
||||
]))
|
||||
])
|
||||
AS_VAR_IF([with_$1], [no], [
|
||||
m4_foreach([feat_name_], [m4_shiftn(4, $@)], [
|
||||
m4_ifnblank([$5], m4_foreach([feat_name_], [m4_shiftn(4, $@)], [
|
||||
AS_VAR_IF([enable_]m4_translit(feat_name_, [-], [_]), [yes], [
|
||||
AC_MSG_ERROR(m4_normalize([
|
||||
Bad option '[--without-]feat_name_'. The $3 is mandatory
|
||||
for AS_VAR_GET([desc_]m4_translit(feat_name_, [-], [_])).
|
||||
]))
|
||||
])
|
||||
])
|
||||
]))
|
||||
], [
|
||||
AS_VAR_SET([old_pkg_config_path_], ["${PKG_CONFIG_PATH}"])
|
||||
AS_VAR_IF([with_$1], [yes], , [
|
||||
|
|
Loading…
Add table
Reference in a new issue