httpd-apreq-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r155691 - in httpd/apreq/branches/multi-env-unstable: ./ glue/ glue/perl/ library/ library/t/ module/ module/apache/ module/apache/t/ module/apache/t/c-modules/ module/apache/t/c-modules/apreq_access_test/ module/apache/t/c-modules/apreq_big_request_test/ module/apache/t/c-modules/apreq_cookie_test/ module/apache/t/c-modules/apreq_redirect_test/ module/apache/t/c-modules/apreq_request_test/ module/apache/t/conf/ module/apache2/
Date Mon, 28 Feb 2005 19:46:45 GMT
Author: joes
Date: Mon Feb 28 11:46:39 2005
New Revision: 155691

URL: http://svn.apache.org/viewcvs?view=rev&rev=155691
Log:
*nix build system fixes:
  Add --with-perl-opts, to pass additional MM options to glue/perl.
  Clean up internal libtool/ld flags.

Copy module/t/c-modules test layout to module/apache/t.

Added:
    httpd/apreq/branches/multi-env-unstable/module/apache/t/   (with props)
    httpd/apreq/branches/multi-env-unstable/module/apache/t/TEST.PL
    httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/   (with props)
    httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_access_test/ 
 (with props)
    httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_access_test/mod_apreq_access_test.c
    httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_big_request_test/
  (with props)
    httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_big_request_test/mod_apreq_big_request_test.c
    httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_cookie_test/ 
 (with props)
    httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_cookie_test/mod_apreq_cookie_test.c
    httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_redirect_test/
  (with props)
    httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_redirect_test/mod_apreq_redirect_test.c
    httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_request_test/
  (with props)
    httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_request_test/mod_apreq_request_test.c
    httpd/apreq/branches/multi-env-unstable/module/apache/t/conf/
Modified:
    httpd/apreq/branches/multi-env-unstable/Makefile.PL
    httpd/apreq/branches/multi-env-unstable/acinclude.m4
    httpd/apreq/branches/multi-env-unstable/apreq2-config.in
    httpd/apreq/branches/multi-env-unstable/glue/Makefile.am
    httpd/apreq/branches/multi-env-unstable/glue/perl/Makefile.PL
    httpd/apreq/branches/multi-env-unstable/library/Makefile.am
    httpd/apreq/branches/multi-env-unstable/library/t/Makefile.am
    httpd/apreq/branches/multi-env-unstable/module/Makefile.am
    httpd/apreq/branches/multi-env-unstable/module/apache/Makefile.am
    httpd/apreq/branches/multi-env-unstable/module/apache2/Makefile.am

Modified: httpd/apreq/branches/multi-env-unstable/Makefile.PL
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/Makefile.PL?view=diff&r1=155690&r2=155691
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/Makefile.PL (original)
+++ httpd/apreq/branches/multi-env-unstable/Makefile.PL Mon Feb 28 11:46:39 2005
@@ -1,5 +1,4 @@
 require 5.006;
-
 use strict;
 use warnings;
 
@@ -23,19 +22,21 @@
     system(@args) == 0 or die "system @args failed: $?";
 }
 else {
-    my @opts = qw(with-apache2-apxs with-apache2-src with-apache2-httpd
-                  with-apr-config with-apu-config apxs);
+    my %opts;
+    undef @opts{qw(with-apache2-apxs with-apache1-apxs with-apache2-src
+                   with-perl with-apache2-httpd
+                   with-apr-config with-apu-config apxs)};
 
     my @flags = qw/enable-maintainer-mode enable-perl-glue disable-perl-glue/;
-    my %opts;
+    my %args;
     # grab from @ARGV only the options that we expect
-    GetOptions(\%opts, (map "$_=s", @opts), @flags);
+    GetOptions(\%args, (map "$_=s", keys %opts), @flags);
 
-    $opts{"with-perl"} = PERL_PATH;
+    $args{"with-perl"} = PERL_PATH;
     my $opts = "";
-    $opts .= "--enable-maintainer-mode " if $opts{"enable-maintainer-mode"};
+    $opts .= "--enable-maintainer-mode " if $args{"enable-maintainer-mode"};
 
-    unless (exists $opts{"disable-perl-glue"}) {
+    unless (exists $args{"disable-perl-glue"}) {
         $opts .= "--enable-perl-glue ";
         test_prereq "mod_perl";
         test_prereq "Apache::Test";
@@ -44,11 +45,14 @@
         test_prereq "Test::More";
     }
 
-    delete @opts{@flags};
-    $opts{"with-apache2-apxs"} = delete $opts{apxs}
-        if exists $opts{apxs} and not exists $opts{"with-apache2-apxs"};
+    delete @args{@flags};
+    $args{"with-apache2-apxs"} = delete $args{apxs}
+        if exists $args{apxs} and not exists $args{"with-apache2-apxs"};
+
+    $args{"with-perl-opts"} = "@ARGV" if @ARGV;
+
+    $opts .= join " ", map {qq/--$_="$args{$_}"/} keys %args;
 
-    $opts .= join " ", map {"--$_=$opts{$_}"} keys %opts;
     my $cmd = "./configure $opts";
     print "$cmd\n";
     exec  $cmd;

Modified: httpd/apreq/branches/multi-env-unstable/acinclude.m4
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/acinclude.m4?view=diff&r1=155690&r2=155691
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/acinclude.m4 (original)
+++ httpd/apreq/branches/multi-env-unstable/acinclude.m4 Mon Feb 28 11:46:39 2005
@@ -10,7 +10,7 @@
                 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 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 source]),
@@ -25,8 +25,11 @@
                 AC_HELP_STRING([  --with-apu-config],[path to apu-*-config script]),
                 [APU_CONFIG=$withval],[APU_CONFIG=""])
         AC_ARG_WITH(apache1-apxs,
-                AC_HELP_STRING([--with-apache1-apxs],[path to apxs]),
+                AC_HELP_STRING([--with-apache1-apxs],[path to apache1's apxs]),
                 [APACHE1_APXS=$withval],[APACHE1_APXS=""])
+        AC_ARG_WITH(perl-opts,
+                AC_HELP_STRING([--with-perl-opts],[extra MakeMaker options]),
+                [PERL_OPTS=$withval],[PERL_OPTS=""])
 
         prereq_check="$PERL build/version_check.pl"
 
@@ -59,9 +62,11 @@
                 if test ${APR_MAJOR_VERSION:="0"} -eq 0; then
                     apr_config=apr-config
                     apu_config=apu-config 
+                    apreq_libs="-lapr -laprutil"
                 else
                     apr_config=apr-$APR_MAJOR_VERSION-config
                     apu_config=apu-$APR_MAJOR_VERSION-config
+                    apreq_libs="-lapr-$APR_MAJOR_VERSION -laprutil-$APR_MAJOR_VERSION"
                 fi
 
                 if test -z "$APR_CONFIG"; then
@@ -137,19 +142,19 @@
         AM_CONDITIONAL(HAVE_APACHE1, test -n "$APACHE1_APXS")
 
         dnl Reset the default installation prefix to be the same as apu's
-        ac_default_prefix=`$APU_CONFIG --prefix`
+        ac_default_prefix="`$APU_CONFIG --prefix`"
 
-        APR_INCLUDES=`$APR_CONFIG --includes`
-        APU_INCLUDES=`$APU_CONFIG --includes`
-        APR_LA=`$APR_CONFIG --link-libtool`
-        APU_LA=`$APU_CONFIG --link-libtool`
-        APR_LTLIBS=`$APR_CONFIG --link-libtool --libs`
-        APU_LTLIBS=`$APU_CONFIG --link-libtool --libs`
+        APR_INCLUDES="`$APR_CONFIG --includes`"
+        APU_INCLUDES="`$APU_CONFIG --includes`"
+        APR_LA="`$APR_CONFIG --apr-la-file`"
+        APU_LA="`$APU_CONFIG --apu-la-file`"
+        APR_LTFLAGS="`$APR_CONFIG --link-libtool`"
+        APU_LTFLAGS="`$APU_CONFIG --link-libtool`"
         dnl perl glue/tests do not use libtool: need ld linker flags
-        APR_LDLIBS=`$APR_CONFIG --link-ld --libs`
-        APU_LDLIBS=`$APU_CONFIG --link-ld --libs`
-        APR_LDFLAGS=`$APR_CONFIG --ldflags`
-        APU_LDFLAGS=`$APU_CONFIG --ldflags`
+        APR_LIBS="`$APR_CONFIG --libs`"
+        APU_LIBS="`$APU_CONFIG --libs`"
+        APR_LDFLAGS="`$APR_CONFIG --link-ld --ldflags`"
+        APU_LDFLAGS="`$APU_CONFIG --link-ld --ldflags`"
 
         dnl Absolute source/build directory
         abs_srcdir=`(cd $srcdir && pwd)`
@@ -194,7 +199,7 @@
 
         APREQ_LIBNAME="apreq$APREQ_MAJOR_VERSION"
         APREQ_INCLUDES=""
-        APREQ_LDFLAGS=""
+        APREQ_LDFLAGS="$apreq_libs"
         APREQ_EXPORT_LIBS=""
 
         echo "lib$APREQ_LIBNAME Version: $APREQ_DOTTED_VERSION"
@@ -218,15 +223,16 @@
         AC_SUBST(APR_CONFIG)
         AC_SUBST(APR_INCLUDES)
         AC_SUBST(APU_INCLUDES)
-        AC_SUBST(APR_LTLIBS)
-        AC_SUBST(APU_LTLIBS)
-        AC_SUBST(APR_LDLIBS)
-        AC_SUBST(APU_LDLIBS)
+        AC_SUBST(APR_LTFLAGS)
+        AC_SUBST(APU_LTFLAGS)
+        AC_SUBST(APR_LIBS)
+        AC_SUBST(APU_LIBS)
         AC_SUBST(APR_LDFLAGS)
         AC_SUBST(APU_LDFLAGS)
         AC_SUBST(APR_LA)
         AC_SUBST(APU_LA)
         AC_SUBST(PERL)
+        AC_SUBST(PERL_OPTS)
 ])
 
 dnl APR_CONFIG_NICE(filename)

Modified: httpd/apreq/branches/multi-env-unstable/apreq2-config.in
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/apreq2-config.in?view=diff&r1=155690&r2=155691
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/apreq2-config.in (original)
+++ httpd/apreq/branches/multi-env-unstable/apreq2-config.in Mon Feb 28 11:46:39 2005
@@ -28,9 +28,10 @@
 libdir="@libdir@"
 includedir="@includedir@/@APREQ_LIBNAME@"
 
