diff options
author | foobar <sniper@php.net> | 2003-03-19 23:52:45 +0000 |
---|---|---|
committer | foobar <sniper@php.net> | 2003-03-19 23:52:45 +0000 |
commit | 6a6e0151c594793514ae83daf7e0358d6983722b (patch) | |
tree | 7ea300fc135092afd36b220fca0a107aa77a3503 /ext/mysqli/config.m4 | |
parent | 9ff622f2684b65e9ea1010b146853231cae95540 (diff) | |
download | php-git-6a6e0151c594793514ae83daf7e0358d6983722b.tar.gz |
Better config.m4..
Diffstat (limited to 'ext/mysqli/config.m4')
-rw-r--r-- | ext/mysqli/config.m4 | 65 |
1 files changed, 26 insertions, 39 deletions
diff --git a/ext/mysqli/config.m4 b/ext/mysqli/config.m4 index 8618cb24ac..c8ec07ef67 100644 --- a/ext/mysqli/config.m4 +++ b/ext/mysqli/config.m4 @@ -1,58 +1,45 @@ +dnl dnl $Id$ dnl config.m4 for extension mysqli -dnl Comments in this file start with the string 'dnl'. -dnl Remove where necessary. This file will not work -dnl without editing. - -dnl If your extension references something external, use with: - -PHP_ARG_WITH(mysqli, for mysqli support, -[ --with-mysqli[=DIR] Include mysqli support]) +PHP_ARG_WITH(mysqli, for MySQLi support, +[ --with-mysqli[=FILE] Include MySQLi support. FILE is the optional + pathname to mysql-config.]) if test "$PHP_MYSQLI" != "no"; then - SEARCH_PATH="/usr/local /usr" # you might want to change this - if test -r $PHP_MYSQLI/; then # path given as parameter - SEARCH_PATH=$PHP_MYSQLI - else - AC_MSG_CHECKING([for mysqli files in default path]) + if test "$PHP_MYSQL" = "yes"; then + AC_MSG_ERROR([--with-mysql (using bundled libs) can not be used together with --with-mysqli.]) fi - for i in $SEARCH_PATH ; do - if test -r $i/include/mysql/mysql.h; then - MYSQLI_DIR=$i/lib/mysql - MYSQLI_INC_DIR=$i/include/mysql - AC_MSG_RESULT(found in $i) - elif test -r $i/include/mysql.h; then - MYSQLI_DIR=$i/lib - MYSQLI_INC_DIR=$i/include - AC_MSG_RESULT(found in $i) - fi - done + if test "$PHP_MYSQLI" = "yes"; then + MYSQL_CONFIG=`$php_shtool path mysql_config` + else + MYSQL_CONFIG=$PHP_MYSQLI + fi - if test -z "$MYSQLI_DIR"; then - AC_MSG_RESULT([not found]) - AC_MSG_ERROR([Please reinstall the mysqli distribution]) + if test -x "$MYSQL_CONFIG" && $MYSQL_CONFIG --libs > /dev/null 2>&1; then + MYSQLI_INCLINE=`$MYSQL_CONFIG --cflags | sed -e "s/'//g"` + MYSQLI_LIBLINE=`$MYSQL_CONFIG --libs | sed -e "s/'//g"` + else + AC_MSG_RESULT([mysql-config not found]) + AC_MSG_ERROR([Please reinstall the mysql distribution]) fi - # --with-mysqli -> add include path - PHP_ADD_INCLUDE($MYSQLI_INC_DIR) - - # --with-mysqli -> check for lib and symbol presence - LIBNAME=mysqlclient - LIBSYMBOL=mysql_bind_param - - PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL, + dnl + dnl Check the library + dnl + PHP_CHECK_LIBRARY(mysqlclient, mysql_bind_param, [ - PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $MYSQLI_DIR, MYSQLI_SHARED_LIBADD) + PHP_EVAL_INCLINE($MYSQLI_INCLINE) + PHP_EVAL_LIBLINE($MYSQLI_LIBLINE, MYSQLI_SHARED_LIBADD) AC_DEFINE(HAVE_MYSQLILIB,1,[ ]) ],[ - AC_MSG_ERROR([wrong mysql library version or lib not found]) + AC_MSG_ERROR([wrong mysql library version or lib not found. Check config.log for more information.]) ],[ - `$PHP_MYSQLI/bin/mysql_config --libs | sed -e "s/'//g"` + $MYSQLI_LIBLINE ]) - PHP_SUBST(MYSQLI_SHARED_LIBADD) + PHP_SUBST(MYSQLI_SHARED_LIBADD) PHP_NEW_EXTENSION(mysqli, mysqli.c mysqli_api.c mysqli_nonapi.c mysqli_fe.c mysqli_profiler.c mysqli_profiler_com.c, $ext_shared) fi |