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