]> git.notmuchmail.org Git - notmuch/commitdiff
lib/gen-version-script.sh: replace --defined argument to nm with awk
authorDavid Bremner <bremner@debian.org>
Mon, 5 Sep 2011 02:50:36 +0000 (23:50 -0300)
committerDavid Bremner <bremner@debian.org>
Mon, 5 Sep 2011 10:39:44 +0000 (07:39 -0300)
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.

lib/gen-version-script.sh

index ec801966f97e406aebd1d221e092f118d80d868c..bf152cc9b2da286e0fc71db6ad0bdbf28dd3bf80 100644 (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