5bfd485d26d383f3df393482c684b054cb7220e1
[Faustine.git] / interpretor / libsndfile-1.0.25 / src / make-static-lib-hidden-privates.sh
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
7 grep sf_ Symbols.gnu-binutils | sed -e "s/[ ;]//g" > Symbols.static
8
9 ld -r --whole-archive .libs/libsndfile.a -o libsndfile_a.o
10
11 objcopy --keep-global-symbols=Symbols.static libsndfile_a.o libsndfile.o
12
13 rm -f libsndfile.a
14 ar cru libsndfile.a libsndfile.o