From c2545b921523538e8237ff6a2591f6cb75ee79f1 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 7 Oct 2017 12:56:53 +0200 Subject: [PATCH] Add check for HB_EXTERNs https://github.com/behdad/harfbuzz/pull/555 --- src/Makefile.am | 1 + src/check-externs.sh | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100755 src/check-externs.sh diff --git a/src/Makefile.am b/src/Makefile.am index 0c077d990..ea550d266 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -300,6 +300,7 @@ check: harfbuzz.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 \ check-libstdc++.sh \ diff --git a/src/check-externs.sh b/src/check-externs.sh new file mode 100755 index 000000000..63cc7d5bb --- /dev/null +++ b/src/check-externs.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +LC_ALL=C +export LC_ALL + +test -z "$srcdir" && srcdir=. +stat=0 + +test "x$HBHEADERS" = x && HBHEADERS=`cd "$srcdir"; find . -maxdepth 1 -name 'hb*.h'` +test "x$EGREP" = x && EGREP='grep -E' + + +echo 'Checking that all public symbols are exported with HB_EXTERN' + +for x in $HBHEADERS; do + test -f "$srcdir/$x" && x="$srcdir/$x" + $EGREP -B1 '^hb_' "$x" | $EGREP -E -v '^(--|hb_|HB_EXTERN )' -A1 +done | +grep . >&2 && stat=1 + +exit $stat