summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2009-12-04 13:13:55 -0200
committerJohan Dahlin <johan@gnome.org>2009-12-04 13:18:08 -0200
commitbf393f0c01fb40a4ae737f88eeddce5bce896069 (patch)
tree10f7747ea71f1ca96ad963310e09816038b16a14
parent7deaa9e6176f09ac753935475be8c080383241b2 (diff)
downloadgobject-introspection-bf393f0c01fb40a4ae737f88eeddce5bce896069.tar.gz
Add ffi cflags/libs/requires to exported .pc
This is required as external projects such as gjs are now using girffi and thus need the ffi cflags to be able to link. https://bugzilla.gnome.org/show_bug.cgi?id=603653
-rw-r--r--configure.ac14
-rw-r--r--gobject-introspection-1.0.pc.in6
-rw-r--r--gobject-introspection-no-export-1.0.pc.in6
3 files changed, 17 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index fccc0769..48ac25bf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -129,8 +129,12 @@ PKG_CHECK_MODULES(SCANNER, [gobject-2.0 gthread-2.0 gio-2.0])
dnl libffi
PKG_CHECK_MODULES(FFI, libffi, have_ffi_pkgconfig=yes, have_ffi_pkgconfig=no)
-
-if test x"$have_ffi_pkgconfig" = xno ; then
+FFI_PC_CFLAGS=""
+FFI_PC_LIBS=""
+FFI_PC_PACKAGES=""
+if test x"$have_ffi_pkgconfig" = xyes ; then
+ FFI_PC_PACKAGES="libffi"
+else
AC_MSG_CHECKING(for ffi.h)
AC_TRY_CPP([#include <ffi.h>], have_ffi_h=yes, have_ffi_h=no)
@@ -156,12 +160,16 @@ if test x"$have_ffi_pkgconfig" = xno ; then
AC_MSG_ERROR([ffi.h not found])
fi
+ FFI_PC_LIBS=$FFI_LIBS
+ FFI_PC_CFLAGS=$FFI_CFLAGS
FFI_CFLAGS=
-
AC_MSG_RESULT([$have_ffi_h])
AC_SUBST(FFI_LIBS)
AC_SUBST(FFI_CFLAGS)
fi
+AC_SUBST(FFI_PC_CFLAGS)
+AC_SUBST(FFI_PC_LIBS)
+AC_SUBST(FFI_PC_PACKAGES)
AC_CHECK_SIZEOF(time_t, [], [#include <time.h>])
diff --git a/gobject-introspection-1.0.pc.in b/gobject-introspection-1.0.pc.in
index f9c85f7b..e4bf2345 100644
--- a/gobject-introspection-1.0.pc.in
+++ b/gobject-introspection-1.0.pc.in
@@ -12,9 +12,9 @@ g_ir_generate=${bindir}/g-ir-generate
girdir=${datadir}/gir-1.0
typelibdir=${libdir}/girepository-1.0
-Cflags: -I${includedir}/gobject-introspection-1.0
-Requires: glib-2.0 gobject-2.0 gmodule-2.0 gthread-2.0
-Libs: -L${libdir} -lgirepository-1.0
+Cflags: -I${includedir}/gobject-introspection-1.0 @FFI_PC_CFLAGS@
+Requires: glib-2.0 gobject-2.0 gmodule-2.0 gthread-2.0 @FFI_PC_PACKAGES@
+Libs: -L${libdir} -lgirepository-1.0 @FFI_PC_LIBS@
Name: gobject-introspection
Description: GObject Introspection
diff --git a/gobject-introspection-no-export-1.0.pc.in b/gobject-introspection-no-export-1.0.pc.in
index 54deae0e..110cb752 100644
--- a/gobject-introspection-no-export-1.0.pc.in
+++ b/gobject-introspection-no-export-1.0.pc.in
@@ -12,9 +12,9 @@ g_ir_generate=${bindir}/g-ir-generate
girdir=${datadir}/gir-1.0
typelibdir=${libdir}/girepository-1.0
-Cflags: -I${includedir}/gobject-introspection-1.0
-Requires: glib-2.0 gobject-2.0 gmodule-no-export-2.0 gthread-2.0
-Libs: -L${libdir} -lgirepository-1.0
+Cflags: -I${includedir}/gobject-introspection-1.0 @FFI_PC_CFLAGS@
+Requires: glib-2.0 gobject-2.0 gmodule-no-export-2.0 gthread-2.0 @FFI_PC_PACKAGES@
+Libs: -L${libdir} -lgirepository-1.0 @FFI_PC_LIBS@
Name: gobject-introspection
Description: GObject Introspection