1
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
2
dnl Licensed to the Apache Software Foundation (ASF) under one or more
3
dnl contributor license agreements. See the NOTICE file distributed with
4
dnl this work for additional information regarding copyright ownership.
5
dnl The ASF licenses this file to You under the Apache License, Version 2.0
6
dnl (the "License"); you may not use this file except in compliance with
7
dnl the License. You may obtain a copy of the License at
9
9
dnl http://www.apache.org/licenses/LICENSE-2.0
24
24
AC_DEFUN([APU_CHECK_DBD], [
27
AC_ARG_WITH([pgsql], [
28
--with-pgsql=DIR specify PostgreSQL location
28
APR_HELP_STRING([--with-pgsql=DIR], [specify PostgreSQL location]),
31
31
if test "$withval" = "yes"; then
32
32
AC_CHECK_HEADERS(libpq-fe.h, AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1]))
78
78
AC_DEFUN([APU_CHECK_DBD_MYSQL], [
81
AC_CHECK_FILES([dbd/apr_dbd_mysql.c],[
82
AC_ARG_WITH([mysql], [
83
--with-mysql=DIR **** SEE INSTALL.MySQL ****
86
if test "$withval" = "yes"; then
87
old_cppflags="$CPPFLAGS"
88
old_ldflags="$LDFLAGS"
90
AC_PATH_PROG([MYSQL_CONFIG],[mysql_config])
91
if test "x$MYSQL_CONFIG" != 'x'; then
92
mysql_CPPFLAGS="`$MYSQL_CONFIG --include`"
93
mysql_LDFLAGS="`$MYSQL_CONFIG --libs_r`"
95
APR_ADDTO(CPPFLAGS, [$mysql_CPPFLAGS])
96
APR_ADDTO(LDFLAGS, [$mysql_LDFLAGS])
99
AC_CHECK_HEADERS(mysql.h, AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]))
100
if test "$apu_have_mysql" = "0"; then
101
AC_CHECK_HEADERS(mysql/mysql.h, AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]))
103
if test "x$MYSQL_CONFIG" != 'x'; then
104
APR_ADDTO(APRUTIL_INCLUDES, [$mysql_CPPFLAGS])
105
APR_ADDTO(APRUTIL_LDFLAGS, [$mysql_LDFLAGS])
109
CPPFLAGS="$old_cppflags"
110
LDFLAGS="$old_ldflags"
111
elif test "$withval" = "no"; then
114
old_cppflags="$CPPFLAGS"
115
old_ldflags="$LDFLAGS"
117
AC_PATH_PROG([MYSQL_CONFIG],[mysql_config],,[$withval/bin])
118
if test "x$MYSQL_CONFIG" != 'x'; then
119
mysql_CPPFLAGS="`$MYSQL_CONFIG --include`"
120
mysql_LDFLAGS="`$MYSQL_CONFIG --libs_r`"
122
mysql_CPPFLAGS="-I$withval/include"
123
mysql_LDFLAGS="-L$withval/lib "
126
APR_ADDTO(CPPFLAGS, [$mysql_CPPFLAGS])
127
APR_ADDTO(LDFLAGS, [$mysql_LDFLAGS])
129
AC_MSG_NOTICE(checking for mysql in $withval)
130
AC_CHECK_HEADERS(mysql.h, AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]))
131
if test "$apu_have_mysql" != "0"; then
132
APR_ADDTO(APRUTIL_INCLUDES, [$mysql_CPPFLAGS])
133
APR_ADDTO(APRUTIL_LDFLAGS, [$mysql_LDFLAGS])
136
if test "$apu_have_mysql" != "1"; then
137
AC_CHECK_HEADERS(mysql/mysql.h, AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]))
138
if test "$apu_have_mysql" != "0"; then
139
APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include/mysql])
140
APR_ADDTO(APRUTIL_LDFLAGS, [-L$withval/lib])
144
CPPFLAGS="$old_cppflags"
145
LDFLAGS="$old_ldflags"
82
APR_HELP_STRING([--with-mysql=DIR], [specify MySQL location (disabled by default)]),
85
if test "$withval" = "yes"; then
150
86
old_cppflags="$CPPFLAGS"
151
87
old_ldflags="$LDFLAGS"
162
98
AC_CHECK_HEADERS(mysql.h, AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]))
99
if test "$apu_have_mysql" = "0"; then
100
AC_CHECK_HEADERS(mysql/mysql.h, AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]))
102
if test "x$MYSQL_CONFIG" != 'x'; then
103
APR_ADDTO(APRUTIL_INCLUDES, [$mysql_CPPFLAGS])
104
APR_ADDTO(APRUTIL_LDFLAGS, [$mysql_LDFLAGS])
108
CPPFLAGS="$old_cppflags"
109
LDFLAGS="$old_ldflags"
110
elif test "$withval" = "no"; then
113
old_cppflags="$CPPFLAGS"
114
old_ldflags="$LDFLAGS"
116
AC_PATH_PROG([MYSQL_CONFIG],[mysql_config],,[$withval/bin])
117
if test "x$MYSQL_CONFIG" != 'x'; then
118
mysql_CPPFLAGS="`$MYSQL_CONFIG --include`"
119
mysql_LDFLAGS="`$MYSQL_CONFIG --libs_r`"
121
mysql_CPPFLAGS="-I$withval/include"
122
mysql_LDFLAGS="-L$withval/lib "
125
APR_ADDTO(CPPFLAGS, [$mysql_CPPFLAGS])
126
APR_ADDTO(LDFLAGS, [$mysql_LDFLAGS])
128
AC_MSG_NOTICE(checking for mysql in $withval)
129
AC_CHECK_HEADERS(mysql.h, AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]))
164
130
if test "$apu_have_mysql" != "0"; then
165
if test "x$MYSQL_CONFIG" != 'x'; then
166
APR_ADDTO(APRUTIL_INCLUDES, [$mysql_CPPFLAGS])
167
APR_ADDTO(APRUTIL_LDFLAGS, [$mysql_LDFLAGS])
131
APR_ADDTO(APRUTIL_INCLUDES, [$mysql_CPPFLAGS])
132
APR_ADDTO(APRUTIL_LDFLAGS, [$mysql_LDFLAGS])
135
if test "$apu_have_mysql" != "1"; then
136
AC_CHECK_HEADERS(mysql/mysql.h, AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]))
137
if test "$apu_have_mysql" != "0"; then
138
APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include/mysql])
139
APR_ADDTO(APRUTIL_LDFLAGS, [-L$withval/lib])
171
143
CPPFLAGS="$old_cppflags"
172
144
LDFLAGS="$old_ldflags"
176
148
AC_SUBST(apu_have_mysql)