Hi,
Slightly updated patch, based on feedack form the list (just the
formatting issue Matt Kraii pointed out.) .
-David
        Allow for locally installed neon.
        * Makefile.in : Only build neon/ subdir if necessary.  New variable
        contains path to libneon.la.
        * autogen.sh : Remove neon check that is now in ac-helpers/neon.m4.
        * build.conf : [libsvn_ra_dav] libs is now equal to
        libneon.la variable.
        * configure.in : Remove neon configuration that is now in
        ac-helpers/neon.m4.
        * ac-helpers/neon.m4 : New file.  Handle version checking,
        configuration and variable assignments for neon.
diff -urN subversion-svn-282/Makefile.in subversion-svn-282.new/Makefile.in
--- subversion-svn-282/Makefile.in	Mon Oct 22 15:23:47 2001
+++ subversion-svn-282.new/Makefile.in	Mon Oct 22 22:48:04 2001
@@ -10,7 +10,9 @@
 
 DOC_DIRS = doc/programmer/design doc/user/manual doc/user/svn_for_cvs_users
 
-EXTERNAL_PROJECT_DIRS = neon apr @DB_SUBDIR@
+EXTERNAL_PROJECT_DIRS = @NEON_SUBDIR@ apr @DB_SUBDIR@
+
+LIBNEON_LA = @LIBNEON_LA@
 
 SVN_APR_LIBS = @SVN_APR_LIBS@
 
