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")
26 printf("#define CORE_PRIVATE\n")
29 for (i = 1; i < ARGC; i++) {
31 sub("([^/]*[/])*", "", file)
32 printf("#include \"%s\"\n", file)
36 printf("const void *ap_ugly_hack = NULL;\n")
46 stack[stackptr] = line
50 function do_output() {
52 printf(" * %s\n", FILENAME)
55 for (i = 0; i < stackptr; i++) {
56 printf("%s\n", stack[i])
64 function enter_scope(type) {
66 scope_type[scope] = type
67 scope_stack[scope] = stackptr
68 delete scope_used[scope]
71 function leave_scope() {
72 used = scope_used[scope]
75 stackptr = scope_stack[scope]
86 function add_symbol(symbol) {
87 if (!index(symbol, "#")) {
88 push("const void *ap_hack_" symbol " = (const void *)" symbol ";")
93 /^[ \t]*AP[RU]?_(CORE_)?DECLARE[^(]*[(][^)]*[)]([^ ]* )*[^(]+[(]/ {
94 sub("[ \t]*AP[RU]?_(CORE_)?DECLARE[^(]*[(][^)]*[)][ \t]*", "")
96 sub("([^ ]* (^([ \t]*[(])))+", "")
102 /^[ \t]*AP_DECLARE_HOOK[^(]*[(][^)]*/ {
105 sub("^[ \t]+", "", symbol)
106 sub("[ \t]+$", "", symbol)
108 add_symbol("ap_hook_" symbol)
109 add_symbol("ap_hook_get_" symbol)
110 add_symbol("ap_run_" symbol)
114 /^[ \t]*APR_POOL_DECLARE_ACCESSOR[^(]*[(][^)]*[)]/ {
115 sub("[ \t]*APR_POOL_DECLARE_ACCESSOR[^(]*[(]", "", $0)
116 sub("[)].*$", "", $0)
117 add_symbol("apr_" $0 "_pool_get")
121 /^[ \t]*APR_DECLARE_INHERIT_SET[^(]*[(][^)]*[)]/ {
122 sub("[ \t]*APR_DECLARE_INHERIT_SET[^(]*[(]", "", $0)
123 sub("[)].*$", "", $0)
124 add_symbol("apr_" $0 "_inherit_set")
128 /^[ \t]*APR_DECLARE_INHERIT_UNSET[^(]*[(][^)]*[)]/ {
129 sub("[ \t]*APR_DECLARE_INHERIT_UNSET[^(]*[(]", "", $0)
130 sub("[)].*$", "", $0)
131 add_symbol("apr_" $0 "_inherit_unset")
135 /^#[ \t]*if(ndef| !defined[(])([^_]*_)*H/ {
136 enter_scope(TYPE_HEADER)
140 /^#[ \t]*if([n]?def)? / {
141 enter_scope(TYPE_NORMAL)
147 if (scope_type[scope] == TYPE_NORMAL)