Manuel Pégourié-Gonnard | 3385cf4 | 2015-04-02 17:59:30 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | set -eu |
| 4 | |
Manuel Pégourié-Gonnard | d1ddd29 | 2015-04-09 10:15:10 +0200 | [diff] [blame] | 5 | if [ -d include/mbedtls ]; then :; else |
| 6 | echo "$0: must be run from root" >&2 |
| 7 | exit 1 |
| 8 | fi |
| 9 | |
Manuel Pégourié-Gonnard | 3385cf4 | 2015-04-02 17:59:30 +0100 | [diff] [blame] | 10 | if grep -i cmake Makefile >/dev/null; then |
Manuel Pégourié-Gonnard | d1ddd29 | 2015-04-09 10:15:10 +0200 | [diff] [blame] | 11 | echo "$0: not compatible with cmake" >&2 |
Manuel Pégourié-Gonnard | 3385cf4 | 2015-04-02 17:59:30 +0100 | [diff] [blame] | 12 | exit 1 |
| 13 | fi |
| 14 | |
Manuel Pégourié-Gonnard | 9afdc83 | 2015-08-04 17:15:13 +0200 | [diff] [blame] | 15 | cp include/mbedtls/config.h include/mbedtls/config.h.bak |
Manuel Pégourié-Gonnard | 3385cf4 | 2015-04-02 17:59:30 +0100 | [diff] [blame] | 16 | scripts/config.pl full |
| 17 | CFLAGS=-fno-asynchronous-unwind-tables make clean lib >/dev/null 2>&1 |
Manuel Pégourié-Gonnard | 9afdc83 | 2015-08-04 17:15:13 +0200 | [diff] [blame] | 18 | mv include/mbedtls/config.h.bak include/mbedtls/config.h |
Manuel Pégourié-Gonnard | bf6ed08 | 2015-08-04 17:34:18 +0200 | [diff] [blame] | 19 | if uname | grep -F Darwin >/dev/null; then |
| 20 | nm -gUj library/libmbed*.a 2>/dev/null | sed -n -e 's/^_//p' |
| 21 | elif uname | grep -F Linux >/dev/null; then |
| 22 | nm -og library/libmbed*.a | grep -v '^[^ ]*: *U \|^$\|^[^ ]*:$' | sed 's/^[^ ]* . //' |
| 23 | fi | sort > exported-symbols |
Manuel Pégourié-Gonnard | 3385cf4 | 2015-04-02 17:59:30 +0100 | [diff] [blame] | 24 | make clean |
| 25 | |
| 26 | wc -l exported-symbols |