You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-cvs@httpd.apache.org by je...@apache.org on 2002/01/17 02:06:27 UTC

cvs commit: httpd-test/flood/build .cvsignore config_vars.mk.in find_apr.m4 find_apu.m4 rules.mk.in

jerenkrantz    02/01/16 17:06:27

  Modified:    flood    Makefile.in buildconf configure.in
  Added:       flood/build .cvsignore config_vars.mk.in find_apr.m4
                        find_apu.m4 rules.mk.in
  Log:
  New build system that allows complete separation from httpd-2.0 tree.
  
  Use the find_apr.m4 and find_apu.m4 macros to find and link against
  APR/apr-util.
  
  This provides --with-apr= and --with-apr-util= to use an installed
  version.  Or, if you place apr and apr-util under the flood tree,
  configure will use/build them automatically.  (This is SVN's method
  and I rather like it for distribution.)
  
  The compilation system (spec. rules.mk.in) is from httpd-2.0.
  
  There may be some kinks, but it builds here, so let's checkpoint.
  
  Revision  Changes    Path
  1.11      +13 -19    httpd-test/flood/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/httpd-test/flood/Makefile.in,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Makefile.in	3 Dec 2001 21:58:43 -0000	1.10
  +++ Makefile.in	17 Jan 2002 01:06:26 -0000	1.11
  @@ -1,39 +1,33 @@
  -top_srcdir   = @HTTPD_SOURCE@
  -top_builddir = @HTTPD_SOURCE@
  -srcdir       = $(shell pwd)
  +# Flood Makefile
  +top_srcdir   = @top_srcdir@
  +top_builddir = @top_builddir@
  +srcdir       = @srcdir@
   builddir     = $(shell pwd)
  -VPATH        = $(shell pwd)
  +VPATH        = @srcdir@
   
  -# no targets: we don't want to build anything by default. if you want the
  -# test programs, then "make test"
  -targets =
  +targets = flood
   
   PROGRAMS = flood
  +CLEAN_TARGETS = $(PROGRAMS)
   
  -PROGRAM_LDADD        = $(EXTRA_LDFLAGS) $(PROGRAM_DEPENDENCIES) $(EXTRA_LIBS)
  -PROGRAM_DEPENDENCIES = @APU_SOURCE@/libaprutil.la \
  -	@APR_SOURCE@/libapr.la
  +SUBDIRS = @FLOOD_SUBDIRS@
   
   include $(top_srcdir)/build/rules.mk
   
  -APR_OSDIR=@APR_SOURCE@/include/arch/unix
  -EXTRA_LDFLAGS=@EXTRA_LDFLAGS@
  -EXTRA_CPPFLAGS=@EXTRA_CPPFLAGS@ -I${APR_OSDIR}
  -EXTRA_CFLAGS=@EXTRA_CFLAGS@
  -EXTRA_LIBS=@EXTRA_LIBS@ @LIBS@
  +INCLUDES=-I$(srcdir)
   
  -all: $(PROGRAMS)
  +all: $(SUBDIRS) $(PROGRAMS)
   FLOOD_OBJS = flood_round_robin.lo flood_profile.lo flood_config.lo \
   	flood_net.lo flood_net_ssl.lo \
   	flood_farmer.lo flood_simple_reports.lo flood_easy_reports.lo \
   	flood_farm.lo \
  -        flood_socket_generic.lo flood_socket_keepalive.lo \
  +	flood_socket_generic.lo flood_socket_keepalive.lo \
   	flood_report_relative_times.lo
   
   flood_OBJECTS = flood.lo $(FLOOD_OBJS)
   flood: $(flood_OBJECTS) $(PROGRAM_DEPENDENCIES)
  -	$(LINK) $(flood_OBJECTS) $(PROGRAM_LDADD)
  +	$(LINK) $(flood_OBJECTS) $(LIBS)
   
  -# Feel free to add real dependencies. httpd-2.0/build/rules.mk includes $(builddir)/.deps
  +# Feel free to add real dependencies. build/rules.mk includes $(builddir)/.deps
   $(builddir)/.deps:
   	@touch $@
  
  
  
  1.2       +12 -0     httpd-test/flood/buildconf
  
  Index: buildconf
  ===================================================================
  RCS file: /home/cvs/httpd-test/flood/buildconf,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- buildconf	18 Jul 2001 03:42:53 -0000	1.1
  +++ buildconf	17 Jan 2002 01:06:26 -0000	1.2
  @@ -1,2 +1,14 @@
   #!/bin/sh
   autoconf
  +
  +if [ -d ./apr ] ; then
  +  cd apr
  +  buildconf
  +  cd ..
  +fi
  +
  +if [ -d ./apr-util ] ; then
  +  cd apr-util
  +  buildconf
  +  cd ..
  +fi
  
  
  
  1.17      +89 -34    httpd-test/flood/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/httpd-test/flood/configure.in,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- configure.in	4 Dec 2001 10:08:30 -0000	1.16
  +++ configure.in	17 Jan 2002 01:06:26 -0000	1.17
  @@ -4,6 +4,16 @@
   dnl Override the default prefix with /pkg/flood-0.1
   AC_PREFIX_DEFAULT(/pkg/flood-0.1)
   
  +dnl m4 Macros for finding APR and APR-util
  +sinclude(build/find_apr.m4)
  +sinclude(build/find_apu.m4)
  +
  +dnl We need to know our top directory.
  +top_builddir=`pwd`
  +
  +dnl Initially, we need no subdirs
  +FLOOD_SUBDIRS=""   
  +
   dnl Checks for programs.
   AC_PROG_CC
   AC_PROG_CPP
  @@ -30,7 +40,8 @@
     dnl Prefix these to the list, so they override env var settings
     CPPFLAGS="-I${fl_openssl_prefix}/include $CPPFLAGS"
     dnl We may need to also include $fl_openssl_prefix/openssl
  -  LDFLAGS="-L${fl_openssl_prefix}/lib $LDFLAGS -R${fl_openssl_prefix}/lib"
  +  LDFLAGS="-L${fl_openssl_prefix}/lib $LDFLAGS"
  +  LIBTOOL_LDFLAGS="-R${fl_openssl_prefix}/lib"
   fi])
   
   dnl If the OS provides random support, use it.  Otherwise, we'll be 
  @@ -82,24 +93,65 @@
       ])
   fi
   
  -dnl Need for now.  Remove later.
  -AC_ARG_WITH(httpd,
  -  [  --with-httpd=PATH       Prefix to httpd-2.0 (default /home/jerenkrantz/cvs-apache/httpd-2.0)],
  -  [if test "$withval" = "yes"; then AC_MSG_ERROR('option --with-httpd requires a path'); else HTTPD_SOURCE="$withval"; fi],
  -  [HTTPD_SOURCE="/home/jerenkrantz/cvs-apache/httpd-2.0"])
  -
  -AC_ARG_WITH(apr,
  -  [  --with-apr=PATH         Prefix to apr (default ${HTTPD_SOURCE}/srclib/apr)],
  -  [if test "$withval" = "yes"; then AC_MSG_ERROR('option --with-apr requires a path'); else APR_SOURCE="$withval"; fi],
  -  [APR_SOURCE="$HTTPD_SOURCE/srclib/apr"])
  -
  -AC_ARG_WITH(apr,
  -  [  --with-apr-util=PATH    Prefix to apr-util (default ${HTTPD_SOURCE}/srclib/apr-util)],
  -  [if test "$withval" = "yes"; then AC_MSG_ERROR('option --with-apr-util requires a path'); else APU_SOURCE="$withval"; fi],
  -  [APU_SOURCE="$HTTPD_SOURCE/srclib/apr-util"])
  +APR_FIND_APR(./apr)
  +
  +if test "$apr_found" = "no"; then
  +  AC_MSG_ERROR([APR not found.  Please read the documentation.])
  +fi
  +
  +if test "$apr_found" = "reconfig"; then
  +  dnl Comment out for now!
  +  dnl AC_NO_NO_NO_CONFIG_SUBDIRS([apr])
  +  FLOOD_SUBDIRS="$FLOOD_SUBDIRS apr"   
  +fi
  +
  +CFLAGS="$CFLAGS `$apr_config --cflags`"
  +
  +if test -n "$apr_includes"; then
  + CPPFLAGS="$CPPFLAGS $apr_includes"
  +fi
  +CPPFLAGS="$CPPFLAGS `$apr_config --cppflags`"
  +
  +if test -n "$apr_libdir"; then
  +  LDFLAGS="$LDFLAGS -L$apr_libdir"
  +  LIBTOOL_LDFLAGS="$LIBTOOL_LDFLAGS -R$apr_libdir"
  +fi
  +LDFLAGS="$LDFLAGS `$apr_config --ldflags`"
  +
  +if test -n "$apr_la_file"; then
  +  LIBTOOL_LIBS="$LIBTOOL_LIBS $apr_la_file"
  +else
  +  LIBS="$LIBS -lapr"
  +fi
  +LIBS="$LIBS `$apr_config --libs`"
  +
  +if test -n "$apr_libtool"; then
  +  LIBTOOL_PATH="$apr_libtool"
  +else
  +  AC_ERROR([flood requires a libtool-enabled APR.])
  +fi
  +
  +dnl Hack until find_apu.m4 is added
  +APR_FIND_APU(./apr-util)
  +
  +if test "$apu_found" = "no"; then
  +  AC_MSG_ERROR([APR-util not found.  Please read the documentation.])
  +fi
  +if test "$apu_found" = "reconfig"; then
  +  dnl Comment out for now!
  +  dnl AC_NO_NO_NO_CONFIG_SUBDIRS([apr-util])
  +  FLOOD_SUBDIRS="$FLOOD_SUBDIRS apr-util"
  +fi
  +
  +if test -n "$apu_la_file"; then
  +  LIBTOOL_LIBS="$LIBTOOL_LIBS $apu_la_file"
  +else
  +  LIBS="$LIBS -laprutil"
  +fi
   
  -. $APR_SOURCE/APRVARS
  -. $APU_SOURCE/export_vars.sh
  +dnl FIXME: Hack until the split occurs in apr-util to put expat somewhere
  +dnl else!
  +LIBTOOL_LIBS="$LIBTOOL_LIBS `$apu_config --libs`"
   
   AC_CHECK_FUNC(strtoll, hasstrtoll="1", hasstrtoll="0")
   AC_CHECK_FUNC(strtoq, hasstrtoq="1", hasstrtoq="0")
  @@ -112,34 +164,28 @@
   prngrand="0"
   prngrand48="0"
   prngrandom="0"
  -if test $hasrandom = "1"; then
  +if test "$hasrandom" = "1"; then
       prngrandom="1"
       AC_MSG_RESULT([random])
  -else if $hasrand48 = "1"; then
  +else if test "$hasrand48" = "1"; then
       prngrand48="1"
       AC_MSG_RESULT([rand48])
  -else if $hasrand = "1"; then
  +else if test "$hasrand" = "1"; then
       prngrand="1"
       AC_MSG_RESULT([rand])
  +else
  +    AC_ERROR([No suitable PRNG detected])
   fi
   fi
   fi
   
  -EXTRA_CFLAGS="$CFLAGS $EXTRA_CFLAGS"
  -EXTRA_CPPFLAGS="$CPPFLAGS $EXTRA_CPPFLAGS"
  -EXTRA_LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
  -EXTRA_LIBS="$LIBS $EXTRA_LIBS $APRUTIL_EXPORT_LIBS"
  -
   AC_SUBST(OPENSSL_PREFIX)
   AC_SUBST(RANDFILE)
   AC_SUBST(CAPATH)
  -AC_SUBST(HTTPD_SOURCE)
  -AC_SUBST(APR_SOURCE)
  -AC_SUBST(APU_SOURCE)
  -AC_SUBST(EXTRA_CFLAGS)
  -AC_SUBST(EXTRA_CPPFLAGS)
  -AC_SUBST(EXTRA_LDFLAGS)
  -AC_SUBST(EXTRA_LIBS)
  +AC_SUBST(FLOOD_SUBDIRS)
  +AC_SUBST(LIBTOOL_PATH)
  +AC_SUBST(LIBTOOL_LDFLAGS)
  +AC_SUBST(LIBTOOL_LIBS)
   AC_SUBST(prngrand)
   AC_SUBST(prngrand48)
   AC_SUBST(prngrandom)
  @@ -147,7 +193,16 @@
   AC_SUBST(hasstrtoq)
   AC_SUBST(flood_has_openssl)
   AC_SUBST(flood_has_devrand)
  +AC_SUBST(top_builddir)
  +
  +dnl Required for source compatibility with build/rules.mk of httpd-2.0
  +LTFLAGS="--silent"
  +LTCFLAGS=""
  +SHLTCFLAGS=""
  +AC_SUBST(LTFLAGS)
  +AC_SUBST(LTCFLAGS)
  +AC_SUBST(SHLTCFLAGS)
   
   dnl Makefile outputs
   dnl Note: There can only be one AC_OUTPUT command.
  -AC_OUTPUT(Makefile config.h)
  +AC_OUTPUT(Makefile config.h build/rules.mk build/config_vars.mk)
  
  
  
  1.1                  httpd-test/flood/build/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  config_vars.mk
  rules.mk
  
  
  
  1.1                  httpd-test/flood/build/config_vars.mk.in
  
  Index: config_vars.mk.in
  ===================================================================
  CC=@CC@
  
  CPPFLAGS=@CPPFLAGS@
  CFLAGS=@CFLAGS@
  LDFLAGS=@LDFLAGS@ @LIBTOOL_LDFLAGS@
  LIBS=@LIBS@ @LIBTOOL_LIBS@
  LIBTOOL=@LIBTOOL_PATH@
  
  LTFLAGS=@LTFLAGS@
  
  
  
  1.1                  httpd-test/flood/build/find_apr.m4
  
  Index: find_apr.m4
  ===================================================================
  dnl
  dnl find_apr.m4 : locate the APR include files and libraries
  dnl
  dnl This macro file can be used by applications to find and use the APR
  dnl library. It provides a standardized mechanism for using APR. It supports
  dnl embedding APR into the application source, or locating an installed
  dnl copy of APR.
  dnl
  dnl APR_FIND_APR([srcdir])
  dnl
  dnl   where srcdir is the location of the bundled APR source directory, or
  dnl   empty if source is not bundled.
  dnl
  dnl
  dnl Sets the following variables on exit:
  dnl
  dnl   apr_libdir : A custom directory to use for linking (the -L switch).
  dnl                If APR exists in a standard location, this variable
  dnl                will be empty
  dnl
  dnl   apr_la_file : If a libtool .la file exists, this will refer to it. If
  dnl                 there is no .la file, then this variable will be empty.
  dnl
  dnl   apr_includes : Where the APR includes are located, if a non-standard
  dnl                  location. This variable has the format "-Idir -Idir".
  dnl                  It may specify more than one directory.
  dnl
  dnl   apr_libtool : If APR used libtool, this is the path to libtool.
  dnl
  dnl   apr_srcdir : If an APR source tree is available and needs to be
  dnl                (re)configured, this refers to it.
  dnl
  dnl   apr_config : If the apr-config tool exists, this refers to it.
  dnl
  dnl   apr_vars : If the APR config file (APRVARS) exists, this refers to it.
  dnl
  dnl   apr_found : "yes", "no", "reconfig"
  dnl
  dnl Note: At this time, we cannot find *both* a source dir and a build dir.
  dnl       If both are available, the build directory should be passed to
  dnl       the --with-apr switch (apr_srcdir will be empty).
  dnl
  dnl Note: the installation layout is presumed to follow the standard
  dnl       PREFIX/lib and PREFIX/include pattern. If the APR config file
  dnl       is available (and can be found), then non-standard layouts are
  dnl       possible, since it will be described in the config file.
  dnl
  dnl If apr_found is "yes" or "reconfig", then the caller should link using
  dnl apr_la_file, if available; otherwise, -lapr should be used (and if
  dnl apr_libdir is not null, then -L$apr_libdir). If apr_includes is not null,
  dnl then it should be used during compilation.
  dnl
  dnl If a source directory is available and needs to be (re)configured, then
  dnl apr_srcdir specifies the directory and apr_found is "reconfig".
  dnl
  
  AC_DEFUN(APR_FIND_APR, [
    apr_found="no"
  
    preserve_LIBS="$LIBS"
    preserve_LDFLAGS="$LDFLAGS"
    preserve_CFLAGS="$CFLAGS"
  
    AC_MSG_CHECKING(for APR)
    AC_ARG_WITH(apr,
    [  --with-apr=DIR          prefix for installed APR, or path to APR build tree],
    [
      if test "$withval" = "no" || test "$withval" = "yes"; then
        AC_MSG_ERROR([--with-apr requires a directory to be provided])
      fi
  
      if test -x "$withval/bin/apr-config"; then
         apr_config="$withval/bin/apr-config"
         CFLAGS="$CFLAGS `$withval/bin/apr-config --cflags`"
         LIBS="$LIBS `$withval/bin/apr-config --libs`"
         LDFLAGS="$LDFLAGS `$withval/bin/apr-config --ldflags`"
      else
         apr_config=""
      fi
  
      LIBS="$LIBS -lapr"
      LDFLAGS="$preserve_LDFLAGS -L$withval/lib"
      AC_TRY_LINK_FUNC(apr_initialize, [
        if test -f "$withval/include/apr.h"; then
          dnl found an installed version of APR
          apr_found="yes"
          apr_libdir="$withval/lib"
          apr_includes="-I$withval/include"
          if test -x "$withval/build/libtool"; then
            apr_libtool="$withval/build/libtool"
          fi
        fi
      ], [
        dnl look for a build tree (note: already configured/built)
        if test -f "$withval/libapr.la"; then
          apr_found="yes"
          apr_libdir=""
          apr_la_file="$withval/libapr.la"
          apr_vars="$withval/APRVARS"
          if test -x $withval/apr-config; then
            apr_config="$withval/apr-config"
          else
            apr_config=""
          fi
          apr_includes="-I$withval/include"
          if test -x "$withval/libtool"; then
            apr_libtool="$withval/libtool"
          fi
          if test ! -f "$withval/APRVARS.in"; then
            dnl extract the APR source directory without polluting our
            dnl shell variable space
            apr_srcdir="`sed -n '/APR_SOURCE_DIR/s/.*"\(.*\)"/\1/p' $apr_vars`"
            apr_includes="$apr_includes -I$apr_srcdir/include"
          fi
        fi
      ])
  
      dnl if --with-apr is used, then the target prefix/directory must be valid
      if test "$apr_found" != "yes"; then
        AC_MSG_ERROR([
  The directory given to --with-apr does not specify a prefix for an installed
  APR, nor an APR build directory.])
      fi
    ],[
      dnl always look in the builtin/default places
      LIBS="$LIBS -lapr"
      AC_TRY_LINK_FUNC(apr_initialize, [
          dnl We don't have to do anything.
          apr_found="yes"
          apr_srcdir=""
          apr_libdir=""
          apr_includes=""
          apr_libtool=""
          apr_la_file=""
          apr_config=""
          apr_vars=""
        ], [
        dnl look in the some standard places (apparently not in builtin/default)
        for lookdir in /usr /usr/local /opt/apr ; do
          if test "$apr_found" != "yes"; then
            LDFLAGS="$preserve_LDFLAGS -L$lookdir/lib"
            AC_TRY_LINK_FUNC(apr_initialize, [
              apr_found="yes"
              apr_libdir="$lookdir/lib" 
              apr_includes="-I$lookdir/include"
              if test -x "$withval/bin/apr-config"; then
                apr_config="$withval/bin/apr-config"
              else
                apr_config=""
              fi
              if test -x "$withval/build/libtool"; then
                apr_libtool="$withval/build/libtool"
              else
                apr_libtool=""
              fi
            ])
          fi
        done
      ])
      dnl We attempt to guess what the data will be *after* configure is run.
      dnl Note, if we don't see configure, but do have configure.in, it'd be
      dnl nice to run buildconf, but that's for another day.
      if test "$apr_found" = "no" && test -n "$1" && test -x "$1/configure"; then
        apr_found="reconfig"
        apr_srcdir="$1"
        apr_libdir=""
        apr_la_file="$apr_srcdir/libapr.la"
        apr_vars="$apr_srcdir/APRVARS"
        if test -f "$apr_srcdir/apr-config.in"; then
          apr_config="$apr_srcdir/apr-config"
        else
          apr_config=""
        fi
        apr_includes="-I$apr_srcdir/include"
        apr_libtool="$apr_srcdir/libtool"
      fi
    ])
  
    if test "$apr_found" != "no" && test "$apr_libdir" != ""; then
      if test "$apr_vars" = "" && test -f "$apr_libdir/APRVARS"; then
        apr_vars="$apr_libdir/APRVARS"
      fi
      if test "$apr_la_file" = "" && test -f "$apr_libdir/libapr.la"; then
        apr_la_file="$apr_libdir/libapr.la"
      fi
    fi
  
    AC_MSG_RESULT($apr_found)
    CFLAGS="$preserve_CFLAGS"
    LIBS="$preserve_LIBS"
    LDFLAGS="$preserve_LDFLAGS"
  ])
  
  
  
  1.1                  httpd-test/flood/build/find_apu.m4
  
  Index: find_apu.m4
  ===================================================================
  dnl
  dnl find_apu.m4 : locate the APR-util (APU) include files and libraries
  dnl
  dnl This macro file can be used by applications to find and use the APU
  dnl library. It provides a standardized mechanism for using APU. It supports
  dnl embedding APU into the application source, or locating an installed
  dnl copy of APU.
  dnl
  dnl APR_FIND_APU([srcdir])
  dnl
  dnl   where srcdir is the location of the bundled APU source directory, or
  dnl   empty if source is not bundled.
  dnl
  dnl
  dnl Sets the following variables on exit:
  dnl
  dnl   apu_libdir : A custom directory to use for linking (the -L switch).
  dnl                If APU exists in a standard location, this variable
  dnl                will be empty
  dnl
  dnl   apu_la_file : If a libtool .la file exists, this will refer to it. If
  dnl                 there is no .la file, then this variable will be empty.
  dnl
  dnl   apu_includes : Where the APU includes are located, if a non-standard
  dnl                  location. This variable has the format "-Idir -Idir".
  dnl                  It may specify more than one directory.
  dnl
  dnl   apu_srcdir : If an APU source tree is available and needs to be
  dnl                (re)configured, this refers to it.
  dnl
  dnl   apu_config : If the apr-config tool exists, this refers to it.
  dnl
  dnl   apu_found : "yes", "no", "reconfig"
  dnl
  dnl Note: At this time, we cannot find *both* a source dir and a build dir.
  dnl       If both are available, the build directory should be passed to
  dnl       the --with-apr switch (apu_srcdir will be empty).
  dnl
  dnl Note: the installation layout is presumed to follow the standard
  dnl       PREFIX/lib and PREFIX/include pattern. If the APU config file
  dnl       is available (and can be found), then non-standard layouts are
  dnl       possible, since it will be described in the config file.
  dnl
  dnl If apu_found is "yes" or "reconfig", then the caller should link using
  dnl apu_la_file, if available; otherwise, -lapr should be used (and if
  dnl apu_libdir is not null, then -L$apr_libdir). If apr_includes is not null,
  dnl then it should be used during compilation.
  dnl
  dnl If a source directory is available and needs to be (re)configured, then
  dnl apu_srcdir specifies the directory and apr_found is "reconfig".
  dnl
  dnl Note: This m4 macro set makes the assumption that APR has already
  dnl       been found and properly configured.
  dnl
  
  AC_DEFUN(APR_FIND_APU, [
    apu_found="no"
  
    preserve_LIBS="$LIBS"
    preserve_LDFLAGS="$LDFLAGS"
    preserve_CFLAGS="$CFLAGS"
  
    dnl We're going to be running our tests with gcc not libtool.  So,
    dnl attempt to setup APR correctly for the interim period.  We just
    dnl need to link not run, so -lapr should be fine if everything else
    dnl has been setup.
    if test -n "$apr_la_file"; then
      LIBS="$LIBS -lapr"  
    fi
  
    AC_MSG_CHECKING(for APR-util)
    AC_ARG_WITH(apr-util,
    [  --with-apr-util=DIR     prefix for installed APU, or path to APU build tree],
    [
      if test "$withval" = "no" || test "$withval" = "yes"; then
        AC_MSG_ERROR([--with-apr-util requires a directory to be provided])
      fi
  
      if test -x "$withval/bin/apu-config"; then
         apu_config="$withval/bin/apu-config"
         dnl FIXME: Convert libexpat.la to -lexpat
         APU_LIBS=`$withval/bin/apu-config --libs`
         TMP_WITHVAL=`echo "$withval/lib/libexpat.la" | sed 's/\\//\\\\\\//g'`
         APU_LIBS=`echo $APU_LIBS | sed "s/$TMP_WITHVAL/-lexpat/g"`
         LIBS="$LIBS $APU_LIBS"
      else
         apu_config=""
      fi
  
      LIBS="$LIBS -laprutil"
      LDFLAGS="$preserve_LDFLAGS -L$withval/lib"
      AC_TRY_LINK_FUNC(apr_uri_parse, [
        if test -f "$withval/include/apu.h"; then
          dnl found an installed version of APU
          apu_found="yes"
          apu_libdir="$withval/lib"
          apu_includes="-I$withval/include"
        fi
      ], [
        dnl look for a build tree (note: already configured/built)
        if test -f "$withval/libaprutil.la"; then
          apu_found="yes"
          apu_libdir=""
          apu_la_file="$withval/libaprutil.la"
          if test -x $withval/apu-config; then
            apu_config="$withval/apu-config"
          else
            apu_config=""
          fi
          apu_includes="-I$withval/include"
        fi
      ])
  
      dnl if --with-apr is used, then the target prefix/directory must be valid
      if test "$apu_found" != "yes"; then
        AC_MSG_ERROR([
  The directory given to --with-apr-util does not specify a prefix for an 
  installed APU, nor an APR-util build directory.])
      fi
    ],[
      dnl always look in the builtin/default places
      LIBS="$LIBS -laprutil"
      AC_TRY_LINK_FUNC(apr_uri_parse, [
          dnl We don't have to do anything.
          apu_found="yes"
          apu_srcdir=""
          apu_libdir=""
          apu_includes=""
          apu_libtool=""
          apu_la_file=""
          apu_config=""
        ], [
        dnl look in the some standard places (apparently not in builtin/default)
        for lookdir in /usr /usr/local /opt/apr ; do
          if test "$apu_found" != "yes"; then
            LDFLAGS="$preserve_LDFLAGS -L$lookdir/lib"
            AC_TRY_LINK_FUNC(apr_uri_parse, [
              apu_found="yes"
              apu_libdir="$lookdir/lib" 
              apu_includes="-I$lookdir/include"
              if test -x "$withval/bin/apu-config"; then
                apu_config="$withval/bin/apu-config"
              else
                apu_config=""
              fi
            ])
          fi
        done
      ])
      dnl We attempt to guess what the data will be *after* configure is run.
      dnl Note, if we don't see configure, but do have configure.in, it'd be
      dnl nice to run buildconf, but that's for another day.
      if test "$apu_found" = "no" && test -n "$1" && test -x "$1/configure"; then
        apu_found="reconfig"
        apu_srcdir="$1"
        apu_libdir=""
        apu_la_file="$apu_srcdir/libaprutil.la"
        if test -f "$apu_srcdir/apu-config.in"; then
          apu_config="$apu_srcdir/apu-config"
        else
          apu_config=""
        fi
        apu_includes="-I$apu_srcdir/include"
      fi
    ])
  
    if test "$apu_found" != "no" && test "$apr_libdir" != ""; then
      if test "$apu_la_file" = "" && test -f "$apr_libdir/libapr.la"; then
        apu_la_file="$apr_libdir/libaprutil.la"
      fi
    fi
  
    AC_MSG_RESULT($apu_found)
    CFLAGS="$preserve_CFLAGS"
    LIBS="$preserve_LIBS"
    LDFLAGS="$preserve_LDFLAGS"
  ])
  
  
  
  1.1                  httpd-test/flood/build/rules.mk.in
  
  Index: rules.mk.in
  ===================================================================
  # ====================================================================
  # The Apache Software License, Version 1.1
  #
  # Copyright (c) 2000-2001 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 apache@apache.org.
  #
  # 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/>.
  #
  # The build environment was originally provided by Sascha Schumann.
  #
  
  include $(top_builddir)/build/config_vars.mk
  
  # Combine all of the flags together in the proper order so that
  # the user-defined flags can always override the configure ones, if needed.
  # Note that includes are listed after the flags because -I options have
  # left-to-right precedence and CPPFLAGS may include user-defined overrides.
  #
  ALL_CFLAGS   = $(EXTRA_CFLAGS) $(NOTEST_CFLAGS) $(CFLAGS)
  ALL_CPPFLAGS = $(DEFS) $(EXTRA_CPPFLAGS) $(NOTEST_CPPFLAGS) $(CPPFLAGS)
  ALL_CXXFLAGS = $(EXTRA_CXXFLAGS) $(NOTEST_CXXFLAGS) $(CXXFLAGS)
  ALL_LDFLAGS  = $(EXTRA_LDFLAGS) $(NOTEST_LDFLAGS) $(LDFLAGS)
  ALL_LIBS     = $(EXTRA_LIBS) $(NOTEST_LIBS) $(LIBS)
  ALL_INCLUDES = $(INCLUDES) $(EXTRA_INCLUDES)
  
  # Compile commands
  
  COMPILE      = $(CC)  $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(ALL_INCLUDES)
  CXX_COMPILE  = $(CXX) $(ALL_CXXFLAGS) $(ALL_CPPFLAGS) $(ALL_INCLUDES)
  
  SH_COMPILE     = $(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) @SHLTCFLAGS@ -c $< && touch $@
  SH_CXX_COMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(CXX_COMPILE) @SHLTCFLAGS@ -c $< && touch $@
  
  LT_COMPILE     = $(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) @LTCFLAGS@ -c $< && touch $@
  LT_CXX_COMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(CXX_COMPILE) @LTCFLAGS@ -c $< && touch $@
  
  # Link-related commands
  
  LINK     = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@
  SH_LINK  = $(SH_LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LT_LDFLAGS) $(ALL_LDFLAGS) $(SH_LDFLAGS) $(CORE_IMPLIB) $(SH_LIBS) -o $@
  MOD_LINK = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -module $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@
  
  # Cross compile commands
  
  # Helper programs
  
  MKINSTALLDIRS = $(abs_srcdir)/build/mkdir.sh
  INSTALL = $(LIBTOOL) --mode=install $(abs_srcdir)/build/install.sh -c
  INSTALL_DATA = $(INSTALL) -m 644
  INSTALL_PROGRAM = $(INSTALL) -m 755 $(INSTALL_PROG_FLAGS)
  
  #
  # Standard build rules
  #
  all: all-recursive
  depend: depend-recursive
  clean: clean-recursive
  distclean: distclean-recursive
  extraclean: extraclean-recursive
  install: install-recursive
  shared-build: shared-build-recursive
  
  all-recursive install-recursive depend-recursive:
  	@otarget=`echo $@|sed s/-recursive//`; \
  	list=' $(BUILD_SUBDIRS) $(SUBDIRS)'; \
  	for i in $$list; do \
  	    if test -d "$$i"; then \
  		target="$$otarget"; \
  		echo "Making $$target in $$i"; \
  		if test "$$i" = "."; then \
  			made_local=yes; \
  			target="local-$$target"; \
  		fi; \
  		(cd $$i && $(MAKE) $$target) || exit 1; \
  	    fi; \
  	done; \
  	if test "$$otarget" = "all" && test -z '$(TARGETS)'; then \
  	    made_local=yes; \
  	fi; \
  	if test "$$made_local" != "yes"; then \
  	    $(MAKE) "local-$$otarget" || exit 1; \
  	fi
  
  clean-recursive distclean-recursive extraclean-recursive:
  	@otarget=`echo $@|sed s/-recursive//`; \
  	list='$(CLEAN_SUBDIRS) $(SUBDIRS)'; \
  	for i in $$list; do \
  	    if test -d "$$i"; then \
  		target="$$otarget"; \
  		echo "Making $$target in $$i"; \
  		if test "$$i" = "."; then \
  			made_local=yes; \
  			target="local-$$target"; \
  		fi; \
  		(cd $$i && $(MAKE) $$target); \
  	    fi; \
  	done; \
  	if test "$$otarget" = "all" && test -z '$(TARGETS)'; then \
  	    made_local=yes; \
  	fi; \
  	if test "$$made_local" != "yes"; then \
  	    $(MAKE) "local-$$otarget"; \
  	fi
  
  shared-build-recursive:
  	@if test `pwd` = "$(top_builddir)"; then \
  	    $(PRE_SHARED_CMDS) ; \
  	fi; \
  	list='$(SUBDIRS)'; for i in $$list; do \
  	    target="shared-build"; \
  	    if test "$$i" = "."; then \
  		made_local=yes; \
  		target="local-shared-build"; \
  	    fi; \
  	    if test "$$i" != "srclib"; then \
  		(cd $$i && $(MAKE) $$target) || exit 1; \
  	    fi; \
  	done; \
  	if test -f 'modules.mk'; then \
  	    if test -n '$(SHARED_TARGETS)'; then \
  		echo "Building shared: $(SHARED_TARGETS)"; \
  		if test "$$made_local" != "yes"; then \
  			$(MAKE) "local-shared-build" || exit 1; \
  		fi; \
  	    fi; \
  	fi; \
  	if test `pwd` = "$(top_builddir)"; then \
  		$(POST_SHARED_CMDS) ; \
  	fi
  
  local-all: $(TARGETS)
  
  local-shared-build: $(SHARED_TARGETS)
  
  local-depend: x-local-depend
  	if test "`echo $(srcdir)/*.c`" != "$(srcdir)'/*.c'"; then \
  		$(CC) -MM $(ALL_CPPFLAGS) $(ALL_INCLUDES) $(srcdir)/*.c | sed 's/\.o:/.lo:/' > $(builddir)/.deps || true;           \
  	fi
  
  local-clean: x-local-clean
  	rm -f *.o *.lo *.slo *.obj *.a *.la $(CLEAN_TARGETS) $(TARGETS)
  	rm -rf .libs
  
  local-distclean: local-clean x-local-distclean
  	rm -f .deps Makefile $(DISTCLEAN_TARGETS)
  
  local-extraclean: local-distclean x-local-extraclean
  	@if test -n "$(EXTRACLEAN_TARGETS)"; then \
  	    echo "rm -f $(EXTRACLEAN_TARGETS)"; \
  	    rm -f $(EXTRACLEAN_TARGETS) ; \
  	fi
  
  local-install: $(TARGETS) $(SHARED_TARGETS) $(INSTALL_TARGETS)
  	@if test -n '$(PROGRAMS)'; then \
  	    test -d $(sbindir) || $(MKINSTALLDIRS) $(sbindir); \
  	    list='$(PROGRAMS)'; for i in $$list; do \
  	        $(INSTALL_PROGRAM) $$i $(sbindir); \
  	    done; \
  	fi
  
  # to be filled in by the actual Makefile if extra commands are needed
  x-local-depend x-local-clean x-local-distclean x-local-extraclean:
  
  #
  # Implicit rules for creating outputs from input files
  #
  CXX_SUFFIX = cpp
  SHLIB_SUFFIX = so
  
  .SUFFIXES:
  .SUFFIXES: .S .c .$(CXX_SUFFIX) .lo .o .s .y .l .slo .def .la
  
  .c.o:
  	$(COMPILE) -c $<
  
  .s.o:
  	$(COMPILE) -c $<
  
  .c.lo:
  	$(LT_COMPILE)
  
  .s.lo:
  	$(LT_COMPILE)
  
  .c.slo:
  	$(SH_COMPILE)
  
  .$(CXX_SUFFIX).lo:
  	$(LT_CXX_COMPILE)
  
  .$(CXX_SUFFIX).slo:
  	$(SH_CXX_COMPILE)
  
  .y.c:
  	$(YACC) $(YFLAGS) $< && mv y.tab.c $*.c
  	if test -f y.tab.h; then \
  	if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
  	else :; fi
  
  .l.c:
  	$(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
  
  # Makes an import library from a def file
  .def.la:
  	$(LIBTOOL) --mode=compile $(MK_IMPLIB) -o $@ $<
  
  #
  # Dependencies
  #
  include $(builddir)/.deps
  
  .PHONY: all all-recursive install-recursive local-all $(PHONY_TARGETS) \
  	shared-build shared-build-recursive local-shared-build \
  	depend depend-recursive local-depend x-local-depend \
  	clean clean-recursive local-clean x-local-clean \
  	distclean distclean-recursive local-distclean x-local-distclean \
  	extraclean extraclean-recursive local-extraclean x-local-extraclean \
  	install local-install $(INSTALL_TARGETS)