joes 2003/10/13 11:24:47
Modified: . CHANGES STATUS acinclude.m4 configure.ac
build xsbuilder.pl
env Makefile.am
env/t TEST.PL
glue/perl Makefile.PL
src .cvsignore Makefile.am apreq.h apreq_params.c
t Makefile.am
Added: . apreq2-config.in
build get-version.sh
src apreq_version.c apreq_version.h
Log:
Add versioning changes to libapreq-
1) The shared library is now named libapreq2.
2) The header files get installed into their own subdirectory: apreq2.
3) Added a versioning API (apreq_version.[ch]) based on apr-util.
4) I also added an apreq2-config script based on apu-config.
Revision Changes Path
1.9 +1 -1 httpd-apreq-2/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/httpd-apreq-2/CHANGES,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- CHANGES 8 Oct 2003 17:44:18 -0000 1.8
+++ CHANGES 13 Oct 2003 18:24:46 -0000 1.9
@@ -1,6 +1,6 @@
/** @page CHANGES
[EMAIL PROTECTED] 2.0.0-dev Changes with libapreq-2.0.0-dev
[EMAIL PROTECTED] 2.0.0-dev Changes with libapreq2-0.0-dev
- October 8, 2003 - configure: static mod_apreq.c [Bojan Smojver, joes]
1.25 +2 -3 httpd-apreq-2/STATUS
Index: STATUS
===================================================================
RCS file: /home/cvs/httpd-apreq-2/STATUS,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- STATUS 12 Oct 2003 19:49:56 -0000 1.24
+++ STATUS 13 Oct 2003 18:24:46 -0000 1.25
@@ -23,7 +23,6 @@
CURRENT VOTES:
-
TODO:
- Figure out why there's problems (Win32 specific?) with
@@ -35,7 +34,7 @@
- Get env/ (Apache::Test) tests to work for --with-apache2-src option.
- - Add an apreq-config script similar to ap[ru]-config.
+ - Add an apreq2-config script similar to ap[ru]-config.
- Bring Perl documentation up to speed.
1.10 +56 -12 httpd-apreq-2/acinclude.m4
Index: acinclude.m4
===================================================================
RCS file: /home/cvs/httpd-apreq-2/acinclude.m4,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- acinclude.m4 8 Oct 2003 17:44:18 -0000 1.9
+++ acinclude.m4 13 Oct 2003 18:24:46 -0000 1.10
@@ -11,7 +11,11 @@
if test -n "$APACHE2_SRC"; then
APACHE2_SRC=`cd $APACHE2_SRC;pwd`
- APACHE2_INCLUDES=$APACHE2_SRC/include
+
+ AC_CHECK_FILE([$APACHE2_SRC/include/httpd.h],,
+ AC_MSG_ERROR([invalid Apache2 source directory]))
+
+ APACHE2_INCLUDES=-I$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)]),
@@ -21,19 +25,17 @@
[APU_CONFIG=$withval],[APU_CONFIG="$APACHE2_SRC/srclib/apr-util/apu-config"])
else
- APACHE2_INCLUDES=`$APACHE2_APXS -q INCLUDEDIR`
+ APACHE2_INCLUDES=-I`$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_MSG_ERROR([invalid apr-config location- did you forget to
configure apr?]))
AC_CHECK_FILE([$APU_CONFIG],,
- AC_MSG_ERROR([invalid apu-config location- perhaps you need
to configure apr-util first?]))
+ AC_MSG_ERROR([invalid apu-config location- did you forget to
configure apr-util?]))
AM_CONDITIONAL(BUILD_HTTPD, test -n "$APACHE2_SRC")
AM_CONDITIONAL(BUILD_APR, test "x$APR_CONFIG" = x`$APR_CONFIG
--srcdir`/apr-config)
@@ -42,22 +44,64 @@
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-libtool --libs`
- APU_LIBS=`$APU_CONFIG --link-libtool --libs`
+ 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`
+ 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`
+
+ dnl Absolute source/build directory
+ abs_srcdir=`(cd $srcdir && pwd)`
+ abs_builddir=`pwd`
+ top_builddir="$abs_srcdir"
+
+ if test "$abs_builddir" != "$abs_srcdir"; then
+ USE_VPATH=1
+ fi
+
+ AC_SUBST(top_builddir)
+ AC_SUBST(abs_srcdir)
+ AC_SUBST(abs_builddir)
+
+ get_version="$abs_srcdir/build/get-version.sh"
+ version_hdr="$abs_srcdir/src/apreq_version.h"
+
+ APREQ_LIBTOOL_VERSION=`$get_version libtool $version_hdr APREQ`
+ APREQ_MAJOR_VERSION=`$get_version major $version_hdr APREQ`
+ APREQ_DOTTED_VERSION=`$get_version all $version_hdr APREQ`
+
+ echo "libapreq Version: $APREQ_DOTTED_VERSION"
+
+ APREQ_LIBNAME="apreq$APREQ_MAJOR_VERSION"
+ APREQ_INCLUDES=""
+ APREQ_LDFLAGS=""
+ APREQ_EXPORT_LIBS=""
+
+ AC_SUBST(APREQ_LIBNAME)
+ AC_SUBST(APREQ_LDFLAGS)
+ AC_SUBST(APREQ_INCLUDES)
+ AC_SUBST(APREQ_EXPORT_LIBS)
+ AC_SUBST(APREQ_LIBTOOL_VERSION)
+ AC_SUBST(APREQ_MAJOR_VERSION)
+ AC_SUBST(APREQ_DOTTED_VERSION)
+
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(APR_INCLUDES)
AC_SUBST(APU_INCLUDES)
- AC_SUBST(APR_LIBS)
- AC_SUBST(APU_LIBS)
+ AC_SUBST(APR_LTLIBS)
+ AC_SUBST(APU_LTLIBS)
+ AC_SUBST(APR_LDLIBS)
+ AC_SUBST(APU_LDLIBS)
AC_SUBST(APR_LA)
AC_SUBST(APU_LA)
AC_SUBST(PERL)
1.6 +4 -2 httpd-apreq-2/configure.ac
Index: configure.ac
===================================================================
RCS file: /home/cvs/httpd-apreq-2/configure.ac,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- configure.ac 12 Jun 2003 08:23:47 -0000 1.5
+++ configure.ac 13 Oct 2003 18:24:46 -0000 1.6
@@ -1,7 +1,7 @@
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.13)
-AC_INIT(libapreq - Apache Request Library, 2.0, [EMAIL PROTECTED], libapreq)
+AC_INIT(libapreq - Apache Request Library, 2.0, [EMAIL PROTECTED], apreq2)
dnl this:
dnl AC_CONFIG_AUX_DIR(build)
@@ -28,4 +28,6 @@
dnl Checks for library functions.
AC_APREQ
-AC_OUTPUT([Makefile src/Makefile env/Makefile t/Makefile])
+AC_CONFIG_FILES([Makefile src/Makefile env/Makefile t/Makefile])
+AC_CONFIG_FILES([apreq2-config], [chmod +x apreq2-config])
+AC_OUTPUT
1.1 httpd-apreq-2/apreq2-config.in
Index: apreq2-config.in
===================================================================
#!/bin/sh
# ====================================================================
# The Apache Software License, Version 1.1
#
# Copyright (c) 2001-2003 The Apache Software Foundation. All rights
# reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# 3. The end-user documentation included with the redistribution,
# if any, must include the following acknowledgment:
# "This product includes software developed by the
# Apache Software Foundation (http://www.apache.org/)."
# Alternately, this acknowledgment may appear in the software itself,
# if and wherever such third-party acknowledgments normally appear.
#
# 4. The names "Apache" and "Apache Software Foundation" must
# not be used to endorse or promote products derived from this
# software without prior written permission. For written
# permission, please contact [EMAIL PROTECTED]
#
# 5. Products derived from this software may not be called "Apache",
# nor may "Apache" appear in their name, without prior written
# permission of the Apache Software Foundation.
#
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
# ====================================================================
#
# This software consists of voluntary contributions made by many
# individuals on behalf of the Apache Software Foundation. For more
# information on the Apache Software Foundation, please see
# <http://www.apache.org/>.
# apreq2-config- based on apu-config:
# APR-util script designed to allow easy command line access to APR-util
# configuration parameters.
APREQ2_DOTTED_VERSION="@APREQ2_DOTTED_VERSION@"
prefix="@prefix@"
exec_prefix="@exec_prefix@"
bindir="@bindir@"
libdir="@libdir@"
includedir="@includedir@"
LIBS="@APREQ_EXPORT_LIBS@"
INCLUDES="@APREQ_INCLUDES@"
LDFLAGS="@APREQ_LDFLAGS@"
APREQ2_LIBNAME="@APREQ_LIBNAME@"
APREQ2_SOURCE_DIR="@abs_srcdir@"
APREQ2_BUILD_DIR="@abs_builddir@"
show_usage()
{
cat << EOF
Usage: apreq2-config [OPTION]
Known values for OPTION are:
--prefix[=DIR] change prefix to DIR
--bindir print location where binaries are installed
--includes print include information
--includedir print location where headers are installed
--ldflags print linker flags
--libs print library information
--srcdir print apreq2 source directory
--link-ld print link switch(es) for linking to libapreq2
--link-libtool print the libtool inputs for linking to libapreq2
--apreq2-la-file print the path to the .la file, if available
--version print libapreq2's version as a dotted triple
--help print this help
When linking with libtool, an application should do something like:
APREQ2_LIBS="\`apreq2-config --link-libtool --libs\`"
or when linking directly:
APREQ2_LIBS="\`apreq2-config --link-ld --libs\`"
An application should use the results of --includes, and --ldflags in
their build process.
EOF
}
if test $# -eq 0; then
show_usage
exit 1
fi
thisdir="`dirname $0`"
thisdir="`cd $thisdir && pwd`"
if test -d $bindir; then
tmpbindir="`cd $bindir && pwd`"
else
tmpbindir=""
fi
# If we have the realpath program, use it to resolve symlinks.
# Otherwise, being in a symlinked dir may result in incorrect output.
if test -x "`which realpath 2>/dev/null`"; then
thisdir="`realpath $thisdir`"
if test -d "$APREQ2_SOURCE_DIR"; then
APREQ2_SOURCE_DIR="`realpath $APREQ2_SOURCE_DIR`"
fi
if test -n "$tmpbindir"; then
tmpbindir="`realpath $tmpbindir`"
fi
fi
if test "$tmpbindir" = "$thisdir"; then
location=installed
elif test "$APREQ2_SOURCE_DIR" = "$thisdir"; then
location=source
else
location=build
fi
if test "$location" = "installed"; then
LA_FILE="$libdir/lib${APREQ2_LIBNAME}.la"
else
LA_FILE="$thisdir/src/lib${APREQ2_LIBNAME}.la"
fi
flags=""
while test $# -gt 0; do
# Normalize the prefix.
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case "$1" in
# It is possible for the user to override our prefix.
--prefix=*)
prefix=$optarg
;;
--prefix)
echo $prefix
exit 0
;;
--bindir)
echo $bindir
exit 0
;;
--libs)
flags="$flags $LIBS"
;;
--includedir)
if test "$location" = "installed"; then
flags="$includedir"
elif test "$location" = "source"; then
flags="$APREQ2_SOURCE_DIR/src"
else
# this is for VPATH builds
flags="$thisdir/include $APREQ2_SOURCE_DIR/src"
fi
echo $flags
exit 0
;;
--includes)
if test "$location" = "installed"; then
flags="$flags -I$includedir $INCLUDES"
elif test "$location" = "source"; then
flags="$flags -I$APREQ2_SOURCE_DIR/src $INCLUDES"
else
# this is for VPATH builds
flags="$flags -I$thisdir/include -I$APREQ2_SOURCE_DIR/src $INCLUDES"
fi
;;
--ldflags)
flags="$flags $LDFLAGS"
;;
--srcdir)
echo $APREQ2_SOURCE_DIR
exit 0
;;
--version)
echo $APREQ2_DOTTED_VERSION
exit 0
;;
--link-ld)
if test "$location" = "installed"; then
### avoid using -L if libdir is a "standard" location like /usr/lib
flags="$flags -L$libdir -l$APREQ2_LIBNAME"
else
flags="$flags -L$thisdir/src -l$APREQ2_LIBNAME"
fi
;;
--link-libtool)
# If the LA_FILE exists where we think it should be, use it. If we're
# installed and the LA_FILE does not exist, assume to use -L/-l
# (the LA_FILE may not have been installed). If we're building ourselves,
# we'll assume that at some point the .la file be created.
if test -f "$LA_FILE"; then
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$APREQ2_LIBNAME"
else
flags="$flags $LA_FILE"
fi
;;
--apreq2-la-file)
if test -f "$LA_FILE"; then
flags="$flags $LA_FILE"
fi
;;
--help)
show_usage
exit 0
;;
*)
show_usage
exit 1
;;
esac
# Next please.
shift
done
if test -n "$flags"; then
echo "$flags"
fi
exit 0
1.10 +28 -12 httpd-apreq-2/build/xsbuilder.pl
Index: xsbuilder.pl
===================================================================
RCS file: /home/cvs/httpd-apreq-2/build/xsbuilder.pl,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- xsbuilder.pl 20 Jul 2003 18:13:39 -0000 1.9
+++ xsbuilder.pl 13 Oct 2003 18:24:46 -0000 1.10
@@ -13,7 +13,7 @@
use Cwd;
my $cwd = Apache::Build::WIN32 ?
Win32::GetLongPathName(cwd) : cwd;
-$cwd =~ m{^(.+httpd-apreq-2)} or die "Can't find base cvs directory";
+$cwd =~ m{^(.+)/glue/perl$} or die "Can't find base directory";
my $base_dir = $1;
my $src_dir = "$base_dir/src";
my $xs_dir = "$base_dir/glue/perl/xsbuilder";
@@ -23,27 +23,44 @@
read $file, $_[0], -s $file;
}
-my ($apache_includes, $apr_libs);
+my ($apache_includes, $apr_libs, $apreq_libname);
+
if (Apache::Build::WIN32) {
+ # XXX May need fixing, Randy!
my $apache_dir = Apache::Build->build_config()->dir;
- ($apache_includes = $apache_dir . '/include') =~ s!\\!/!g;
+ ($apache_includes = "-I$apache_dir" . '/include') =~ s!\\!/!g;
($apr_libs = $apache_dir . '/lib') =~ s!\\!/!g;
+ $apreq_libname = "apreq";
}
else {
slurp my $config => "$base_dir/config.status";
- $config =~ /^s,[EMAIL PROTECTED]@,([^,]+)/m && -d $1 or
+ $config =~ /^s,[EMAIL PROTECTED]@,([^,]+)/m or
die "Can't find apache include directory";
$apache_includes = $1;
- $config =~ m/^s,[EMAIL PROTECTED]@,([^,]+)/m && -d $1 or
- die "Can't find apr lib directory";
+ $config =~ /^s,[EMAIL PROTECTED]@,([^,]+)/m or
+ die "Can't find apache include directory";
+ $apache_includes .= " $1";
+ $config =~ /^s,[EMAIL PROTECTED]@,([^,]+)/m or
+ die "Can't find apache include directory";
+ $apache_includes .= " $1";
+
+ $config =~ m/^s,[EMAIL PROTECTED]@,([^,]+)/m or
+ die "Can't find apu libraries";
$apr_libs = $1;
+ $config =~ m/^s,[EMAIL PROTECTED]@,([^,]+)/m or
+ die "Can't find apr libraries";
+ $apr_libs .= " $1";
+
+ $config =~ m/^s,[EMAIL PROTECTED]@,([^,]+)/m or
+ die "Can't find apreq libname";
+ $apreq_libname = $1;
}
my $apr_lib_flags = Apache::Build::WIN32 ?
qq{-L$apr_libs -llibapr -llibaprutil} :
- qq{-L$apr_libs -lapr-0 -laprutil-0};
+ qq{$apr_libs};
my $apreq_lib_flags = Apache::Build::WIN32 ?
- qq{-L$base_dir/win32/libs -llibapreq -lmod_apreq} :
- qq{-L$src_dir/.libs -lapreq};
+ qq{-L$base_dir/win32/libs -llib$apreq_libname -lmod_apreq} :
+ qq{-L$src_dir/.libs -l$apreq_libname};
my $mp2_typemaps = Apache::Build->new->typemaps;
read DATA, my $grammar, -s DATA;
@@ -84,7 +101,7 @@
use base qw/ExtUtils::XSBuilder::ParseSource/;
__PACKAGE__->$_ for shift || ();
-sub package {'Apache::libapreq'}
+sub package {'Apache::libapreq2'}
sub unwanted_includes {["apreq_tables.h"]}
# ParseSource.pm v 0.23 bug: line 214 should read
# my @dirs = @{$self->include_dirs};
@@ -200,7 +217,6 @@
my $mmargspath = '../' x @parts ;
$mmargspath .= 'mmargs.pl' ;
- # XXX probably should gut EU::MM and use MP::MM instead
my $txt = qq{
$self->{noedit_warning_hash}
use Apache2;
@@ -221,7 +237,7 @@
'NAME' => '$class',
'VERSION' => '0.01',
'TYPEMAPS' => [qw(@$mp2_typemaps $typemap)],
- 'INC' => "-I.. -I../.. -I../../.. -I$src_dir -I$xs_dir
-I$apache_includes",
+ 'INC' => "-I.. -I../.. -I../../.. -I$src_dir -I$xs_dir
$apache_includes",
'LIBS' => "$apreq_lib_flags $apr_lib_flags",
} ;
$txt .= "'depend' => $deps,\n" if ($deps) ;
1.1 httpd-apreq-2/build/get-version.sh
Index: get-version.sh
===================================================================
#!/bin/sh
#
# extract version numbers from a header file
#
# USAGE: get-version.sh CMD VERSION_HEADER PREFIX
# where CMD is one of: all, major, libtool
# where PREFIX is the prefix to {MAJOR|MINOR|PATCH}_VERSION defines
#
# get-version.sh all returns a dotted version number
# get-version.sh major returns just the major version number
# get-version.sh libtool returns a version "libtool -version-info" format
#
if test $# != 3; then
echo "USAGE: $0 CMD INCLUDEDIR PREFIX"
echo " where CMD is one of: all, major, libtool"
exit 1
fi
major_sed="/#define.*$3_MAJOR_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p"
minor_sed="/#define.*$3_MINOR_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p"
patch_sed="/#define.*$3_PATCH_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p"
major="`sed -n $major_sed $2`"
minor="`sed -n $minor_sed $2`"
patch="`sed -n $patch_sed $2`"
ltmaj="`expr $major + $minor`"
if test "$1" = "all"; then
echo ${major}.${minor}.${patch}
elif test "$1" = "major"; then
echo ${major}
elif test "$1" = "libtool"; then
echo ${ltmaj}:${patch}:${minor}
else
echo "ERROR: unknown version CMD ($1)"
exit 1
fi
1.13 +14 -10 httpd-apreq-2/env/Makefile.am
Index: Makefile.am
===================================================================
RCS file: /home/cvs/httpd-apreq-2/env/Makefile.am,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Makefile.am 8 Oct 2003 17:44:18 -0000 1.12
+++ Makefile.am 13 Oct 2003 18:24:46 -0000 1.13
@@ -1,9 +1,13 @@
-INCLUDES = -I../src [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ [EMAIL PROTECTED]@
-LIBS = ../src/libapreq.la @APR_LIBS@ @APU_LIBS@
+INCLUDES = -I../src @APACHE2_INCLUDES@ @APR_INCLUDES@ @APU_INCLUDES@
+LIBS = ../src/[EMAIL PROTECTED]@.la @APR_LTLIBS@ @APU_LTLIBS@
TEST_CONFIG_SCRIPT = package Apache::TestMM; filter_args();
generate_script("t/TEST")
-lib_LIBRARIES = libapreq_cgi.a
-libapreq_cgi_a_SOURCES = libapreq_cgi.c
+# XXX: should name libapreq2_cgi.a w/ source file libapreq2_cgi.c
+# lib_LIBRARIES = [EMAIL PROTECTED]@_cgi.a
+# [EMAIL PROTECTED]@_cgi_a_SOURCES = [EMAIL PROTECTED]@_cgi.c
+#
+#check_PROGRAMS = test_cgi
+#test_cgi_LDADD = [EMAIL PROTECTED]@_cgi.a
if BUILD_HTTPD
@@ -15,12 +19,12 @@
# See the INSTALL file for details.
@APACHE2_HTTPD@:
- cd @APACHE2_SRC@ && make
+ cd @APACHE2_SRC@ && $(MAKE)
all-local: @APACHE2_HTTPD@
-t/TEST : Makefile.am
- @PERL@ -MApache::TestMM -e '$(TEST_CONFIG_SCRIPT)' -- -httpd
@APACHE2_SRC@/.libs/httpd
+t/TEST : Makefile.am t/TEST.PL
+ @PERL@ -MApache::TestMM -e '$(TEST_CONFIG_SCRIPT)' -- -httpd
@APACHE2_HTTPD@
else
@@ -33,7 +37,7 @@
install-exec-local: mod_apreq.la
@APACHE2_APXS@ -i -a -n apreq mod_apreq.la
-t/TEST : Makefile.am
+t/TEST : Makefile.am t/TEST.PL
@PERL@ -MApache::TestMM -e '$(TEST_CONFIG_SCRIPT)' -- -apxs
@APACHE2_APXS@
endif
@@ -41,11 +45,11 @@
run_tests : t/TEST
@PERL@ t/TEST
-test :: all run_tests
+test :: all check run_tests
test_clean : cmodules_clean
[EMAIL PROTECTED]@ t/TEST -clean
- -rm -rf t/conf t/htdocs t/logs t/modules t/TEST
+ -rm -rf t/htdocs t/logs t/modules t/TEST
cmodules_clean:
-cd c-modules && $(MAKE) clean
1.5 +2 -2 httpd-apreq-2/env/t/TEST.PL
Index: TEST.PL
===================================================================
RCS file: /home/cvs/httpd-apreq-2/env/t/TEST.PL,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TEST.PL 20 Aug 2003 07:55:23 -0000 1.4
+++ TEST.PL 13 Oct 2003 18:24:46 -0000 1.5
@@ -9,7 +9,7 @@
use Cwd;
my $cwd = WIN32 ?
Win32::GetLongPathName(cwd) : cwd;
-$cwd =~ m{^(.+httpd-apreq-2)} or die "Can't find base cvs directory";
+$cwd =~ m{^(.+)/env$} or die "Can't find base directory";
my $base_dir = $1;
my $env_dir = "$base_dir/env";
my $env_dir_libs = WIN32 ?
@@ -80,7 +80,7 @@
all: $lib
$lib: $name.c
- \$(APXS) -L../../../src -I../../../src -lapreq $dversion
-I$self->{cmodules_dir} -c $name.c
+ \$(APXS) -L../../../src -I../../../src -lapreq2 $dversion
-I$self->{cmodules_dir} -c $name.c
clean:
-rm -rf $name.o $name.lo $name.slo $name.la .libs
1.7 +2 -2 httpd-apreq-2/glue/perl/Makefile.PL
Index: Makefile.PL
===================================================================
RCS file: /home/cvs/httpd-apreq-2/glue/perl/Makefile.PL,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Makefile.PL 20 Jul 2003 18:13:39 -0000 1.6
+++ Makefile.PL 13 Oct 2003 18:24:47 -0000 1.7
@@ -29,8 +29,8 @@
Apache::TestMM::generate_script("t/TEST");
ModPerl::MM::WriteMakefile(
- NAME => 'libapreq',
- VERSION => '0.01',
+ NAME => 'libapreq2',
+ VERSION => '0.1',
DIR => [qw(xs)],
clean => { DIRS => "blib", FILES => "t/TEST @scripts" },
);
1.2 +1 -1 httpd-apreq-2/src/.cvsignore
Index: .cvsignore
===================================================================
RCS file: /home/cvs/httpd-apreq-2/src/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 11 Jun 2003 01:06:04 -0000 1.1
+++ .cvsignore 13 Oct 2003 18:24:47 -0000 1.2
@@ -3,4 +3,4 @@
Makefile
Makefile.in
*.lo
-libapreq.la
+*.la
1.12 +9 -9 httpd-apreq-2/src/Makefile.am
Index: Makefile.am
===================================================================
RCS file: /home/cvs/httpd-apreq-2/src/Makefile.am,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Makefile.am 8 Oct 2003 17:44:18 -0000 1.11
+++ Makefile.am 13 Oct 2003 18:24:47 -0000 1.12
@@ -1,13 +1,13 @@
-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
-
+INCLUDES = @APR_INCLUDES@ @APU_INCLUDES@
+LIBS = @APR_LTLIBS@ @APU_LTLIBS@
BUILT_SOURCES= @APR_LA@ @APU_LA@
-libapreq_la_SOURCES = apreq.c apreq_cookie.c \
- apreq_params.c apreq_parsers.c
+lib_LTLIBRARIES = [EMAIL PROTECTED]@.la
[EMAIL PROTECTED]@_la_SOURCES = apreq.c apreq_version.c apreq_cookie.c \
+ apreq_params.c apreq_parsers.c
+include_HEADERS = apreq.h apreq_version.h apreq_cookie.h \
+ apreq_params.h apreq_env.h apreq_parsers.h
[EMAIL PROTECTED]@_la_LDFLAGS = -version-info @APREQ_LIBTOOL_VERSION@
+
if BUILD_APR
@APR_LA@:
1.33 +1 -1 httpd-apreq-2/src/apreq.h
Index: apreq.h
===================================================================
RCS file: /home/cvs/httpd-apreq-2/src/apreq.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- apreq.h 15 Jul 2003 16:15:50 -0000 1.32
+++ apreq.h 13 Oct 2003 18:24:47 -0000 1.33
@@ -68,7 +68,7 @@
extern "C" {
#endif
-/** @defgroup LIBRARY libapreq.so.2 */
+/** @defgroup LIBRARY libapreq2 */
/** @defgroup MODULES Environments */
/** @defgroup GLUE Language Bindings*/
1.35 +11 -7 httpd-apreq-2/src/apreq_params.c
Index: apreq_params.c
===================================================================
RCS file: /home/cvs/httpd-apreq-2/src/apreq_params.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- apreq_params.c 1 Oct 2003 16:49:11 -0000 1.34
+++ apreq_params.c 13 Oct 2003 18:24:47 -0000 1.35
@@ -65,7 +65,7 @@
#define MAX_LEN (1024 * 1024)
#define MAX_BRIGADE_LEN (1024 * 256)
#define MAX_FIELDS (200)
-#define READ_AHEAD (1024 * 64)
+#define MAX_READ_AHEAD (1024 * 64)
APREQ_DECLARE(apreq_param_t *) apreq_make_param(apr_pool_t *p,
const char *name,
@@ -95,14 +95,13 @@
apreq_request_t *req;
apreq_cfg_t *cfg;
apr_pool_t *p;
- apr_status_t s;
/** default parser configuration */
static const apreq_cfg_t default_cfg = {
- MAX_LEN, /**< limit on POST data size */
+ MAX_LEN, /**< limit on POST data size */
MAX_BRIGADE_LEN, /**< limit on brigade size */
- MAX_FIELDS, /**< maximum number of form fields */
- READ_AHEAD /**< maximum amount of prefetch data */
+ MAX_FIELDS, /**< maximum number of form fields */
+ MAX_READ_AHEAD /**< maximum amount of prefetch data */
};
if (qs == NULL) {
@@ -126,6 +125,8 @@
old_req = apreq_env_request(env, req);
if (old_req != NULL) {
+ apreq_log(APREQ_ERROR APR_EGENERAL, env, "race condition"
+ "between consecutive calls of apreq_env_request");
apreq_env_request(env, old_req); /* reset old_req */
return old_req;
}
@@ -146,8 +147,11 @@
*req->cfg = default_cfg;
- s = (qs == NULL) ? APR_SUCCESS :
- apreq_parse_query_string(p, req->args, qs);
+ if (qs != NULL) {
+ apr_status_t s = apreq_parse_query_string(p, req->args, qs);
+ if (s != APR_SUCCESS)
+ apreq_log(APREQ_ERROR s, env, "invalid query string: %s", qs);
+ }
return req;
}
1.1 httpd-apreq-2/src/apreq_version.c
Index: apreq_version.c
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2000-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
#include "apreq_version.h"
#include "apr_general.h" /* for APR_STRINGIFY */
APREQ_DECLARE(void) apreq_version(apr_version_t *pvsn)
{
pvsn->major = APREQ_MAJOR_VERSION;
pvsn->minor = APREQ_MINOR_VERSION;
pvsn->patch = APREQ_PATCH_VERSION;
#ifdef APREQ_IS_DEV_VERSION
pvsn->is_dev = 1;
#else
pvsn->is_dev = 0;
#endif
}
APREQ_DECLARE(const char *) apreq_version_string(void)
{
return APREQ_VERSION_STRING;
}
1.1 httpd-apreq-2/src/apreq_version.h
Index: apreq_version.h
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2000-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
#ifndef APREQ_VERSION_H
#define APREQ_VERSION_H
#ifdef __cplusplus
extern "C" {
#endif
#include "apreq.h"
#include "apr_version.h"
/**
* @file apreq_version.h
* @brief
*
* libapreq's Version
*
* There are several different mechanisms for accessing the version. There
* is a string form, and a set of numbers; in addition, there are constants
* which can be compiled into your application, and you can query the library
* being used for its actual version.
*
* Note that it is possible for an application to detect that it has been
* compiled against a different version of libapreq by use of the compile-time
* constants and the use of the run-time query function.
*
* libapreq version numbering follows the guidelines specified in:
*
* http://apr.apache.org/versioning.html
*/
/* The numeric compile-time version constants. These constants are the
* authoritative version numbers for libapreq.
*/
/** major version
* Major API changes that could cause compatibility problems for older
* programs such as structure size changes. No binary compatibility is
* possible across a change in the major version.
*/
#define APREQ_MAJOR_VERSION 2
/**
* Minor API changes that do not cause binary compatibility problems.
* Should be reset to 0 when upgrading APREQ_MAJOR_VERSION
*/
#define APREQ_MINOR_VERSION 0
/** patch level */
#define APREQ_PATCH_VERSION 0
/**
* This symbol is defined for internal, "development" copies of libapreq.
* This symbol will be #undef'd for releases.
*/
#define APREQ_IS_DEV_VERSION
/** The formatted string of libapreq's version */
#define APREQ_VERSION_STRING \
APR_STRINGIFY(APREQ_MAJOR_VERSION) "." \
APR_STRINGIFY(APREQ_MINOR_VERSION) "." \
APR_STRINGIFY(APREQ_PATCH_VERSION) \
APREQ_IS_DEV_STRING
/**
* Return APR-util's version information information in a numeric form.
*
* @param pvsn Pointer to a version structure for returning the version
* information.
*/
APREQ_DECLARE(void) apreq_version(apr_version_t *pvsn);
/** Return APU's version information as a string. */
APREQ_DECLARE(const char *) apreq_version_string(void);
/** Internal: string form of the "is dev" flag */
#ifdef APREQ_IS_DEV_VERSION
#define APREQ_IS_DEV_STRING "-dev"
#else
#define APREQ_IS_DEV_STRING ""
#endif
#ifdef __cplusplus
}
#endif
#endif /* APREQ_VERSION_H */
1.13 +5 -5 httpd-apreq-2/t/Makefile.am
Index: Makefile.am
===================================================================
RCS file: /home/cvs/httpd-apreq-2/t/Makefile.am,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Makefile.am 8 Oct 2003 17:44:18 -0000 1.12
+++ Makefile.am 13 Oct 2003 18:24:47 -0000 1.13
@@ -1,11 +1,11 @@
-INCLUDES = -I../src [EMAIL PROTECTED]@ [EMAIL PROTECTED]@
-LIBS = ../src/libapreq.la @APR_LIBS@ @APU_LIBS@
+INCLUDES = -I../src @APR_INCLUDES @APU_INCLUDES@
+LIBS = ../src/[EMAIL PROTECTED]@.la @APR_LTLIBS@ @APU_LTLIBS@
-noinst_LIBRARIES = libapreq_tests.a
-libapreq_tests_a_SOURCES = CuTest.c env.c cookie.c params.c parsers.c
+noinst_LIBRARIES = [EMAIL PROTECTED]@_tests.a
[EMAIL PROTECTED]@_tests_a_SOURCES = CuTest.c env.c cookie.c params.c
parsers.c
check_PROGRAMS = testall
-testall_LDADD = libapreq_tests.a
+testall_LDADD = [EMAIL PROTECTED]@_tests.a
test: check
./testall -v