~ubuntu-branches/ubuntu/feisty/apache2/feisty

« back to all changes in this revision

Viewing changes to srclib/apr-util/build/dbd.m4

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Barth
  • Date: 2006-12-09 21:05:45 UTC
  • mfrom: (0.6.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20061209210545-h70s0xaqc2v8vqr2
Tags: 2.2.3-3.2
* Non-maintainer upload.
* 043_ajp_connection_reuse: Patch from upstream Bugzilla, fixing a critical
  issue with regard to connection reuse in mod_proxy_ajp.
  Closes: #396265

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl -------------------------------------------------------- -*- autoconf -*-
 
2
dnl Copyright 2005 The Apache Software Foundation or its licensors, as
 
3
dnl applicable.
 
4
dnl
 
5
dnl Licensed under the Apache License, Version 2.0 (the "License");
 
6
dnl you may not use this file except in compliance with the License.
 
7
dnl You may obtain a copy of the License at
 
8
dnl
 
9
dnl     http://www.apache.org/licenses/LICENSE-2.0
 
10
dnl
 
11
dnl Unless required by applicable law or agreed to in writing, software
 
12
dnl distributed under the License is distributed on an "AS IS" BASIS,
 
13
dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
14
dnl See the License for the specific language governing permissions and
 
15
dnl limitations under the License.
 
16
 
 
17
dnl
 
18
dnl DBD module
 
19
dnl
 
20
 
 
21
dnl
 
22
dnl APU_CHECK_DBD: compile backends for apr_dbd.
 
23
dnl
 
24
AC_DEFUN([APU_CHECK_DBD], [
 
25
  apu_have_pgsql=0
 
26
 
 
27
  AC_ARG_WITH([pgsql], [
 
28
  --with-pgsql=DIR          specify PostgreSQL location
 
29
  ], [
 
30
    apu_have_pgsql=0
 
31
    if test "$withval" = "yes"; then
 
32
      AC_CHECK_HEADER(libpq-fe.h, AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1]))
 
33
      if test "$apu_have_pgsql" == "0"; then
 
34
        AC_CHECK_HEADER(postgresql/libpq-fe.h, AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1]))
 
35
        if test "$apu_have_pgsql" != "0"; then
 
36
          APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include/postgresql])
 
37
        fi
 
38
      fi
 
39
    elif test "$withval" = "no"; then
 
40
      apu_have_pgsql=0
 
41
    else
 
42
      CPPFLAGS="-I$withval/include"
 
43
      LIBS="-L$withval/lib "
 
44
 
 
45
      AC_MSG_NOTICE(checking for pgsql in $withval)
 
46
      AC_CHECK_HEADER(libpq-fe.h, AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1]))
 
47
      if test "$apu_have_pgsql" != "0"; then
 
48
        APR_ADDTO(APRUTIL_LDFLAGS, [-L$withval/lib])
 
49
        APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include])
 
50
      fi
 
51
      if test "$apu_have_pgsql" != "1"; then
 
52
        AC_CHECK_HEADER(postgresql/libpq-fe.h, AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1]))
 
53
        if test "$apu_have_pgsql" != "0"; then
 
54
          APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include/postgresql])
 
55
          APR_ADDTO(APRUTIL_LDFLAGS, [-L$withval/lib])
 
56
        fi
 
57
      fi
 
58
    fi
 
59
  ], [
 
60
    apu_have_pgsql=0
 
61
    AC_CHECK_HEADER(libpq-fe.h, AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1]))
 
62
  ])
 
63
  AC_SUBST(apu_have_pgsql)
 
64
  dnl Since we have already done the AC_CHECK_LIB tests, if we have it, 
 
65
  dnl we know the library is there.
 
66
  if test "$apu_have_pgsql" = "1"; then
 
67
    APR_ADDTO(APRUTIL_EXPORT_LIBS,[-lpq])
 
68
    APR_ADDTO(APRUTIL_LIBS,[-lpq])
 
69
  fi
 
70
])
 
71
dnl
 
72
AC_DEFUN([APU_CHECK_DBD_MYSQL], [
 
73
  apu_have_mysql=0
 
74
 
 
75
  AC_ARG_WITH([mysql], [
 
76
  --with-mysql=DIR          **** SEE INSTALL.MySQL ****
 
77
  ], [
 
78
    apu_have_mysql=0
 
79
    if test "$withval" = "yes"; then
 
80
      AC_CHECK_HEADER(mysql.h, AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]))
 
81
      if test "$apu_have_mysql" == "0"; then
 
82
        AC_CHECK_HEADER(mysql/mysql.h, AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]))
 
83
        if test "$apu_have_mysql" != "0"; then
 
84
          APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include/myql])
 
85
        fi
 
86
      fi
 
87
    elif test "$withval" = "no"; then
 
88
      apu_have_mysql=0
 
89
    else
 
90
      CPPFLAGS="-I$withval/include"
 
91
      LIBS="-L$withval/lib "
 
92
 
 
93
      AC_MSG_NOTICE(checking for mysql in $withval)
 
94
      AC_CHECK_HEADER(mysql.h, AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]))
 
95
      if test "$apu_have_mysql" != "0"; then
 
96
        APR_ADDTO(APRUTIL_LDFLAGS, [-L$withval/lib])
 
