summaryrefslogtreecommitdiffstats
path: root/m4/mysql.m4
diff options
context:
space:
mode:
authorGravatar Edward Rudd 2003-12-23 19:49:56 +0000
committerGravatar Edward Rudd 2003-12-23 19:49:56 +0000
commitab1ac8ba7570005c169e7aa772762b55d354e07d (patch)
treea4e8d712b5dbf4b5edbb7bd89edc1fa08e40a332 /m4/mysql.m4
parentf89b2cced3608b248cb02b2e48907dcae07e8bbe (diff)
update autoconf scripts to check MySQL..1.91
moved autoconf DEFUN macros to m4 subdirectory autogen.sh calls aclocal to include m4 directory. merged in changes from 1.19b1 fixed log_sql_merge_config bug in 1.19b1 release 1.91
Diffstat (limited to 'm4/mysql.m4')
-rw-r--r--m4/mysql.m464
1 files changed, 64 insertions, 0 deletions
diff --git a/m4/mysql.m4 b/m4/mysql.m4
new file mode 100644
index 0000000..c4c4a3b
--- /dev/null
+++ b/m4/mysql.m4
@@ -0,0 +1,64 @@
1dnl CHECK_PATH_MYSQL([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUNT]])
2dnl Check for MySQL Libs
3dnl
4AC_DEFUN(CHECK_PATH_MYSQL,
5[dnl
6AC_ARG_WITH(
7 mysql,
8 [AC_HELP_STRING([--with-mysql],[Path to MySQL client library])],
9 mysql_prefix="$withval",
10
11 )
12AC_ARG_ENABLE(
13 mysqltest,
14 [AC_HELP_STRING([--disble-mysqltest],[Do not try to compile and run mysql test program])],
15 ,
16 enable_apachetest=yes)
17
18 AC_REQUIRE([AC_CANONICAL_TARGET])
19 ac_save_CFLAGS=$CFLAGS
20 ac_save_LDFLAGS=$LDFLAGS
21 if test "x$mysql_prefix" != "x" && test "x$mysql_prefix" != "xyes"; then
22 MYSQL_LDFLAGS="-L${mysql_prefix}/lib -L${mysql_prefix}/lib/mysql -L${mysql_prefix}/mysql/lib"
23 MYSQL_CFLAGS="-I${mysql_prefix}/include -I${mysql_prefix}/include/mysql -I${mysql_prefix}/mysql/include"
24 else
25 MYSQL_LDFLAGS="-L/usr/local/mysql/lib -L/usr/lib/mysql -L/usr/mysql/lib -L/usr/local/lib/mysql -L/usr/local/mysql/lib/mysql -L/usr/mysql/lib/mysql"
26 MYSQL_CFLAGS="-I/usr/local/mysql/include -I/usr/include/mysql -I/usr/mysql/include -I/usr/local/include/mysql -I/usr/local/mysql/include/mysql -I/usr/mysql/include/mysql"
27 fi
28 CFLAGS="$CFLAGS $MYSQL_CFLAGS"
29 LDFLAGS="$LDFLAGS $MYSQL_LDFLAGS"
30 AC_CHECK_LIB(m, floor)
31 AC_CHECK_LIB(z, gzclose)
32 with_mysql="yes"
33 AC_DEFINE(WITH_MYSQL,,[with mysql])
34 AC_CHECK_LIB(mysqlclient, mysql_init, ,
35 [AC_MSG_ERROR(libmysqlclient is needed for MySQL support)])
36 MYSQL_LIBS=$LIBS
37 AC_CHECK_FUNCS(mysql_real_escape_string)
38 AC_MSG_CHECKING(whether mysql clients can run)
39 AC_TRY_RUN([
40 #include <stdio.h>
41 #include <mysql.h>
42 int main(void)
43 {
44 MYSQL *a = mysql_init(NULL);
45 return 0;
46 }
47 ], , no_mysql=yes,[echo $ac_n "cross compiling; assumed OK.... $ac_c"])
48 CFLAGS=$ac_save_CFLAGS
49 LDFLAGS=$ac_save_LDFLAGS
50 if test "x$no_mysql" = x; then
51 AC_MSG_RESULT(yes)
52 ifelse([$1], , :, [$1])
53 else
54 AC_MSG_RESULT(no)
55 echo "*** MySQL could not be found ***"
56 MYSQL_CFLAGS=""
57 MYSQL_LDFLAGS=""
58 MYSQL_LIBS=""
59 ifelse([$2], , :, [$2])
60 fi
61 AC_SUBST(MYSQL_LDFLAGS)
62 AC_SUBST(MYSQL_CFLAGS)
63 AC_SUBST(MYSQL_LIBS)
64])