apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fua...@apache.org
Subject svn commit: r1087184 - in /apr/apr/trunk/build: NWGNUenvironment.inc NWGNUmakefile make_nw_export.awk
Date Thu, 31 Mar 2011 04:57:27 GMT
Author: fuankg
Date: Thu Mar 31 04:57:27 2011
New Revision: 1087184

URL: http://svn.apache.org/viewvc?rev=1087184&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/trunk/build/NWGNUenvironment.inc
    apr/apr/trunk/build/NWGNUmakefile
    apr/apr/trunk/build/make_nw_export.awk

Modified: apr/apr/trunk/build/NWGNUenvironment.inc
URL: http://svn.apache.org/viewvc/apr/apr/trunk/build/NWGNUenvironment.inc?rev=1087184&r1=1087183&r2=1087184&view=diff
==============================================================================
--- apr/apr/trunk/build/NWGNUenvironment.inc (original)
+++ apr/apr/trunk/build/NWGNUenvironment.inc Thu Mar 31 04:57:27 2011
@@ -142,7 +142,6 @@ LIB	= mwldnlm -type library -w nocmdline
 
 # Setup build tools
 AWK	= awk
-SORT	= sort
 
 #
 # Declare Command and tool macros here

Modified: apr/apr/trunk/build/NWGNUmakefile
URL: http://svn.apache.org/viewvc/apr/apr/trunk/build/NWGNUmakefile?rev=1087184&r1=1087183&r2=1087184&view=diff
==============================================================================
--- apr/apr/trunk/build/NWGNUmakefile (original)
+++ apr/apr/trunk/build/NWGNUmakefile Thu Mar 31 04:57:27 2011
@@ -27,7 +27,7 @@ nlms :: $(APR)/aprlib.imp
 $(APR)/aprlib.imp : make_nw_export.awk nw_export.i
 #	@echo Generating $@
 	@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 $(FILES_prebuild_headers) cc.opt
 #	@echo Generating $@

Modified: apr/apr/trunk/build/make_nw_export.awk
URL: http://svn.apache.org/viewvc/apr/apr/trunk/build/make_nw_export.awk?rev=1087184&r1=1087183&r2=1087184&view=diff
==============================================================================
--- apr/apr/trunk/build/make_nw_export.awk (original)
+++ apr/apr/trunk/build/make_nw_export.awk Thu Mar 31 04:57:27 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??
@@ -88,7 +87,29 @@ function add_symbol(sym_name) {
 
 
 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