xref: /aoo4110/main/solenv/bin/addsym.awk (revision b1cdbd2c)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22# Add certain symbol patterns to the first global section.
23#
24# The below code fails with 'perverted' mapfiles (using a strange line layout,
25# or containing version UDK_3_0_0 without a global section, ...).
26
27BEGIN { state = 0 }
28END {
29    if (state == 0) {
30        print "# Weak RTTI symbols for C++ exceptions:"
31        print "UDK_3_0_0 {"
32        print "global:"
33        print "_ZTI*; _ZTS*; # weak RTTI symbols for C++ exceptions"
34        if (ENVIRON["USE_SYSTEM_STL"] != "YES")
35            print "_ZN4_STL7num_put*; # for STLport"
36        print "};"
37    }
38}
39state == 2 {
40    print "_ZTI*; _ZTS*; # weak RTTI symbols for C++ exceptions"
41    if (ENVIRON["USE_SYSTEM_STL"] != "YES")
42        print "_ZN4_STL7num_put*; # for STLport"
43    state = 3
44}
45# #i66636# - ???
46/^[\t ]*UDK_3_0_0[\t ]*\{/ { state = 1 }
47/^[\t ]*global[\t ]*:/ && state == 1 { state = 2 }
48{ print }
49