diff options
author | Guenter Knauf <fuankg@apache.org> | 2011-03-31 04:57:27 +0000 |
---|---|---|
committer | Guenter Knauf <fuankg@apache.org> | 2011-03-31 04:57:27 +0000 |
commit | 9f3a2c2076b57d3b8136b06c62698183ef1cbcad (patch) | |
tree | 9d10224b16502ba8ec0edd34a1774e23acb8ee9c /build/make_nw_export.awk | |
parent | 52c5ed3b9e351af8c241d6059496a4d0e5378ac8 (diff) | |
download | apr-9f3a2c2076b57d3b8136b06c62698183ef1cbcad.tar.gz |
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/apr/apr/trunk@1087184 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'build/make_nw_export.awk')
-rw-r--r-- | build/make_nw_export.awk | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/build/make_nw_export.awk b/build/make_nw_export.awk index 60835eb2f..14f60ffdb 100644 --- a/build/make_nw_export.awk +++ b/build/make_nw_export.awk @@ -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]) } |