From: Ryan Bloom Date: Mon, 30 Oct 2000 23:08:27 +0000 (+0000) Subject: This is an ugly little hack to allow DSO modules to work. This basically X-Git-Tag: APACHE_2_0_ALPHA_8~222 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=511d2c481ca85bf5ca22967139d0fbe1db86c9db;p=thirdparty%2Fapache%2Fhttpd.git This is an ugly little hack to allow DSO modules to work. This basically forces Apache to link in all of the APR functions whether they are used by any static modules or not. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86770 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/build/build.mk b/build/build.mk index b5dbb907f21..d4a58ec5c73 100644 --- a/build/build.mk +++ b/build/build.mk @@ -60,7 +60,7 @@ STAMP = buildmk.stamp -all: $(STAMP) generated_lists +all: $(STAMP) generated_lists export_lists @$(MAKE) AMFLAGS=$(AMFLAGS) -s -f build/build2.mk generated_lists: @@ -72,6 +72,9 @@ generated_lists: @echo config_m4_files = `find . -name config.m4` > $@ @n=`helpers/PrintPath libtoolize`; echo libtool_prefix = `dirname $$n`/.. >> $@ +export_lists: + @build/buildexports.sh main/exports.c support/httpd.exp + $(STAMP): build/buildcheck.sh @build/buildcheck.sh && touch $(STAMP) diff --git a/build/buildexports.sh b/build/buildexports.sh new file mode 100755 index 00000000000..c8313f3bb0c --- /dev/null +++ b/build/buildexports.sh @@ -0,0 +1,31 @@ +#! /bin/sh + +exec >$1 +exec <$2 + +echo "/* This is an ugly hack that needs to be here, so that libtool will" +echo " * link all of the APR functions into server regardless of whether" +echo " * the base server uses them." +echo " */" +echo "" + +cd lib/apr/include +for file in *.h +do + echo "#include \"$file\"" +done +cd ../../../ +echo "" +echo "" + +while read LINE +do + if [ "x`echo $LINE | egrep '^[:space:]*apr_'`" != "x" ]; then + newline=`echo "$LINE" |\ + sed -e 's%^\(.*\)%void *ap_hack_\1 = \1\;%'` + echo $newline + fi +done + +echo "void *ap_ugly_hack;" +exit 0 diff --git a/include/http_main.h b/include/http_main.h index ce07f4914d9..33f9f486afb 100644 --- a/include/http_main.h +++ b/include/http_main.h @@ -89,6 +89,8 @@ extern AP_DECLARE_DATA apr_array_header_t *ap_server_post_read_config; * effect the server based on command line options */ extern AP_DECLARE_DATA apr_array_header_t *ap_server_config_defines; +extern void *ap_ugly_hack; + #ifdef __cplusplus } #endif diff --git a/server/Makefile.in b/server/Makefile.in index dd30e010f88..e1b779537c0 100644 --- a/server/Makefile.in +++ b/server/Makefile.in @@ -9,7 +9,7 @@ LTLIBRARY_SOURCES = \ util_script.c util_uri.c util_md5.c util_cfgtree.c util_ebcdic.c \ rfc1413.c http_connection.c listen.c \ mpm_common.c util_charset.c util_debug.c util_xml.c \ - util_filter.c + util_filter.c exports.c include $(top_srcdir)/build/ltlib.mk diff --git a/server/main.c b/server/main.c index 9682eff8754..6cd35b64745 100644 --- a/server/main.c +++ b/server/main.c @@ -293,6 +293,13 @@ int main(int argc, char *argv[]) const char *optarg; apr_initialize(); + + /* This ugly little hack pulls any function referenced in exports.c into + * the web server. exports.c is generated by buildconf, and it + * has all of the apr functions specified by httpd.exp. + */ + ap_ugly_hack = apr_initialize; + process = create_process(argc, argv); pglobal = process->pool; pconf = process->pconf; diff --git a/support/httpd.exp b/support/httpd.exp index b057c94994c..93c98731d5c 100644 --- a/support/httpd.exp +++ b/support/httpd.exp @@ -333,6 +333,8 @@ apr_signal apr_snprintf apr_socket_from_file apr_stat +apr_strnatcmp +apr_strnatcasecmp apr_table_add apr_table_addn apr_table_do