Allow MySQL to be compiled against extern mysqlclient library

This commit is contained in:
Sascha Schumann 2000-03-26 19:46:11 +00:00
parent 8419dc332b
commit 491792e0d0
2 changed files with 36 additions and 10 deletions

View File

@ -6,10 +6,10 @@ VPATH = @srcdir@
LTLIBRARY_NAME = libmysql.la
LTLIBRARY_SOURCES = php_mysql.c
LTLIBRARY_LIBADD = libmysql/libmysql_client.la
LTLIBRARY_LIBADD = $(MYSQL_LIBADD)
LTLIBRARY_SHARED_NAME = mysql.la
LTLIBRARY_SHARED_LIBADD = $(MYSQL_LFLAGS) -lmysqlclient
SUBDIRS = libmysql
SUBDIRS = $(MYSQL_SUBDIRS)
include $(topsrcdir)/build/ltlib.mk

View File

@ -3,8 +3,6 @@ dnl $Id$
sinclude(ext/mysql/libmysql/acinclude.m4)
sinclude(ext/mysql/libmysql/mysql.m4)
AC_ARG_WITH(mysql,[],[enable_mysql=$withval])
AC_DEFUN(PHP_MYSQL_SOCK,[
AC_MSG_CHECKING(for MySQL UNIX socket)
MYSQL_SOCK=/tmp/mysql.sock
@ -22,18 +20,46 @@ AC_DEFUN(PHP_MYSQL_SOCK,[
])
AC_MSG_CHECKING(for MySQL support)
AC_ARG_ENABLE(mysql,
[ --disable-mysql Disable embedded MySQL support],[
PHP_MYSQL=$enableval
AC_ARG_WITH(mysql,
[ --with-mysql[=DIR] Include MySQL support. DIR is the MySQL base
directory. If unspecified, the bundled MySQL library
will be used.],[
PHP_MYSQL=$withval
],[
PHP_MYSQL=yes
])
AC_MSG_RESULT($PHP_MYSQL)
if test "$PHP_MYSQL" = "yes"; then
PHP_MYSQL_SOCK
MYSQL_CHECKS
MYSQL_LIBADD=libmysql/libmysql_client.la
MYSQL_SUBDIRS=libmysql
PHP_SUBST(MYSQL_LIBADD)
PHP_SUBST(MYSQL_SUBDIRS)
AC_ADD_INCLUDE(${ext_src_base}libmysql)
elif test "$PHP_MYSQL" != "no"; then
for i in $PHP_MYSQL; do
if test -r $i/include/mysql/mysql.h; then
MYSQL_DIR=$i
MYSQL_INC_DIR=$i/include/mysql
elif test -r $i/include/mysql.h; then
MYSQL_DIR=$i
MYSQL_INC_DIR=$i/include
fi
done
if test -z "$MYSQL_DIR"; then
AC_MSG_ERROR(Cannot find header files under $PHP_MYSQL)
fi
AC_ADD_LIBPATH($MYSQL_DIR/lib/mysql)
AC_ADD_LIBRARY(mysqlclient)
AC_ADD_INCLUDE($MYSQL_INC_DIR)
fi
if test "$PHP_MYSQL" != "no"; then
PHP_EXTENSION(mysql)
AC_DEFINE(HAVE_MYSQL, 1, [Whether you have MySQL])
AC_ADD_INCLUDE(${ext_src_base}libmysql)
MYSQL_CHECKS
PHP_MYSQL_SOCK
fi