[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH]: use locally installed apr

From: David Kimdon <David_Kimdon_at_alumni.hmc.edu>
Date: 2001-10-24 00:53:16 CEST

Hi,

This is a patch to allow svn to build with a locally installed apr, it
is similar to the neon patch I submitted last week. When creating the
diff I assume that the neon patch has been applied.

The patch is big mostly because of the introduction of install-sh,
apr_common.m4 and the removal of install.sh. At a high level this
patch does:

1. move all APR out of autogen.sh and configure.in and into apr.m4
2. remove dependancy on files in the apr source repository, copying
them locally to svn when necessary.
3. install.sh -> install-sh since we needed mkdir capability.

-David

Note: This isn't fully tested. I haven't gotten the server to work on
my system with or without the patch.

        Allow for locally installed Apache Portable Runtime (APR) library
        * Makefile.in : Only build apr/ subdir if necessary.
        * ac-helpers/apr.m4 : New file. Handle all APR options, configuration
        and variable assignments.
        * ac-helpers/apr_common.m4 : New file. It is needed since the apr/
        subdir is no longer required.
        * ac-helpers/install-sh : New File. Install script to replace
        ac-helpers/install.sh, this replacement can create directories.
        * ac-helpers/install.sh : Remove this file in favor of
        ac-helpers/install-sh.
        * autogen.sh : We use install-sh in place of install.sh. Remove APR
        checks/configuration that is now in ac-helpers/apr.m4. Don't use
        APR's PrintPath, instead use 'which' and 'head'.
        * buildcheck.sh : don't use APR's PrintPath, instead use 'which'
        and 'head'.
        * configure.in : Don't use apr's mkdir.sh, instead use
        ac-helpers/install-sh. apr_common.m4 is now in ac-helpers/. Include
        ac-helpers/apr.m4 for all apr checks, option processing and
        configuration.

diff -urN subversion-svn-282/Makefile.in subversion-svn-282.new/Makefile.in
--- subversion-svn-282/Makefile.in Mon Oct 22 22:58:41 2001
+++ subversion-svn-282.new/Makefile.in Mon Oct 22 22:58:31 2001
@@ -10,7 +10,7 @@
 
 DOC_DIRS = doc/programmer/design doc/user/manual doc/user/svn_for_cvs_users
 
-EXTERNAL_PROJECT_DIRS = @NEON_SUBDIR@ apr @DB_SUBDIR@
+EXTERNAL_PROJECT_DIRS = @NEON_SUBDIR@ @APR_SUBDIR@ @DB_SUBDIR@
 
 LIBNEON_LA = @LIBNEON_LA@
 
