- 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
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"
@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
#! /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"
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"
* 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
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) > $@
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;
}
#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