list-symbols.sh 732 B

1234567891011121314151617181920212223242526
  1. #!/bin/sh
  2. set -eu
  3. if [ -d include/mbedtls ]; then :; else
  4. echo "$0: must be run from root" >&2
  5. exit 1
  6. fi
  7. if grep -i cmake Makefile >/dev/null; then
  8. echo "$0: not compatible with cmake" >&2
  9. exit 1
  10. fi
  11. cp include/mbedtls/config.h include/mbedtls/config.h.bak
  12. scripts/config.pl full
  13. CFLAGS=-fno-asynchronous-unwind-tables make clean lib >/dev/null 2>&1
  14. mv include/mbedtls/config.h.bak include/mbedtls/config.h
  15. if uname | grep -F Darwin >/dev/null; then
  16. nm -gUj library/libmbed*.a 2>/dev/null | sed -n -e 's/^_//p'
  17. elif uname | grep -F Linux >/dev/null; then
  18. nm -og library/libmbed*.a | grep -v '^[^ ]*: *U \|^$\|^[^ ]*:$' | sed 's/^[^ ]* . //'
  19. fi | sort > exported-symbols
  20. make clean
  21. wc -l exported-symbols