]> granicus.if.org Git - apache/commitdiff
This is an ugly little hack to allow DSO modules to work. This basically
authorRyan Bloom <rbb@apache.org>
Mon, 30 Oct 2000 23:08:27 +0000 (23:08 +0000)
committerRyan Bloom <rbb@apache.org>
Mon, 30 Oct 2000 23:08:27 +0000 (23:08 +0000)
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

build/build.mk
build/buildexports.sh [new file with mode: 0755]
include/http_main.h
server/Makefile.in
server/main.c
support/httpd.exp

index b5dbb907f21da34c63acc95fb4819747aea37178..d4a58ec5c73485040f2377282a9c2902a565b8c0 100644 (file)
@@ -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 (executable)
index 0000000..c8313f3
--- /dev/null
@@ -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
index ce07f4914d97d92dc04f624747a2f7d593d3dbbb..33f9f486afbb6f0c872fecba33a19501475ff13a 100644 (file)
@@ -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
index dd30e010f8860108ef300945f9363c51ad050ec2..e1b779537c0f87e722de64db95e1a71595c0007d 100644 (file)
@@ -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
 
index 9682eff8754b31022033ef7a47cbba0d82b5f28e..6cd35b6474557da12ddb332747a5d8a3112d13b6 100644 (file)
@@ -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;
index b057c94994c88339f72319d1eda87ec80b1a1d3b..93c98731d5c330e01fb3179795f155733e9bd5f9 100644 (file)
@@ -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