]> granicus.if.org Git - apache/blob - build/make_nw_export.awk
Add support for an "epoch" in the RPM spec file. This epoch is a discrete
[apache] / build / make_nw_export.awk
1 # Licensed to the Apache Software Foundation (ASF) under one or more
2 # contributor license agreements.  See the NOTICE file distributed with
3 # this work for additional information regarding copyright ownership.
4 # The ASF licenses this file to You under the Apache License, Version 2.0
5 # (the "License"); you may not use this file except in compliance with
6 # the License.  You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16 #
17 # Based on apr's make_export.awk, which is
18 # based on Ryan Bloom's make_export.pl
19
20 BEGIN {
21     printf(" ("EXPPREFIX")\n")
22 }
23
24 # List of functions that we don't support, yet??
25 #/ap_some_name/{next}
26 /ap_mpm_pod_/{next}
27
28 /^[ \t]*AP([RU]|_CORE|_WD)?_DECLARE[^(]*[(][^)]*[)]([^ ]* )*[^(]+[(]/ {
29     sub("[ \t]*AP([RU]|_CORE|_WD)?_DECLARE[^(]*[(][^)]*[)][ \t]*", "")
30     sub("[(].*", "")
31     sub("([^ ]* (^([ \t]*[(])))+", "")
32     add_symbol($0)
33     next
34 }
35
36 /^[ \t]*AP_DECLARE_HOOK[^(]*[(][^)]*/ {
37     split($0, args, ",")
38     symbol = args[2]
39     sub("^[ \t]+", "", symbol)
40     sub("[ \t]+$", "", symbol)
41     add_symbol("ap_hook_" symbol)
42     add_symbol("ap_hook_get_" symbol)
43     add_symbol("ap_run_" symbol)
44     next
45 }
46
47 /^[ \t]*AP[RU]?_DECLARE_EXTERNAL_HOOK[^(]*[(][^)]*/ {
48     split($0, args, ",")
49     symbol = args[4]
50     sub("^[ \t]+", "", symbol)
51     sub("[ \t]+$", "", symbol)
52     add_symbol("ap_hook_" symbol)
53     add_symbol("ap_hook_get_" symbol)
54     add_symbol("ap_run_" symbol)
55     next
56 }
57
58 /^[ \t]*APR_POOL_DECLARE_ACCESSOR[^(]*[(][^)]*[)]/ {
59     sub("[ \t]*APR_POOL_DECLARE_ACCESSOR[^(]*[(]", "", $0)
60     sub("[)].*$", "", $0)
61     add_symbol("apr_" $0 "_pool_get")
62     next
63 }
64
65 /^[ \t]*APR_DECLARE_INHERIT_SET[^(]*[(][^)]*[)]/ {
66     sub("[ \t]*APR_DECLARE_INHERIT_SET[^(]*[(]", "", $0)
67     sub("[)].*$", "", $0)
68     add_symbol("apr_" $0 "_inherit_set")
69     next
70 }
71
72 /^[ \t]*APR_DECLARE_INHERIT_UNSET[^(]*[(][^)]*[)]/ {
73     sub("[ \t]*APR_DECLARE_INHERIT_UNSET[^(]*[(]", "", $0)
74     sub("[)].*$", "", $0)
75     add_symbol("apr_" $0 "_inherit_unset")
76     next
77 }
78
79 /^[ \t]*(extern[ \t]+)?AP[RU]?_DECLARE_DATA .*;$/ {
80     gsub(/[*;]/, "", $NF)
81     gsub(/\[.*\]/, "", $NF)
82     add_symbol($NF)
83 }
84
85 #END {
86 #    printf("\n\n#found: %d symbols.\n", found)
87 #}
88
89 function add_symbol(sym_name) {
90     found++
91     sub (" ", "", sym_name)
92     printf(" %s,\n", sym_name)
93 }
94
95