diff -ru apr-0.9.19/build/make_nw_export.awk apr-0.9.20/build/make_nw_export.awk --- apr-0.9.19/build/make_nw_export.awk 2004-11-24 18:10:04.000000000 -0500 +++ apr-0.9.20/build/make_nw_export.awk 2011-03-31 20:29:34.000000000 -0400 @@ -1,33 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# # Based on apr's make_export.awk, which is # based on Ryan Bloom's make_export.pl +# BEGIN { - printf(" (APRLIB)\n") + add_symbol("apr_wait_for_io_or_timeout") +} + +function add_symbol(sym_name) { + sub(" ", "", sym_name) + exports[++idx] = sym_name } # List of functions that we don't support, yet?? #/apr_##name##_set_inherit/{next} #/apr_##name##_unset_inherit/{next} - -function add_symbol (sym_name) { - if (count) { - found++ - } - gsub (/ /, "", sym_name) - line = line sym_name ",\n" - - if (count == 0) { - printf(" %s", line) - line = "" - } -} - /^[ \t]*AP[RUI]?_DECLARE[^(]*[(][^)]*[)]([^ ]* )*[^(]+[(]/ { sub("[ \t]*AP[RUI]?_DECLARE[^(]*[(][^)]*[)][ \t]*", "") sub("[(].*", "") sub("([^ ]* (^([ \t]*[(])))+", "") - add_symbol($0) next } @@ -37,7 +43,6 @@ symbol = args[2] sub("^[ \t]+", "", symbol) sub("[ \t]+$", "", symbol) - add_symbol("ap_hook_" symbol) add_symbol("ap_hook_get_" symbol) add_symbol("ap_run_" symbol) @@ -65,14 +70,37 @@ next } -/^[ \t]*AP[RUI]?_DECLARE_DATA .*;$/ { - varname = $NF; - gsub( /[*;]/, "", varname); - gsub( /\[.*\]/, "", varname); - add_symbol(varname); +/^[ \t]*AP[RUI]?_DECLARE_DATA .*;/ { + gsub(/[*;\n\r]/, "", $NF) + gsub(/\[.*\]/, "", $NF) + add_symbol($NF) } -#END { -# printf(" %s", line) -#} +END { + printf("Added %d symbols to export list.\n", idx) > "/dev/stderr" + # sort symbols with shell sort + increment = int(idx / 2) + while (increment > 0) { + for (i = increment+1; i <= idx; i++) { + j = i + temp = exports[i] + while ((j >= increment+1) && (exports[j-increment] > temp)) { + exports[j] = exports[j-increment] + j -= increment + } + exports[j] = temp + } + if (increment == 2) + increment = 1 + else + increment = int(increment*5/11) + } + # print the array + printf(" (%s)\n", EXPPREFIX) + while (x < idx - 1) { + printf(" %s,\n", exports[++x]) + } + printf(" %s\n", exports[++x]) +} + diff -ru apr-0.9.19/build/NWGNUenvironment.inc apr-0.9.20/build/NWGNUenvironment.inc --- apr-0.9.19/build/NWGNUenvironment.inc 2009-07-18 17:21:07.000000000 -0400 +++ apr-0.9.20/build/NWGNUenvironment.inc 2011-03-02 11:21:26.000000000 -0500 @@ -152,6 +152,10 @@ CFLAGS = -c -nosyspath -Cpp_exceptions off -RTTI off -align 4 -w nocmdline -proc PII +ifeq "$(REQUIRE_PROTOTYPES)" "1" +CFLAGS += -r +endif + # -g generate debugging information # -O0 level 0 optimizations @@ -274,10 +278,10 @@ # Common directories # -APR = $(APR_WORK) -APRTEST = $(APR_WORK)/test -APRUTIL = $(APR_WORK)/../apr-util -XML = $(APRUTIL)/xml +APR = $(APR_WORK) +APRTEST = $(APR)/test +APRUTIL = $(APU_WORK) +XML = $(APRUTIL)/xml # # Internal Libraries diff -ru apr-0.9.19/build/NWGNUmakefile apr-0.9.20/build/NWGNUmakefile --- apr-0.9.19/build/NWGNUmakefile 2010-10-08 21:48:31.000000000 -0400 +++ apr-0.9.20/build/NWGNUmakefile 2011-03-31 20:29:34.000000000 -0400 @@ -30,13 +30,13 @@ $(APR)/aprlib.imp : make_nw_export.awk nw_export.i @echo Generating $(subst /,\,$@) - awk -f make_nw_export.awk nw_export.i | sort >$(APR)/aprlib.imp + $(AWK) -v EXPPREFIX=APRLIB -f $^ >$@ -nw_export.i : nw_export.inc $(FILES_prebuild_headers) $(NLM_NAME)_cc.opt +nw_export.i : nw_export.inc $(FILES_prebuild_headers) cc.opt @echo Generating $(subst /,\,$@) - $(CC) $< @$(NLM_NAME)_cc.opt + $(CC) $< @cc.opt -$(NLM_NAME)_cc.opt : NWGNUmakefile $(APR_WORK)\build\NWGNUenvironment.inc $(APR_WORK)\build\NWGNUhead.inc $(APR_WORK)\build\NWGNUtail.inc $(CUSTOM_INI) +cc.opt : NWGNUmakefile $(APR_WORK)\build\NWGNUenvironment.inc $(APR_WORK)\build\NWGNUhead.inc $(APR_WORK)\build\NWGNUtail.inc $(CUSTOM_INI) $(CHK) $@ $(DEL) $@ @echo -P >> $@ @echo -EP >> $@ @@ -91,7 +91,7 @@ clean :: $(CHK) nw_export.i $(DEL) nw_export.i - $(CHK) $(NLM_NAME)_cc.opt $(DEL) $(NLM_NAME)_cc.opt + $(CHK) cc.opt $(DEL) cc.opt $(CHK) NWGNUversion.inc $(DEL) NWGNUversion.inc $(CHK) $(subst /,\,$(APR))\include\apr.h $(DEL) $(subst /,\,$(APR))\include\apr.h $(CHK) $(subst /,\,$(APRUTIL))\include\apu.h $(DEL) $(subst /,\,$(APRUTIL))\include\apu.h diff -ru apr-0.9.19/build/NWGNUtail.inc apr-0.9.20/build/NWGNUtail.inc --- apr-0.9.19/build/NWGNUtail.inc 2009-07-04 15:18:22.000000000 -0400 +++ apr-0.9.20/build/NWGNUtail.inc 2011-03-31 20:29:34.000000000 -0400 @@ -7,7 +7,7 @@ # If we are going to create an nlm, make sure we have assigned variables to # use during the link. # -echo NLM_NAME=$(NLM_NAME) +#echo NLM_NAME=$(NLM_NAME) ifndef NLM_NAME NLM_NAME = $(TARGET_nlm) endif @@ -97,6 +97,8 @@ VERSION_STR = 0.9.0 endif endif +VERSION_MAJMIN = $(word 1,$(subst ., ,$(VERSION_STR)))$(word 2,$(subst ., ,$(VERSION_STR))) + ifeq "$(words $(strip $(TARGET_nlm)))" "1" INCLUDE_BLDCMDS=1 - ..\apr-util \ + $(APU_WORK) \ $(EOLIST) # @@ -26,10 +42,10 @@ # INCDIRS # XINCDIRS += \ - $(APR_WORK)/include \ - $(APR_WORK)/include/arch/NetWare \ - $(APR_WORK)/include/arch/unix \ - $(APR_WORK)/memory/unix \ + $(APR)/include \ + $(APR)/include/arch/NetWare \ + $(APR)/include/arch/unix \ + $(APR)/memory/unix \ $(APRUTIL)/xml \ $(EOLIST) @@ -102,7 +118,7 @@ # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = aprlib +NLM_NAME = aprlib # # This is used by the link '-desc ' directive. @@ -119,7 +135,7 @@ # If this is specified, it will override VERSION value in # $(APR_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -144,14 +160,14 @@ # # If this is specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # If this is specified it will be linked in with the XDCData option in the def # file instead of the default of $(APR)/misc/netware/apache.xdc. XDCData can # be disabled by setting APACHE_UNIPROC in the environment # -XDCDATA = +XDCDATA = # # Declare all target files (you must add your files here) @@ -229,9 +245,9 @@ # Any symbols exported to here # FILES_nlm_exports = \ - @aprlib.imp \ + @aprlib.imp \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character @@ -266,7 +282,6 @@ $(OBJDIR)/groupinfo.o \ $(OBJDIR)/inet_pton.o \ $(OBJDIR)/inet_ntop.o \ - $(OBJDIR)/libprews.o \ $(OBJDIR)/mktemp.o \ $(OBJDIR)/mmap.o \ $(OBJDIR)/open.o \ @@ -325,9 +340,8 @@ @echo xcopy docs $(INSTALLBASE)\docs\*.* $(XCOPYSW) >> xc.bat $(CMD) xc.bat $(DEL) xc.bat - -endif - +endif + $(INSTDIRS) :: $(CHKNOT) $@\NUL mkdir $@ @@ -337,10 +351,10 @@ -copy $(subst /,\,$(APRUTIL))\include\*.h $(INSTALLBASE)\include\*.* -copy $(subst /,\,$(APR))\*.imp $(INSTALLBASE)\lib\*.* -copy $(subst /,\,$(APR))\misc\netware\*.xdc $(INSTALLBASE)\lib\*.* - + $(INSTDEVDIRS) :: $(CHKNOT) $@\NUL mkdir $@ -endif +endif # # Any specialized rules here