blob: c25871942918614f1245f5ac695b8ea246ad02b5 [file] [log] [blame]
Manuel Pégourié-Gonnard3385cf42015-04-02 17:59:30 +01001#!/bin/sh
2
3set -eu
4
Manuel Pégourié-Gonnardd1ddd292015-04-09 10:15:10 +02005if [ -d include/mbedtls ]; then :; else
6 echo "$0: must be run from root" >&2
7 exit 1
8fi
9
Manuel Pégourié-Gonnard3385cf42015-04-02 17:59:30 +010010if grep -i cmake Makefile >/dev/null; then
Manuel Pégourié-Gonnardd1ddd292015-04-09 10:15:10 +020011 echo "$0: not compatible with cmake" >&2
Manuel Pégourié-Gonnard3385cf42015-04-02 17:59:30 +010012 exit 1
13fi
14
Manuel Pégourié-Gonnard9afdc832015-08-04 17:15:13 +020015cp include/mbedtls/config.h include/mbedtls/config.h.bak
Manuel Pégourié-Gonnard3385cf42015-04-02 17:59:30 +010016scripts/config.pl full
17CFLAGS=-fno-asynchronous-unwind-tables make clean lib >/dev/null 2>&1
Manuel Pégourié-Gonnard9afdc832015-08-04 17:15:13 +020018mv include/mbedtls/config.h.bak include/mbedtls/config.h
Manuel Pégourié-Gonnardbf6ed082015-08-04 17:34:18 +020019if uname | grep -F Darwin >/dev/null; then
20 nm -gUj library/libmbed*.a 2>/dev/null | sed -n -e 's/^_//p'
21elif uname | grep -F Linux >/dev/null; then
22 nm -og library/libmbed*.a | grep -v '^[^ ]*: *U \|^$\|^[^ ]*:$' | sed 's/^[^ ]* . //'
23fi | sort > exported-symbols
Manuel Pégourié-Gonnard3385cf42015-04-02 17:59:30 +010024make clean
25
26wc -l exported-symbols