-LIBS="@APREQ_EXPORT_LIBS@"
-INCLUDES="@APREQ_INCLUDES@"
-LDFLAGS="@APREQ_LDFLAGS@"
+LIBS="@APR_LIBS@ @APU_LIBS@ @APREQ_LIBS@"
+LDFLAGS="@APR_LDFLAGS@ @APU_LDFLAGS@"
+INCLUDES="@APR_INCLUDES@ @APU_INCLUDES@"
+LDFLAGS="@APR_LDFLAGS@ @APU_LDFLAGS@"
 
 APREQ_LIBNAME="@APREQ_LIBNAME@"
 
@@ -60,9 +61,9 @@
   --help            print this help
 
 When linking with libtool, an application should do something like:
-  APREQ_LIBS="\`apreq2-config --link-libtool --libs\`"
+  APREQ_LIBS="\`apreq2-config --link-libtool --ltlibs\`"
 or when linking directly:
-  APREQ_LIBS="\`apreq2-config --link-ld --ldflags --libs\`"
+  APREQ_LIBS="\`apreq2-config --link-ld --ldflags --ldlibs\`"
 
 An application should use the results of --includes, and --ldflags in
 their build process.
@@ -100,10 +101,12 @@
     location=build
 fi
 
+location=installed
+
 if test "$location" = "installed"; then
     LA_FILE="$libdir/lib${APREQ_LIBNAME}.la"
 else
-    LA_FILE="$thisdir/src/lib${APREQ_LIBNAME}.la"
+    LA_FILE="$thisdir/library/lib${APREQ_LIBNAME}.la"
 fi
 
 flags=""
@@ -147,10 +150,10 @@
     if test "$location" = "installed"; then
         flags="$includedir"
     elif test "$location" = "source"; then
-        flags="$APREQ_SOURCE_DIR/src"
+        flags="$APREQ_SOURCE_DIR/include"
     else
         # this is for VPATH builds
-        flags="$thisdir/include $APREQ_SOURCE_DIR/src"
+        flags="$thisdir/include $APREQ_SOURCE_DIR/include"
     fi
     echo $flags
     exit 0
@@ -159,10 +162,10 @@
     if test "$location" = "installed"; then
         flags="$flags -I$includedir $INCLUDES"
     elif test "$location" = "source"; then
-        flags="$flags -I$APREQ_SOURCE_DIR/src $INCLUDES"
+        flags="$flags -I$APREQ_SOURCE_DIR/include $INCLUDES"
     else
         # this is for VPATH builds
-        flags="$flags -I$thisdir/include -I$APREQ_SOURCE_DIR/src $INCLUDES"
+        flags="$flags -I$thisdir/include -I$APREQ_SOURCE_DIR/include $INCLUDES"
     fi
     ;;
     --ldflags)
@@ -181,7 +184,7 @@
         ### avoid using -L if libdir is a "standard" location like /usr/lib
         flags="$flags -L$libdir -l$APREQ_LIBNAME"
     else
-        flags="$flags -L$thisdir/src -l$APREQ_LIBNAME"
+        flags="$flags -L$thisdir/library/.libs -l$APREQ_LIBNAME"
     fi
     ;;
     --link-libtool)
@@ -193,7 +196,7 @@
         flags="$flags $LA_FILE"
     elif test "$location" = "installed"; then
         ### avoid using -L if libdir is a "standard" location like /usr/lib
-        flags="$flags -L$libdir -l$APREQ_LIBNAME"
+        flags="$flags -L$libdir -l$APREQ_LIBNAME $apreq_libs"
     else
         flags="$flags $LA_FILE"
     fi

Modified: httpd/apreq/branches/multi-env-unstable/glue/Makefile.am
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/glue/Makefile.am?view=diff&r1=155690&r2=155691
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/glue/Makefile.am (original)
+++ httpd/apreq/branches/multi-env-unstable/glue/Makefile.am Mon Feb 28 11:46:39 2005
@@ -6,7 +6,7 @@
 	cd perl; @PERL@ ../../build/xsbuilder.pl run
 
 perl/Makefile: perl/xsbuilder perl/Makefile.PL
-	cd perl; @PERL@ Makefile.PL -apxs @APACHE2_APXS@
+	cd perl; @PERL@ Makefile.PL -apxs @APACHE2_APXS@ @PERL_OPTS@
 
 perl_glue: perl/Makefile
 	cd perl; $(MAKE)

Modified: httpd/apreq/branches/multi-env-unstable/glue/perl/Makefile.PL
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/glue/perl/Makefile.PL?view=diff&r1=155690&r2=155691
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/glue/perl/Makefile.PL (original)
+++ httpd/apreq/branches/multi-env-unstable/glue/perl/Makefile.PL Mon Feb 28 11:46:39 2005
@@ -79,10 +79,10 @@
     $apr_libs .= " $1";
 
     # need -laprutil befpre -lapr
-    $config =~ m/^s,\@APU_LDLIBS\@,([^,]+)/m or
+    $config =~ m/^s,\@APU_LIBS\@,([^,]+)/m or
         die "Can't find apu libraries";
     $apr_libs = $1;