diff -urN subversion-svn-282/ac-helpers/apr.m4 subversion-svn-282.new/ac-helpers/apr.m4
--- subversion-svn-282/ac-helpers/apr.m4 Wed Dec 31 16:00:00 1969
+++ subversion-svn-282.new/ac-helpers/apr.m4 Mon Oct 22 22:58:31 2001
@@ -0,0 +1,120 @@
+dnl SVN_LIB_APR(version)
+dnl
+dnl Check configure options and assign variables related to
+dnl the Apache Portable Runtime (APR) library.
+dnl
+dnl If there is a apr/ subdir we assme we want to use it. In that
+dnl case an option telling us to use a locally installed apr
+dnl triggers an error.
+dnl
+dnl TODO : check apr version, link a test program
+dnl Do we want to automatically find libapr so the --with
+dnl options aren't required for a locally installed library?
+
+
+AC_DEFUN(SVN_LIB_APR,
+[
+
+ AC_MSG_NOTICE([Apache Portable Runtime (APR) library configuration])
+
+ AC_ARG_WITH(apr-libs,
+ [AC_HELP_STRING([--with-apr-libs=PREFIX],
+ [Use Apache Portable Runtime (APR) library at PREFIX])],
+ [
+ if test "$withval" = "yes" ; then
+ AC_MSG_ERROR([--with-apr-libs requires an argument.])
+ else
+ APRVARS=$withval/APRVARS
+ APR_LIBS=$withval
+ fi
+
+ if test -d $abs_srcdir/apr ; then
+ AC_MSG_ERROR([--with-apr-libs option but apr/ subdir exists.
+Please either remove that subdir or don't use the --with-apr-libs option.])
+ fi
+ ],
+ [
+ if test -d $abs_srcdir/apr ; then
+ APR_LIBS='$(abs_builddir)/apr'
+ APRVARS="$abs_builddir/apr/APRVARS"
+ else
+ SVN_GET_APR
+ fi
+ ])
+
+ AC_ARG_WITH(apr-includes,
+ [AC_HELP_STRING([--with-apr-includes=PREFIX],
+ [Use Apache Portable Runtime (APR) includes at PREFIX])],
+ [
+ if test "$withval" = "yes" ; then
+ AC_MSG_ERROR([--with-apr-includes requires an argument.])
+ else
+ APR_INCLUDES=$withval
+ fi
+
+ if test -d $abs_srcdir/apr ; then
+ AC_MSG_ERROR([--with-apr-includes option but apr/ subdir exists.
+Please either remove that subdir or don't use the --with-apr-includes option.])
+ fi
+ ],
+ [
+ if test -d $abs_srcdir/apr ; then
+ APR_INCLUDES='$(top_srcdir)/apr/include'
+ else
+ SVN_GET_APR
+ fi
+ ])
+
+ if test -d $abs_srcdir/apr ; then
+ echo "Creating config files for APR..."
+ (cd apr; ./buildconf) # this is apr's equivalent of autogen.sh
+ APR_SUBDIR_CONFIG(apr)
+ APR_SUBDIR=apr
+ AC_SUBST(APR_SUBDIR)
+ fi
+
+ dnl Get libraries and thread flags from APR ---------------------
+
+ if test -f "$APRVARS"; then
+ . "$APRVARS"
+ CPPFLAGS="$CPPFLAGS $EXTRA_CPPFLAGS"
+ CFLAGS="$CFLAGS $EXTRA_CFLAGS"
+ LIBS="$LIBS $EXTRA_LIBS"
+ else
+ AC_MSG_ERROR([$APRVARS not found.])
+ fi
+
+ dnl APR
+ SVN_APR_INCLUDES="-I$APR_INCLUDES"
+ if test "$abs_srcdir" != "$abs_builddir"; then
+ SVN_APR_INCLUDES="-I$APR_INCLUDES $SVN_APR_INCLUDES"
+ fi
+ AC_SUBST(SVN_APR_INCLUDES)
+ SVN_APR_LIBS="$APR_LIBS/libapr.la $LIBTOOL_LIBS"
+ AC_SUBST(SVN_APR_LIBS)
+
+])
+
+
+dnl SVN_GET_APR()
+dnl no apr found, print out a message telling
+dnl the user what to do
+AC_DEFUN(SVN_GET_APR,
+[
+ echo "No Apache Portable Runtime (APR) library can be found."
+ echo "Either install APR on this system and supply appropriate"
+ echo "--with-apr-libs and --with-apr-includes options"
+ echo ""
+ echo "or"
+ echo ""
+ echo "get it with CVS and put it in a subdirectory of this source:"
+ echo ""
+ echo " cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic login"
+ echo " (password 'anoncvs')"
+ echo ""
+ echo " cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic co apr"
+ echo ""
+ echo "Run that right here in the top-level of the Subversion tree."
+ echo ""
+ AC_MSG_ERROR([no suitable apr found])
+])
diff -urN subversion-svn-282/ac-helpers/apr_common.m4 subversion-svn-282.new/ac-helpers/apr_common.m4
--- subversion-svn-282/ac-helpers/apr_common.m4 Wed Dec 31 16:00:00 1969
+++ subversion-svn-282.new/ac-helpers/apr_common.m4 Mon Oct 22 22:58:31 2001
@@ -0,0 +1,523 @@
+dnl -----------------------------------------------------------------
+dnl apr_common.m4: APR's general-purpose autoconf macros
+dnl
+
+dnl APR_CONFIG_NICE(filename)
+dnl
+dnl Saves a snapshot of the configure command-line for later reuse
+dnl
+AC_DEFUN(APR_CONFIG_NICE,[
+ rm -f $1
+ cat >$1<<EOF
+#! /bin/sh
+#
+# Created by configure
+
+EOF
+ if test -n "$CFLAGS"; then
+ echo "CFLAGS=\"$CFLAGS\"; export CFLAGS" >> $1
+ fi
+ if test -n "$CPPFLAGS"; then
+ echo "CPPFLAGS=\"$CPPFLAGS\"; export CPPFLAGS" >> $1
+ fi
+ if test -n "$LDFLAGS"; then
+ echo "LDFLAGS=\"$LDFLAGS\"; export LDFLAGS" >> $1
+ fi
+ if test -n "$LIBS"; then
+ echo "LIBS=\"$LIBS\"; export LIBS" >> $1
+ fi
+ if test -n "$INCLUDES"; then
+ echo "INCLUDES=\"$INCLUDES\"; export INCLUDES" >> $1
+ fi
+ if test -n "$NOTEST_CFLAGS"; then
+ echo "NOTEST_CFLAGS=\"$NOTEST_CFLAGS\"; export NOTEST_CFLAGS" >> $1
+ fi
+ if test -n "$NOTEST_CPPFLAGS"; then
+ echo "NOTEST_CPPFLAGS=\"$NOTEST_CPPFLAGS\"; export NOTEST_CPPFLAGS" >> $1
+ fi
+ if test -n "$NOTEST_LDFLAGS"; then
+ echo "NOTEST_LDFLAGS=\"$NOTEST_LDFLAGS\"; export NOTEST_LDFLAGS" >> $1
+ fi
+ if test -n "$NOTEST_LIBS"; then
+ echo "NOTEST_LIBS=\"$NOTEST_LIBS\"; export NOTEST_LIBS" >> $1
+ fi
+
+ for arg in [$]0 "[$]@"; do
+ echo "\"[$]arg\" \\" >> $1
+ done
+ echo '"[$]@"' >> $1
+ chmod +x $1
+])dnl
+
+dnl
+dnl APR_SUBDIR_CONFIG(dir [, sub-package-cmdline-args])
+dnl
+AC_DEFUN(APR_SUBDIR_CONFIG, [
+ # save our work to this point; this allows the sub-package to use it
+ AC_CACHE_SAVE
+
+ echo "configuring package in $1 now"
+ ac_popdir=`pwd`
+ ac_abs_srcdir=`(cd $srcdir/$1 && pwd)`
+ apr_config_subdirs="$1"
+ test -d $1 || $MKDIR $1
+ cd $1
+
+changequote(, )dnl
+ # A "../" for each directory in /$config_subdirs.
+ ac_dots=`echo $apr_config_subdirs|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
+changequote([, ])dnl
+
+ # Make the cache file name correct relative to the subdirectory.
+ case "$cache_file" in
+ /*) ac_sub_cache_file=$cache_file ;;
+ *) # Relative path.
+ ac_sub_cache_file="$ac_dots$cache_file" ;;
+ esac
+
+ # The eval makes quoting arguments work.
+ if eval $ac_abs_srcdir/configure $ac_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_abs_srcdir $2
+ then :
+ echo "$1 configured properly"
+ else
+ echo "configure failed for $1"
+ exit 1
+ fi
+
+ cd $ac_popdir
+
+ # grab any updates from the sub-package
+ AC_CACHE_LOAD
+])dnl
+
+dnl
+dnl APR_SAVE_THE_ENVIRONMENT(variable_name)
+dnl
+dnl Stores the variable (usually a Makefile macro) for later restoration
+dnl
+AC_DEFUN(APR_SAVE_THE_ENVIRONMENT,[
+ apr_ste_save_$1="$$1"
+])dnl
+
+dnl
+dnl APR_RESTORE_THE_ENVIRONMENT(variable_name, prefix_)
+dnl
+dnl Uses the previously saved variable content to figure out what configure
+dnl has added to the variable, moving the new bits to prefix_variable_name
+dnl and restoring the original variable contents. This makes it possible
+dnl for a user to override configure when it does something stupid.
+dnl
+AC_DEFUN(APR_RESTORE_THE_ENVIRONMENT,[
+if test "x$apr_ste_save_$1" = "x"; then
+ $2$1="$$1"
+ $1=
+else
+ if test "x$apr_ste_save_$1" = "x$$1"; then
+ $2$1=
+ else
+ $2$1=`echo $$1 | sed -e "s%${apr_ste_save_$1}%%"`
+ $1="$apr_ste_save_$1"
+ fi
+fi
+echo " restoring $1 to \"$$1\""
+echo " setting $2$1 to \"$$2$1\""
+AC_SUBST($2$1)
+])dnl
+
+dnl
+dnl APR_SETIFNULL(variable, value)
+dnl
+dnl Set variable iff it's currently null
+dnl
+AC_DEFUN(APR_SETIFNULL,[
+ if test -z "$$1"; then
+ echo " setting $1 to \"$2\""
+ $1="$2"
+ fi
+])dnl
+
+dnl
+dnl APR_SETVAR(variable, value)
+dnl
+dnl Set variable no matter what
+dnl
+AC_DEFUN(APR_SETVAR,[
+ echo " forcing $1 to \"$2\""
+ $1="$2"
+])dnl
+
+dnl
+dnl APR_ADDTO(variable, value)
+dnl
+dnl Add value to variable
+dnl
+AC_DEFUN(APR_ADDTO,[
+ if test "x$$1" = "x"; then
+ echo " setting $1 to \"$2\""
+ $1="$2"
+ else
+ apr_addto_bugger="$2"
+ for i in $apr_addto_bugger; do
+ apr_addto_duplicate="0"
+ for j in $$1; do
+ if test "x$i" = "x$j"; then
+ apr_addto_duplicate="1"
+ break
+ fi
+ done
+ if test $apr_addto_duplicate = "0"; then
+ echo " adding \"$i\" to $1"
+ $1="$$1 $i"
+ fi
+ done
+ fi
+])dnl
+
+dnl
+dnl APR_REMOVEFROM(variable, value)
+dnl
+dnl Remove a value from a variable
+dnl
+AC_DEFUN(APR_REMOVEFROM,[
+ if test "x$$1" = "x$2"; then
+ echo " nulling $1"
+ $1=""
+ else
+ apr_new_bugger=""
+ apr_removed=0
+ for i in $$1; do
+ if test "x$i" != "x$2"; then
+ apr_new_bugger="$apr_new_bugger $i"
+ else
+ apr_removed=1
+ fi
+ done
+ if test $apr_removed = "1"; then
+ echo " removed \"$2\" from $1"
+ $1=$apr_new_bugger
+ fi
+ fi
+]) dnl
+
+dnl
+dnl APR_CHECK_DEFINE_FILES( symbol, header_file [header_file ...] )
+dnl
+AC_DEFUN(APR_CHECK_DEFINE_FILES,[
+ AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[
+ ac_cv_define_$1=no
+ for curhdr in $2
+ do
+ AC_EGREP_CPP(YES_IS_DEFINED, [
+ #include <$curhdr>
+ #ifdef $1
+ YES_IS_DEFINED
+ #endif
+ ], ac_cv_define_$1=yes)
+ done
+ ])
+ if test "$ac_cv_define_$1" = "yes"; then
+ AC_DEFINE(HAVE_$1)
+ fi
+])
+
+
+dnl
+dnl APR_CHECK_DEFINE( symbol, header_file )
+dnl
+AC_DEFUN(APR_CHECK_DEFINE,[
+ AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[
+ AC_EGREP_CPP(YES_IS_DEFINED, [
+ #include <$2>
+ #ifdef $1
+ YES_IS_DEFINED
+ #endif
+ ], ac_cv_define_$1=yes, ac_cv_define_$1=no)
+ ])
+ if test "$ac_cv_define_$1" = "yes"; then
+ AC_DEFINE(HAVE_$1)
+ fi
+])
+
+dnl
+dnl APR_CHECK_APR_DEFINE( symbol, path_to_apr )
+dnl
+AC_DEFUN(APR_CHECK_APR_DEFINE,[
+ AC_EGREP_CPP(YES_IS_DEFINED, [
+ #include "$2/include/apr.h"
+ #if $1
+ YES_IS_DEFINED
+ #endif
+ ], ac_cv_define_$1=yes, ac_cv_define_$1=no)
+])
+
+define(APR_CHECK_FILE,[
+ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(ac_cv_file_$ac_safe, [
+ if test -r $1; then
+ eval "ac_cv_file_$ac_safe=yes"
+ else
+ eval "ac_cv_file_$ac_safe=no"
+ fi
+])dnl
+if eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then
+ AC_MSG_RESULT(yes)
+ ifelse([$2], , :, [$2])
+else
+ AC_MSG_RESULT(no)
+ifelse([$3], , , [$3])
+fi
+])
+
+define(APR_IFALLYES,[dnl
+ac_rc=yes
+for ac_spec in $1; do
+ ac_type=`echo "$ac_spec" | sed -e 's/:.*$//'`
+ ac_item=`echo "$ac_spec" | sed -e 's/^.*://'`
+ case $ac_type in
+ header )
+ ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'`
+ ac_var="ac_cv_header_$ac_item"
+ ;;
+ file )
+ ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'`
+ ac_var="ac_cv_file_$ac_item"
+ ;;
+ func ) ac_var="ac_cv_func_$ac_item" ;;
+ struct ) ac_var="ac_cv_struct_$ac_item" ;;
+ define ) ac_var="ac_cv_define_$ac_item" ;;
+ custom ) ac_var="$ac_item" ;;
+ esac
+ eval "ac_val=\$$ac_var"
+ if test ".$ac_val" != .yes; then
+ ac_rc=no
+ break
+ fi
+done
+if test ".$ac_rc" = .yes; then
+ :
+ $2
+else
+ :
+ $3
+fi
+])
+
+
+define(APR_BEGIN_DECISION,[dnl
+ac_decision_item='$1'
+ac_decision_msg='FAILED'
+ac_decision=''
+])
+
+
+define(APR_DECIDE,[dnl
+ac_decision='$1'
+ac_decision_msg='$2'
+ac_decision_$1=yes
+ac_decision_$1_msg='$2'
+])
+
+
+define(APR_DECISION_OVERRIDE,[dnl
+ ac_decision=''
+ for ac_item in $1; do
+ eval "ac_decision_this=\$ac_decision_${ac_item}"
+ if test ".$ac_decision_this" = .yes; then
+ ac_decision=$ac_item
+ eval "ac_decision_msg=\$ac_decision_${ac_item}_msg"
+ fi
+ done
+])
+
+
+define(APR_DECISION_FORCE,[dnl
+ac_decision="$1"
+eval "ac_decision_msg=\"\$ac_decision_${ac_decision}_msg\""
+])
+
+
+define(APR_END_DECISION,[dnl
+if test ".$ac_decision" = .; then
+ echo "[$]0:Error: decision on $ac_decision_item failed" 1>&2
+ exit 1
+else
+ if test ".$ac_decision_msg" = .; then
+ ac_decision_msg="$ac_decision"
+ fi
+ AC_DEFINE_UNQUOTED(${ac_decision_item})
+ AC_MSG_RESULT([decision on $ac_decision_item... $ac_decision_msg])
+fi
+])
+
+
+dnl
+dnl APR_CHECK_SIZEOF_EXTENDED(INCLUDES, TYPE [, CROSS_SIZE])
+dnl
+dnl A variant of AC_CHECK_SIZEOF which allows the checking of
+dnl sizes of non-builtin types
+dnl
+AC_DEFUN(APR_CHECK_SIZEOF_EXTENDED,
+[changequote(<<,>>)dnl
+dnl The name to #define
+define(<<AC_TYPE_NAME>>, translit(sizeof_$2, [a-z *], [A-Z_P]))dnl
+dnl The cache variable
+define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$2, [ *],[<p>]))dnl
+changequote([, ])dnl
+AC_MSG_CHECKING(size of $2)
+AC_CACHE_VAL(AC_CV_NAME,
+[AC_TRY_RUN([#include <stdio.h>
+$1
+main()
+{
+ FILE *f=fopen("conftestval","w");
+ if (!f) exit(1);
+ fprintf(f, "%d\n", sizeof($2));
+ exit(0);
+}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$3],,,
+AC_CV_NAME=$3))])dnl
+AC_MSG_RESULT($AC_CV_NAME)
+AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)
+undefine([AC_TYPE_NAME])dnl
+undefine([AC_CV_NAME])dnl
+])
+
+
+dnl
+dnl APR_TRY_COMPILE_NO_WARNING(INCLUDES, FUNCTION-BODY,
+dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl
+dnl Tries a compile test with warnings activated so that the result
+dnl is false if the code doesn't compile cleanly.
+dnl
+AC_DEFUN(APR_TRY_COMPILE_NO_WARNING,
+[if test "x$CFLAGS_WARN" = "x"; then
+ apr_tcnw_flags=""
+else
+ apr_tcnw_flags=$CFLAGS_WARN
+fi
+if test "$GCC" = "yes"; then
+ apr_tcnw_flags="$apr_tcnw_flags -Werror"
+fi
+changequote(', ')
+cat > conftest.$ac_ext <<EOTEST
+#include "confdefs.h"
+'$1'
+int main(int argc, const char * const argv[]) {
+'$2'
+; return 0; }
+EOTEST
+changequote([, ])
+if ${CC-cc} -c $CFLAGS $CPPFLAGS $apr_tcnw_flags conftest.$ac_ext 2>&AC_FD_CC ; then
+ ifelse([$3], , :, [rm -rf conftest*
+ $3])
+else
+ echo "configure: failed or warning program:" >&AC_FD_CC
+ cat conftest.$ac_ext >&AC_FD_CC
+ ifelse([$4], , , [rm -rf conftest*
+ $4])
+fi
+rm -f conftest*
+])dnl
+
+
+dnl
+dnl APR_CHECK_ICONV_INBUF
+dnl
+dnl Decide whether or not the inbuf parameter to iconv() is const.
+dnl
+dnl We try to compile something without const. If it fails to
+dnl compile, we assume that the system's iconv() has const.
+dnl Unfortunately, we won't realize when there was a compile
+dnl warning, so we allow a variable -- apr_iconv_inbuf_const -- to
+dnl be set in hints.m4 to specify whether or not iconv() has const
+dnl on this parameter.
+dnl
+AC_DEFUN(APR_CHECK_ICONV_INBUF,[
+AC_MSG_CHECKING(for type of inbuf parameter to iconv)
+if test "x$apr_iconv_inbuf_const" = "x"; then
+ APR_TRY_COMPILE_NO_WARNING([
+ #include <stddef.h>
+ #include <iconv.h>
+ ],[
+ iconv(0,(char **)0,(size_t *)0,(char **)0,(size_t *)0);
+ ], apr_iconv_inbuf_const="0", apr_iconv_inbuf_const="1")
+fi
+if test "$apr_iconv_inbuf_const" = "1"; then
+ AC_DEFINE(APR_ICONV_INBUF_CONST, 1, [Define if the inbuf parm to iconv() is const char **])
+ msg="const char **"
+else
+ msg="char **"
+fi
+AC_MSG_RESULT([$msg])
+])dnl
+
+
+dnl the following is a newline, a space, a tab, and a backslash (the
+dnl backslash is used by the shell to skip newlines, but m4 sees it;
+dnl treat it like whitespace).
+dnl WARNING: don't reindent these lines, or the space/tab will be lost!
+define([apr_whitespace],[
+ \])
+
+dnl
+dnl APR_COMMA_ARGS(ARG1 ...)
+dnl convert the whitespace-separated arguments into comman-separated
+dnl arguments.
+dnl
+dnl APR_FOREACH(CODE-BLOCK, ARG1, ARG2, ...)
+dnl subsitute CODE-BLOCK for each ARG[i]. "eachval" will be set to ARG[i]
+dnl within each iteration.
+dnl
+changequote({,})
+define({APR_COMMA_ARGS},{patsubst([$}{1],[[}apr_whitespace{]+],[,])})
+define({APR_FOREACH},
+ {ifelse($}{2,,,
+ [define([eachval],
+ $}{2)$}{1[]APR_FOREACH([$}{1],
+ builtin([shift],
+ builtin([shift], $}{@)))])})
+changequote([,])
+
+dnl APR_FLAG_HEADERS(HEADER-FILE ... [, FLAG-TO-SET ] [, "yes" ])
+dnl we set FLAG-TO-SET to 1 if we find HEADER-FILE, otherwise we set to 0
+dnl if FLAG-TO-SET is null, we automagically determine it's name
+dnl by changing all "/" to "_" in the HEADER-FILE and dropping
+dnl all "." and "-" chars. If the 3rd parameter is "yes" then instead of
+dnl setting to 1 or 0, we set FLAG-TO-SET to yes or no.
+dnl
+AC_DEFUN(APR_FLAG_HEADERS,[
+AC_CHECK_HEADERS($1)
+for aprt_i in $1
+do
+ ac_safe=`echo "$aprt_i" | sed 'y%./+-%__p_%'`
+ aprt_2=`echo "$aprt_i" | sed -e 's%/%_%g' -e 's/\.//g' -e 's/-//g'`
+ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ eval "ifelse($2,,$aprt_2,$2)=ifelse($3,yes,yes,1)"
+ else
+ eval "ifelse($2,,$aprt_2,$2)=ifelse($3,yes,no,0)"
+ fi
+done
+])
+
+dnl APR_FLAG_FUNCS(FUNC ... [, FLAG-TO-SET] [, "yes" ])
+dnl if FLAG-TO-SET is null, we automagically determine it's name
+dnl prepending "have_" to the function name in FUNC, otherwise
+dnl we use what's provided as FLAG-TO-SET. If the 3rd parameter
+dnl is "yes" then instead of setting to 1 or 0, we set FLAG-TO-SET
+dnl to yes or no.
+dnl
+AC_DEFUN(APR_FLAG_FUNCS,[
+AC_CHECK_FUNCS($1)
+for aprt_j in $1
+do
+ aprt_3="have_$aprt_j"
+ if eval "test \"`echo '$ac_cv_func_'$aprt_j`\" = yes"; then
+ eval "ifelse($2,,$aprt_3,$2)=ifelse($3,yes,yes,1)"
+ else
+ eval "ifelse($2,,$aprt_3,$2)=ifelse($3,yes,no,0)"
+ fi
+done
+])
+
+
diff -urN subversion-svn-282/ac-helpers/install-sh subversion-svn-282.new/ac-helpers/install-sh
--- subversion-svn-282/ac-helpers/install-sh Wed Dec 31 16:00:00 1969
+++ subversion-svn-282.new/ac-helpers/install-sh Mon Oct 22 22:58:31 2001
@@ -0,0 +1,251 @@
+#!/bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission. M.I.T. makes no representations about the
+# suitability of this software for any purpose. It is provided "as is"
+# without express or implied warranty.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd="$cpprog"
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd="$stripprog"
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "install: no input file specified"
+ exit 1
+else
+ true
+fi
+
+if [ x"$dir_arg" != x ]; then
+ dst=$src
+ src=""
+
+ if [ -d $dst ]; then
+ instcmd=:
+ chmodcmd=""
+ else
+ instcmd=mkdir
+ fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+ if [ -f $src -o -d $src ]
+ then
+ true
+ else
+ echo "install: $src does not exist"
+ exit 1
+ fi
+
+ if [ x"$dst" = x ]
+ then
+ echo "install: no destination specified"
+ exit 1
+ else
+ true
+ fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+ if [ -d $dst ]
+ then
+ dst="$dst"/`basename $src`
+ else
+ true
+ fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+# this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+ pathcomp="${pathcomp}${1}"
+ shift
+
+ if [ ! -d "${pathcomp}" ] ;
+ then
+ $mkdirprog "${pathcomp}"
+ else
+ true
+ fi
+
+ pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+ $doit $instcmd $dst &&
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+ if [ x"$transformarg" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ dstfile=`basename $dst $transformbasename |
+ sed $transformarg`$transformbasename
+ fi
+
+# don't allow the sed command to completely eliminate the filename
+
+ if [ x"$dstfile" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ true
+ fi
+
+# Make a temp file name in the proper directory.
+
+ dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+ $doit $instcmd $src $dsttmp &&
+
+ trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing. If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+ $doit $rmcmd -f $dstdir/$dstfile &&
+ $doit $mvcmd $dsttmp $dstdir/$dstfile
+
+fi &&
+
+
+exit 0
diff -urN subversion-svn-282/ac-helpers/install.sh subversion-svn-282.new/ac-helpers/install.sh
--- subversion-svn-282/ac-helpers/install.sh Mon Oct 22 15:28:32 2001
+++ subversion-svn-282.new/ac-helpers/install.sh Mon Oct 22 22:58:31 2001
@@ -1,112 +0,0 @@
-#!/bin/sh
-##
-## install.sh -- install a program, script or datafile
-##
-## Based on `install-sh' from the X Consortium's X11R5 distribution
-## as of 89/12/18 which is freely available.
-## Cleaned up for Apache's Autoconf-style Interface (APACI)
-## by Ralf S. Engelschall <rse@apache.org>
-##
-#
-# This script falls under the Apache License.
-# See http://www.apache.org/docs/LICENSE
-
-
-#
-# put in absolute paths if you don't have them in your path;
-# or use env. vars.
-#
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-
-#
-# parse argument line
-#
-instcmd="$mvprog"
-chmodcmd=""
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-ext=""
-src=""
-dst=""
-while [ "x$1" != "x" ]; do
- case $1 in
- -c) instcmd="$cpprog"
- shift; continue
- ;;
- -m) chmodcmd="$chmodprog $2"
- shift; shift; continue
- ;;
- -o) chowncmd="$chownprog $2"
- shift; shift; continue
- ;;
- -g) chgrpcmd="$chgrpprog $2"
- shift; shift; continue
- ;;
- -s) stripcmd="$stripprog"
- shift; continue
- ;;
- -S) stripcmd="$stripprog $2"
- shift; shift; continue
- ;;
- -e) ext="$2"
- shift; shift; continue
- ;;
- *) if [ "x$src" = "x" ]; then
- src=$1
- else
- dst=$1
- fi
- shift; continue
- ;;
- esac
-done
-if [ "x$src" = "x" ]; then
- echo "install.sh: no input file specified"
- exit 1
-fi
-if [ "x$dst" = "x" ]; then
- echo "install.sh: no destination specified"
- exit 1
-fi
-
-#
-# If destination is a directory, append the input filename; if
-# your system does not like double slashes in filenames, you may
-# need to add some logic
-#
-if [ -d $dst ]; then
- dst="$dst/`basename $src`"
-fi
-
-# Add a possible extension (such as ".exe") to src and dst
-src="$src$ext"
-dst="$dst$ext"
-
-# Make a temp file name in the proper directory.
-dstdir=`dirname $dst`
-dsttmp=$dstdir/#inst.$$#
-
-# Move or copy the file name to the temp name
-$instcmd $src $dsttmp
-
-# And set any options; do chmod last to preserve setuid bits
-if [ "x$chowncmd" != "x" ]; then $chowncmd $dsttmp; fi
-if [ "x$chgrpcmd" != "x" ]; then $chgrpcmd $dsttmp; fi
-if [ "x$stripcmd" != "x" ]; then $stripcmd $dsttmp; fi
-if [ "x$chmodcmd" != "x" ]; then $chmodcmd $dsttmp; fi
-
-# Now rename the file to the real destination.
-$rmcmd $dst
-$mvcmd $dsttmp $dst
-
-exit 0
-
diff -urN subversion-svn-282/autogen.sh subversion-svn-282.new/autogen.sh
--- subversion-svn-282/autogen.sh Mon Oct 22 22:58:41 2001
+++ subversion-svn-282.new/autogen.sh Mon Oct 22 22:58:31 2001
@@ -9,31 +9,9 @@
                 ac-helpers/get-neon-ver.sh \
                 ac-helpers/gnu-diff.sh \
                 ac-helpers/gnu-patch.sh \
