Commit 82628abb authored by Greg Stein's avatar Greg Stein
Browse files

*) 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
parent 1a9d7b86
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -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

+16 −16
Original line number Diff line number Diff line
#! /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"
+0 −4
Original line number Diff line number Diff line
@@ -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
+5 −0
Original line number Diff line number Diff line
@@ -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) > $@
+14 −8
Original line number Diff line number Diff line
@@ -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