~xdv/mod-transform/trunk

« back to all changes in this revision

Viewing changes to m4/apr.m4

  • Committer: Laurence Rowe
  • Date: 2010-07-30 20:11:13 UTC
  • mfrom: (84.1.1 mod-transform-clean)
  • Revision ID: laurence@lrowe.co.uk-20100730201113-2epmrdgj2n1vul12
merge in the externals

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl CHECK_APR([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
 
2
dnl Test for APR
 
3
 
 
4
AC_DEFUN([CHECK_APR],
 
5
[dnl
 
6
AC_ARG_WITH(
 
7
    apr,
 
8
    [AC_HELP_STRING([--with-apr=PATH],[Path to apr-config or apr-1-config])],
 
9
    apr_prefix="$withval",
 
10
    apr_prefix=""
 
11
    )
 
12
 
 
13
    if test -x "$apr_prefix" -a ! -d "$apr_prefix"; then
 
14
        APR_CONFIG=$apr_prefix
 
15
        AC_MSG_NOTICE([Using APR Config: $apr_prefix])
 
16
    else
 
17
        test_paths="$apr_prefix:$apr_prefix/bin:$apr_prefix/sbin"
 
18
        test_paths="${test_paths}:/usr/bin:/usr/sbin"
 
19
        AC_PATH_PROGS(APR_CONFIG, [apr-1-config apr-config], no, [$test_paths])
 
20
    fi
 
21
    if test "$APR_CONFIG" = "no"; then
 
22
        AC_MSG_ERROR([*** apr-config could not be found!])
 
23
        AC_MSG_ERROR([*** Use the --with-apr option with the full path to apr-config/apr-1-config])
 
24
    else
 
25
        APR_INCLUDES=`$APR_CONFIG --includes 2>/dev/null`
 
26
        APR_INCLUDEDIR=`$APR_CONFIG --includedir 2>/dev/null`
 
27
        APR_LDFLAGS=`$APR_CONFIG --link-ld 2>/dev/null`
 
28
        APR_LIBS=`$APR_CONFIG --libs 2>/dev/null`
 
29
        APR_LIBTOOL=`$APR_CONFIG --link-libtool 2>/dev/null`
 
30
        APR_CPPFLAGS=`$APR_CONFIG --cppflags 2>/dev/null`
 
31
        APR_CFLAGS=`$APR_CONFIG --cflags 2>/dev/null`
 
32
        APR_VERSION=`$APR_CONFIG --version 2>/dev/null`
 
33
        AC_SUBST(APR_CONFIG)
 
34
        AC_SUBST(APR_INCLUDES)
 
35
        AC_SUBST(APR_INCLUDEDIR)
 
36
        AC_SUBST(APR_LDFLAGS)
 
37
        AC_SUBST(APR_LIBS)
 
38
        AC_SUBST(APR_LIBTOOL)
 
39
        AC_SUBST(APR_CPPFLAGS)
 
40
        AC_SUBST(APR_CFLAGS)
 
41
        AC_SUBST(APR_VERSION)
 
42
    fi
 
43
])
 
44
 
 
45
dnl CHECK_APU([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
 
46
dnl Test for APR-Util
 
47
 
 
48
AC_DEFUN([CHECK_APU],
 
49
[dnl
 
50
AC_ARG_WITH(
 
51
    apr-util,
 
52
    [AC_HELP_STRING([--with-apr-util=PATH],[Path to apu-config or apu-1-config])],
 
53
    apu_prefix="$withval",
 
54
    apu_prefix=""
 
55
    )
 
56
 
 
57
    if test -x "$apu_prefix" -a ! -d "$apu_prefix"; then
 
58
        APU_CONFIG=$apu_prefix
 
59
        AC_MSG_NOTICE([Using APU Config: $apu_prefix])
 
60
    else
 
61
        test_paths="$apu_prefix:$apu_prefix/bin:$apu_prefix/sbin"
 
62
        test_paths="${test_paths}:/usr/bin:/usr/sbin"
 
63
        AC_PATH_PROGS(APU_CONFIG, [apu-1-config apu-config], no, [$test_paths])
 
64
    fi
 
65
    if test "$APU_CONFIG" = "no"; then
 
66
        AC_MSG_ERROR([*** apu-config could not be found!])
 
67
        AC_MSG_ERROR([*** Use the --with-apr-util option with the full path to apu-config/apu-1-config])
 
68
    else
 
69
        APU_INCLUDES=`$APU_CONFIG --includes 2>/dev/null`
 
70
        APU_INCLUDEDIR=`$APU_CONFIG --includedir 2>/dev/null`
 
71
        APU_LDFLAGS=`$APU_CONFIG --link-ld 2>/dev/null`
 
72
        APU_LIBS=`$APU_CONFIG --libs 2>/dev/null`
 
73
        APU_LIBTOOL=`$APU_CONFIG --link-libtool 2>/dev/null`
 
74
        APU_VERSION=`$APU_CONFIG --version 2>/dev/null`
 
75
        AC_SUBST(APU_CONFIG)
 
76
        AC_SUBST(APU_INCLUDES)
 
77
        AC_SUBST(APU_INCLUDEDIR)
 
78
        AC_SUBST(APU_LDFLAGS)
 
79
        AC_SUBST(APU_LIBS)
 
80
        AC_SUBST(APU_LIBTOOL)
 
81
        AC_SUBST(APU_VERSION)
 
82
    fi
 
83
])
 
84
 
 
85
dnl CHECK_APR_HEADER(HEADER-FILE [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
 
86
dnl Test if the given APR header file exists
 
87
 
 
88
AC_DEFUN([CHECK_APR_HEADERS],
 
89
[dnl
 
90
    CFLAGS="$ac_save_CFLAGS $APR_CPPFLAGS $APR_CFLAGS $APR_INCLUDES"
 
91
    AC_CHECK_HEADERS([$1],[$2],[$3],
 
92
    [#include "apr.h"
 
93
    ])
 
94
    CFLAGS="$ac_save_CFLAGS"
 
95
])
 
96
 
 
97
dnl CHECK_APR_HEADER(HEADER-FILE [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
 
98
dnl Test if the given APR-UTIL header file exists
 
99
 
 
100
AC_DEFUN([CHECK_APU_HEADERS],
 
101
[dnl
 
102
    CFLAGS="$ac_save_CFLAGS $APR_CPPFLAGS $APR_CFLAGS $APR_INCLUDES $APU_INCLUDES"
 
103
    AC_CHECK_HEADERS([$1],[$2],[$3],
 
104
    [#include "apu.h"
 
105
#include "apr_pools.h"
 
106
#include "apr_lib.h"
 
107
    ])
 
108
    CFLAGS="$ac_save_CFLAGS"
 
109
])
 
110
 
 
111
dnl CHECK_APR_FUNCS(FUNC [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
 
112
dnl Test if the given APR header file exists
 
113
 
 
114
AC_DEFUN([CHECK_APR_FUNC],
 
115
[dnl
 
116
    LDFLAGS="$ac_save_LDFLAGS $APR_LDFLAGS"
 
117
    AC_CHECK_FUNCS([$1],[$2],[$3])
 
118
    LDFLAGS="$ac_save_LDFLAGS"
 
119
])
 
120
 
 
121
dnl CHECK_APR_FUNCS(FUNC [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
 
122
dnl Test if the given APR-UTIL header file exists
 
123
 
 
124
AC_DEFUN([CHECK_APU_FUNCS],
 
125
[dnl
 
126
    LDFLAGS="$ac_save_LDFLAGS $APR_LDFLAGS $APU_LDFLAGS"
 
127
    AC_CHECK_FUNCS([$1],[$2],[$3])
 
128
    LDFLAGS="$ac_save_LDFLAGS"
 
129
])