[HarfBuzz] [PATCH] Enhancements for gobject introspection
أحمد المحمودي
aelmahmoudy at sabily.org
Thu Jun 7 13:42:37 PDT 2012
From: "Ø£ØÙ
د اÙÙ
ØÙ
Ù?= =?UTF-8?q?د٠(Ahmed El-Mahmoudy)" <aelmahmoudy at sabily.org>
* Check for HB_GOBJECT_COMPILATION before failing on private headers
* Use introspection autoconf/make stuff.
---
configure.ac | 2 ++
src/Makefile.am | 24 ++++++++++++++++++++++--
src/hb-blob.h | 2 +-
src/hb-buffer.h | 2 +-
src/hb-common.h | 2 +-
src/hb-font.h | 2 +-
src/hb-ot-layout.h | 2 +-
src/hb-ot-tag.h | 2 +-
src/hb-set.h | 2 +-
src/hb-shape.h | 2 +-
src/hb-unicode.h | 2 +-
src/hb-version.h.in | 2 +-
12 files changed, 34 insertions(+), 12 deletions(-)
diff --git a/configure.ac b/configure.ac
index 2fb058f..784c8fe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -194,6 +194,8 @@ fi
dnl ===========================================================================
+GOBJECT_INTROSPECTION_CHECK([0.6.7])
+
AC_CONFIG_FILES([
Makefile
harfbuzz.pc
diff --git a/src/Makefile.am b/src/Makefile.am
index 344cc57..3abd786 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -6,6 +6,7 @@ EXTRA_DIST =
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
+DISTCHECK_CONFIGURE_FLAGS = --enable-introspection
# The following warning options are useful for debugging: -Wpadded -Wcast-align
#AM_CXXFLAGS =
@@ -207,8 +208,27 @@ TESTS_ENVIRONMENT = \
HBHEADERS="$(HBHEADERS)" \
$(NULL)
-scan:
- g-ir-scanner $(HBCFLAGS) $(HBHEADERS) -n hb --strip-prefix=hb --library libharfbuzz.la
+-include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS = hb-1.0.gir
+INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir)
+INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
+if HAVE_INTROSPECTION
+introspection_sources = $(HBHEADERS)
+
+hb-1.0.gir: libharfbuzz.la
+hb_1_0_gir_INCLUDES = GObject-2.0
+hb_1_0_gir_CFLAGS = $(INCLUDES) $(HBCFLAGS) -DHB_GOBJECT_COMPILATION
+hb_1_0_gir_LIBS = libharfbuzz.la
+hb_1_0_gir_FILES = $(introspection_sources)
+
+girdir = $(datadir)/gir-1.0
+gir_DATA = $(INTROSPECTION_GIRS)
+
+typelibdir = $(libdir)/girepository-1.0
+typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
+
+CLEANFILES += $(gir_DATA) $(typelib_DATA)
+endif
-include $(top_srcdir)/git.mk
diff --git a/src/hb-blob.h b/src/hb-blob.h
index 360310b..c64e09b 100644
--- a/src/hb-blob.h
+++ b/src/hb-blob.h
@@ -24,7 +24,7 @@
* Red Hat Author(s): Behdad Esfahbod
*/
-#ifndef HB_H_IN
+#if !defined(HB_H_IN) && !defined(HB_GOBJECT_COMPILATION)
#error "Include <hb.h> instead."
#endif
diff --git a/src/hb-buffer.h b/src/hb-buffer.h
index fe53197..6a5b110 100644
--- a/src/hb-buffer.h
+++ b/src/hb-buffer.h
@@ -27,7 +27,7 @@
* Google Author(s): Behdad Esfahbod
*/
-#ifndef HB_H_IN
+#if !defined(HB_H_IN) && !defined(HB_GOBJECT_COMPILATION)
#error "Include <hb.h> instead."
#endif
diff --git a/src/hb-common.h b/src/hb-common.h
index 562b04c..7140396 100644
--- a/src/hb-common.h
+++ b/src/hb-common.h
@@ -26,7 +26,7 @@
* Google Author(s): Behdad Esfahbod
*/
-#ifndef HB_H_IN
+#if !defined(HB_H_IN) && !defined(HB_GOBJECT_COMPILATION)
#error "Include <hb.h> instead."
#endif
diff --git a/src/hb-font.h b/src/hb-font.h
index b98759b..27239c4 100644
--- a/src/hb-font.h
+++ b/src/hb-font.h
@@ -24,7 +24,7 @@
* Red Hat Author(s): Behdad Esfahbod
*/
-#ifndef HB_H_IN
+#if !defined(HB_H_IN) && !defined(HB_GOBJECT_COMPILATION)
#error "Include <hb.h> instead."
#endif
diff --git a/src/hb-ot-layout.h b/src/hb-ot-layout.h
index b8b5baf..42bd7ef 100644
--- a/src/hb-ot-layout.h
+++ b/src/hb-ot-layout.h
@@ -24,7 +24,7 @@
* Red Hat Author(s): Behdad Esfahbod
*/
-#ifndef HB_OT_H_IN
+#if !defined(HB_OT_H_IN) && !defined(HB_GOBJECT_COMPILATION)
#error "Include <hb-ot.h> instead."
#endif
diff --git a/src/hb-ot-tag.h b/src/hb-ot-tag.h
index 1bf12ab..94f7c59 100644
--- a/src/hb-ot-tag.h
+++ b/src/hb-ot-tag.h
@@ -24,7 +24,7 @@
* Red Hat Author(s): Behdad Esfahbod
*/
-#ifndef HB_OT_H_IN
+#if !defined(HB_OT_H_IN) && !defined(HB_GOBJECT_COMPILATION)
#error "Include <hb-ot.h> instead."
#endif
diff --git a/src/hb-set.h b/src/hb-set.h
index 9f849cf..69367bf 100644
--- a/src/hb-set.h
+++ b/src/hb-set.h
@@ -24,7 +24,7 @@
* Google Author(s): Behdad Esfahbod
*/
-#ifndef HB_H_IN
+#if !defined(HB_H_IN) && !defined(HB_GOBJECT_COMPILATION)
#error "Include <hb.h> instead."
#endif
diff --git a/src/hb-shape.h b/src/hb-shape.h
index 1a0d6cf..89b4922 100644
--- a/src/hb-shape.h
+++ b/src/hb-shape.h
@@ -24,7 +24,7 @@
* Red Hat Author(s): Behdad Esfahbod
*/
-#ifndef HB_H_IN
+#if !defined(HB_H_IN) && !defined(HB_GOBJECT_COMPILATION)
#error "Include <hb.h> instead."
#endif
diff --git a/src/hb-unicode.h b/src/hb-unicode.h
index 205e4c7..e8893ac 100644
--- a/src/hb-unicode.h
+++ b/src/hb-unicode.h
@@ -28,7 +28,7 @@
* Google Author(s): Behdad Esfahbod
*/
-#ifndef HB_H_IN
+#if !defined(HB_H_IN) && !defined(HB_GOBJECT_COMPILATION)
#error "Include <hb.h> instead."
#endif
diff --git a/src/hb-version.h.in b/src/hb-version.h.in
index 43634f9..38185b2 100644
--- a/src/hb-version.h.in
+++ b/src/hb-version.h.in
@@ -24,7 +24,7 @@
* Google Author(s): Behdad Esfahbod
*/
-#ifndef HB_H_IN
+#if !defined(HB_H_IN) && !defined(HB_GOBJECT_COMPILATION)
#error "Include <hb.h> instead."
#endif
--
1.7.9.5
More information about the HarfBuzz
mailing list