source: valtobtest/subversion-1.6.2/contrib/server-side/svnstsw/conf/stsw_lib_apr.m4 @ 3

Last change on this file since 3 was 3, checked in by valtob, 15 years ago

subversion source 1.6.2 as test

File size: 5.2 KB
Line 
1# -*- Autoconf -*-
2
3# TODO:  Figure out licensing of this file (it is derived with heavy
4# modification from apr.m4 from Subversion)
5
6# Copyright (c) 2008 BBN Technologies Corp.  All rights reserved.
7#
8# Redistribution and use in source and binary forms, with or without
9# modification, are permitted provided that the following conditions
10# are met:
11# 1. Redistributions of source code must retain the above copyright
12#    notice, this list of conditions and the following disclaimer.
13# 2. Redistributions in binary form must reproduce the above copyright
14#    notice, this list of conditions and the following disclaimer in the
15#    documentation and/or other materials provided with the distribution.
16# 3. Neither the name of BBN Technologies nor the names of its contributors
17#    may be used to endorse or promote products derived from this software
18#    without specific prior written permission.
19#
20# THIS SOFTWARE IS PROVIDED BY BBN TECHNOLOGIES AND CONTRIBUTORS ``AS IS''
21# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23# ARE DISCLAIMED.  IN NO EVENT SHALL BBN TECHNOLOGIES OR CONTRIBUTORS BE
24# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30# POSSIBILITY OF SUCH DAMAGE.
31
32#
33# NAME
34#        STSW_LIB_APR - Check for the Apache Portable Runtime library
35#
36# SYNOPSIS
37#        STSW_LIB_APR(wanted_regex)
38#
39# DESCRIPTION
40#        Searches for the Apache Portable Runtime (APR) headers and
41#        library and determines the appropriate build flags.
42#
43# ARGUMENTS
44#        wanted_regex
45#               Regular expression that the APR version string must
46#               match.
47#
48# RETURN VALUE
49#        The shell variable 'apr_found' is set to 'yes' if APR is
50#        found.
51#
52#        If APR is found, the following substituted variables are set
53#        according to the output of apr-config:  STSW_APR_CFLAGS,
54#        STSW_APR_CPPFLAGS, STSW_APR_INCLUDES, STSW_APR_LDFLAGS, and
55#        STSW_APR_LIBS
56#
57# NOTES
58#        Derived from Subversion's apr.m4.
59#
60
61# serial 0
62AC_DEFUN([STSW_LIB_APR],
63  [
64    AC_MSG_NOTICE([Apache Portable Runtime (APR) library configuration])
65
66    APR_FIND_APR([], [], [1], [0 1])
67    if test "x$apr_found" != "xyes" ; then
68        AC_MSG_ERROR([the Apache Portable Runtime (APR) library (version 0.x or 1.x) was not found.  Please specify a path to APR using '--with-apr'.])
69    fi
70
71    # check APR version number against regex 
72
73    APR_WANTED_REGEXES="$1"
74    if test "x$APR_WANTED_REGEXES" = "x" ; then
75        AC_MSG_ERROR([internal error:  invalid argument to [STSW_LIB_APR]])
76    fi
77
78    AC_MSG_CHECKING([APR version])
79    apr_version=`$apr_config --version`
80    if test $? -ne 0; then
81        AC_MSG_RESULT([failed])
82        AC_MSG_ERROR(['apr-config --version' failed])
83    fi
84    AC_MSG_RESULT([$apr_version])
85
86    apr_version_regex_match=no
87    for apr_wanted_regex in $APR_WANTED_REGEXES; do
88        AC_MSG_CHECKING([if APR version matches '$apr_wanted_regex'])
89        if test `expr $apr_version : $apr_wanted_regex` -ne 0; then
90            apr_version_regex_match=yes
91        fi
92        AC_MSG_RESULT([$apr_version_regex_match])
93        if test "x$apr_version_regex_match" = "xyes" ; then
94            break
95        fi
96    done
97
98    if test "x$apr_version_regex_match" != "xyes" ; then
99        AC_MSG_ERROR([APR version mismatch])
100    fi
101
102    # Get build information from APR
103
104    AC_MSG_CHECKING([for APR CPPFLAGS])
105    STSW_APR_CPPFLAGS=`$apr_config --cppflags`
106    if test $? -ne 0; then
107        AC_MSG_RESULT([failed])
108        AC_MSG_ERROR(['apr-config --cppflags' failed])
109    fi
110    AC_MSG_RESULT([$STSW_APR_CPPFLAGS])
111
112    AC_MSG_CHECKING([for APR CFLAGS])
113    STSW_APR_CFLAGS=`$apr_config --cflags`
114    if test $? -ne 0; then
115        AC_MSG_RESULT([failed])
116        AC_MSG_ERROR(['apr-config --cflags' failed])
117    fi
118    AC_MSG_RESULT([$STSW_APR_CFLAGS])
119
120    AC_MSG_CHECKING([for APR LDFLAGS])
121    STSW_APR_LDFLAGS=`$apr_config --ldflags`
122    if test $? -ne 0; then
123        AC_MSG_RESULT([failed])
124        AC_MSG_ERROR(['apr-config --ldflags' failed])
125    fi
126    AC_MSG_RESULT([$STSW_APR_LDFLAGS])
127
128    AC_MSG_CHECKING([for APR includes])
129    STSW_APR_INCLUDES=`$apr_config --includes`
130    if test $? -ne 0; then
131        AC_MSG_RESULT([failed])
132        AC_MSG_ERROR(['apr-config --includes' failed])
133    fi
134    AC_MSG_RESULT([$STSW_APR_INCLUDES])
135
136    AC_MSG_CHECKING([for APR LIBS])
137    STSW_APR_LIBS=`$apr_config --link-ld`
138    if test $? -ne 0; then
139        AC_MSG_RESULT([failed])
140        AC_MSG_ERROR(['apr-config --link-ld' failed])
141    fi
142    AC_MSG_RESULT([$STSW_APR_LIBS])
143
144    # substitute the variables so that Makefiles can selectively
145    # enable the flags
146
147    AC_SUBST([STSW_APR_CPPFLAGS])
148    AC_SUBST([STSW_APR_CFLAGS])
149    AC_SUBST([STSW_APR_LDFLAGS])
150    AC_SUBST([STSW_APR_INCLUDES])
151    AC_SUBST([STSW_APR_LIBS])
152
153  ])
Note: See TracBrowser for help on using the repository browser.