-    $config =~ m/^s,\@APR_LDLIBS\@,([^,]+)/m or
+    $config =~ m/^s,\@APR_LIBS\@,([^,]+)/m or
         die "Can't find apr libraries";
     $apr_libs .= " $1";
 

Modified: httpd/apreq/branches/multi-env-unstable/library/Makefile.am
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/library/Makefile.am?view=diff&r1=155690&r2=155691
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/library/Makefile.am (original)
+++ httpd/apreq/branches/multi-env-unstable/library/Makefile.am Mon Feb 28 11:46:39 2005
@@ -1,6 +1,5 @@
 INCLUDES =  -I../include @APR_INCLUDES@ @APU_INCLUDES@
-LIBS = @APR_LTLIBS@ @APU_LTLIBS@
-LDFLAGS = @APR_LDFLAGS@ @APU_LDFLAGS@
+LDFLAGS = @APU_LTFLAGS@ @APR_LTFLAGS@
 BUILT_SOURCES= @APR_LA@ @APU_LA@
 lib_LTLIBRARIES = libapreq2.la
 libapreq2_la_SOURCES = util.c version.c cookie.c param.c parser.c \

Modified: httpd/apreq/branches/multi-env-unstable/library/t/Makefile.am
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/library/t/Makefile.am?view=diff&r1=155690&r2=155691
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/library/t/Makefile.am (original)
+++ httpd/apreq/branches/multi-env-unstable/library/t/Makefile.am Mon Feb 28 11:46:39 2005
@@ -1,7 +1,6 @@
 INCLUDES = -I../../include @APR_INCLUDES@ @APU_INCLUDES@
-LIBS = ../libapreq2.la @APR_LTLIBS@ @APU_LTLIBS@
-LDFLAGS = @APR_LDFLAGS@ @APU_LDFLAGS@
-
+LDFLAGS = @APU_LTFLAGS@ @APR_LTFLAGS@
+LIBS  = ../lib@APREQ_LIBNAME@.la @APU_LIBS@ @APR_LIBS@
 noinst_LIBRARIES = libapache_test.a
 libapache_test_a_SOURCES = at.h at.c
 

Modified: httpd/apreq/branches/multi-env-unstable/module/Makefile.am
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/module/Makefile.am?view=diff&r1=155690&r2=155691
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/module/Makefile.am (original)
+++ httpd/apreq/branches/multi-env-unstable/module/Makefile.am Mon Feb 28 11:46:39 2005
@@ -1,7 +1,7 @@
 INCLUDES = -I../src @APACHE2_INCLUDES@ @APR_INCLUDES@ @APU_INCLUDES@
 SUBDIRS = apache2 apache
-LIBS = ../library/lib@APREQ_LIBNAME@.la @APR_LTLIBS@ @APU_LTLIBS@
-LDFLAGS = @APR_LDFLAGS@ @APU_LDFLAGS@
+LIBS = ../library/lib@APREQ_LIBNAME@.la @APU_LIBS@ @APR_LIBS@
+LDFLAGS = @APU_LTFLAGS@ @APR_LTFLAGS@
 TEST_CONFIG_SCRIPT = package Apache::TestMM; filter_args(); generate_script("t/TEST")
 EXTRA_DIST = t c-modules
 

Modified: httpd/apreq/branches/multi-env-unstable/module/apache/Makefile.am
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/module/apache/Makefile.am?view=diff&r1=155690&r2=155691
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/module/apache/Makefile.am (original)
+++ httpd/apreq/branches/multi-env-unstable/module/apache/Makefile.am Mon Feb 28 11:46:39
2005
@@ -5,8 +5,8 @@
 endif
 
 INCLUDES = $(APACHE1_INCLUDES) @APR_INCLUDES@ @APU_INCLUDES@
-LIBS = ../../library/lib@APREQ_LIBNAME@.la @APR_LTLIBS@ @APU_LTLIBS@
-LDFLAGS = @APR_LDFLAGS@ @APU_LDFLAGS@
+LIBS = ../../library/lib@APREQ_LIBNAME@.la @APU_LIBS@ @APR_LIBS@
+LDFLAGS = @APR_LTFLAGS@ @APU_LTFLAGS@
 TEST_CONFIG_SCRIPT = package Apache::TestMM; filter_args(); generate_script("t/TEST")
 pkgincludedir = $(includedir)/@APREQ_LIBNAME@
 pkginclude_HEADERS = apreq_module_apache.h
@@ -19,5 +19,25 @@
 
 install-exec-local: mod_apreq2.la
 	$(LIBTOOL) --mode=install cp mod_apreq2.la `@APACHE1_APXS@ -q LIBEXECDIR`