- ac-helpers/install.sh; do
+ ac-helpers/install-sh; do
   chmod +x $execfile
 done
-
-# Make sure the APR directory is present
-if [ ! -d apr ]; then
- echo "You don't have an apr/ subdirectory here. Please get one:"
- echo ""
- echo " cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic login"
- echo " (password 'anoncvs')"
- echo ""
- echo " cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic co apr"
- echo ""
- echo "Run that right here in the top-level of the Subversion tree."
- echo ""
- PREREQ_FAILED="yes"
-fi
-
-#
-# If PREREQ_FAILED == "yes", then one or more required packages could
-# not be found in-tree, so exit now.
-#
-if [ "${PREREQ_FAILED}" = "yes" ]; then
- exit 1
-fi
 
 
 # Run a quick test to ensure that our autoconf and libtool verison are ok
@@ -50,7 +28,7 @@
 #
 echo "Copying libtool helper files..."
 
-libtoolize=`apr/build/PrintPath glibtoolize libtoolize`
+libtoolize=$(which glibtoolize libtoolize | head -1)
 if [ "x$libtoolize" = "x" ]; then
     echo "libtoolize not found in path"
     exit 1
@@ -122,12 +100,6 @@
 # Produce ./configure
 echo "Creating configure..."
 autoconf
