From 6baa1b4cb71b3fa813bad548fcc688381e53f058 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 1 Dec 2000 07:32:11 +0000 Subject: [PATCH] Get Apache to use the new generated exports list. This works on my Linux machine, but I am pretty sure there are going to be problems for others. The idea here, is to be able to generate a list of the exported functions from APR. This list needs to be correct, we can not list functions that are not exported on the platform being built on. To accomplish this, we generate a list of the exported symbols when we configure APR. As a part of this list, we also include all of the #if macros that surround those symbols. Apache then uses this list of functions and macros to generate a file that refers to each of those symbols. Because we have the macros, when we compile this file, the compiler ignores any symbols that aren't valid on this platform. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87142 13f79535-47bb-0310-9956-ffa450edef68 --- build/build.mk | 5 +---- build/build2.mk | 5 ++++- build/buildexports.sh | 25 +++++++++++++++++++++---- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/build/build.mk b/build/build.mk index d4a58ec5c7..b5dbb907f2 100644 --- a/build/build.mk +++ b/build/build.mk @@ -60,7 +60,7 @@ STAMP = buildmk.stamp -all: $(STAMP) generated_lists export_lists +all: $(STAMP) generated_lists @$(MAKE) AMFLAGS=$(AMFLAGS) -s -f build/build2.mk generated_lists: @@ -72,9 +72,6 @@ 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/build2.mk b/build/build2.mk index e974df3554..b13dd67fca 100644 --- a/build/build2.mk +++ b/build/build2.mk @@ -72,7 +72,7 @@ APR_TARGETS = $(apr_configure) $(apr_private.h_in) $(mm_configure) PCRE_TARGETS = $(pcre_configure) -targets = .deps aclocal.m4 $(APACHE_TARGETS) $(APR_TARGETS) $(PCRE_TARGETS) +targets = .deps aclocal.m4 $(APACHE_TARGETS) $(APR_TARGETS) $(PCRE_TARGETS) export_lists cross_compile_warning = "warning: AC_TRY_RUN called without default to allow cross compiling" @@ -87,6 +87,9 @@ aclocal.m4: acinclude.m4 lib/apr/apr_common.m4 lib/apr/hints.m4 $(libtool_m4) @echo rebuilding $@ @cat acinclude.m4 $(libtool_m4) > $@ +export_lists: + @build/buildexports.sh main/exports.c lib/apr/apr.exports + $(LT_TARGETS): libtoolize $(AMFLAGS) --force diff --git a/build/buildexports.sh b/build/buildexports.sh index 72a14e4f55..1a04a5f948 100755 --- a/build/buildexports.sh +++ b/build/buildexports.sh @@ -7,19 +7,36 @@ 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 "" while read LINE do + if [ "x`echo $LINE | egrep '^[:space:]*APR_'`" != "x" ]; then + ifline=`echo "$LINE" |\ + sed -e 's%^\(.*\)%\#if \1%'` + echo $ifline + fi if [ "x`echo $LINE | egrep '^[:space:]*apr_'`" != "x" ]; then - newline=`echo "$LINE" |\ - sed -e 's%^\(.*\)%extern const void *\1\\(void\);%'` - echo $newline +# newline=`echo "$LINE" |\ +# sed -e 's%^\(.*\)%extern const void *\1\\(void\);%'` +# echo $newline newline=`echo "$LINE" |\ sed -e 's%^\(.*\)%const void *ap_hack_\1 = \(const void *\)\1\;%'` echo $newline fi + if [ "x`echo $LINE | egrep '^[:space:]*\/APR_'`" != "x" ]; then + endline=`echo "$LINE" |\ + sed -e 's%^\/\(.*\)%\#endif \/\*\1\*\/%'` + echo "$endline" + fi done echo "" -- 2.40.0