Hi,
I'm packaging subversion for Debian and I'd like to allow it to use a
locally installed neon library. FWIW, I talked to brane on irc and he
okay'd the general idea of what I'm trying to do to neon in
subversion, though we didn't talk much about specifics.
A few comments:
- I think I have preserved the status quo, i.e. neon/ subdirs are
supported and everything should work the same if one exists. I've
tested a few different ways so I think I caught everything.
- all neon configuration/checking is removed from autogen.sh. I did
this because it made everything a clearer. At first I didn't want
to do it this way because it makes the patch so large, but IMO it
was the right way to do it.
- most of the neon configuration was moved into ac-helpers/neon.m4
Specifically, the large chunk that used to be in configure.in was moved
unchanged, the little chunk was moved in as well, just broken up a
bit. The chunk from autogen.sh is there to but it was changed a
fair amount to reduce the number of lines and to allow for locally
installed neon.
I'm open to any comments, criticisms or suggestions, I'd like to get
a change like this accepted so I don't have to juggle too many patches
for the Debian build.
-David
P.S. : At some point I'll be wanting to do a similar change for apr,
do we think that could be accepted?
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.
Index: ./Makefile.in
===================================================================
--- ./.svn/text-base/Makefile.in Mon Oct 15 21:21:22 2001
+++ ./Makefile.in Wed Oct 17 23:45:38 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@
Index: ./autogen.sh
===================================================================
--- ./.svn/text-base/autogen.sh Mon Oct 15 21:21:26 2001
+++ ./autogen.sh Wed Oct 17 23:45:39 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.
Index: ./build.conf
===================================================================
--- ./.svn/text-base/build.conf Mon Oct 15 21:21:25 2001
+++ ./build.conf Wed Oct 17 23:45:39 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]
Index: ./configure.in
===================================================================
--- ./.svn/text-base/configure.in Mon Oct 15 21:21:24 2001
+++ ./configure.in Wed Oct 17 23:45:39 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,
--- /dev/null Sun Sep 16 18:26:44 2001
+++ ac-helpers/neon.m4 Thu Oct 18 09:03:16 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 assme 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])
+])
+
+
---------------------------------------------------------------------
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