diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2007-02-02 07:33:18 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2007-02-02 07:33:18 +0000 |
commit | e66581d3268466871dac602e0b083811ca20ef48 (patch) | |
tree | 31aacac4c5ef2ecde881c8b415093c78ab061eff /solenv/bin/addsym-macosx.sh | |
parent | cb2a7121ecedb1a00be54e91f0ea3bad4807d700 (diff) |
INTEGRATION: CWS macosxmapfiles (1.1.2); FILE ADDED
2007/01/26 10:27:25 pjanik 1.1.2.4: Minor corrections, typos and spacing.
2007/01/26 09:46:33 tra 1.1.2.3: #69351#Now also handling '?'
2007/01/24 06:57:37 tra 1.1.2.2: #i69351# general cleanup and better documentation
2007/01/21 13:36:13 tra 1.1.2.1: #i69351#a helper script to extract symbols specified with wildcards from map files
Diffstat (limited to 'solenv/bin/addsym-macosx.sh')
-rwxr-xr-x | solenv/bin/addsym-macosx.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/solenv/bin/addsym-macosx.sh b/solenv/bin/addsym-macosx.sh new file mode 100755 index 000000000000..8c75c4c55707 --- /dev/null +++ b/solenv/bin/addsym-macosx.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# This script is needed in the process of generating exported +# symbols list out of map files on Mac OS X (see also #i69351#) +# The magic generating the regular expression from the temporary +# mapfile containing only star and question mark symbols +# +# The script has to be called as follows: +# nm -gx <file>.o | addsym-macosx.sh <file-with-wildcard-symbols> <temporary-file-where-to-write-the-search-expression-to> +# See tg_shl.mk for an example of how to use the script +# +# Replace every * with .* and every ? with . to get awk expression +# Put ^ at the beginning of every expression +# Put $ at the beginning of every expression +# Connect them all on one line, separated by | +# Remove | at the end of this regular expression because the last end +# of line was also replaced by | + +cat $1 | sed 's#*#.*#g +s#?#.#g +s#^#^# +s#$#$#' | tr '\n' '|' | sed "s#|\$##" >$2 + +# Please note that the awk expression expects to get the output of 'nm -gx'! +awk -v SYMBOLSREGEXP="`cat $2`" ' +match ($6,SYMBOLSREGEXP) > 0 && $6 !~ /_GLOBAL_/ { if ($2 != 1) print $6 }' |