blob: 5bfd485d26d383f3df393482c684b054cb7220e1 [file] [log] [blame]
Alexandre Lision7c6f4a62013-09-05 13:27:01 -04001#!/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