From: Greg Stein Date: Thu, 7 Dec 2000 11:37:08 +0000 (+0000) Subject: *) fix up buildexports.sh: X-Git-Tag: APACHE_2_0_ALPHA_9~48 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b5de155f2a715a72d58a5fee06df5f840a09b858;p=apache *) fix up buildexports.sh: - 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 --- diff --git a/build/build2.mk b/build/build2.mk index f8ada3ab6f..6e43a4759c 100644 --- a/build/build2.mk +++ b/build/build2.mk @@ -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 diff --git a/build/buildexports.sh b/build/buildexports.sh index 000963e955..b1ac43ccd5 100755 --- a/build/buildexports.sh +++ b/build/buildexports.sh @@ -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" diff --git a/include/http_main.h b/include/http_main.h index 16eaa2482e..ce07f4914d 100644 --- a/include/http_main.h +++ b/include/http_main.h @@ -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 diff --git a/server/Makefile.in b/server/Makefile.in index e1fa986ac1..77cda7dc3e 100644 --- a/server/Makefile.in +++ b/server/Makefile.in @@ -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) > $@ diff --git a/server/main.c b/server/main.c index 2604dbf40e..4e3497f643 100644 --- a/server/main.c +++ b/server/main.c @@ -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