Skip to content

Commit 34dd032

Browse files
committed
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.
1 parent 2875d0f commit 34dd032

File tree

2 files changed

+7
-50
lines changed

2 files changed

+7
-50
lines changed

ext/mysqli/config.m4

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,34 +47,18 @@ if test "$PHP_MYSQLI" = "yes" || test "$PHP_MYSQLI" = "mysqlnd"; then
4747
elif test "$PHP_MYSQLI" != "no"; then
4848

4949
MYSQL_CONFIG=$PHP_MYSQLI
50-
MYSQL_LIB_NAME='mysqlclient'
51-
MYSQL_LIB_CFG='--libs'
5250

53-
if test -x "$MYSQL_CONFIG" && $MYSQL_CONFIG $MYSQL_LIB_CFG > /dev/null 2>&1; then
51+
if test -x "$MYSQL_CONFIG" && $MYSQL_CONFIG --libs > /dev/null 2>&1; then
5452
MYSQLI_INCLINE=`$MYSQL_CONFIG --cflags | $SED -e "s/'//g"`
55-
MYSQLI_LIBLINE=`$MYSQL_CONFIG $MYSQL_LIB_CFG | $SED -e "s/'//g"`
53+
MYSQLI_LIBLINE=`$MYSQL_CONFIG --libs | $SED -e "s/'//g"`
5654
else
5755
AC_MSG_RESULT([mysql_config not found])
5856
AC_MSG_ERROR([Please reinstall the mysql distribution])
5957
fi
6058

61-
dnl
62-
dnl Check the library
63-
dnl
64-
PHP_CHECK_LIBRARY($MYSQL_LIB_NAME, mysql_set_server_option,
65-
[
66-
PHP_EVAL_INCLINE($MYSQLI_INCLINE)
67-
PHP_EVAL_LIBLINE($MYSQLI_LIBLINE, MYSQLI_SHARED_LIBADD)
68-
AC_DEFINE(HAVE_MYSQLILIB, 1, [ ])
69-
PHP_CHECK_LIBRARY($MYSQL_LIB_NAME, mysql_set_character_set,
70-
[ ],[
71-
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.])
72-
],[$MYSQLI_LIBLINE])
73-
],[
74-
AC_MSG_ERROR([wrong mysql library version or lib not found. Check config.log for more information.])
75-
],[
76-
$MYSQLI_LIBLINE
77-
])
59+
PHP_EVAL_INCLINE($MYSQLI_INCLINE)
60+
PHP_EVAL_LIBLINE($MYSQLI_LIBLINE, MYSQLI_SHARED_LIBADD)
61+
AC_DEFINE(HAVE_MYSQLILIB, 1, [ ])
7862
fi
7963

8064
dnl Build extension

ext/pdo_mysql/config.m4

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ if test "$PHP_PDO_MYSQL" != "no"; then
5858
if test "x$SED" = "x"; then
5959
AC_PATH_PROG(SED, sed)
6060
fi
61-
PDO_MYSQL_LIBNAME=mysqlclient
6261
PDO_MYSQL_LIBS=`$PDO_MYSQL_CONFIG --libs | $SED -e "s/'//g"`
6362
PDO_MYSQL_INCLUDE=`$PDO_MYSQL_CONFIG --cflags | $SED -e "s/'//g"`
6463
elif test -n "$PDO_MYSQL_DIR"; then
@@ -89,34 +88,8 @@ if test "$PHP_PDO_MYSQL" != "no"; then
8988
AC_MSG_ERROR([Unable to find your mysql installation])
9089
fi
9190

92-
PHP_CHECK_LIBRARY($PDO_MYSQL_LIBNAME, mysql_commit,
93-
[
94-
PHP_EVAL_INCLINE($PDO_MYSQL_INCLUDE)
95-
PHP_EVAL_LIBLINE($PDO_MYSQL_LIBS, PDO_MYSQL_SHARED_LIBADD)
96-
],[
97-
if test "$PHP_ZLIB_DIR" != "no"; then
98-
PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR, PDO_MYSQL_SHARED_LIBADD)
99-
PHP_CHECK_LIBRARY($PDO_MYSQL_LIBNAME, mysql_commit, [], [
100-
AC_MSG_ERROR([PDO_MYSQL configure failed, MySQL 4.1 needed. Please check config.log for more information.])
101-
], [
102-
-L$PHP_ZLIB_DIR/$PHP_LIBDIR -L$PDO_MYSQL_LIB_DIR
103-
])
104-
PDO_MYSQL_LIBS="$PDO_MYSQL_LIBS -L$PHP_ZLIB_DIR/$PHP_LIBDIR -lz"
105-
else
106-
PHP_ADD_LIBRARY(z,, PDO_MYSQL_SHARED_LIBADD)
107-
PHP_CHECK_LIBRARY($PDO_MYSQL_LIBNAME, mysql_query, [], [
108-
AC_MSG_ERROR([Try adding --with-zlib-dir=<DIR>. Please check config.log for more information.])
109-
], [
110-
-L$PDO_MYSQL_LIB_DIR
111-
])
112-
PDO_MYSQL_LIBS="$PDO_MYSQL_LIBS -lz"
113-
fi
114-
115-
PHP_EVAL_INCLINE($PDO_MYSQL_INCLUDE)
116-
PHP_EVAL_LIBLINE($PDO_MYSQL_LIBS, PDO_MYSQL_SHARED_LIBADD)
117-
],[
118-
$PDO_MYSQL_LIBS
119-
])
91+
PHP_EVAL_INCLINE($PDO_MYSQL_INCLUDE)
92+
PHP_EVAL_LIBLINE($PDO_MYSQL_LIBS, PDO_MYSQL_SHARED_LIBADD)
12093
fi
12194

12295
PHP_CHECK_PDO_INCLUDES

0 commit comments

Comments
 (0)