1 # Copyright 2001-2004 Apache Software Foundation
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
16 # Based on apr's make_export.awk, which is
17 # based on Ryan Bloom's make_export.pl
19 /^#[ \t]*if(def)? (AP[RU]?_|!?defined).*/ {
20 if (old_filename != FILENAME) {
21 if (old_filename != "") printf("%s", line)
25 old_filename = FILENAME
28 macro_stack[macro_no++] = macro
29 macro = substr($0, length($1)+2)
31 line = line "#ifdef " macro "\n"
38 line = line "#endif /* " macro " */\n"
39 macro = macro_stack[--macro_no]
50 function add_symbol (sym_name) {
54 for (i = 0; i < count; i++) {
57 line = line sym_name "\n"
65 /^[ \t]*(extern[ \t]+)?AP[RU]?_DECLARE_DATA .*;$/ {
67 gsub( /[*;]/, "", varname);
68 gsub( /\[.*\]/, "", varname);