apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fua...@apache.org
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 GMT
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])
 }
 



Mime
View raw message