+
+run_tests : t/TEST
+	-cp -Rp .libs t
+	MAKE=$(MAKE) @PERL@ t/TEST
+
+t/TEST : Makefile.am t/TEST.PL
+	@PERL@ -MApache::TestMM -e '$(TEST_CONFIG_SCRIPT)' -- -apxs @APACHE1_APXS@
+
+test :: all check run_tests
+
+test_clean : cmodules_clean
+	-MAKE=$(MAKE) @PERL@ t/TEST -clean
+	-rm -rf t/htdocs t/logs t/modules t/TEST t/core t/core.* t/cgi-bin/test_cgi t/cgi-bin/.libs
t/.libs t/conf/extra.conf t/conf/ssl/ca t/conf/ssl/httpd-passphrase.pl
+
+cmodules_clean:
+	-cd c-modules && $(MAKE) clean
+	-rm c-modules/Makefile c-modules/*/Makefile c-modules/apache_httpd_test.h
+
+clean-local: test_clean
+
 
 endif

Propchange: httpd/apreq/branches/multi-env-unstable/module/apache/t/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Feb 28 11:46:39 2005
@@ -0,0 +1 @@
+.libs

Added: httpd/apreq/branches/multi-env-unstable/module/apache/t/TEST.PL
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/module/apache/t/TEST.PL?view=auto&rev=155691
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/module/apache/t/TEST.PL (added)
+++ httpd/apreq/branches/multi-env-unstable/module/apache/t/TEST.PL Mon Feb 28 11:46:39 2005
@@ -0,0 +1,121 @@
+use strict;
+use warnings FATAL => 'all';
+
+use constant WIN32 => $^O eq 'MSWin32';
+
+use Cwd;
+my $cwd = WIN32 ?
+    Win32::GetLongPathName(cwd) : cwd;
+$cwd =~ m{^(.+)/module/apache$} or die "Can't find base directory";
+my $base_dir = $1;
+my $module_dir = "$base_dir/module";
+my $mod_apreq2_dir = WIN32 ?
+    "$base_dir/win32/libs" : "$module_dir/apache/.libs";
+
+use base 'Apache::TestRun';
+$Apache::TestTrace::Level = 'debug';
+main::->new->run(@ARGV);
+
+sub pre_configure {
+    my $self = shift;
+    # Don't load an installed mod_apreq*
+    Apache::TestConfig::autoconfig_skip_module_add('mod_apreq.c');
+    Apache::TestConfig::autoconfig_skip_module_add('mod_apreq2.c');
+}
+
+sub configure {
+    my $self = shift;
+    my $cfg = $self->{test_config};
+    # make sure Win32 uses the just-built libapreq2.dll
+    if (WIN32) {
+        $cfg->preamble(qq{LoadFile "$mod_apreq2_dir/libapreq2.dll"\n});
+    }
+    $cfg->preamble(IfModule => '!mod_apreq2.c',
+               qq(LoadModule apreq_module "$mod_apreq2_dir/mod_apreq2.so"\n));
+    bless $cfg, "My::TestConfig";
+    $self->SUPER::configure();
+}
+
+
+
+package My::TestConfig;
+use Apache::TestTrace;
+use Apache::TestConfigC;
+use Config;
+use constant WIN32 => $^O eq 'MSWin32';
+
+use base 'Apache::TestConfig';
+
+sub cmodules_configure {
+    my $self = shift;
+    my $dir = "$module_dir/apache/t/c-modules";
+    $self->SUPER::cmodules_configure($dir);
+}
+sub cmodules_httpd_conf {
+    my $self = shift;
+    debug "WRITING httpd.conf with " . join", ",map $_->{name},
+        @{$self->{cmodules}};
+    $self->SUPER::cmodules_httpd_conf(@_);
+}
+sub cmodules_write_makefile {
+    my($self, $mod) = @_;
+    my $dversion = $self->server->dversion;
+    my $name = $mod->{name};
+    my $makefile = "$mod->{dir}/Makefile";
+    debug "WRITING $makefile for $name";
+    my $lib = $self->cmodules_build_so($name);
+
+    my $fh = Symbol::gensym();
+    open $fh, ">$makefile" or die "open $makefile: $!";
+
+    if (WIN32) {
+        require File::Spec;
+        my @goners = map {$name . '.' . $_} qw(exp ilk lib pdb so lo);
+        my $libs = join ' ', 
+            (map {'-l' . File::Spec->catfile($mod_apreq2_dir, $_)}
+              qw(libapreq2.lib mod_apreq.lib));
+        print $fh <<EOF;
+APXS=$self->{APXS}
+all: $lib
+
+$lib: $name.c
+        \$(APXS) -I../../.. -I../../../../include $libs -llibhttpd $dversion -p -I$self->{cmodules_dir}
-c $name.c
+
+clean:
+	-erase @goners vc60.pdb 
+EOF
+    }
+    else {
+        print $fh <<EOF;
+APXS=$self->{APXS}
+all: $lib
+
+$lib: $name.c
+	\$(APXS) -L../../../../library -I../../.. -I../../../../../include -lapreq2 $dversion -I$self->{cmodules_dir}
-c $name.c
+
+clean:
+	-rm -rf $name.o $name.lo $name.slo $name.la .libs
+EOF
+    }
+    close $fh or die "close $makefile: $!";
+}
+
+sub cmodules_makefile_vars {
+    my $make = $ENV{MAKE} || $Config{make};
+    return <<EOF; # XXX: do we need to propagate all the vars in config.nice?
+MAKE=$make
+EOF
+}
+
+sub cmodules_make {
+     my $self = shift;
+     my $targ = shift || 'all';
+     my $make = $ENV{MAKE} || $Config{make};
+
+     my $cmd = "cd $self->{cmodules_dir} && $make $targ";
+     debug $cmd;
+     system $cmd;
+     if ($?) {
+         die "Failed to build c-modules";
+     }
+}

Propchange: httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Feb 28 11:46:39 2005
@@ -0,0 +1,2 @@
+Makefile
+apache_httpd_test.h

Propchange: httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_access_test/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Feb 28 11:46:39 2005
@@ -0,0 +1,3 @@
+.libs
+Makefile
+mod_apreq_access_test.slo

Added: httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_access_test/mod_apreq_access_test.c
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_access_test/mod_apreq_access_test.c?view=auto&rev=155691
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_access_test/mod_apreq_access_test.c
(added)
+++ httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_access_test/mod_apreq_access_test.c
Mon Feb 28 11:46:39 2005
@@ -0,0 +1,98 @@
+/*
+**  Copyright 2003-2004  The Apache Software Foundation
+**
+**  Licensed under the Apache License, Version 2.0 (the "License");
+**  you may not use this file except in compliance with the License.
+**  You may obtain a copy of the License at
+**
+**      http://www.apache.org/licenses/LICENSE-2.0
+**
+**  Unless required by applicable law or agreed to in writing, software
+**  distributed under the License is distributed on an "AS IS" BASIS,
+**  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+**  See the License for the specific language governing permissions and
+**  limitations under the License.
+*/
+
+#ifdef CONFIG_FOR_HTTPD_TEST
+#if CONFIG_FOR_HTTPD_TEST
+
+<Location /apreq_access_test>
+   TestAccess test
+   SetHandler apreq_request_test
+</Location>
+
+#endif
+#endif
+
+#define APACHE_HTTPD_TEST_ACCESS_CHECKER apreq_access_checker
+#define APACHE_HTTPD_TEST_COMMANDS       access_cmds
+#define APACHE_HTTPD_TEST_PER_DIR_CREATE create_access_config 
+
+#include "apache_httpd_test.h"
+#include "apreq_module_apache2.h"
+#include "httpd.h"
+#include "apr_strings.h"
+
+extern module AP_MODULE_DECLARE_DATA apreq_access_test_module;
+
+struct access_test_cfg {
+    apr_pool_t *pool;
+    const char *param;
+};
+
+static const char *access_config(cmd_parms *cmd, void *dv, const char *arg)
+{
+    struct access_test_cfg *cfg = (struct access_test_cfg *)dv;
+    cfg->param = apr_pstrdup(cfg->pool, arg);
+    return NULL;
+}
+
+static const command_rec access_cmds[] =
+{
+    AP_INIT_TAKE1("TestAccess", access_config, NULL, OR_LIMIT, "'param'"),
+    { NULL }
+};
+
+static void *create_access_config(apr_pool_t *p, char *dummy)
+{
+    struct access_test_cfg *cfg = apr_palloc(p, sizeof *cfg);
+    cfg->pool = p;
+    cfg->param = dummy;
+    return cfg;
+}
+
+static int apreq_access_checker(request_rec *r)
+{
+    apreq_handle_t *handle;
+    apreq_param_t *param;
+    struct access_test_cfg *cfg = (struct access_test_cfg *)
+        ap_get_module_config(r->per_dir_config, &apreq_access_test_module);
+
+    if (!cfg || !cfg->param)
+        return DECLINED;
+
+    handle = apreq_handle_apache2(r);
+    param = apreq_param(handle, cfg->param);
+    if (param != NULL) {
+        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS,
+                      r, "ACCESS GRANTED: %s => %s", cfg->param, param->v.data);
+        return OK;
+    }
+    else {
+        const apr_table_t *t = apreq_params(handle, r->pool);
+        if (t != NULL) {
+            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_EGENERAL, r, 
+                          "%s not found: parsing error detected (%d params)",
+                          cfg->param, apr_table_elts(t)->nelts);
+        }
+        else {
+            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_EGENERAL, r, 
+                          "%s not found: paring error detected (no param table)",
+                          cfg->param);
+        }
+        return HTTP_FORBIDDEN;
+    }
+}
+
+APACHE_HTTPD_TEST_MODULE(apreq_access_test);

