summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2018-10-10 13:24:09 +0200
committerCarlos Garnacho <carlosg@gnome.org>2018-10-10 13:59:47 +0200
commit250afc2e1d614cd7ab852ba4278194468ced09e1 (patch)
treec9835d54680ecfe02e5ee3af11f0918081d128cb /configure.ac
parent65f7051bda63ec2ad50a42334b95ea22790f7eec (diff)
downloadgobject-introspection-250afc2e1d614cd7ab852ba4278194468ced09e1.tar.gz
build: Make girdir in .pc files relative to ${datadir} by default
This was the de facto behavior, and is already relied upon. If gir-dir-prefix is specified, the gir dir will rely on the more generic ${prefix} location. Also, avoid expanding the path unless necessary in the autotools build. https://gitlab.gnome.org/GNOME/gobject-introspection/issues/236
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac13
1 files changed, 11 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 60506947..2df0e2de 100644
--- a/configure.ac
+++ b/configure.ac
@@ -116,9 +116,18 @@ AC_DEFINE_UNQUOTED(GIR_SUFFIX, "$GIR_SUFFIX", [Name of the gir directory])
AC_ARG_WITH([gir-dir-prefix],
[AS_HELP_STRING([--with-gir-dir-prefix], [Directory prefix for gir installation])],
- [GIR_DIR_PREFIX="$withval"], [GIR_DIR_PREFIX="$EXPANDED_DATADIR"])
-GIR_DIR="$GIR_DIR_PREFIX/$GIR_SUFFIX"
+ [GIR_DIR_PREFIX="$withval"], [])
+
+if test -z $GIR_DIR_PREFIX; then
+ GIR_DIR="$EXPANDED_DATADIR/$GIR_SUFFIX"
+ GIR_PC_DIR="\${datadir}/$GIR_SUFFIX"
+else
+ GIR_DIR="$GIR_DIR_PREFIX/$GIR_SUFFIX"
+ GIR_PC_DIR="$GIR_DIR_PREFIX/$GIR_SUFFIX"
+fi
+
AC_SUBST(GIR_DIR)
+AC_SUBST(GIR_PC_DIR)
AC_DEFINE_UNQUOTED(GIR_DIR, "$GIR_DIR", [Directory prefix for gir installation])
PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.58.0])