-
-# Meta-configure apr/ subdir
-if [ -d apr ]; then
- echo "Creating config files for APR..."
- (cd apr; ./buildconf) # this is apr's equivalent of autogen.sh
-fi
 
 # If we have a config.cache file, toss it if the configure script has
 # changed, or if we just built it for the first time.
diff -urN subversion-svn-282/buildcheck.sh subversion-svn-282.new/buildcheck.sh
--- subversion-svn-282/buildcheck.sh Mon Oct 22 15:23:49 2001
+++ subversion-svn-282.new/buildcheck.sh Mon Oct 22 22:58:31 2001
@@ -20,7 +20,7 @@
 fi
 
 # libtool 1.4 or newer
-libtool=`apr/build/PrintPath glibtool libtool`
+libtool=$(which glibtool libtool | head -1)
 lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/^[^0-9]*//' -e 's/[- ].*//'`
 if test -z "$lt_pversion"; then
 echo "buildcheck: libtool not found."
diff -urN subversion-svn-282/configure.in subversion-svn-282.new/configure.in
--- subversion-svn-282/configure.in Mon Oct 22 22:58:41 2001
+++ subversion-svn-282.new/configure.in Mon Oct 22 22:58:31 2001
@@ -15,17 +15,16 @@
 abs_srcdir="`cd $srcdir && pwd`"
 abs_builddir="`pwd`"
 