Propchange: httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_big_request_test/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Feb 28 11:46:39 2005
@@ -0,0 +1,3 @@
+.libs
+Makefile
+mod_apreq_big_request_test.slo

Added: httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_big_request_test/mod_apreq_big_request_test.c
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_big_request_test/mod_apreq_big_request_test.c?view=auto&rev=155691
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_big_request_test/mod_apreq_big_request_test.c
(added)
+++ httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_big_request_test/mod_apreq_big_request_test.c
Mon Feb 28 11:46:39 2005
@@ -0,0 +1,58 @@
+/*
+**  Copyright 2003-2004  The Apache Software Foundation
+**
+**  Licensed under the Apache License, Version 2.0 (the "License");
+**  you may not use this file except in compliance with the License.
+**  You may obtain a copy of the License at
+**
+**      http://www.apache.org/licenses/LICENSE-2.0
+**
+**  Unless required by applicable law or agreed to in writing, software
+**  distributed under the License is distributed on an "AS IS" BASIS,
+**  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+**  See the License for the specific language governing permissions and
+**  limitations under the License.
+*/
+
+#ifdef CONFIG_FOR_HTTPD_TEST
+#if CONFIG_FOR_HTTPD_TEST
+
+<Location /apreq_big_request_test>
+   SetHandler apreq_big_request_test
+</Location>
+
+#endif
+#endif
+
+#define APACHE_HTTPD_TEST_HANDLER apreq_big_request_test_handler
+
+#include "apache_httpd_test.h"
+#include "apreq_module_apache2.h"
+#include "httpd.h"
+
+static int dump_table(void *count, const char *key, const char *value)
+{
+    int *c = (int *) count;
+    *c = *c + strlen(key) + strlen(value);
+    return 1;
+}
+
+static int apreq_big_request_test_handler(request_rec *r)
+{
+    apreq_handle_t *req;
+    apr_table_t *params;
+    int count = 0;
+
+    if (strcmp(r->handler, "apreq_big_request_test") != 0)
+        return DECLINED;
+
+    req = apreq_handle_apache2(r);
+
+    params = apreq_params(req, r->pool);
+    apr_table_do(dump_table, &count, params, NULL);
+    ap_set_content_type(r, "text/plain");
+    ap_rprintf(r, "%d", count);
+    return OK;
+}
+
+APACHE_HTTPD_TEST_MODULE(apreq_big_request_test);

