Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 38358 invoked from network); 1 Apr 2011 00:30:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Apr 2011 00:30:01 -0000 Received: (qmail 34105 invoked by uid 500); 1 Apr 2011 00:30:01 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 34049 invoked by uid 500); 1 Apr 2011 00:30:00 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 34041 invoked by uid 99); 1 Apr 2011 00:30:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Apr 2011 00:30:00 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Apr 2011 00:29:56 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 2965723888E7; Fri, 1 Apr 2011 00:29:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1087521 - in /apr/apr/branches: 0.9.x/build/ 1.3.x/build/ 1.4.x/build/ 1.5.x/build/ Date: Fri, 01 Apr 2011 00:29:34 -0000 To: commits@apr.apache.org From: fuankg@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110401002935.2965723888E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: fuankg Date: Fri Apr 1 00:29:34 2011 New Revision: 1087521 URL: http://svn.apache.org/viewvc?rev=1087521&view=rev Log: Removed dependency on sort command for export list. Added a shell sort function to the NetWare export script which is only few ms slower than the external sort command; this makes the export list now identical on all build platforms. Modified: apr/apr/branches/0.9.x/build/NWGNUmakefile apr/apr/branches/0.9.x/build/NWGNUtail.inc apr/apr/branches/0.9.x/build/make_nw_export.awk apr/apr/branches/1.3.x/build/NWGNUenvironment.inc apr/apr/branches/1.3.x/build/NWGNUmakefile apr/apr/branches/1.3.x/build/make_nw_export.awk apr/apr/branches/1.4.x/build/NWGNUenvironment.inc apr/apr/branches/1.4.x/build/NWGNUmakefile apr/apr/branches/1.4.x/build/make_nw_export.awk apr/apr/branches/1.5.x/build/NWGNUenvironment.inc apr/apr/branches/1.5.x/build/NWGNUmakefile apr/apr/branches/1.5.x/build/make_nw_export.awk Modified: apr/apr/branches/0.9.x/build/NWGNUmakefile URL: http://svn.apache.org/viewvc/apr/apr/branches/0.9.x/build/NWGNUmakefile?rev=1087521&r1=1087520&r2=1087521&view=diff ============================================================================== --- apr/apr/branches/0.9.x/build/NWGNUmakefile (original) +++ apr/apr/branches/0.9.x/build/NWGNUmakefile Fri Apr 1 00:29:34 2011 @@ -30,13 +30,13 @@ nlms :: $(APR)/aprlib.imp $(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 @@ install :: nlms FORCE 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 Modified: apr/apr/branches/0.9.x/build/NWGNUtail.inc URL: http://svn.apache.org/viewvc/apr/apr/branches/0.9.x/build/NWGNUtail.inc?rev=1087521&r1=1087520&r2=1087521&view=diff ============================================================================== --- apr/apr/branches/0.9.x/build/NWGNUtail.inc (original) +++ apr/apr/branches/0.9.x/build/NWGNUtail.inc Fri Apr 1 00:29:34 2011 @@ -97,6 +97,8 @@ VERSION = 0,9,0 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 Modified: apr/apr/branches/0.9.x/build/make_nw_export.awk URL: http://svn.apache.org/viewvc/apr/apr/branches/0.9.x/build/make_nw_export.awk?rev=1087521&r1=1087520&r2=1087521&view=diff ============================================================================== --- apr/apr/branches/0.9.x/build/make_nw_export.awk (original) +++ apr/apr/branches/0.9.x/build/make_nw_export.awk Fri Apr 1 00:29:34 2011 @@ -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 @@ function add_symbol (sym_name) { 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 @@ function add_symbol (sym_name) { 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]) +} + Modified: apr/apr/branches/1.3.x/build/NWGNUenvironment.inc URL: http://svn.apache.org/viewvc/apr/apr/branches/1.3.x/build/NWGNUenvironment.inc?rev=1087521&r1=1087520&r2=1087521&view=diff ============================================================================== --- apr/apr/branches/1.3.x/build/NWGNUenvironment.inc (original) +++ apr/apr/branches/1.3.x/build/NWGNUenvironment.inc Fri Apr 1 00:29:34 2011 @@ -144,7 +144,6 @@ LIB = mwldnlm -type library -w nocmdline # Setup build tools AWK = awk -SORT = sort # # Declare Command and tool macros here Modified: apr/apr/branches/1.3.x/build/NWGNUmakefile URL: http://svn.apache.org/viewvc/apr/apr/branches/1.3.x/build/NWGNUmakefile?rev=1087521&r1=1087520&r2=1087521&view=diff ============================================================================== --- apr/apr/branches/1.3.x/build/NWGNUmakefile (original) +++ apr/apr/branches/1.3.x/build/NWGNUmakefile Fri Apr 1 00:29:34 2011 @@ -29,7 +29,7 @@ nlms :: $(APR)/aprlib.imp $(APR)/aprlib.imp : make_nw_export.awk nw_export.i @echo $(DL)GEN $@$(DL) - $(AWK) -v EXPPREFIX=APR$(VERSION_MAJMIN) -f $^ | $(SORT) >$@ + $(AWK) -v EXPPREFIX=APR$(VERSION_MAJMIN) -f $^ >$@ nw_export.i : nw_export.inc $(APU)/build/nw_apu_export.inc $(FILES_prebuild_headers) cc.opt @echo $(DL)GEN $@$(DL) Modified: apr/apr/branches/1.3.x/build/make_nw_export.awk URL: http://svn.apache.org/viewvc/apr/apr/branches/1.3.x/build/make_nw_export.awk?rev=1087521&r1=1087520&r2=1087521&view=diff ============================================================================== --- apr/apr/branches/1.3.x/build/make_nw_export.awk (original) +++ apr/apr/branches/1.3.x/build/make_nw_export.awk Fri Apr 1 00:29:34 2011 @@ -13,18 +13,17 @@ # 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(" (%s)\n", EXPPREFIX) + add_symbol("apr_wait_for_io_or_timeout") } function add_symbol(sym_name) { - found++ sub(" ", "", sym_name) - printf(" %s,\n", sym_name) + exports[++idx] = sym_name } # List of functions that we don't support, yet?? @@ -77,8 +76,31 @@ function add_symbol(sym_name) { add_symbol($NF) } + END { - add_symbol("apr_wait_for_io_or_timeout"); -# printf("\n\n#found: %d symbols.\n", found) + 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]) } Modified: apr/apr/branches/1.4.x/build/NWGNUenvironment.inc URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/build/NWGNUenvironment.inc?rev=1087521&r1=1087520&r2=1087521&view=diff ============================================================================== --- apr/apr/branches/1.4.x/build/NWGNUenvironment.inc (original) +++ apr/apr/branches/1.4.x/build/NWGNUenvironment.inc Fri Apr 1 00:29:34 2011 @@ -144,7 +144,6 @@ LIB = mwldnlm -type library -w nocmdline # Setup build tools AWK = awk -SORT = sort # # Declare Command and tool macros here Modified: apr/apr/branches/1.4.x/build/NWGNUmakefile URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/build/NWGNUmakefile?rev=1087521&r1=1087520&r2=1087521&view=diff ============================================================================== --- apr/apr/branches/1.4.x/build/NWGNUmakefile (original) +++ apr/apr/branches/1.4.x/build/NWGNUmakefile Fri Apr 1 00:29:34 2011 @@ -29,7 +29,7 @@ nlms :: $(APR)/aprlib.imp $(APR)/aprlib.imp : make_nw_export.awk nw_export.i @echo $(DL)GEN $@$(DL) - $(AWK) -v EXPPREFIX=APR$(VERSION_MAJMIN) -f $^ | $(SORT) >$@ + $(AWK) -v EXPPREFIX=APR$(VERSION_MAJMIN) -f $^ >$@ nw_export.i : nw_export.inc $(APU)/build/nw_apu_export.inc $(FILES_prebuild_headers) cc.opt @echo $(DL)GEN $@$(DL) Modified: apr/apr/branches/1.4.x/build/make_nw_export.awk URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/build/make_nw_export.awk?rev=1087521&r1=1087520&r2=1087521&view=diff ============================================================================== --- apr/apr/branches/1.4.x/build/make_nw_export.awk (original) +++ apr/apr/branches/1.4.x/build/make_nw_export.awk Fri Apr 1 00:29:34 2011 @@ -13,18 +13,17 @@ # 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(" (%s)\n", EXPPREFIX) + add_symbol("apr_wait_for_io_or_timeout") } function add_symbol(sym_name) { - found++ sub(" ", "", sym_name) - printf(" %s,\n", sym_name) + exports[++idx] = sym_name } # List of functions that we don't support, yet?? @@ -77,8 +76,31 @@ function add_symbol(sym_name) { add_symbol($NF) } + END { - add_symbol("apr_wait_for_io_or_timeout"); -# printf("\n\n#found: %d symbols.\n", found) + 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]) } Modified: apr/apr/branches/1.5.x/build/NWGNUenvironment.inc URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/build/NWGNUenvironment.inc?rev=1087521&r1=1087520&r2=1087521&view=diff ============================================================================== --- apr/apr/branches/1.5.x/build/NWGNUenvironment.inc (original) +++ apr/apr/branches/1.5.x/build/NWGNUenvironment.inc Fri Apr 1 00:29:34 2011 @@ -144,7 +144,6 @@ LIB = mwldnlm -type library -w nocmdline # Setup build tools AWK = awk -SORT = sort # # Declare Command and tool macros here Modified: apr/apr/branches/1.5.x/build/NWGNUmakefile URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/build/NWGNUmakefile?rev=1087521&r1=1087520&r2=1087521&view=diff ============================================================================== --- apr/apr/branches/1.5.x/build/NWGNUmakefile (original) +++ apr/apr/branches/1.5.x/build/NWGNUmakefile Fri Apr 1 00:29:34 2011 @@ -29,7 +29,7 @@ nlms :: $(APR)/aprlib.imp $(APR)/aprlib.imp : make_nw_export.awk nw_export.i @echo $(DL)GEN $@$(DL) - $(AWK) -v EXPPREFIX=APR$(VERSION_MAJMIN) -f $^ | $(SORT) >$@ + $(AWK) -v EXPPREFIX=APR$(VERSION_MAJMIN) -f $^ >$@ nw_export.i : nw_export.inc $(APU)/build/nw_apu_export.inc $(FILES_prebuild_headers) cc.opt @echo $(DL)GEN $@$(DL) Modified: apr/apr/branches/1.5.x/build/make_nw_export.awk URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/build/make_nw_export.awk?rev=1087521&r1=1087520&r2=1087521&view=diff ============================================================================== --- apr/apr/branches/1.5.x/build/make_nw_export.awk (original) +++ apr/apr/branches/1.5.x/build/make_nw_export.awk Fri Apr 1 00:29:34 2011 @@ -13,18 +13,17 @@ # 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(" (%s)\n", EXPPREFIX) + add_symbol("apr_wait_for_io_or_timeout") } function add_symbol(sym_name) { - found++ sub(" ", "", sym_name) - printf(" %s,\n", sym_name) + exports[++idx] = sym_name } # List of functions that we don't support, yet?? @@ -77,8 +76,31 @@ function add_symbol(sym_name) { add_symbol($NF) } + END { - add_symbol("apr_wait_for_io_or_timeout"); -# printf("\n\n#found: %d symbols.\n", found) + 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]) }