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
8 # http://www.apache.org/licenses/LICENSE-2.0
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.
18 printf(" * THIS FILE WAS AUTOGENERATED BY make_exports.awk\n")
20 printf(" * This is an ugly hack that needs to be here, so\n")
21 printf(" * that libtool will link all of the APR functions\n")
22 printf(" * into server regardless of whether the base server\n")
23 printf(" * uses them.\n")
27 for (i = 1; i < ARGC; i++) {
29 sub("([^/]*[/])*", "", file)
30 printf("#include \"%s\"\n", file)
34 printf("const void *ap_ugly_hack = NULL;\n")
44 stack[stackptr] = line
48 function do_output() {
50 printf(" * %s\n", FILENAME)
53 for (i = 0; i < stackptr; i++) {
54 printf("%s\n", stack[i])
62 function enter_scope(type) {
64 scope_type[scope] = type
65 scope_stack[scope] = stackptr
66 delete scope_used[scope]
69 function leave_scope() {
70 used = scope_used[scope]
73 stackptr = scope_stack[scope]
84 function add_symbol(symbol) {
85 if (!index(symbol, "#")) {
86 push("const void *ap_hack_" symbol " = (const void *)" symbol ";")
91 /^[ \t]*AP[RU]?_(CORE_)?DECLARE[^(]*[(][^)]*[)]([^ ]* )*[^(]+[(]/ {
92 sub("[ \t]*AP[RU]?_(CORE_)?DECLARE[^(]*[(][^)]*[)][ \t]*", "")
94 sub("([^ ]* (^([ \t]*[(])))+", "")
100 /^[ \t]*AP_DECLARE_HOOK[^(]*[(][^)]*/ {
103 sub("^[ \t]+", "", symbol)
104 sub("[ \t]+$", "", symbol)
106 add_symbol("ap_hook_" symbol)
107 add_symbol("ap_hook_get_" symbol)
108 add_symbol("ap_run_" symbol)
112 /^[ \t]*APR_POOL_DECLARE_ACCESSOR[^(]*[(][^)]*[)]/ {
113 sub("[ \t]*APR_POOL_DECLARE_ACCESSOR[^(]*[(]", "", $0)
114 sub("[)].*$", "", $0)
115 add_symbol("apr_" $0 "_pool_get")
119 /^[ \t]*APR_DECLARE_INHERIT_SET[^(]*[(][^)]*[)]/ {
120 sub("[ \t]*APR_DECLARE_INHERIT_SET[^(]*[(]", "", $0)
121 sub("[)].*$", "", $0)
122 add_symbol("apr_" $0 "_inherit_set")
126 /^[ \t]*APR_DECLARE_INHERIT_UNSET[^(]*[(][^)]*[)]/ {
127 sub("[ \t]*APR_DECLARE_INHERIT_UNSET[^(]*[(]", "", $0)
128 sub("[)].*$", "", $0)
129 add_symbol("apr_" $0 "_inherit_unset")
133 /^#[ \t]*if(ndef| !defined[(])([^_]*_)*H/ {
134 enter_scope(TYPE_HEADER)
138 /^#[ \t]*if([n]?def)? / {
139 enter_scope(TYPE_NORMAL)
145 if (scope_type[scope] == TYPE_NORMAL)