mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Don't assume libmysqlclient library name
By simply dropping the additional checks, in line with the general guideline of trusting the output of config scripts (this should be migrated to pkg-config though). Also drop the code for manually adding -z if mysql_config does not -- that's not our problem.
This commit is contained in:
parent
2875d0f920
commit
34dd032e4e
2 changed files with 7 additions and 50 deletions
|
@ -47,34 +47,18 @@ if test "$PHP_MYSQLI" = "yes" || test "$PHP_MYSQLI" = "mysqlnd"; then
|
|||
elif test "$PHP_MYSQLI" != "no"; then
|
||||
|
||||
MYSQL_CONFIG=$PHP_MYSQLI
|
||||
MYSQL_LIB_NAME='mysqlclient'
|
||||
MYSQL_LIB_CFG='--libs'
|
||||
|
||||
if test -x "$MYSQL_CONFIG" && $MYSQL_CONFIG $MYSQL_LIB_CFG > /dev/null 2>&1; then
|
||||
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 $MYSQL_LIB_CFG | $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
|
||||
|
||||
dnl
|
||||
dnl Check the library
|
||||
dnl
|
||||
PHP_CHECK_LIBRARY($MYSQL_LIB_NAME, mysql_set_server_option,
|
||||
[
|
||||
PHP_EVAL_INCLINE($MYSQLI_INCLINE)
|
||||
PHP_EVAL_LIBLINE($MYSQLI_LIBLINE, MYSQLI_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_MYSQLILIB, 1, [ ])
|
||||
PHP_CHECK_LIBRARY($MYSQL_LIB_NAME, mysql_set_character_set,
|
||||
[ ],[
|
||||
AC_MSG_ERROR([MySQLI doesn't support versions < 4.1.13 (for MySQL 4.1.x) and < 5.0.7 for (MySQL 5.0.x) anymore. Please update your libraries.])
|
||||
],[$MYSQLI_LIBLINE])
|
||||
],[
|
||||
AC_MSG_ERROR([wrong mysql library version or lib not found. Check config.log for more information.])
|
||||
],[
|
||||
$MYSQLI_LIBLINE
|
||||
])
|
||||
fi
|
||||
|
||||
dnl Build extension
|
||||
|
|
|
@ -58,7 +58,6 @@ if test "$PHP_PDO_MYSQL" != "no"; then
|
|||
if test "x$SED" = "x"; then
|
||||
AC_PATH_PROG(SED, sed)
|
||||
fi
|
||||
PDO_MYSQL_LIBNAME=mysqlclient
|
||||
PDO_MYSQL_LIBS=`$PDO_MYSQL_CONFIG --libs | $SED -e "s/'//g"`
|
||||
PDO_MYSQL_INCLUDE=`$PDO_MYSQL_CONFIG --cflags | $SED -e "s/'//g"`
|
||||
elif test -n "$PDO_MYSQL_DIR"; then
|
||||
|
@ -89,34 +88,8 @@ if test "$PHP_PDO_MYSQL" != "no"; then
|
|||
AC_MSG_ERROR([Unable to find your mysql installation])
|
||||
fi
|
||||
|
||||
PHP_CHECK_LIBRARY($PDO_MYSQL_LIBNAME, mysql_commit,
|
||||
[
|
||||
PHP_EVAL_INCLINE($PDO_MYSQL_INCLUDE)
|
||||
PHP_EVAL_LIBLINE($PDO_MYSQL_LIBS, PDO_MYSQL_SHARED_LIBADD)
|
||||
],[
|
||||
if test "$PHP_ZLIB_DIR" != "no"; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR, PDO_MYSQL_SHARED_LIBADD)
|
||||
PHP_CHECK_LIBRARY($PDO_MYSQL_LIBNAME, mysql_commit, [], [
|
||||
AC_MSG_ERROR([PDO_MYSQL configure failed, MySQL 4.1 needed. Please check config.log for more information.])
|
||||
], [
|
||||
-L$PHP_ZLIB_DIR/$PHP_LIBDIR -L$PDO_MYSQL_LIB_DIR
|
||||
])
|
||||
PDO_MYSQL_LIBS="$PDO_MYSQL_LIBS -L$PHP_ZLIB_DIR/$PHP_LIBDIR -lz"
|
||||
else
|
||||
PHP_ADD_LIBRARY(z,, PDO_MYSQL_SHARED_LIBADD)
|
||||
PHP_CHECK_LIBRARY($PDO_MYSQL_LIBNAME, mysql_query, [], [
|
||||
AC_MSG_ERROR([Try adding --with-zlib-dir=<DIR>. Please check config.log for more information.])
|
||||
], [
|
||||
-L$PDO_MYSQL_LIB_DIR
|
||||
])
|
||||
PDO_MYSQL_LIBS="$PDO_MYSQL_LIBS -lz"
|
||||
fi
|
||||
|
||||
PHP_EVAL_INCLINE($PDO_MYSQL_INCLUDE)
|
||||
PHP_EVAL_LIBLINE($PDO_MYSQL_LIBS, PDO_MYSQL_SHARED_LIBADD)
|
||||
],[
|
||||
$PDO_MYSQL_LIBS
|
||||
])
|
||||
fi
|
||||
|
||||
PHP_CHECK_PDO_INCLUDES
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue