summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2012-05-10 05:34:49 -0700
committerDan Nicholson <dbn.lists@gmail.com>2012-05-10 05:34:49 -0700
commit5fc77a96b7a1114e296f968037342f060d4bc34b (patch)
treedb139357231283ee14df8738883b509dc6b68eae
parent79c768aadf41ed6275e33be9e402430f96d143d4 (diff)
Add autoconf macros to help packagers install .pc files
Some distros and users have unusual installation needs that don't conform to the standard $libdir/pkgconfig and $datadir/pkgconfig pathways. Help packagers support these users with the macros PKG_INSTALLDIR and PKG_NOARCH_INSTALLDIR. These are simple macros that provide the configure parameters --with-pkgconfigdir and --with-noarch-pkgconfigdir to allow users to override the standard locations. Freedesktop #48743
-rw-r--r--pkg.m440
1 files changed, 40 insertions, 0 deletions
diff --git a/pkg.m4 b/pkg.m4
index 9a71878..f26f84c 100644
--- a/pkg.m4
+++ b/pkg.m4
@@ -157,3 +157,43 @@ else
$3
fi[]dnl
])# PKG_CHECK_MODULES
+
+
+# PKG_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable pkgconfigdir as the location where a module
+# should install pkg-config .pc files. By default the directory is
+# $libdir/pkgconfig, but the default can be changed by passing
+# DIRECTORY. The user can override through the --with-pkgconfigdir
+# 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
+
+
+# PKG_NOARCH_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable noarch_pkgconfigdir as the location where a
+# module should install arch-independent pkg-config .pc files. By
+# default the directory is $datadir/pkgconfig, but the default can be
+# changed by passing DIRECTORY. The user can override through the
+# --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+ [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+ [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_NOARCH_INSTALLDIR