diff -urN subversion-svn-282/ac-helpers/neon.m4 subversion-svn-282.new/ac-helpers/neon.m4
--- subversion-svn-282/ac-helpers/neon.m4	Wed Dec 31 16:00:00 1969
+++ subversion-svn-282.new/ac-helpers/neon.m4	Mon Oct 22 22:48:04 2001
@@ -0,0 +1,127 @@
+dnl   SVN_LIB_NEON(version)
+dnl
+dnl   Search for a suitable version of neon, it must be 
+dnl   the exact version 'version'.
+dnl
+dnl   If there is a neon/ subdir we assume we want to use it.
+dnl   If the subdir is the wrong version we exit with a failure
+dnl   regardless if neon is installed somewhere else on the system.
+dnl
+dnl   If there isn't a neon/ subdir then we look for 'neon-config'
+dnl   in PATH (or the location specified by a --with-neon=PATH 
+dnl   switch).  
+
+AC_DEFUN(SVN_LIB_NEON,
+[
+
+  NEON_WANTED="$1"
+  NEON_URL="http://www.webdav.org/neon/neon-${NEON_WANTED}.tar.gz"
+
+  AC_MSG_NOTICE([checking neon library])
+
+  AC_ARG_WITH(neon,
+              [AC_HELP_STRING([--with-neon=PREFIX], 
+	      [Determine neon library configuration based on 
+	      'PREFIX/bin/neon-config'. Default is to search for neon 
+	      in a subdirectory of the top source directory and then to
+	      look for neon-config in $PATH.])],
+  [
+    if test "$withval" = "yes" ; then
+      AC_PATH_PROG(neon_config,neon-config)
+    else
+      neon_config="$withval/bin/neon-config"
+    fi
+  ],
+  [
+    # no --with-neon switch, look in PATH
+    AC_PATH_PROG(neon_config,neon-config)
+  ])
+  
+  AC_MSG_CHECKING([neon library version])
+
+  if test -d neon ; then
+    # if there is a neon subdir, assume we want to use it
+
+    NEON_VERSION=`ac-helpers/get-neon-ver.sh neon`
+    AC_MSG_RESULT([$NEON_VERSION])
+    if test "$NEON_WANTED" != "$NEON_VERSION"; then
+      echo "You have a neon/ subdir containing version $NEON_VERSION,"
+      echo "but Subversion needs neon ${NEON_WANTED}."
+      SVN_GET_NEON()
+    else
+      SVN_NEON_INCLUDES=-'I$(top_srcdir)/neon/src'
+      LIBNEON_LA="\$(abs_builddir)/neon/src/libneon.la"
+dnl Configure neon --------------------------
+
+      if test "$enable_subdir_config" = "yes"; then
+        # The arguments passed to this configure script are passed down to
+        # neon's configure script, but, since neon defaults to *not* building
+        # shared libs, and we default to building shared libs, we have to 
+        # explicitly pass down an --{enable,disable}-shared argument, to make
+        # sure neon does the same as we do.
+        if test "$enable_shared" = "yes"; then
+          args="--enable-shared"
+        else
+          args="--disable-shared"
+        fi
+
+        # neon uses an old autoconf which does not understand the -C and
+        # --config-cache arguments. strip them from the args passed down.
+        ac_configure_args="`echo $ac_configure_args | sed 's/-C//' | sed 's/--config-cache//'`"
+        APR_SUBDIR_CONFIG(neon, $args --with-expat="$abs_srcdir/expat-lite/libexpat.la")
+
+        AC_MSG_CHECKING([for any extra libraries neon needs])
+        # this is not perfect since it will pick up extra -L flags too,
+        # but that shouldn't do any real damage.
+        NEON_LIBS=`$SHELL $abs_builddir/neon/neon-config --libs | sed -e "s/-lneon//g"`
+        AC_MSG_RESULT([$NEON_LIBS])
+        # Also find out which macros neon defines (but ignore extra include paths):
+        # this will include -DNEON_SSL if neon was built with SSL support
+        CFLAGS="$CFLAGS `$SHELL $abs_builddir/neon/neon-config --cflags | sed -e "s/-I.* //g"`"
+      fi
+      NEON_SUBDIR=neon
+    fi
+  elif test "$neon_config" != "" ; then
+    NEON_VERSION=`$neon_config --version | sed -e 's/^neon //'`
+    AC_MSG_RESULT([$NEON_VERSION])
+
+    if test "$NEON_WANTED" != "$NEON_VERSION"; then
+      echo "You have neon version $NEON_VERSION,"
+      echo "but Subversion needs neon $NEON_WANTED."
+      SVN_GET_NEON()
+    else
+      SVN_NEON_INCLUDES=`$neon_config --cflags | sed -e 's/-D.*//g'`
+      NEON_LIBS=`$neon_config --libs | sed -e 's/-lneon//g'`
+      CFLAGS="$CFLAGS `$neon_config --cflags | sed -e 's/-I.* //g'`"
+      LIBNEON_LA=`$neon_config --prefix `"/lib/libneon.la"
+    fi
+  else 
+    # no neon subdir, no neon-config in PATH
+    AC_MSG_RESULT([nothing])
+    echo "No suitable neon can be found."
+    SVN_GET_NEON()
+  fi
+ 
+  AC_SUBST(SVN_NEON_INCLUDES)
+  AC_SUBST(NEON_SUBDIR)
+  AC_SUBST(LIBNEON_LA)
+])
+
+
+dnl SVN_GET_NEON()
+dnl no neon found, print out a message telling
+dnl the user what to do
+AC_DEFUN(SVN_GET_NEON,
+[
+  echo "Please either install neon ${NEON_WANTED} on this system"
+  echo ""
+  echo "or"
+  echo ""
+  echo "get neon ${NEON_WANTED} from:"
+  echo "${NEON_URL}"
+  echo "unpack the archive using tar/gunzip and rename the resulting"
+  echo "directory from ./neon-${NEON_WANTED}/ to ./neon/"
+  AC_MSG_ERROR([no suitable neon found])
+])
+
+
diff -urN subversion-svn-282/autogen.sh subversion-svn-282.new/autogen.sh
--- subversion-svn-282/autogen.sh	Mon Oct 22 15:23:49 2001
+++ subversion-svn-282.new/autogen.sh	Mon Oct 22 22:48:04 2001
@@ -27,35 +27,6 @@
   PREREQ_FAILED="yes"
 fi
 
-# Make sure the Neon directory is present
-NEON_WANTED=0.17.1
-NEON_URL="http://www.webdav.org/neon/neon-${NEON_WANTED}.tar.gz"
-
-if [ ! -d neon ]; then
-  echo "You don't have a neon/ subdirectory here."
-  echo "Please get neon ${NEON_WANTED} from:"
-  echo "       ${NEON_URL}"
-  echo ""
-  echo "Unpack the archive using tar/gunzip and rename the resulting"
-  echo "directory from ./neon-${NEON_WANTED}/ to ./neon/"
-  echo ""
-  PREREQ_FAILED="yes"
-else
-   NEON_VERSION=`ac-helpers/get-neon-ver.sh neon`
-   if test "$NEON_WANTED" != "$NEON_VERSION"; then
-     echo "You have a neon/ subdir containing version $NEON_VERSION,"
-     echo "but Subversion needs neon ${NEON_WANTED}."
-     echo "Please get neon ${NEON_WANTED} from:"
-     echo "       ${NEON_URL}"
-     echo ""
-     echo "Unpack the archive using tar/gunzip and rename the resulting"
-     echo "directory from ./neon-${NEON_WANTED}/ to ./neon/"
-     echo ""
-     PREREQ_FAILED="yes"
-   fi
-fi
-
-
 #
 # If PREREQ_FAILED == "yes", then one or more required packages could
 # not be found in-tree, so exit now.
