From: Guenter Knauf Date: Thu, 31 Mar 2011 05:21:20 +0000 (+0000) Subject: Removed dependency on sort command for export list. X-Git-Tag: 2.3.12~129 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a09ac112153416cc5860bbc5192aa68f4985755e;p=thirdparty%2Fapache%2Fhttpd.git 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 --- diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index 2b0cc70ec28..e5fc7cef532 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -132,7 +132,6 @@ WIN_CC = mwcc # Setup build tools AWK = awk -SORT = sort # Setup distribution tools ZIP = zip -qr9 diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile index fe228b40297..8e588aeae73 100644 --- a/build/NWGNUmakefile +++ b/build/NWGNUmakefile @@ -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) diff --git a/build/make_nw_export.awk b/build/make_nw_export.awk index f2e1c9046b4..52f43e531c9 100644 --- a/build/make_nw_export.awk +++ b/build/make_nw_export.awk @@ -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]) } -