Commit c18a3c9e authored by Ryan Bloom's avatar Ryan Bloom
Browse files

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

+4 −1
Original line number Diff line number Diff line
@@ -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

+21 −4
Original line number Diff line number Diff line
@@ -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 ""