notmuch/lib/gen-version-script.sh
David Bremner 9db2145272 lib/gen-version-script.h: add getline and getdelim to notmuch.sym if needed
If the configure script detects missing getline and/or getdelim
symbols, then notmuch will use it's own versions. This patch, based on
id:"87k49v12i5.fsf@pc44es141.cs.uni-magdeburg.de" by Matthias
Guedemann, adds the symbols to notmuch.sym as well so they are
properly exported from the library.
2011-09-05 07:44:14 -03:00

28 lines
716 B
Bash

# we go through a bit of work to get the unmangled names of the
# typeinfo symbols because of
# http://sourceware.org/bugzilla/show_bug.cgi?id=10326
if [ $# -lt 2 ]; then
echo Usage: $0 header obj1 obj2 obj3
exit 1;
fi
HEADER=$1
shift
printf '{\nglobal:\n'
nm $* | awk '$1 ~ "^[0-9a-fA-F][0-9a-fA-F]*$" && $3 ~ "Xapian.*Error" {print $3}' | sort | uniq | \
while read sym; do
demangled=$(c++filt $sym)
case $demangled in
typeinfo*)
printf "\t$sym;\n"
;;
*)
;;
esac
done
nm $* | awk '$1 ~ "^[0-9a-fA-F][0-9a-fA-F]*$" && $2 == "T" && $3 ~ "^get(line|delim)$" {print $3 ";"}'
sed -n 's/^[[:space:]]*\(notmuch_[a-z_]*\)[[:space:]]*(.*/ \1;/p' $HEADER
printf "local: *;\n};\n"