gfx/harfbuzz/src/check-static-inits.sh

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/harfbuzz/src/check-static-inits.sh	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,39 @@
     1.4 +#!/bin/sh
     1.5 +
     1.6 +LC_ALL=C
     1.7 +export LC_ALL
     1.8 +
     1.9 +test -z "$srcdir" && srcdir=.
    1.10 +stat=0
    1.11 +
    1.12 +
    1.13 +if which objdump 2>/dev/null >/dev/null; then
    1.14 +	:
    1.15 +else
    1.16 +	echo "check-static-inits.sh: 'objdump' not found; skipping test"
    1.17 +	exit 77
    1.18 +fi
    1.19 +
    1.20 +OBJS=.libs/*.o
    1.21 +if test "x`echo $OBJS`" = "x$OBJS" 2>/dev/null >/dev/null; then
    1.22 +	echo "check-static-inits.sh: object files not found; skipping test"
    1.23 +	exit 77
    1.24 +fi
    1.25 +
    1.26 +echo "Checking that no object file has static initializers"
    1.27 +for obj in $OBJS; do
    1.28 +	if objdump -t "$obj" | grep '[.]ctors'; then
    1.29 +		echo "Ouch, $obj has static initializers"
    1.30 +		stat=1
    1.31 +	fi
    1.32 +done
    1.33 +
    1.34 +echo "Checking that no object file has lazy static C++ constructors/destructors or other such stuff"
    1.35 +for obj in $OBJS; do
    1.36 +	if objdump -t "$obj" | grep '__c'; then
    1.37 +		echo "Ouch, $obj has lazy static C++ constructors/destructors or other such stuff"
    1.38 +		stat=1
    1.39 +	fi
    1.40 +done
    1.41 +
    1.42 +exit $stat

mercurial