fix: allow custom pkgconfigdir

should not assume that ${libdir}/pkgconfig is pkgconfigdir.
This commit is contained in:
CismonX 2023-04-27 11:26:10 +08:00
parent 6d0c97895a
commit 09ccd4827a
Signed by: cismonx
GPG Key ID: 3094873E29A482FB
3 changed files with 4 additions and 4 deletions

View File

@ -11,5 +11,4 @@ ACLOCAL_AMFLAGS = -I m4
SUBDIRS = doc examples include src tests
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = arif.pc

View File

@ -91,6 +91,7 @@ AC_CHECK_FUNCS([atexit memchr strcasecmp])
# -- Output --
PKG_INSTALLDIR()
AC_CONFIG_FILES([
Makefile
doc/Makefile

View File

@ -43,13 +43,13 @@ dnl
AC_DEFUN([ARIF_CHECK_PKG], [
m4_pushdef([with_var_], [with_]m4_translit([$1], [-+.], [___]))
AC_ARG_WITH([$1], m4_normalize([
AS_HELP_STRING([--with-$1[[=PREFIX]]], [installation path of $3])
AS_HELP_STRING(
[--with-$1[[=PKGCONFIGDIR]]], [pkg-config search path for $3])
]), [], [$4])
AS_VAR_IF(with_var_, [no], [$6], [
AS_VAR_SET([SAVED_PKG_CONFIG_PATH_], ["${PKG_CONFIG_PATH}"])
AS_VAR_IF(with_var_, [yes], [], [
AS_VAR_SET([PKG_CONFIG_PATH],
["${with_$1}/lib/pkgconfig:${PKG_CONFIG_PATH}"])
AS_VAR_SET([PKG_CONFIG_PATH], ["${with_$1}:${PKG_CONFIG_PATH}"])
])
export PKG_CONFIG_PATH
PKG_CHECK_MODULES(m4_toupper([$1]), [$1 $2], [$5])