File indexing completed on 2025-08-03 08:22:02
0001
0002
0003 AC_MSG_CHECKING(for MySQL support)
0004 AC_ARG_WITH(mysql,
0005 [ --with-mysql[=DIR] Include MySQL support. DIR is the MySQL base
0006 install directory, defaults to searching through
0007 a number of common places for the MySQL files.
0008 Set DIR to "shared" to build as a dl, or "shared,DIR"
0009 to build as a dl and still specify DIR.],
0010 [
0011
0012 if test "$withval" != "no"; then
0013 if test "$withval" = "yes"; then
0014 if test -f /usr/include/mysql/mysql.h; then
0015 MYSQL_INCDIR=/usr/include/mysql
0016 if test -d /usr/lib/mysql; then
0017 MYSQL_LIBDIR=/usr/lib/mysql
0018 else
0019 MYSQL_LIBDIR=/usr/lib
0020 fi
0021 elif test -f /usr/include/mysql.h; then
0022 MYSQL_INCDIR=/usr/include
0023 MYSQL_LIBDIR=/usr/lib
0024 elif test -f /usr/local/include/mysql/mysql.h; then
0025 MYSQL_INCDIR=/usr/local/include/mysql
0026 MYSQL_LIBDIR=/usr/local/lib/mysql
0027 elif test -f /usr/local/include/mysql.h; then
0028 MYSQL_INCDIR=/usr/local/include
0029 MYSQL_LIBDIR=/usr/local/lib
0030 elif test -f /usr/local/mysql/include/mysql/mysql.h; then
0031 MYSQL_INCDIR=/usr/local/mysql/include/mysql
0032 MYSQL_LIBDIR=/usr/local/mysql/lib/mysql
0033 else
0034 AC_MSG_RESULT(no)
0035 AC_MSG_ERROR(Invalid MySQL directory - unable to find mysql.h)
0036 fi
0037 else
0038 if test -f $withval/include/mysql/mysql.h; then
0039 MYSQL_INCDIR=$withval/include/mysql
0040 MYSQL_LIBDIR=$withval/lib/mysql
0041 elif test -f $withval/include/mysql.h; then
0042 MYSQL_INCDIR=$withval/include
0043 MYSQL_LIBDIR=$withval/lib
0044 else
0045 AC_MSG_RESULT(no)
0046 AC_MSG_ERROR(Invalid MySQL directory - unable to find mysql.h under $withval)
0047 fi
0048 fi
0049 MYSQL_INCLUDE=-I$MYSQL_INCDIR
0050
0051 AC_DEFINE(HAVE_MYSQL)
0052 if test "$shared" = "yes"; then
0053 AC_MSG_RESULT(yes (shared))
0054 MYSQL_LFLAGS="-L$MYSQL_LIBDIR"
0055 MYSQL_SHARED="mysql.la"
0056 else
0057 AC_MSG_RESULT(yes (static))
0058 AC_ADD_LIBRARY_WITH_PATH(mysqlclient, $MYSQL_LIBDIR)
0059 AC_ADD_INCLUDE($MYSQL_INCDIR)
0060 MYSQL_STATIC="libphpext_mysql.la"
0061 fi
0062
0063
0064
0065 old_CPPFLAGS="$CPPFLAGS"
0066 CPPFLAGS="$CPPFLAGS $MYSQL_INCLUDE"
0067 AC_CHECK_HEADERS(errmsg.h mysql.h)
0068 CPPFLAGS="$old_CPPFLAGS"
0069 else
0070 AC_MSG_RESULT(no)
0071 AC_DEFINE(HAVE_MYSQL, 0)
0072 fi
0073 ],[
0074 AC_MSG_RESULT(no)
0075 ])
0076 AC_SUBST(MYSQL_STATIC)
0077 AC_SUBST(MYSQL_SHARED)
0078 AC_SUBST(MYSQL_INCLUDE)
0079 AC_SUBST(MYSQL_LFLAGS)