blob: 82b6cc90bc9e3dfde1ecb2aa306bfc75cd1d87eb [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é-Gonnard3385cf42015-04-02 17:59:30 +010019nm -gUj library/libmbedtls.a 2>/dev/null | sed -n -e 's/^_//p' | sort > exported-symbols
20make clean
21
22wc -l exported-symbols