joes 2003/10/08 10:44:18
Modified: . CHANGES INSTALL Makefile.am STATUS acinclude.m4
env Makefile.am
src Makefile.am
t Makefile.am
Log:
Add support for building mod_apreq as a static module, which is based on
Bojan Smojver's patch-
http://marc.theaimsgroup.com/?l=apreq-dev&m=106515072621995&w=2
Revision Changes Path
1.8 +12 -0 httpd-apreq-2/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/httpd-apreq-2/CHANGES,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- CHANGES 18 Jul 2003 16:07:22 -0000 1.7
+++ CHANGES 8 Oct 2003 17:44:18 -0000 1.8
@@ -2,6 +2,18 @@
@section 2.0.0-dev Changes with libapreq-2.0.0-dev
+- October 8, 2003 - configure: static mod_apreq.c [Bojan Smojver, joes]
+
+Add --with-apache2-src configure option, along with --with-apr-config
+and --with-apu-config, and provide support for compiling mod_apreq
+into httpd as a static apache module.
+
+- October 1, 2003 - C API: mod_apreq.c [joes]
+
+Support for internal redirects added to the mod_apreq filter.
+This ensures any POST data prefetched in the main request
+gets passed along to the subrequest handler(s).
+
- July 18, 2003 - C bugfix: apreq_decode [Graham Clark]
If the source and destination strings are represented by the same
1.7 +25 -0 httpd-apreq-2/INSTALL
Index: INSTALL
===================================================================
RCS file: /home/cvs/httpd-apreq-2/INSTALL,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- INSTALL 23 Jul 2003 05:07:11 -0000 1.6
+++ INSTALL 8 Oct 2003 17:44:18 -0000 1.7
@@ -32,6 +32,7 @@
% make install
(optional)% make perl_install
+
Or using the CPAN/perlish way:
(optional)% ./buildconf
@@ -43,6 +44,27 @@
(optional)% make perl_install
+Alternately, here's a recipe to install mod_apreq.c as a static apache
module:
+
+ 1) configure httpd to add mod_apreq.c to its filter modules:
+
+ % cd /path/to/httpd-2.0
+ % CPPFLAGS=-I/path/to/httpd-apreq-2/src \
+ HTTPD_LDFLAGS=/path/to/httpd-apreq-2/src/libapreq.la \
+ ./configure --with-module=filters:/path/to/httpd-apreq-2/env/mod_apreq.c
\
+ ...(add usual httpd+apr options here)...
+
+ 2) compile and install everything using httpd-apreq-2's build system:
+
+ % cd /path/to/httpd-apreq-2
+ % ./configure --with-apache2-src=/path/to/httpd-2.0
+ % make
+ (optional)% make test
+ % make httpd_install
+ % make install
+
+
+
Win32 build:
C:\httpd-apreq-2> perl Makefile.PL
C:\httpd-apreq-2> nmake
@@ -50,3 +72,6 @@
C:\httpd-apreq-2> nmake mod_apreq
C:\httpd-apreq-2> nmake perl_glue
C:\httpd-apreq-2> nmake perl_test
+
+
+
1.13 +13 -6 httpd-apreq-2/Makefile.am
Index: Makefile.am
===================================================================
RCS file: /home/cvs/httpd-apreq-2/Makefile.am,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Makefile.am 2 Oct 2003 01:50:45 -0000 1.12
+++ Makefile.am 8 Oct 2003 17:44:18 -0000 1.13
@@ -1,10 +1,10 @@
AUTOMAKE_OPTIONS = foreign
SUBDIRS = src env t
EXTRA_DIST = INSTALL
[EMAIL PROTECTED]@ --srcdir`
[EMAIL PROTECTED]@ --srcdir`
-APUDOX = (cd $(APUDIR); cat - docs/doxygen.conf | doxygen -)
-APRDOX = (cd $(APRDIR); cat - docs/doxygen.conf | doxygen -)
[EMAIL PROTECTED]@ --srcdir`
[EMAIL PROTECTED]@ --srcdir`
+APU_DOX = (cd $(APU_SRCDIR); cat - docs/doxygen.conf | doxygen -)
+APR_DOX = (cd $(APR_SRCDIR); cat - docs/doxygen.conf | doxygen -)
COOKIE_POD=glue/perl/blib/lib/Apache/Cookie.pod
REQUEST_POD=glue/perl/blib/lib/Apache/Request.pod
@@ -20,8 +20,8 @@
apr_tags:
-mkdir docs
- echo GENERATE_TAGFILE=`pwd`/docs/apu.tag | $(APUDOX)
- echo GENERATE_TAGFILE=`pwd`/docs/apr.tag | $(APRDOX)
+ echo GENERATE_TAGFILE=`pwd`/docs/apu.tag | $(APU_DOX)
+ echo GENERATE_TAGFILE=`pwd`/docs/apr.tag | $(APR_DOX)
test: lib_test env_test
@@ -41,3 +41,10 @@
cd glue/perl; @PERL@ ../../build/xsbuilder.pl run
cd glue/perl; @PERL@ Makefile.PL -apxs @APACHE2_APXS@
cd glue/perl; make
+
+if BUILD_HTTPD
+
+httpd_install:
+ cd @APACHE2_SRC@; make install
+
+endif
1.23 +4 -15 httpd-apreq-2/STATUS
Index: STATUS
===================================================================
RCS file: /home/cvs/httpd-apreq-2/STATUS,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- STATUS 29 Sep 2003 19:20:04 -0000 1.22
+++ STATUS 8 Oct 2003 17:44:18 -0000 1.23
@@ -29,20 +29,9 @@
- httpd 2.0.46 is a requirement, need to add the check in
./configure and abort if not satisfied.
- - Write tests to exercise the filter prefetch code:
- We need to make the prefectch code compatible
- with internal redirects and subrequests. Also
- should stop parsing at filter_init() stage if
- the only handler that needs libapreq is a
- pre-content handler. I think we'll wind up needing
- to adjust r->proto_input_filters, making it
- point at the apreq filter (right behind HTTP_IN),
- but I haven't figured out what condition signals that
- the apreq filter is being injected pre-, or post-,
- filter_init. If redirects and subrequests can only
- happen in the content handler phase (or later),
- we can safely do the adjustment during filter_init()
- and the problem is solved. [joes]
+ - Get env/ (Apache::Test) tests to work for --with-apache2-src option.
+
+ - Add an apreq-config script similar to ap[ru]-config.
- Bring Perl documentation up to speed.
1.9 +53 -20 httpd-apreq-2/acinclude.m4
Index: acinclude.m4
===================================================================
RCS file: /home/cvs/httpd-apreq-2/acinclude.m4,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- acinclude.m4 2 Oct 2003 02:21:55 -0000 1.8
+++ acinclude.m4 8 Oct 2003 17:44:18 -0000 1.9
@@ -1,31 +1,65 @@
AC_DEFUN(AC_APREQ, [
- AC_ARG_WITH(apache2-apxs,
- [ --with-apache2-apxs path to apache2's apxs],
- [APACHE2_APXS=$withval],
- [APACHE2_APXS="/usr/local/apache2/bin/apxs"])
- AC_ARG_WITH(perl,
- [ --with-perl path to perl executable],
- [PERL=$withval],
- [PERL="perl"])
- APU_CONFIG=`$APACHE2_APXS -q APU_BINDIR`/apu-config
- APR_CONFIG=`$APACHE2_APXS -q APR_BINDIR`/apr-config
- APACHE2_INCLUDES=`$APACHE2_APXS -q INCLUDEDIR`
- APACHE2_MODULES=`$APACHE2_APXS -q LIBEXECDIR`
- APACHE2_LIBS=`$APACHE2_APXS -q LIBDIR`
+ AC_ARG_WITH(perl,
+ AC_HELP_STRING([--with-perl],[path to perl executable]),
+ [PERL=$withval],[PERL="perl"])
+ AC_ARG_WITH(apache2-apxs,
+ AC_HELP_STRING([--with-apache2-apxs],[path to apache2's
apxs]),
+ [APACHE2_APXS=$withval],[APACHE2_APXS="apxs"])
+ AC_ARG_WITH(apache2-src,
+ AC_HELP_STRING([--with-apache2-src],[path to httpd-2
source]),
+ [APACHE2_SRC=$withval],[APACHE2_SRC=""])
+
+ if test -n "$APACHE2_SRC"; then
+ APACHE2_SRC=`cd $APACHE2_SRC;pwd`
+ APACHE2_INCLUDES=$APACHE2_SRC/include
+ APACHE2_HTTPD=$APACHE2_SRC/httpd
+ AC_ARG_WITH(apr-config,
+ AC_HELP_STRING([ --with-apr-config],[path to apr-config
(requires --with-apache2-src)]),
+
[APR_CONFIG=$withval],[APR_CONFIG="$APACHE2_SRC/srclib/apr/apr-config"])
+ AC_ARG_WITH(apu-config,
+ AC_HELP_STRING([ --with-apu-config],[path to apu-config
(requires --with-apache2-src)]),
+
[APU_CONFIG=$withval],[APU_CONFIG="$APACHE2_SRC/srclib/apr-util/apu-config"])
+
+ else
+ APACHE2_INCLUDES=`$APACHE2_APXS -q INCLUDEDIR`
+ APACHE2_HTTPD=`$APACHE2_APXS -q BINDIR`/httpd
+ APR_CONFIG=`$APACHE2_APXS -q APR_BINDIR`/apr-config
+ APU_CONFIG=`$APACHE2_APXS -q APU_BINDIR`/apu-config
+
+ fi
+
+ AC_CHECK_FILE([$APACHE2_INCLUDES/httpd.h],,
+ AC_MSG_ERROR([invalid Apache2 include directory]))
+ AC_CHECK_FILE([$APR_CONFIG],,
+ AC_MSG_ERROR([invalid apr-config location- perhaps you need
to configure apr first?]))
+ AC_CHECK_FILE([$APU_CONFIG],,
+ AC_MSG_ERROR([invalid apu-config location- perhaps you need
to configure apr-util first?]))
+
+ AM_CONDITIONAL(BUILD_HTTPD, test -n "$APACHE2_SRC")
+ AM_CONDITIONAL(BUILD_APR, test "x$APR_CONFIG" = x`$APR_CONFIG
--srcdir`/apr-config)
+ AM_CONDITIONAL(BUILD_APU, test "x$APU_CONFIG" = x`$APU_CONFIG
--srcdir`/apu-config)
+
+ dnl Reset the default installation prefix to be the same as apu's
+ ac_default_prefix=`$APU_CONFIG --prefix`
+
APR_INCLUDES=`$APR_CONFIG --includedir`
APU_INCLUDES=`$APU_CONFIG --includedir`
- APR_LIBS=`$APR_CONFIG --link-ld --link-libtool`
- APU_LIBS=`$APU_CONFIG --link-ld --link-libtool`
+ APR_LIBS=`$APR_CONFIG --link-libtool --libs`
+ APU_LIBS=`$APU_CONFIG --link-libtool --libs`
+ APR_LA=`$APR_CONFIG --link-libtool`
+ APU_LA=`$APU_CONFIG --link-libtool`
+ AC_SUBST(APACHE2_APXS)
+ AC_SUBST(APACHE2_SRC)
+ AC_SUBST(APACHE2_INCLUDES)
+ AC_SUBST(APACHE2_HTTPD)
AC_SUBST(APU_CONFIG)
AC_SUBST(APR_CONFIG)
- AC_SUBST(APACHE2_APXS)
- AC_SUBST(APACHE2_INCLUDES)
- AC_SUBST(APACHE2_MODULES)
- AC_SUBST(APACHE2_LIBS)
AC_SUBST(APR_INCLUDES)
AC_SUBST(APU_INCLUDES)
AC_SUBST(APR_LIBS)
AC_SUBST(APU_LIBS)
+ AC_SUBST(APR_LA)
+ AC_SUBST(APU_LA)
AC_SUBST(PERL)
])
@@ -50,4 +84,3 @@
done
fi
])
-
1.12 +26 -9 httpd-apreq-2/env/Makefile.am
Index: Makefile.am
===================================================================
RCS file: /home/cvs/httpd-apreq-2/env/Makefile.am,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Makefile.am 2 Oct 2003 02:21:55 -0000 1.11
+++ Makefile.am 8 Oct 2003 17:44:18 -0000 1.12
@@ -1,25 +1,42 @@
INCLUDES = -I../src [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ [EMAIL PROTECTED]@
-LIBS = @APR_LIBS@ @APU_LIBS@
+LIBS = ../src/libapreq.la @APR_LIBS@ @APU_LIBS@
TEST_CONFIG_SCRIPT = package Apache::TestMM; filter_args();
generate_script("t/TEST")
lib_LIBRARIES = libapreq_cgi.a
-noinst_LTLIBRARIES = mod_apreq.la
+libapreq_cgi_a_SOURCES = libapreq_cgi.c
-mod_apreq_la_SOURCES = mod_apreq.c
-mod_apreq_la_LDFLAGS = -export-dynamic -module -avoid-version -rpath
@APACHE2_MODULES@
-mod_apreq_la_LIBADD = ../src/libapreq.la
+if BUILD_HTTPD
-libapreq_cgi_a_SOURCES = libapreq_cgi.c
-libapreq_cgi_a_LIBADD = ../src/libapreq.la
+# mod_apreq.c needs to be built from httpd-2.X, e.g.
+#
+# % cd ../httpd-2.X;
+# % ./configure --with-module=filters:../httpd-apreq-2/env/mod_apreq.c ...
+#
+# See the INSTALL file for details.
-libdir = @APACHE2_LIBS@
-includedir = @APACHE2_INCLUDES@
[EMAIL PROTECTED]@:
+ cd @APACHE2_SRC@ && make
+
+all-local: @APACHE2_HTTPD@
+
+t/TEST : Makefile.am
+ @PERL@ -MApache::TestMM -e '$(TEST_CONFIG_SCRIPT)' -- -httpd
@APACHE2_SRC@/.libs/httpd
+
+else
+
[EMAIL PROTECTED]@ -q LIBEXECDIR`
+
+noinst_LTLIBRARIES = mod_apreq.la
+mod_apreq_la_SOURCES = mod_apreq.c
+mod_apreq_la_LDFLAGS = -export-dynamic -module -avoid-version -rpath
$(APACHE2_MODULES)
install-exec-local: mod_apreq.la
@APACHE2_APXS@ -i -a -n apreq mod_apreq.la
t/TEST : Makefile.am
@PERL@ -MApache::TestMM -e '$(TEST_CONFIG_SCRIPT)' -- -apxs
@APACHE2_APXS@
+
+endif
run_tests : t/TEST
@PERL@ t/TEST
1.11 +15 -4 httpd-apreq-2/src/Makefile.am
Index: Makefile.am
===================================================================
RCS file: /home/cvs/httpd-apreq-2/src/Makefile.am,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Makefile.am 2 Oct 2003 02:21:55 -0000 1.10
+++ Makefile.am 8 Oct 2003 17:44:18 -0000 1.11
@@ -1,12 +1,23 @@
INCLUDES = [EMAIL PROTECTED]@ [EMAIL PROTECTED]@
LIBS = @APR_LIBS@ @APU_LIBS@
-
lib_LTLIBRARIES = libapreq.la
nobase_include_HEADERS = apreq.h apreq_cookie.h apreq_params.h \
apreq_env.h apreq_parsers.h
+libapreq_la_LDFLAGS = -version-info 2:0
+
+BUILT_SOURCES= @APR_LA@ @APU_LA@
libapreq_la_SOURCES = apreq.c apreq_cookie.c \
apreq_params.c apreq_parsers.c
-libapreq_la_LDFLAGS = -version-info 2:0
+if BUILD_APR
+
[EMAIL PROTECTED]@:
+ cd [EMAIL PROTECTED]@ --srcdir` && make
+
+endif
+
+if BUILD_APU
+
[EMAIL PROTECTED]@: @APR_LA@
+ cd [EMAIL PROTECTED]@ --srcdir` && make
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
+endif
1.12 +2 -4 httpd-apreq-2/t/Makefile.am
Index: Makefile.am
===================================================================
RCS file: /home/cvs/httpd-apreq-2/t/Makefile.am,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Makefile.am 2 Oct 2003 02:21:55 -0000 1.11
+++ Makefile.am 8 Oct 2003 17:44:18 -0000 1.12
@@ -1,13 +1,11 @@
INCLUDES = -I../src [EMAIL PROTECTED]@ [EMAIL PROTECTED]@
-LIBS = -L../src @APR_LIBS@ @APU_LIBS@
+LIBS = ../src/libapreq.la @APR_LIBS@ @APU_LIBS@
noinst_LIBRARIES = libapreq_tests.a
libapreq_tests_a_SOURCES = CuTest.c env.c cookie.c params.c parsers.c
-libapreq_tests_a_LIBADD = ../src/libapreq.la
check_PROGRAMS = testall
-testall_LDADD = libapreq_tests.a
-testall_LINK = @APACHE2_APXS@ -c -p -L../src -lapreq -o testall
+testall_LDADD = libapreq_tests.a
test: check
./testall -v