1 dnl SVN_LIB_NEON(wanted_regex, recommended_ver, url)
3 dnl Search for a suitable version of neon. wanted_regex is a
4 dnl regular expression used in a Bourne shell switch/case statement
5 dnl to match versions of Neon that can be used. recommended_ver is the
6 dnl recommended version of Neon, which is not necessarily the latest
7 dnl released version of neon that exists. url is the URL of the
8 dnl recommended version of Neon.
10 dnl If a --with-neon=PREFIX option is passed search for a suitable
11 dnl neon installed on the system whose configuration can be found in
12 dnl PREFIX/bin/neon-config. In this case ignore any neon/ subdir
13 dnl within the source tree.
15 dnl If no --with-neon option is passed look first for a neon/ subdir.
16 dnl If a neon/ subdir exists and is the wrong version exit with a
17 dnl failure. If no neon/ subdir is present search for a neon installed
20 dnl If the search for neon fails, set svn_lib_neon to no, otherwise set
23 AC_DEFUN(SVN_LIB_NEON,
25 NEON_ALLOWED_LIST="$1"
26 NEON_RECOMMENDED_VER="$2"
29 AC_MSG_NOTICE([checking neon library])
32 AS_HELP_STRING([--with-neon=PREFIX],
33 [Determine neon library configuration based on
34 'PREFIX/bin/neon-config'. Default is to search for neon
35 in a subdirectory of the top source directory and then to
36 look for neon-config in $PATH.]),
38 if test "$withval" = "yes" ; then
39 AC_MSG_ERROR([--with-neon requires an argument.])
41 neon_config="$withval/bin/neon-config"
47 if test -d $abs_srcdir/neon ; then
48 AC_MSG_CHECKING([neon library version])
50 NEON_VERSION=`cat $abs_srcdir/neon/.version`
51 AC_MSG_RESULT([$NEON_VERSION])
53 if test -n ["`echo "$NEON_VERSION" | grep '^0\.2[6-9]\.'`"] ; then
54 AC_DEFINE_UNQUOTED([SVN_NEON_0_26], [1],
55 [Define to 1 if you have Neon 0.26 or later.])
58 if test -n ["`echo "$NEON_VERSION" | grep '^0\.2[7-9]\.'`"] ; then
59 AC_DEFINE_UNQUOTED([SVN_NEON_0_27], [1],
60 [Define to 1 if you have Neon 0.27 or later.])
63 if test -n ["`echo "$NEON_VERSION" | grep '^0\.2[8-9]\.'`"] ; then
64 AC_DEFINE_UNQUOTED([SVN_NEON_0_28], [1],
65 [Define to 1 if you have Neon 0.28 or later.])
68 for svn_allowed_neon in $NEON_ALLOWED_LIST; do
69 if test "$NEON_VERSION" = "$svn_allowed_neon" ||
70 test "$svn_allowed_neon" = "any"; then
71 echo "Using neon found in source directory."
72 svn_allowed_neon_in_srcdir="yes"
73 SVN_NEON_INCLUDES=-'I$(abs_srcdir)/neon/src'
74 NEON_LIBS="\$(abs_builddir)/neon/src/libneon.la"
76 dnl Configure neon --------------------------
77 # The arguments passed to this configure script are passed
78 # down to neon's configure script, but, since neon
79 # defaults to *not* building shared libs, and we default
80 # to building shared libs, we have to explicitly pass down
81 # an --{enable,disable}-shared argument, to make sure neon
82 # does the same as we do.
83 if test "$enable_shared" = "yes"; then
84 args="--enable-shared"
86 args="--disable-shared"
89 # If we have apr-util and its bundled expat, we can point neon
90 # there, otherwise, neon is on its own to find expat.
91 if test -f "$abs_builddir/apr-util/xml/expat/lib/expat.h" ; then
92 args="$args --with-expat='$abs_builddir/apr-util/xml/expat/lib/libexpat.la'"
94 SVN_EXTERNAL_PROJECT([neon], [$args])
96 if test -f "$abs_builddir/neon/neon-config" ; then
97 # Also find out which macros neon defines (but ignore extra include paths):
98 # this will include -DNEON_SSL if neon was built with SSL support
99 CFLAGS=["$CFLAGS `$SHELL $abs_builddir/neon/neon-config --cflags | sed -e 's/-I[^ ]*//g'`"]
100 SVN_NEON_INCLUDES=["$SVN_NEON_INCLUDES `$SHELL $abs_builddir/neon/neon-config --cflags | sed -e 's/-D[^ ]*//g'`"]
108 if test -z $svn_allowed_neon_in_srcdir; then
109 echo "You have a neon/ subdir containing version $NEON_VERSION,"
110 echo "but Subversion needs neon ${NEON_RECOMMENDED_VER}."
115 # no --with-neon switch, and no neon subdir, look in PATH
116 AC_PATH_PROG(neon_config,neon-config)
122 AC_SUBST(SVN_NEON_INCLUDES)
126 dnl SVN_NEON_CONFIG()
127 dnl neon-config found, gather relevant information from it
128 AC_DEFUN(SVN_NEON_CONFIG,
130 if test -f "$neon_config"; then
131 if test "$neon_config" != ""; then
132 AC_MSG_CHECKING([neon library version])
133 NEON_VERSION=`$neon_config --version | sed -e 's/^neon //'`
134 AC_MSG_RESULT([$NEON_VERSION])
136 if test -n ["`echo "$NEON_VERSION" | grep '^0\.2[6-9]\.'`"] ; then
137 AC_DEFINE_UNQUOTED([SVN_NEON_0_26], [1],
138 [Define to 1 if you have Neon 0.26 or later.])
141 if test -n ["`echo "$NEON_VERSION" | grep '^0\.2[7-9]\.'`"] ; then
142 AC_DEFINE_UNQUOTED([SVN_NEON_0_27], [1],
143 [Define to 1 if you have Neon 0.27 or later.])
146 if test -n ["`echo "$NEON_VERSION" | grep '^0\.2[8-9]\.'`"] ; then
147 AC_DEFINE_UNQUOTED([SVN_NEON_0_28], [1],
148 [Define to 1 if you have Neon 0.28 or later.])
151 for svn_allowed_neon in $NEON_ALLOWED_LIST; do
152 if test "$NEON_VERSION" = "$svn_allowed_neon" ||
153 test "$svn_allowed_neon" = "any"; then
154 svn_allowed_neon_on_system="yes"
155 SVN_NEON_INCLUDES=[`$neon_config --cflags | sed -e 's/-D[^ ]*//g'`]
156 NEON_LIBS=`$neon_config --la-file`
157 CFLAGS=["$CFLAGS `$neon_config --cflags | sed -e 's/-I[^ ]*//g'`"]
163 if test -z $svn_allowed_neon_on_system; then
164 echo "You have neon version $NEON_VERSION,"
165 echo "but Subversion needs neon $NEON_RECOMMENDED_VER."
170 # no neon subdir, no neon-config in PATH
171 AC_MSG_RESULT([nothing])
172 echo "No suitable neon can be found."
177 # user probably passed --without-neon, or --with-neon=/something/dumb
182 dnl SVN_DOWNLOAD_NEON()
183 dnl no neon found, print out a message telling the user what to do
184 AC_DEFUN(SVN_DOWNLOAD_NEON,
187 echo "An appropriate version of neon could not be found, so libsvn_ra_neon"
188 echo "will not be built. If you want to build libsvn_ra_neon, please either"
189 echo "install neon ${NEON_RECOMMENDED_VER} on this system"
193 echo "get neon ${NEON_RECOMMENDED_VER} from:"
195 echo "unpack the archive using tar/gunzip and rename the resulting"
196 echo "directory from ./neon-${NEON_RECOMMENDED_VER}/ to ./neon/"
198 AC_MSG_RESULT([no suitable neon found])