1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: unxmap-to-macosx-explist.awk,v $
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
32 # Generate an exported symbols list out of a map file (as use on Linux/Solaris) in order to
33 # build shared libraries on Mac OS X
35 # The below code fails may fail with 'perverted' mapfiles (using a strange line layout etc.)
37 # Skip 'SECTION_NAME {' lines
38 /^
[\t ]*.
*[\t ]*\
{/ { next }
40 # Skip 'global:' or 'local:' lines
41 /global
:/ || /local
:/ { next }
44 /^
[\t ]*\
*;[\t ]*/ { next }
46 # Skip section end '}?;' lines
47 /^
[\t ]*\
}[\t ]*.
*[;]*/ { next }
49 # Skip comment or empty lines
50 /^
[\t ]*#.*/ || /^[\t ]*$/ || /^$/ { next }
52 # Echo all lines containing symbol names and prefix them with '_'
53 # because symbols on Mac OS X start always with '__'
55 # There may appear multiple symbols in one line
56 # e.g. "sym1; sym2; # and finally a comment"
57 # take this into account
58 for (i =
1; i
<=
NF ; i
++) {
59 if ($i !~
/^
[\t ]*#.*/) { # as long as the current field doesn't start with '#'
60 gsub(/[\t ;]/, "", $i
) # Remove leading spaces and trailing ';'
63 else { # ignore everything after a '#' (comment) sign