-dnl $MKDIR is required for configuring apr and neon in a vpath build
-MKDIR="$abs_srcdir/apr/build/mkdir.sh"
 
 dnl APR defines a number of useful autoconf macros. grab them.
-sinclude(apr/build/apr_common.m4)
+sinclude(ac-helpers/apr_common.m4)
 
 dnl Grab our own macros
 sinclude(ac-helpers/berkeley-db.m4)
 sinclude(ac-helpers/svn-apache.m4)
 sinclude(ac-helpers/svn-macros.m4)
 sinclude(ac-helpers/neon.m4)
+sinclude(ac-helpers/apr.m4)
 
 dnl Grab the libtool macros
 sinclude(ac-helpers/libtool.m4)
@@ -52,8 +51,10 @@
 
 dnl Configure APR, and local Berkeley DB if any --------------------------
 
+
+SVN_LIB_APR
+
 if test "$enable_subdir_config" = "yes"; then
- APR_SUBDIR_CONFIG(apr)
   if test -d $abs_srcdir/db ; then
       # Note: We have to configure and build a db subdirectory even if
       # some other berkeley db is configured via --with-berkeley-db
@@ -64,33 +65,12 @@
   AC_SUBST(DB_SUBDIR)
 fi
 
-
-dnl Get libraries and thread flags from APR ---------------------
-
-if test -f "$abs_builddir/apr/APRVARS"; then
- . "$abs_builddir/apr/APRVARS"
- CPPFLAGS="$CPPFLAGS $EXTRA_CPPFLAGS"
- CFLAGS="$CFLAGS $EXTRA_CFLAGS"
- LIBS="$LIBS $EXTRA_LIBS"
-else
- AC_MSG_ERROR([Must configure APR before Subversion.])
-fi
-
 dnl Set include dir and module library lists for Makefiles -----------------
 
 dnl Top level
 SVN_INCLUDES='-I$(top_srcdir)/subversion/include -I$(top_builddir)'
 AC_SUBST(SVN_INCLUDES)
 
