lib/gen-version-script.sh: replace --defined argument to nm with awk

OpenBSD nm apparently doesn't support --defined.

The awk condition is based on the assumption that all defined symbols
have some hex number in the first column.

Thanks to Matthias Guedemann reporting the problem, and an earlier
version of this patch.
This commit is contained in:
David Bremner 2011-09-04 23:50:36 -03:00
parent 8e2a14bbbb
commit 80212b1329

View file

@ -12,7 +12,7 @@ HEADER=$1
shift
printf '{\nglobal:\n'
nm --defined $* | awk '$3 ~ "Xapian.*Error" {print $3}' | sort | uniq | \
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