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