michael@0: #!/bin/sh michael@0: michael@0: LC_ALL=C michael@0: export LC_ALL michael@0: michael@0: test -z "$srcdir" && srcdir=. michael@0: stat=0 michael@0: michael@0: michael@0: if which objdump 2>/dev/null >/dev/null; then michael@0: : michael@0: else michael@0: echo "check-static-inits.sh: 'objdump' not found; skipping test" michael@0: exit 77 michael@0: fi michael@0: michael@0: OBJS=.libs/*.o michael@0: if test "x`echo $OBJS`" = "x$OBJS" 2>/dev/null >/dev/null; then michael@0: echo "check-static-inits.sh: object files not found; skipping test" michael@0: exit 77 michael@0: fi michael@0: michael@0: echo "Checking that no object file has static initializers" michael@0: for obj in $OBJS; do michael@0: if objdump -t "$obj" | grep '[.]ctors'; then michael@0: echo "Ouch, $obj has static initializers" michael@0: stat=1 michael@0: fi michael@0: done michael@0: michael@0: echo "Checking that no object file has lazy static C++ constructors/destructors or other such stuff" michael@0: for obj in $OBJS; do michael@0: if objdump -t "$obj" | grep '__c'; then michael@0: echo "Ouch, $obj has lazy static C++ constructors/destructors or other such stuff" michael@0: stat=1 michael@0: fi michael@0: done michael@0: michael@0: exit $stat