97
        APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include])
 
98
      fi
 
99
 
 
100
      if test "$apu_have_mysql" != "1"; then
 
101
        AC_CHECK_HEADER(mysql/mysql.h, AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]))
 
102
        if test "$apu_have_mysql" != "0"; then
 
103
          APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include/mysql])
 
104
          APR_ADDTO(APRUTIL_LDFLAGS, [-L$withval/lib])
 
105
        fi
 
106
      fi
 
107
    fi
 
108
  ], [
 
109
    apu_have_mysql=0
 
110
    AC_CHECK_HEADER(mysql.h, AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]))
 
111
  ])
 
112
 
 
113
  AC_SUBST(apu_have_mysql)
 
114
 
 
115
  dnl Since we have already done the AC_CHECK_LIB tests, if we have it, 
 
116
  dnl we know the library is there.
 
117
  if test "$apu_have_mysql" = "1"; then
 
118
    APR_ADDTO(APRUTIL_EXPORT_LIBS,[-lmysqlclient_r])
 
119
    APR_ADDTO(APRUTIL_LIBS,[-lmysqlclient_r])
 
120
  fi
 
121
])
 
122
dnl
 
123
AC_DEFUN([APU_CHECK_DBD_SQLITE3], [
 
124
  apu_have_sqlite3=0
 
125
 
 
126
  AC_ARG_WITH([sqlite3], [
 
127
  --with-sqlite3=DIR         
 
128
  ], [
 
129
    apu_have_sqlite3=0
 
130
    if test "$withval" = "yes"; then
 
131
      AC_CHECK_HEADER(sqlite3.h, AC_CHECK_LIB(sqlite3, sqlite3_open, [apu_have_sqlite3=1]))
 
132
    elif test "$withval" = "no"; then
 
133
      apu_have_sqlite3=0
 
134
    else
 
135
      CPPFLAGS="-I$withval/include"
 
136
      LIBS="-L$withval/lib "
 
137
 
 
138
      AC_MSG_NOTICE(checking for sqlite3 in $withval)
 
139
      AC_CHECK_HEADER(sqlite3.h, AC_CHECK_LIB(sqlite3, sqlite3_open, [apu_have_sqlite3=1]))
 
140
      if test "$apu_have_sqlite3" != "0"; then
 
141
        APR_ADDTO(APRUTIL_LDFLAGS, [-L$withval/lib])
 
142
        APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include])
 
143
      fi
 
144
    fi
 
145
  ], [
 
146
    apu_have_sqlite3=0
 
147
    AC_CHECK_HEADER(sqlite3.h, AC_CHECK_LIB(sqlite3, sqlite3_open, [apu_have_sqlite3=1]))
 
148
  ])
 
149
 
 
150
  AC_SUBST(apu_have_sqlite3)
 
151
 
 
152
  dnl Since we have already done the AC_CHECK_LIB tests, if we have it, 
 
153
  dnl we know the library is there.
 
154
  if test "$apu_have_sqlite3" = "1"; then
 
155
    APR_ADDTO(APRUTIL_EXPORT_LIBS,[-lsqlite3])
 
156
    APR_ADDTO(APRUTIL_LIBS,[-lsqlite3])
 
157
  fi
 
158
])
 
159
dnl
 
160
AC_DEFUN([APU_CHECK_DBD_SQLITE2], [
 
161
  apu_have_sqlite2=0
 
162
 
 
163
  AC_ARG_WITH([sqlite2], [
 
164
  --with-sqlite2=DIR         
 
165
  ], [
 
166
    apu_have_sqlite2=0
 
167
    if test "$withval" = "yes"; then
 
168
      AC_CHECK_HEADER(sqlite.h, AC_CHECK_LIB(sqlite, sqlite_open, [apu_have_sqlite2=1]))
 
169
    elif test "$withval" = "no"; then
 
170
      apu_have_sqlite2=0
 
171
    else
 
172
      CPPFLAGS="-I$withval/include"
 
173
      LIBS="-L$withval/lib "
 
174
 
 
175
      AC_MSG_NOTICE(checking for sqlite2 in $withval)
 
176
      AC_CHECK_HEADER(sqlite.h, AC_CHECK_LIB(sqlite, sqlite_open, [apu_have_sqlite2=1]))
 
177
      if test "$apu_have_sqlite2" != "0"; then
 
178
        APR_ADDTO(APRUTIL_LDFLAGS, [-L$withval/lib])
 
179
        APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include])
 
180
      fi
 
181
    fi
 
182
  ], [
 
183
    apu_have_sqlite2=0
 
184
    AC_CHECK_HEADER(sqlite.h, AC_CHECK_LIB(sqlite, sqlite_open, [apu_have_sqlite2=1]))
 
185
  ])
 
186
 
 
187
  AC_SUBST(apu_have_sqlite2)
 
188
 
 
189
  dnl Since we have already done the AC_CHECK_LIB tests, if we have it, 
 
190
  dnl we know the library is there.
 
191
  if test "$apu_have_sqlite2" = "1"; then
 
192
    APR_ADDTO(APRUTIL_EXPORT_LIBS,[-lsqlite])
 
193
    APR_ADDTO(APRUTIL_LIBS,[-lsqlite])
 
194
  fi
 
195
])
 
196
dnl
 
197