Propchange: httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_cookie_test/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Feb 28 11:46:39 2005
@@ -0,0 +1,3 @@
+.libs
+Makefile
+mod_apreq_cookie_test.slo

Added: httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_cookie_test/mod_apreq_cookie_test.c
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_cookie_test/mod_apreq_cookie_test.c?view=auto&rev=155691
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_cookie_test/mod_apreq_cookie_test.c
(added)
+++ httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_cookie_test/mod_apreq_cookie_test.c
Mon Feb 28 11:46:39 2005
@@ -0,0 +1,96 @@
+/*
+**  Copyright 2003-2004  The Apache Software Foundation
+**
+**  Licensed under the Apache License, Version 2.0 (the "License");
+**  you may not use this file except in compliance with the License.
+**  You may obtain a copy of the License at
+**
+**      http://www.apache.org/licenses/LICENSE-2.0
+**
+**  Unless required by applicable law or agreed to in writing, software
+**  distributed under the License is distributed on an "AS IS" BASIS,
+**  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+**  See the License for the specific language governing permissions and
+**  limitations under the License.
+*/
+
+#ifdef CONFIG_FOR_HTTPD_TEST
+#if CONFIG_FOR_HTTPD_TEST
+
+<Location /apreq_cookie_test>
+   SetHandler apreq_cookie_test
+</Location>
+
+#endif
+#endif
+
+#define APACHE_HTTPD_TEST_HANDLER apreq_cookie_test_handler
+
+#include "apache_httpd_test.h"
+#include "apreq_module_apache2.h"
+#include "apreq_util.h"
+#include "httpd.h"
+#include <assert.h>
+
+
+static int dump_table(void *ctx, const char *key, const char *value)
+{
+    request_rec *r = ctx;
+    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS,
+                  r, "[%s] => [%s]", key, value);
+    return 1;
+}
+
+
+static int apreq_cookie_test_handler(request_rec *r)
+{
+    apreq_handle_t *req;
+    apr_status_t s;
+    const char *test, *key;
+    apreq_cookie_t *cookie;
+    apr_size_t size;
+    char *dest;
+    const apr_table_t *args;
+
+    if (strcmp(r->handler, "apreq_cookie_test") != 0)
+        return DECLINED;
+
+    req = apreq_handle_apache2(r);
+
+    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, r, 
+                  "starting cookie tests");
+
+    apreq_args(req, &args);
+
+    apr_table_do(dump_table, r, args, NULL);
+
+    test = apr_table_get(args, "test");
+    key = apr_table_get(args, "key");
+
+    cookie = apreq_cookie(req, key);
+
+    ap_set_content_type(r, "text/plain");
+
+    if (strcmp(test, "bake") == 0) {
+        apreq_cookie_taint_off(cookie);
+        s = apreq_cookie_bake(cookie, req);
+    }
+    else if (strcmp(test, "bake2") == 0) {
+        apreq_cookie_taint_off(cookie);
+        s = apreq_cookie_bake2(cookie, req);
+    }
+    else {
+        size = strlen(cookie->v.data);
+        dest = apr_palloc(r->pool, size + 1);
+        s = apreq_decode(dest, &size, cookie->v.data, size);
+        if (s == APR_SUCCESS)
+            ap_rprintf(r, "%s", dest);
+    }
+
+    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, s, r, 
+                  "finished cookie tests");
+
+    return OK;
+}
+
+APACHE_HTTPD_TEST_MODULE(apreq_cookie_test);

Propchange: httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_redirect_test/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Feb 28 11:46:39 2005
@@ -0,0 +1,3 @@
+.libs
+Makefile
+mod_apreq_redirect_test.slo

