2 dnl SVN_LIB_APR(wanted_regex, alt_wanted_regex)
4 dnl 'wanted_regex' and 'alt_wanted_regex are regular expressions
5 dnl that the apr version string must match.
7 dnl Check configure options and assign variables related to
8 dnl the Apache Portable Runtime (APR) library.
13 APR_WANTED_REGEXES="$1"
15 AC_MSG_NOTICE([Apache Portable Runtime (APR) library configuration])
17 APR_FIND_APR("$abs_srcdir/apr", "$abs_builddir/apr", 1, [0 1])
19 if test $apr_found = "no"; then
20 AC_MSG_WARN([APR not found])
24 if test $apr_found = "reconfig"; then
25 SVN_EXTERNAL_PROJECT([apr])
28 dnl check APR version number against regex
30 AC_MSG_CHECKING([APR version])
31 apr_version="`$apr_config --version`"
32 if test $? -ne 0; then
33 AC_MSG_ERROR([apr-config --version failed])
35 AC_MSG_RESULT([$apr_version])
37 APR_WANTED_REGEX_MATCH=0
38 for apr_wanted_regex in $APR_WANTED_REGEXES; do
39 if test `expr $apr_version : $apr_wanted_regex` -ne 0; then
40 APR_WANTED_REGEX_MATCH=1
45 if test $APR_WANTED_REGEX_MATCH -eq 0; then
46 echo "wanted regexes are $APR_WANTED_REGEXES"
47 AC_MSG_ERROR([invalid apr version found])
50 dnl Get build information from APR
52 CPPFLAGS="$CPPFLAGS `$apr_config --cppflags`"
53 if test $? -ne 0; then
54 AC_MSG_ERROR([apr-config --cppflags failed])
57 CFLAGS="$CFLAGS `$apr_config --cflags`"
58 if test $? -ne 0; then
59 AC_MSG_ERROR([apr-config --cflags failed])
62 LDFLAGS="$LDFLAGS `$apr_config --ldflags`"
63 if test $? -ne 0; then
64 AC_MSG_ERROR([apr-config --ldflags failed])
67 SVN_APR_INCLUDES="`$apr_config --includes`"
68 if test $? -ne 0; then
69 AC_MSG_ERROR([apr-config --includes failed])
72 SVN_APR_PREFIX="`$apr_config --prefix`"
73 if test $? -ne 0; then
74 AC_MSG_ERROR([apr-config --prefix failed])
77 dnl When APR stores the dependent libs in the .la file, we don't need
79 SVN_APR_LIBS="`$apr_config --link-libtool --libs`"
80 if test $? -ne 0; then
81 AC_MSG_ERROR([apr-config --link-libtool --libs failed])
84 SVN_APR_EXPORT_LIBS="`$apr_config --link-ld --libs`"
85 if test $? -ne 0; then
86 AC_MSG_ERROR([apr-config --link-ld --libs failed])
89 SVN_APR_SHLIB_PATH_VAR="`$apr_config --shlib-path-var`"
90 if test $? -ne 0; then
91 AC_MSG_ERROR([apr-config --shlib-path-var failed])
94 AC_SUBST(SVN_APR_PREFIX)
95 AC_SUBST(SVN_APR_INCLUDES)
96 AC_SUBST(SVN_APR_LIBS)
97 AC_SUBST(SVN_APR_EXPORT_LIBS)
98 AC_SUBST(SVN_APR_SHLIB_PATH_VAR)
101 dnl SVN_DOWNLOAD_APR()
102 dnl no apr found, print out a message telling the user what to do
103 AC_DEFUN(SVN_DOWNLOAD_APR,
105 echo "The Apache Portable Runtime (APR) library cannot be found."
106 echo "Please install APR on this system and supply the appropriate"
107 echo "--with-apr option to 'configure'"
111 echo "get it with SVN and put it in a subdirectory of this source:"
114 echo " http://svn.apache.org/repos/asf/apr/apr/branches/1.2.x \\"
117 echo "Run that right here in the top level of the Subversion tree."
118 echo "Afterwards, run apr/buildconf in that subdirectory and"
119 echo "then run configure again here."
121 echo "Whichever of the above you do, you probably need to do"
122 echo "something similar for apr-util, either providing both"
123 echo "--with-apr and --with-apr-util to 'configure', or"
124 echo "getting both from SVN with:"
127 echo " http://svn.apache.org/repos/asf/apr/apr-util/branches/1.2.x \\"
130 AC_MSG_ERROR([no suitable apr found])