]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: add PKG_INSTALLDIR fallback
authorKarel Zak <kzak@redhat.com>
Tue, 14 May 2019 13:25:07 +0000 (15:25 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 14 May 2019 13:25:07 +0000 (15:25 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
m4/pkg.m4 [new file with mode: 0644]

diff --git a/m4/pkg.m4 b/m4/pkg.m4
new file mode 100644 (file)
index 0000000..c3572bc
--- /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
+