[HarfBuzz] harfbuzz: Branch 'check-symbols' - 3 commits
Behdad Esfahbod
behdad at kemper.freedesktop.org
Wed Feb 21 23:45:18 UTC 2018
src/Makefile.am | 28 +++++++++++++----------
src/Makefile.sources | 5 ++--
src/check-defs.sh | 52 --------------------------------------------
src/check-symbols.sh | 24 ++++++++++++++++----
src/hb-gobject-enums.h.tmpl | 3 +-
src/hb-gobject-structs.h | 45 +++++++++++++++++++++++++-------------
6 files changed, 70 insertions(+), 87 deletions(-)
New commits:
commit eb0066a8f71896002b4078a532e85ce9afae9ec1
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Wed Feb 21 15:45:01 2018 -0800
Fix build without gobject
diff --git a/src/Makefile.am b/src/Makefile.am
index 663c4f1d..1bf76c87 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -258,7 +258,10 @@ EXTRA_DIST += \
CLEANFILES += $(pkgconfig_DATA)
-DEF_FILES = harfbuzz.def harfbuzz-subset.def harfbuzz-icu.def harfbuzz-gobject.def
+DEF_FILES = harfbuzz.def harfbuzz-subset.def harfbuzz-icu.def
+if HAVE_GOBJECT
+DEF_FILES += harfbuzz-gobject.def
+endif
check: $(DEF_FILES) # For check-symbols.sh
CLEANFILES += $(DEF_FILES)
harfbuzz.def: $(HBHEADERS) $(HBNODISTHEADERS)
commit 8350fd237933976337e651262dceee68aa76ba4c
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Wed Feb 21 15:38:49 2018 -0800
Hopefully refix check-symbols.sh on dylib
diff --git a/src/check-symbols.sh b/src/check-symbols.sh
index 882bf9ea..bfc93b34 100755
--- a/src/check-symbols.sh
+++ b/src/check-symbols.sh
@@ -7,7 +7,7 @@ test -z "$srcdir" && srcdir=.
test -z "$libs" && libs=.libs
stat=0
-IGNORED_SYMBOLS='_fini\>\|_init\>\|_fdata\>\|_ftext\>\|_fbss\>\|__bss_start\>\|__bss_start__\>\|__bss_end__\>\|_edata\>\|_end\>\|_bss_end__\>\|__end__\>\|__gcov_flush\>\|llvm_'
+IGNORED_SYMBOLS='_fini\|_init\|_fdata\|_ftext\|_fbss\|__bss_start\|__bss_start__\|__bss_end__\|_edata\|_end\|_bss_end__\|__end__\|__gcov_flush\|llvm_.*'
if which nm 2>/dev/null >/dev/null; then
:
@@ -23,12 +23,12 @@ for soname in harfbuzz harfbuzz-subset harfbuzz-icu harfbuzz-gobject; do
if ! test -f "$so"; then continue; fi
# On macOS, C symbols are prefixed with _
- if test $suffix = dylib; then prefix="_$prefix"; fi
+ symprefix=
+ if test $suffix = dylib; then symprefix=_; fi
- EXPORTED_SYMBOLS="`nm "$so" | grep ' [BCDGINRSTVW] .' | grep -v " \\($IGNORED_SYMBOLS\\)" | cut -d' ' -f3 | c++filt`"
-
- prefix=`basename "$so" | sed 's/libharfbuzz/hb/; s/-/_/g; s/[.].*//'`
+ EXPORTED_SYMBOLS="`nm "$so" | grep ' [BCDGINRSTVW] .' | grep -v " $symprefix\\($IGNORED_SYMBOLS\\>\\)" | cut -d' ' -f3 | c++filt`"
+ prefix=$symprefix`basename "$so" | sed 's/libharfbuzz/hb/; s/-/_/g; s/[.].*//'`
echo
echo "Checking that $so does not expose internal symbols"
@@ -45,7 +45,7 @@ for soname in harfbuzz harfbuzz-subset harfbuzz-icu harfbuzz-gobject; do
echo "Checking that $so has the same symbol list as $def"
{
echo EXPORTS
- echo "$EXPORTED_SYMBOLS" | sed -e "s/^${prefix}hb/hb/g"
+ echo "$EXPORTED_SYMBOLS" | sed -e "s/^${symprefix}hb/hb/g"
# cheat: copy the last line from the def file!
tail -n1 "$def"
} | c++filt | diff "$def" - >&2 || stat=1
commit fabc2b652c662a172919c3d65214e487e1d91e64
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Wed Feb 21 15:33:57 2018 -0800
Merge check-defs.sh into check-symbols.sh
Also build and fix and check harfbuzz-gobject.def
Also changes harfbuzz-gobject to distribute generated enum sources.
diff --git a/src/Makefile.am b/src/Makefile.am
index aba6803c..663c4f1d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -125,10 +125,12 @@ HBLIBS += $(HBNONPCLIBS)
if OS_WIN32
export_symbols = -export-symbols harfbuzz.def
harfbuzz_def_dependency = harfbuzz.def
-export_symbols_icu = -export-symbols harfbuzz-icu.def
-harfbuzz_icu_def_dependency = harfbuzz-icu.def
export_symbols_subset = -export-symbols harfbuzz-subset.def
harfbuzz_subset_def_dependency = harfbuzz-subset.def
+export_symbols_icu = -export-symbols harfbuzz-icu.def
+harfbuzz_icu_def_dependency = harfbuzz-icu.def
+export_symbols_gobject = -export-symbols harfbuzz-gobject.def
+harfbuzz_gobject_def_dependency = harfbuzz-gobject.def
chosen_linker = $(CXXLINK)
else
if WITH_LIBSTDCXX
@@ -211,10 +213,10 @@ if HAVE_GOBJECT
lib_LTLIBRARIES += libharfbuzz-gobject.la
libharfbuzz_gobject_la_LINK = $(chosen_linker) $(libharfbuzz_gobject_la_LDFLAGS)
libharfbuzz_gobject_la_SOURCES = $(HB_GOBJECT_sources)
-nodist_libharfbuzz_gobject_la_SOURCES = $(HB_GOBJECT_ENUM_sources)
libharfbuzz_gobject_la_CPPFLAGS = $(HBCFLAGS) $(HBNOLIBCXXFLAGS) $(GOBJECT_CFLAGS)
libharfbuzz_gobject_la_LDFLAGS = $(base_link_flags)
libharfbuzz_gobject_la_LIBADD = $(GOBJECT_LIBS) libharfbuzz.la
+EXTRA_libharfbuzz_gobject_la_DEPENDENCIES = $(harfbuzz_gobject_def_dependency)
pkginclude_HEADERS += $(HB_GOBJECT_headers)
nodist_pkginclude_HEADERS += $(HB_GOBJECT_ENUM_headers)
pkgconfig_DATA += harfbuzz-gobject.pc
@@ -223,7 +225,7 @@ BUILT_SOURCES += \
$(HB_GOBJECT_ENUM_sources) \
$(HB_GOBJECT_ENUM_headers) \
$(NULL)
-DISTCLEANFILES += \
+MAINTAINERCLEANFILES += \
$(HB_GOBJECT_ENUM_sources) \
$(HB_GOBJECT_ENUM_headers) \
$(NULL)
@@ -256,12 +258,16 @@ EXTRA_DIST += \
CLEANFILES += $(pkgconfig_DATA)
-CLEANFILES += harfbuzz.def harfbuzz-icu.def harfbuzz-subset.def
+DEF_FILES = harfbuzz.def harfbuzz-subset.def harfbuzz-icu.def harfbuzz-gobject.def
+check: $(DEF_FILES) # For check-symbols.sh
+CLEANFILES += $(DEF_FILES)
harfbuzz.def: $(HBHEADERS) $(HBNODISTHEADERS)
$(AM_V_GEN) headers="$^" $(srcdir)/gen-def.py $@
+harfbuzz-subset.def: $(HB_SUBSET_headers)
+ $(AM_V_GEN) headers="$^" $(srcdir)/gen-def.py $@
harfbuzz-icu.def: $(HB_ICU_headers)
$(AM_V_GEN) headers="$^" $(srcdir)/gen-def.py $@
-harfbuzz-subset.def: $(HB_SUBSET_headers)
+harfbuzz-gobject.def: $(HB_GOBJECT_headers)
$(AM_V_GEN) headers="$^" $(srcdir)/gen-def.py $@
@@ -335,11 +341,8 @@ test_buffer_serialize_SOURCES = test-buffer-serialize.cc
test_buffer_serialize_CPPFLAGS = $(HBCFLAGS)
test_buffer_serialize_LDADD = libharfbuzz.la $(HBLIBS)
-check: harfbuzz.def harfbuzz-icu.def harfbuzz-subset.def # For check-defs.sh
-
dist_check_SCRIPTS = \
check-c-linkage-decls.sh \
- check-defs.sh \
check-externs.sh \
check-header-guards.sh \
check-includes.sh \
@@ -415,10 +418,8 @@ HarfBuzz_0_0_gir_FILES = \
$(HBHEADERS) \
$(HBNODISTHEADERS) \
$(HBSOURCES) \
- $(HB_GOBJECT_ENUM_sources) \
- $(HB_GOBJECT_ENUM_headers) \
$(HB_GOBJECT_sources) \
- $(HB_GOBJECT_STRUCTS_headers) \
+ $(HB_GOBJECT_headers) \
$(NULL)
girdir = $(datadir)/gir-1.0
diff --git a/src/Makefile.sources b/src/Makefile.sources
index 9b96716d..87fa807e 100644
--- a/src/Makefile.sources
+++ b/src/Makefile.sources
@@ -200,8 +200,9 @@ HB_SUBSET_headers = \
hb-subset-private.hh \
$(NULL)
-HB_GOBJECT_sources = hb-gobject-structs.cc
+HB_GOBJECT_STRUCTS_sources = hb-gobject-structs.cc
HB_GOBJECT_STRUCTS_headers = hb-gobject-structs.h
-HB_GOBJECT_headers = hb-gobject.h $(HB_GOBJECT_STRUCTS_headers)
HB_GOBJECT_ENUM_sources = hb-gobject-enums.cc
HB_GOBJECT_ENUM_headers = hb-gobject-enums.h
+HB_GOBJECT_sources = $(HB_GOBJECT_STRUCTS_sources) $(HB_GOBJECT_ENUM_sources)
+HB_GOBJECT_headers = hb-gobject.h $(HB_GOBJECT_STRUCTS_headers) $(HB_GOBJECT_ENUM_headers)
diff --git a/src/check-defs.sh b/src/check-defs.sh
deleted file mode 100755
index e8ec6d36..00000000
--- a/src/check-defs.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/sh
-
-LC_ALL=C
-export LC_ALL
-
-test -z "$srcdir" && srcdir=.
-test -z "$libs" && libs=.libs
-stat=0
-
-IGNORED_SYMBOLS='_fini\>\|_init\>\|_fdata\>\|_ftext\>\|_fbss\>\|__bss_start\>\|__bss_start__\>\|__bss_end__\>\|_edata\>\|_end\>\|_bss_end__\>\|__end__\>\|__gcov_flush\>\|llvm_'
-
-if which nm 2>/dev/null >/dev/null; then
- :
-else
- echo "check-defs.sh: 'nm' not found; skipping test"
- exit 77
-fi
-
-tested=false
-for soname in harfbuzz harfbuzz-icu harfbuzz-subset; do
- def=$soname.def
- if ! test -f "$def"; then
- echo "check-defs.sh: '$def' not found; skipping test it"
- continue
- fi
- for suffix in so dylib; do
- so=$libs/lib$soname.$suffix
- if ! test -f "$so"; then continue; fi
-
- # On macOS, C symbols are prefixed with _
- if test $suffix = dylib; then prefix="_"; fi
-
- EXPORTED_SYMBOLS="`nm "$so" | grep ' [BCDGINRSTVW] .' | grep -v " $prefix\\($IGNORED_SYMBOLS\\)" | cut -d' ' -f3`"
-
- echo
- echo "Checking that $so has the same symbol list as $def"
- {
- echo EXPORTS
- echo "$EXPORTED_SYMBOLS" | sed -e "s/^${prefix}hb/hb/g"
- # cheat: copy the last line from the def file!
- tail -n1 "$def"
- } | c++filt | diff "$def" - >&2 || stat=1
-
- tested=true
- done
-done
-if ! $tested; then
- echo "check-defs.sh: no shared libraries found; skipping test"
- exit 77
-fi
-
-exit $stat
diff --git a/src/check-symbols.sh b/src/check-symbols.sh
index 06dcc8f9..882bf9ea 100755
--- a/src/check-symbols.sh
+++ b/src/check-symbols.sh
@@ -37,6 +37,20 @@ for soname in harfbuzz harfbuzz-subset harfbuzz-icu harfbuzz-gobject; do
stat=1
fi
+ def=$soname.def
+ if ! test -f "$def"; then
+ echo "'$def' not found; skipping"
+ else
+ echo
+ echo "Checking that $so has the same symbol list as $def"
+ {
+ echo EXPORTS
+ echo "$EXPORTED_SYMBOLS" | sed -e "s/^${prefix}hb/hb/g"
+ # cheat: copy the last line from the def file!
+ tail -n1 "$def"
+ } | c++filt | diff "$def" - >&2 || stat=1
+ fi
+
tested=true
done
done
diff --git a/src/hb-gobject-enums.h.tmpl b/src/hb-gobject-enums.h.tmpl
index e28510c2..606727cd 100644
--- a/src/hb-gobject-enums.h.tmpl
+++ b/src/hb-gobject-enums.h.tmpl
@@ -42,7 +42,8 @@ HB_BEGIN_DECLS
/*** END file-header ***/
/*** BEGIN value-header ***/
-HB_EXTERN GType @enum_name at _get_type (void) G_GNUC_CONST;
+HB_EXTERN GType
+ at enum_name@_get_type (void) G_GNUC_CONST;
#define @ENUMPREFIX at _TYPE_@ENUMSHORT@ (@enum_name at _get_type ())
/*** END value-header ***/
diff --git a/src/hb-gobject-structs.h b/src/hb-gobject-structs.h
index a34b06ab..302dc958 100644
--- a/src/hb-gobject-structs.h
+++ b/src/hb-gobject-structs.h
@@ -45,7 +45,8 @@ HB_BEGIN_DECLS
*
* Since: 0.9.2
**/
-HB_EXTERN GType hb_gobject_blob_get_type (void);
+HB_EXTERN GType
+hb_gobject_blob_get_type (void);
#define HB_GOBJECT_TYPE_BLOB (hb_gobject_blob_get_type ())
/**
@@ -53,7 +54,8 @@ HB_EXTERN GType hb_gobject_blob_get_type (void);
*
* Since: 0.9.2
**/
-HB_EXTERN GType hb_gobject_buffer_get_type (void);
+HB_EXTERN GType
+hb_gobject_buffer_get_type (void);
#define HB_GOBJECT_TYPE_BUFFER (hb_gobject_buffer_get_type ())
/**
@@ -61,7 +63,8 @@ HB_EXTERN GType hb_gobject_buffer_get_type (void);
*
* Since: 0.9.2
**/
-HB_EXTERN GType hb_gobject_face_get_type (void);
+HB_EXTERN GType
+hb_gobject_face_get_type (void);
#define HB_GOBJECT_TYPE_FACE (hb_gobject_face_get_type ())
/**
@@ -69,7 +72,8 @@ HB_EXTERN GType hb_gobject_face_get_type (void);
*
* Since: 0.9.2
**/
-HB_EXTERN GType hb_gobject_font_get_type (void);
+HB_EXTERN GType
+hb_gobject_font_get_type (void);
#define HB_GOBJECT_TYPE_FONT (hb_gobject_font_get_type ())
/**
@@ -77,13 +81,16 @@ HB_EXTERN GType hb_gobject_font_get_type (void);
*
* Since: 0.9.2
**/
-HB_EXTERN GType hb_gobject_font_funcs_get_type (void);
+HB_EXTERN GType
+hb_gobject_font_funcs_get_type (void);
#define HB_GOBJECT_TYPE_FONT_FUNCS (hb_gobject_font_funcs_get_type ())
-HB_EXTERN GType hb_gobject_set_get_type (void);
+HB_EXTERN GType
+hb_gobject_set_get_type (void);
#define HB_GOBJECT_TYPE_SET (hb_gobject_set_get_type ())
-HB_EXTERN GType hb_gobject_shape_plan_get_type (void);
+HB_EXTERN GType
+hb_gobject_shape_plan_get_type (void);
#define HB_GOBJECT_TYPE_SHAPE_PLAN (hb_gobject_shape_plan_get_type ())
/**
@@ -91,30 +98,38 @@ HB_EXTERN GType hb_gobject_shape_plan_get_type (void);
*
* Since: 0.9.2
**/
-HB_EXTERN GType hb_gobject_unicode_funcs_get_type (void);
+HB_EXTERN GType
+hb_gobject_unicode_funcs_get_type (void);
#define HB_GOBJECT_TYPE_UNICODE_FUNCS (hb_gobject_unicode_funcs_get_type ())
/* Value types */
-HB_EXTERN GType hb_gobject_feature_get_type (void);
+HB_EXTERN GType
+hb_gobject_feature_get_type (void);
#define HB_GOBJECT_TYPE_FEATURE (hb_gobject_feature_get_type ())
-HB_EXTERN GType hb_gobject_glyph_info_get_type (void);
+HB_EXTERN GType
+hb_gobject_glyph_info_get_type (void);
#define HB_GOBJECT_TYPE_GLYPH_INFO (hb_gobject_glyph_info_get_type ())
-HB_EXTERN GType hb_gobject_glyph_position_get_type (void);
+HB_EXTERN GType
+hb_gobject_glyph_position_get_type (void);
#define HB_GOBJECT_TYPE_GLYPH_POSITION (hb_gobject_glyph_position_get_type ())
-HB_EXTERN GType hb_gobject_segment_properties_get_type (void);
+HB_EXTERN GType
+hb_gobject_segment_properties_get_type (void);
#define HB_GOBJECT_TYPE_SEGMENT_PROPERTIES (hb_gobject_segment_properties_get_type ())
-HB_EXTERN GType hb_gobject_user_data_key_get_type (void);
+HB_EXTERN GType
+hb_gobject_user_data_key_get_type (void);
#define HB_GOBJECT_TYPE_USER_DATA_KEY (hb_gobject_user_data_key_get_type ())
-HB_EXTERN GType hb_gobject_ot_math_glyph_variant_get_type (void);
+HB_EXTERN GType
+hb_gobject_ot_math_glyph_variant_get_type (void);
#define HB_GOBJECT_TYPE_OT_MATH_GLYPH_VARIANT (hb_gobject_ot_math_glyph_variant_get_type ())
-HB_EXTERN GType hb_gobject_ot_math_glyph_part_get_type (void);
+HB_EXTERN GType
+hb_gobject_ot_math_glyph_part_get_type (void);
#define HB_GOBJECT_TYPE_OT_MATH_GLYPH_PART (hb_gobject_ot_math_glyph_part_get_type ())
More information about the HarfBuzz
mailing list