> That's what the mysql_config script is for:
>
> tim@cane:~$ mysql_config
> Usage: /usr/local/mysql/bin/mysql_config [OPTIONS]
> Options:
> --cflags [-I'/usr/local/mysql/include/mysql']
> --libs [ -L'/usr/local/mysql/lib/mysql' -lmysqlclient -lz -lcrypt
>-lm ]
> --socket [/tmp/mysql.sock]
> --port [3306]
> --version [3.23.30-gamma]
> tim@cane:~$ mysql_config --libs
> -L'/usr/local/mysql/lib/mysql' -lmysqlclient -lz -lcrypt -lm
>
> I'm not sure what the best way to use it in PHP is, but hopefully
> someone familiar with ext/mysql/config.m4 could fix that. If not,
> let me know and I'll try to look at it some time.
I'm not sure how effective this patch is, but it seems to generate a
working configure script for myself. I don't have 3.23.30-gamma installed
yet, though I intend on doing so soon (am downloading at the moment), so I
will get the chance to test the script myself.
For the time being, if anyone wants to look at it, the patch to
ext/mysql/config.m4 is included.
Chris
--- ../php4-oldcvs/ext/mysql/config.m4 Thu Nov 23 12:01:03 2000
+++ ext/mysql/config.m4 Wed Jan 17 01:54:08 2001
@@ -32,6 +32,19 @@
AC_MSG_RESULT($MYSQL_SOCK)
])
+AC_DEFUN(PHP_MYSQL_VERSION,[
+ if test "$PHP_MYSQL" != "yes"; then
+ AC_MSG_CHECKING(for MySQL version)
+ MYSQL_VERSION=$( strings $MYSQL_LIB_DIR/libmysqlclient.so | grep '3\.' )
+ if test "x$( echo $MYSQL_VERSION | cut -f2 -d. )" = "x23" ; then
+ AC_MSG_RESULT($MYSQL_VERSION)
+ PHP_EVAL_LIBLINE($PHP_MYSQL/bin/mysql_config --libs)
+ else
+ AC_MSG_RESULT($MYSQL_VERSION)
+ fi
+ fi
+])
+
PHP_ARG_WITH(mysql, for MySQL support,
[ --with-mysql[=DIR] Include MySQL support. DIR is the MySQL base
directory. If unspecified, the bundled MySQL library
@@ -77,6 +90,8 @@
AC_MSG_ERROR(Cannot find mysqlclient library under $MYSQL_DIR)
fi
+ PHP_MYSQL_VERSION
+
AC_ADD_LIBRARY_WITH_PATH(mysqlclient, $MYSQL_LIB_DIR, MYSQL_SHARED_LIBADD)
AC_ADD_INCLUDE($MYSQL_INC_DIR)
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]