Commit b53fe2fc authored by Guenter Knauf's avatar Guenter Knauf
Browse files

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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1087185 13f79535-47bb-0310-9956-ffa450edef68
parent fe7c68cc
Loading
Loading
Loading
Loading
+0 −1
Changes for build/NWGNUenvironment.inc: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -132,7 +132,6 @@ WIN_CC = mwcc

# Setup build tools
AWK	= awk
SORT	= sort

# Setup distribution tools
ZIP	= zip -qr9
+2 −2
Changes for build/NWGNUmakefile: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -29,11 +29,11 @@ libs :: chkapr $(NWOS)/chartables.c

$(DAV)/main/dav.imp : make_nw_export.awk $(DAV)/main/mod_dav.h
	@echo $(DL)GEN  $@$(DL)
	$(AWK) -v EXPPREFIX=AP$(VERSION_MAJMIN) -f $^ | $(SORT) >$@
	$(AWK) -v EXPPREFIX=AP$(VERSION_MAJMIN) -f $^ >$@

$(NWOS)/httpd.imp : make_nw_export.awk nw_export.i
	@echo $(DL)GEN  $@$(DL)
	$(AWK) -v EXPPREFIX=AP$(VERSION_MAJMIN) -f $^ | $(SORT) >$@
	$(AWK) -v EXPPREFIX=AP$(VERSION_MAJMIN) -f $^ >$@
    
nw_export.i : nw_export.inc $(FILES_prebuild_headers) cc.opt
	@echo $(DL)GEN  $@$(DL)
+31 −10
Changes for build/make_nw_export.awk: 31 added lines, 10 removed lines.
Original line number Diff line number Diff line
@@ -13,12 +13,16 @@
# 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)
}

function add_symbol(sym_name) {
    sub(" ", "", sym_name)
    exports[++idx] = sym_name
}

# List of functions that we don't support, yet??
@@ -84,14 +88,31 @@ BEGIN {
    add_symbol($NF)
}

#END {
#    printf("\n\n#found: %d symbols.\n", found)
#}

function add_symbol(sym_name) {
    found++
    sub (" ", "", sym_name)
    printf(" %s,\n", sym_name)
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])
}