diff -urN subversion-svn-282/build.conf subversion-svn-282.new/build.conf
--- subversion-svn-282/build.conf	Mon Oct 22 15:23:47 2001
+++ subversion-svn-282.new/build.conf	Mon Oct 22 22:48:04 2001
@@ -102,7 +102,7 @@
 [libsvn_ra_dav]
 type = lib
 path = subversion/libsvn_ra_dav
-libs = $(abs_builddir)/neon/src/libneon.la
+libs = $(LIBNEON_LA)
 
 # Accessing repositories via direct libsvn_fs
 [libsvn_ra_local]
diff -urN subversion-svn-282/configure.in subversion-svn-282.new/configure.in
--- subversion-svn-282/configure.in	Mon Oct 22 15:23:53 2001
+++ subversion-svn-282.new/configure.in	Mon Oct 22 22:48:04 2001
@@ -25,6 +25,7 @@
 sinclude(ac-helpers/berkeley-db.m4)
 sinclude(ac-helpers/svn-apache.m4)
 sinclude(ac-helpers/svn-macros.m4)
+sinclude(ac-helpers/neon.m4)
 
 dnl Grab the libtool macros
 sinclude(ac-helpers/libtool.m4)
@@ -94,11 +95,6 @@
 SVN_EXPAT_INCLUDES='-I$(top_srcdir)/expat-lite'
 AC_SUBST(SVN_EXPAT_INCLUDES)
 
-dnl Neon
-SVN_NEON_INCLUDES=-'I$(top_srcdir)/neon/src'
-AC_SUBST(SVN_NEON_INCLUDES)
-
-
 dnl Check for programs ---------------------
 
 dnl Look for a C compiler
@@ -111,34 +107,8 @@
 echo "configuring libtool now"
 AC_PROG_LIBTOOL
 
-dnl Configure neon --------------------------
-
-if test "$enable_subdir_config" = "yes"; then
-  # The arguments passed to this configure script are passed down to
-  # neon's configure script, but, since neon defaults to *not* building
-  # shared libs, and we default to building shared libs, we have to 
-  # explicitly pass down an --{enable,disable}-shared argument, to make
-  # sure neon does the same as we do.
-  if test "$enable_shared" = "yes"; then
-     args="--enable-shared"
-  else
-     args="--disable-shared"
-  fi
-
-  # neon uses an old autoconf which does not understand the -C and
-  # --config-cache arguments. strip them from the args passed down.
-  ac_configure_args="`echo $ac_configure_args | sed 's/-C//' | sed 's/--config-cache//'`"
-  APR_SUBDIR_CONFIG(neon, $args --with-expat="$abs_srcdir/expat-lite/libexpat.la")
-
-  AC_MSG_CHECKING([for any extra libraries neon needs])
-  # this is not perfect since it will pick up extra -L flags too,
-  # but that shouldn't do any real damage.
-  NEON_LIBS=`$SHELL $abs_builddir/neon/neon-config --libs | sed -e "s/-lneon//g"`
-  AC_MSG_RESULT([$NEON_LIBS])
-  # Also find out which macros neon defines (but ignore extra include paths):
-  # this will include -DNEON_SSL if neon was built with SSL support
-  CFLAGS="$CFLAGS `$SHELL $abs_builddir/neon/neon-config --cflags | sed -e "s/-I.* //g"`"
-fi
+NEON_WANTED=0.17.1
+SVN_LIB_NEON($NEON_WANTED)
 
 dnl find Apache
 SVN_FIND_APACHE
@@ -295,7 +265,7 @@
         [Defined if libsvn_client should link against libsvn_ra_dav])
   SVN_RA_LIB_DEPS="subversion/libsvn_ra_dav/libsvn_ra_dav.la"
   SVN_RA_LIB_LINK="\$(abs_builddir)/subversion/libsvn_ra_dav/libsvn_ra_dav.la \
-	\$(abs_builddir)/neon/src/libneon.la $NEON_LIBS"
+	\$(LIBNEON_LA) $NEON_LIBS"
 
   if test "$svn_lib_berkeley_db" = "yes"; then
     AC_DEFINE(SVN_LIBSVN_CLIENT_LINKS_RA_LOCAL, 1,
---------------------------------------------------------------------
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