blob: e0402f8f493c2291b5cba6d0b1b05395d6ba859b [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001configure.ac: make GIR_DIR configurable
2
3Some .gir files such as GLib-2.0.gir are arch related which contain such
4as lengths of pointers that they are different for 64 and 32 bit target.
5It causes install file conflicts for multilib when intall
6gobject-introspection and lib32-gobject-introspection both.
7
8Add configure option 'with-gir-dir-prefix' for autotools to make .gir
9could be installed to a configured path such as ${libdir}. And update
10girdir in .pc files as well.
11
12Upstream-Status: Accepted [https://gitlab.gnome.org/GNOME/gobject-introspection/commit/3301c7e]
13
14Signed-off-by: Kai Kang <kai.kang@windriver.com>
15---
16 configure.ac | 7 +++++--
17 gobject-introspection-1.0.pc.in | 2 +-
18 gobject-introspection-no-export-1.0.pc.in | 2 +-
19 3 files changed, 7 insertions(+), 4 deletions(-)
20
21diff --git a/configure.ac b/configure.ac
22index b4294c57..60506947 100644
23--- a/configure.ac
24+++ b/configure.ac
25@@ -114,9 +114,12 @@ GIR_SUFFIX="gir-1.0"
26 AC_SUBST(GIR_SUFFIX)
27 AC_DEFINE_UNQUOTED(GIR_SUFFIX, "$GIR_SUFFIX", [Name of the gir directory])
28
29-GIR_DIR="$EXPANDED_DATADIR/$GIR_SUFFIX"
30+AC_ARG_WITH([gir-dir-prefix],
31+ [AS_HELP_STRING([--with-gir-dir-prefix], [Directory prefix for gir installation])],
32+ [GIR_DIR_PREFIX="$withval"], [GIR_DIR_PREFIX="$EXPANDED_DATADIR"])
33+GIR_DIR="$GIR_DIR_PREFIX/$GIR_SUFFIX"
34 AC_SUBST(GIR_DIR)
35-AC_DEFINE_UNQUOTED(GIR_DIR, "$GIR_DIR", [Director prefix for gir installation])
36+AC_DEFINE_UNQUOTED(GIR_DIR, "$GIR_DIR", [Directory prefix for gir installation])
37
38 PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.58.0])
39
40diff --git a/gobject-introspection-1.0.pc.in b/gobject-introspection-1.0.pc.in
41index a08b5d27..3409856c 100644
42--- a/gobject-introspection-1.0.pc.in
43+++ b/gobject-introspection-1.0.pc.in
44@@ -10,7 +10,7 @@ g_ir_scanner=${bindir}/g-ir-scanner
45 g_ir_compiler=${bindir}/g-ir-compiler@EXEEXT@
46 g_ir_generate=${bindir}/g-ir-generate@EXEEXT@
47 gidatadir=${datadir}/gobject-introspection-1.0
48-girdir=${datadir}/gir-1.0
49+girdir=@GIR_DIR@
50 typelibdir=${libdir}/girepository-1.0
51
52 Cflags: -I${includedir}/gobject-introspection-1.0 @FFI_PC_CFLAGS@
53diff --git a/gobject-introspection-no-export-1.0.pc.in b/gobject-introspection-no-export-1.0.pc.in
54index d214d22d..745aaade 100644
55--- a/gobject-introspection-no-export-1.0.pc.in
56+++ b/gobject-introspection-no-export-1.0.pc.in
57@@ -9,7 +9,7 @@ includedir=@includedir@
58 g_ir_scanner=${bindir}/g-ir-scanner
59 g_ir_compiler=${bindir}/g-ir-compiler@EXEEXT@
60 g_ir_generate=${bindir}/g-ir-generate@EXEEXT@
61-girdir=${datadir}/gir-1.0
62+girdir=@GIR_DIR@
63 typelibdir=${libdir}/girepository-1.0
64
65 Cflags: -I${includedir}/gobject-introspection-1.0 @FFI_PC_CFLAGS@
66--
672.17.0
68