1
dnl -------------------------------------------------------- -*- autoconf -*-
2
dnl Copyright 2005 The Apache Software Foundation or its licensors, as
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
9
dnl http://www.apache.org/licenses/LICENSE-2.0
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.
22
dnl APU_CHECK_DBD: compile backends for apr_dbd.
24
AC_DEFUN([APU_CHECK_DBD], [
27
AC_ARG_WITH([pgsql], [
28
--with-pgsql=DIR specify PostgreSQL location
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])
39
elif test "$withval" = "no"; then
42
CPPFLAGS="-I$withval/include"
43
LIBS="-L$withval/lib "
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])
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])
61
AC_CHECK_HEADER(libpq-fe.h, AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1]))
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])
72
AC_DEFUN([APU_CHECK_DBD_MYSQL], [
75
AC_ARG_WITH([mysql], [
76
--with-mysql=DIR **** SEE INSTALL.MySQL ****
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])
87
elif test "$withval" = "no"; then
90
CPPFLAGS="-I$withval/include"
91
LIBS="-L$withval/lib "
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])
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])
110
AC_CHECK_HEADER(mysql.h, AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]))
113
AC_SUBST(apu_have_mysql)
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])
123
AC_DEFUN([APU_CHECK_DBD_SQLITE3], [
126
AC_ARG_WITH([sqlite3], [
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
135
CPPFLAGS="-I$withval/include"
136
LIBS="-L$withval/lib "
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])
147
AC_CHECK_HEADER(sqlite3.h, AC_CHECK_LIB(sqlite3, sqlite3_open, [apu_have_sqlite3=1]))
150
AC_SUBST(apu_have_sqlite3)
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])
160
AC_DEFUN([APU_CHECK_DBD_SQLITE2], [
163
AC_ARG_WITH([sqlite2], [
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
172
CPPFLAGS="-I$withval/include"
173
LIBS="-L$withval/lib "
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])
184
AC_CHECK_HEADER(sqlite.h, AC_CHECK_LIB(sqlite, sqlite_open, [apu_have_sqlite2=1]))
187
AC_SUBST(apu_have_sqlite2)
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])