]> granicus.if.org Git - apache/commitdiff
*) fix up buildexports.sh:
authorGreg Stein <gstein@apache.org>
Thu, 7 Dec 2000 11:37:08 +0000 (11:37 +0000)
committerGreg Stein <gstein@apache.org>
Thu, 7 Dec 2000 11:37:08 +0000 (11:37 +0000)
   - enable it to be run from any dir by passing a parameter for the
     location of srclib, and using its own location for determining where
     the AWK script is located
   - accept exports files on STDIN, and produce output on STDOUT
   - use "pwd" and cd back to it, rather than assuming ../../.. (which might
     not apply if we feed it other export files)
   - add USAGE reporting

*) generate exports.c during normal build of "server" rather than during the
   buildconf stage. update invocation to match above changes

*) revamp the ap_ugly_hack referencing in main.c: put it at the bottom of
   the file with the other, similar references, and style it similarly.

*) remove the ap_ugly_hack declaration from http_main.h; it is internal to
   the "server" code

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87249 13f79535-47bb-0310-9956-ffa450edef68

build/build2.mk
build/buildexports.sh
include/http_main.h
server/Makefile.in
server/main.c

index f8ada3ab6fd6f26363445f3c056f779008894780..6e43a4759ce2916e0ab31a15635fef2e8c31199d 100644 (file)
@@ -73,7 +73,7 @@ APR_TARGETS = $(apr_configure) $(apr_private.h_in) $(mm_configure) $(aprutil_con
 
 PCRE_TARGETS = $(pcre_configure)
 
-targets = .deps aclocal.m4 $(APACHE_TARGETS) $(APR_TARGETS) $(PCRE_TARGETS) export_lists
+targets = .deps aclocal.m4 $(APACHE_TARGETS) $(APR_TARGETS) $(PCRE_TARGETS)
 
 cross_compile_warning = "warning: AC_TRY_RUN called without default to allow cross compiling"
 
@@ -88,9 +88,6 @@ aclocal.m4: acinclude.m4 srclib/apr/apr_common.m4 srclib/apr/hints.m4 $(libtool_
        @echo rebuilding $@
        @cat acinclude.m4 $(libtool_m4) > $@
 
-export_lists: $(aprutil_configure) $(apr_configure)
-       @build/buildexports.sh server/exports.c srclib/apr/apr.exports srclib/apr-util/aprutil.exports
-
 $(LT_TARGETS):
        libtoolize $(AMFLAGS) --force
 
index 000963e955627209493b0d8e12a792e009b5151a..b1ac43ccd5d798190b2c30d538b7136c3d90e876 100755 (executable)
@@ -1,8 +1,11 @@
 #! /bin/sh
 
-outfile=$1
-exec >$outfile
-shift
+if test -z "$1"; then
+    echo "USAGE: $0 SRCLIB-DIRECTORY"
+    echo ""
+    echo "for example: $0 ../srclib"
+    exit 1
+fi
 
 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"
@@ -10,23 +13,20 @@ echo " * the base server uses them."
 echo " */"
 echo ""
 
-for dir in srclib/apr/include srclib/apr-util/include
+cur_dir="`pwd`"
+for dir in $1/apr/include $1/apr-util/include
 do
     cd $dir
-    for file in *.h
-    do
+    for file in *.h; do
         echo "#include \"$file\""
     done
-    cd ../../../
-done
-echo ""
-
-for file
-do
-    exec <$file
-    awk -f build/buildexports.awk
+    cd "$cur_dir"
 done
 
 echo ""
-echo "void *ap_ugly_hack;"
-exit 0
+echo "const void *ap_ugly_hack;"
+echo ""
+
+# convert export files (on STDIN) into a series of declarations
+my_dir="`dirname $0`"
+awk -f "$my_dir/buildexports.awk"
index 16eaa2482e335b280ece064fc2b1dea40fe11a1f..ce07f4914d97d92dc04f624747a2f7d593d3dbbb 100644 (file)
@@ -89,10 +89,6 @@ 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;
 
-#ifdef AP_USING_AUTOCONF
-extern void *ap_ugly_hack;
-#endif
-
 #ifdef __cplusplus
 }
 #endif
index e1fa986ac120b0ddcf718e5f0f23b830fa084ccb..77cda7dc3e9b6a22e77298a17500fcd0b6bc5f12 100644 (file)
@@ -30,3 +30,8 @@ test_char.h: gen_test_char
 
 util_uri.lo: uri_delims.h
 util.lo: test_char.h
+
+EXPORT_FILES = ../srclib/apr/apr.exports ../srclib/apr-util/aprutil.exports
+
+exports.c: $(EXPORT_FILES)
+       (cat $(EXPORT_FILES) | ../build/buildexports.sh ../srclib) > $@
index 2604dbf40e47627f0e3f888c4811db2344a69b9d..4e3497f643fa03c553e869e7db0cb9326b67410c 100644 (file)
@@ -301,14 +301,6 @@ int main(int argc, const char * const argv[])
 
     apr_initialize();
 
-#ifdef AP_USING_AUTOCONF
-    /* 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 = (void *) apr_initialize;
-#endif
-
     process = create_process(argc, argv);
     pglobal = process->pool;
     pconf = process->pconf;
@@ -456,3 +448,17 @@ void suck_in_apr_validate_password(void)
 }
 #endif
 
+#ifdef AP_USING_AUTOCONF
+/* This ugly little hack pulls any function referenced in exports.c into
+ * the web server.  exports.c is generated during the build, and it
+ * has all of the APR functions specified by the apr/apr.exports and
+ * apr-util/aprutil.exports files.
+ */
+const void *suck_in_APR(void);
+const void *suck_in_APR(void)
+{
+    extern const void *ap_ugly_hack;
+
+    return ap_ugly_hack;
+}
+#endif