Skip to content
Browse files

Add checkglobals.sh script to list all globals found

  • Loading branch information...
1 parent d899996 commit 74c0a15a554e5c1aeaf179a73dce7411db55d73d @dottedmag dottedmag committed Dec 28, 2013
Showing with 29 additions and 0 deletions.
  1. +29 −0 checkglobals.sh
View
29 checkglobals.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+OS=$(uname -s)
+
+case "$OS" in
+ Linux)
+ NM_ARGS='--defined-only'
+ FILTER=' [Ttr] '
+ ;;
+ Darwin)
+ NM_ARGS='-U -m'
+ FILTER=',(__eh_frame|__cstring|__text|__const)'
+ ;;
+ *)
+ echo "Unknown operating system: $OS" >&2
+ exit 1;;
+esac
+
+for dotlibs_dir in $(find . -name .libs)
+do
+ dir=${dotlibs_dir%/.libs}
+ dir=${dir#./}
+ echo '----------------------------------------------------------------------'
+ echo "$dir"
+ echo '----------------------------------------------------------------------'
+ echo
+ (cd $dir/.libs
+ nm $NM_ARGS *.o 2>/dev/null | egrep -v "$FILTER")
+done

0 comments on commit 74c0a15

Please sign in to comment.
Something went wrong with that request. Please try again.