fix: allow custom pkgconfigdir

should not assume that ${libdir}/pkgconfig is pkgconfigdir.
This commit is contained in:
CismonX 2023-04-28 10:05:41 +08:00
parent c160c9f47a
commit ed4631b913
Signed by: cismonx
GPG Key ID: 3094873E29A482FB
4 changed files with 6 additions and 6 deletions

View File

@ -32,11 +32,11 @@ Build and Install
ARIF can be built and installed from source using the GNU build system. ARIF can be built and installed from source using the GNU build system.
Notable build options: Notable build options:
- `--with-readline[=PREFIX]` (default), `--without-readline` - `--with-readline[=PKGCONFIGDIR]` (default), `--without-readline`
* Whether to build the ARIF library with GNU Readline features. * Whether to build the ARIF library with GNU Readline features.
- `--enable-arify` (default), `--disable-arify` - `--enable-arify` (default), `--disable-arify`
* Whether to build the `arify` command-line tool. * Whether to build the `arify` command-line tool.
- `--with-rime[=PREFIX]`, `--without-rime` (default) - `--with-rime[=PKGCONFIGDIR]`, `--without-rime` (default)
* Whether to build the example Rime IME integration. * Whether to build the example Rime IME integration.
Example shell script: Example shell script:

View File

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

View File

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

View File

@ -43,13 +43,13 @@ dnl
AC_DEFUN([ARIF_CHECK_PKG], [ AC_DEFUN([ARIF_CHECK_PKG], [
m4_pushdef([with_var_], [with_]m4_translit([$1], [-+.], [___])) m4_pushdef([with_var_], [with_]m4_translit([$1], [-+.], [___]))
AC_ARG_WITH([$1], m4_normalize([ 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]) ]), [], [$4])
AS_VAR_IF(with_var_, [no], [$6], [ AS_VAR_IF(with_var_, [no], [$6], [
AS_VAR_SET([SAVED_PKG_CONFIG_PATH_], ["${PKG_CONFIG_PATH}"]) AS_VAR_SET([SAVED_PKG_CONFIG_PATH_], ["${PKG_CONFIG_PATH}"])
AS_VAR_IF(with_var_, [yes], [], [ AS_VAR_IF(with_var_, [yes], [], [
AS_VAR_SET([PKG_CONFIG_PATH], AS_VAR_SET([PKG_CONFIG_PATH], ["${with_$1}:${PKG_CONFIG_PATH}"])
["${with_$1}/lib/pkgconfig:${PKG_CONFIG_PATH}"])
]) ])
export PKG_CONFIG_PATH export PKG_CONFIG_PATH
PKG_CHECK_MODULES(m4_toupper([$1]), [$1 $2], [$5]) PKG_CHECK_MODULES(m4_toupper([$1]), [$1 $2], [$5])