Imported Upstream version 1.7.6
[platform/upstream/harfbuzz.git] / src / check-static-inits.sh
index 83d02c8..71551cb 100755 (executable)
@@ -4,6 +4,7 @@ LC_ALL=C
 export LC_ALL
 
 test -z "$srcdir" && srcdir=.
+test -z "$libs" && libs=.libs
 stat=0
 
 
@@ -14,7 +15,7 @@ else
        exit 77
 fi
 
-OBJS=.libs/*.o
+OBJS=$libs/*.o
 if test "x`echo $OBJS`" = "x$OBJS" 2>/dev/null >/dev/null; then
        echo "check-static-inits.sh: object files not found; skipping test"
        exit 77
@@ -22,8 +23,8 @@ fi
 
 echo "Checking that no object file has static initializers"
 for obj in $OBJS; do
-       if objdump -t "$obj" | grep '[.]ctors'; then
-               echo "Ouch, $obj has static initializers"
+       if objdump -t "$obj" | grep '[.][cd]tors' | grep -v '\<00*\>'; then
+               echo "Ouch, $obj has static initializers/finalizers"
                stat=1
        fi
 done