Added: httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_redirect_test/mod_apreq_redirect_test.c
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_redirect_test/mod_apreq_redirect_test.c?view=auto&rev=155691
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_redirect_test/mod_apreq_redirect_test.c
(added)
+++ httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_redirect_test/mod_apreq_redirect_test.c
Mon Feb 28 11:46:39 2005
@@ -0,0 +1,55 @@
+/*
+**  Copyright 2003-2004  The Apache Software Foundation
+**
+**  Licensed under the Apache License, Version 2.0 (the "License");
+**  you may not use this file except in compliance with the License.
+**  You may obtain a copy of the License at
+**
+**      http://www.apache.org/licenses/LICENSE-2.0
+**
+**  Unless required by applicable law or agreed to in writing, software
+**  distributed under the License is distributed on an "AS IS" BASIS,
+**  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+**  See the License for the specific language governing permissions and
+**  limitations under the License.
+*/
+
+#ifdef CONFIG_FOR_HTTPD_TEST
+#if CONFIG_FOR_HTTPD_TEST
+
+<Location /apreq_redirect_test>
+   TestAccess test
+   SetHandler apreq_redirect_test
+</Location>
+
+#endif
+#endif
+
+#define APACHE_HTTPD_TEST_HANDLER apreq_redirect_test_handler
+
+#include "apache_httpd_test.h"
+#include "apreq_module_apache2.h"
+#include "httpd.h"
+
+static int apreq_redirect_test_handler(request_rec *r)
+{
+    apreq_handle_t *req;
+    const apreq_param_t *loc;
+
+    if (strcmp(r->handler, "apreq_redirect_test") != 0)
+        return DECLINED;
+
+    req = apreq_handle_apache2(r);
+
+    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS,
+                  r, "looking for new location");
+    loc = apreq_param(req, "location");
+    if (!loc)
+        return DECLINED;
+    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS,
+                  r, "redirecting to %s", loc->v.data);
+    ap_internal_redirect(loc->v.data, r);
+    return OK;
+}
+
+APACHE_HTTPD_TEST_MODULE(apreq_redirect_test);

Propchange: httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_request_test/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Feb 28 11:46:39 2005
@@ -0,0 +1,4 @@
+.libs
+*.
+Makefile
+mod_apreq_request_test.slo

Added: httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_request_test/mod_apreq_request_test.c
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_request_test/mod_apreq_request_test.c?view=auto&rev=155691
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_request_test/mod_apreq_request_test.c
(added)
+++ httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_request_test/mod_apreq_request_test.c
Mon Feb 28 11:46:39 2005
@@ -0,0 +1,78 @@
+/*
+**  Copyright 2003-2004  The Apache Software Foundation
+**
+**  Licensed under the Apache License, Version 2.0 (the "License");
+**  you may not use this file except in compliance with the License.
+**  You may obtain a copy of the License at
+**
+**      http://www.apache.org/licenses/LICENSE-2.0
+**
+**  Unless required by applicable law or agreed to in writing, software
+**  distributed under the License is distributed on an "AS IS" BASIS,
+**  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+**  See the License for the specific language governing permissions and
+**  limitations under the License.
+*/
+
+#ifdef CONFIG_FOR_HTTPD_TEST
+#if CONFIG_FOR_HTTPD_TEST
+
+<Location /apreq_request_test>
+   APREQ_ReadLimit 500K
+   SetHandler apreq_request_test
+</Location>
+
+#endif
+#endif
+
+#define APACHE_HTTPD_TEST_HANDLER apreq_request_test_handler
+
+#include "apache_httpd_test.h"
+#include "apreq_module_apache.h"
+#include "httpd.h"
+
+static int dump_table(void *ctx, const char *key, const char *value)
+{
+    request_rec *r = ctx;
+    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS,
+                  r, "%s => %s", key, value);
+    ap_rprintf(r, "\t%s => %s\n", key, value);
+    return 1;
+}
+
+static int apreq_request_test_handler(request_rec *r)
+{
+    apreq_handle_t *req;
+    const apr_table_t *t;
+    apr_status_t s;
+
+    if (strcmp(r->handler, "apreq_request_test") != 0)
+        return DECLINED;
+
+    req = apreq_handle_apache2(r);
+
+    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS,
+                  r, "starting apreq_request_test");
+
+    s = ap_discard_request_body(r);
+
+    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, s,
+                  r, "discard request body");
+
+    ap_set_content_type(r, "text/plain");
+    ap_rputs("ARGS:\n",r);
+    if (apreq_args(req, &t) == APR_SUCCESS)
+        apr_table_do(dump_table, r, t, NULL);
+
+    if (apreq_body(req, &t) == APR_SUCCESS) {
+        ap_rputs("BODY:\n",r);
+        apr_table_do(dump_table, r, t, NULL);
+    }
+
+    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS,
+                  r, "finished apreq_request_test");
+
+    return OK;
+}
+
+APACHE_HTTPD_TEST_MODULE(apreq_request_test);

Modified: httpd/apreq/branches/multi-env-unstable/module/apache2/Makefile.am
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/module/apache2/Makefile.am?view=diff&r1=155690&r2=155691
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/module/apache2/Makefile.am (original)
+++ httpd/apreq/branches/multi-env-unstable/module/apache2/Makefile.am Mon Feb 28 11:46:39
2005
@@ -1,6 +1,6 @@
 INCLUDES = -I../../include @APACHE2_INCLUDES@ @APR_INCLUDES@ @APU_INCLUDES@
-LIBS = ../../library/lib@APREQ_LIBNAME@.la @APR_LTLIBS@ @APU_LTLIBS@
-LDFLAGS = @APR_LDFLAGS@ @APU_LDFLAGS@
+LIBS = ../../library/lib@APREQ_LIBNAME@.la @APU_LIBS@ @APR_LIBS@
+LDFLAGS = @APU_LTFLAGS@ @APR_LTFLAGS@
 TEST_CONFIG_SCRIPT = package Apache::TestMM; filter_args(); generate_script("t/TEST")
 pkgincludedir = $(includedir)/@APREQ_LIBNAME@
 pkginclude_HEADERS = apreq_module_apache2.h



Mime
View raw message