-dnl APR
-SVN_APR_INCLUDES=-I'$(top_srcdir)/apr/include'
-if test "$abs_srcdir" != "$abs_builddir"; then
- SVN_APR_INCLUDES='-I$(top_builddir)/apr/include '"$SVN_APR_INCLUDES"
-fi
-AC_SUBST(SVN_APR_INCLUDES)
-SVN_APR_LIBS='$(abs_builddir)/apr/libapr.la '"$LIBTOOL_LIBS"
-AC_SUBST(SVN_APR_LIBS)
-
 dnl Expat
 SVN_EXPAT_INCLUDES='-I$(top_srcdir)/expat-lite'
 AC_SUBST(SVN_EXPAT_INCLUDES)
@@ -116,11 +96,11 @@
 dnl ### should we ever bother with the system install?
 dnl use abs_srcdir. sometimes during installation, libtool will relink the
 dnl library. when it does this, it does a "cd", so a relative use of
-dnl install.sh will not work.
-INSTALL="\$(abs_srcdir)/apr/build/install.sh -c"
+dnl install-sh will not work.
+INSTALL="\$(abs_srcdir)/ac-helpers/install-sh -c"
 AC_SUBST(INSTALL)
 
-dnl use APR's mkdir to enable creating intervening directories
+MKDIR="$INSTALL -d"
 AC_SUBST(MKDIR)
 
 dnl Check for libraries --------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:45 2006

This is an archived mail posted to the Subversion Dev mailing list.