From fbd2d01e23c56d78b343745bc532434d5517ae5d Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 14 May 2019 15:25:07 +0200 Subject: build-sys: add PKG_INSTALLDIR fallback Signed-off-by: Karel Zak --- m4/pkg.m4 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 m4/pkg.m4 (limited to 'm4') diff --git a/m4/pkg.m4 b/m4/pkg.m4 new file mode 100644 index 000000000..c3572bc4e --- /dev/null +++ b/m4/pkg.m4 @@ -0,0 +1,24 @@ +dnl +dnl https://github.com/pkgconf/pkgconf/blob/master/pkg.m4#L217-L236 +dnl +dnl PKG_INSTALLDIR([DIRECTORY]) +dnl ------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable pkgconfigdir as the location where a module +dnl should install pkg-config .pc files. By default the directory is +dnl $libdir/pkgconfig, but the default can be changed by passing +dnl DIRECTORY. The user can override through the --with-pkgconfigdir +dnl parameter. +AC_DEFUN([PKG_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([pkgconfigdir], + [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, + [with_pkgconfigdir=]pkg_default) +AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +])dnl PKG_INSTALLDIR + -- cgit v1.2.3-55-g7522