1#!/bin/bash -e 2 3# This script takes a static library and removes all non-public symbols. 4# Ie, it makes a static lib whose symbols are far less likely to clash with 5# the symbols of another shared or static library. 6 7grep sf_ Symbols.gnu-binutils | sed -e "s/[ ;]//g" > Symbols.static 8 9ld -r --whole-archive .libs/libsndfile.a -o libsndfile_a.o 10 11objcopy --keep-global-symbols=Symbols.static libsndfile_a.o libsndfile.o 12 13rm -f libsndfile.a 14ar cru libsndfile.a libsndfile.o 15