Re: cvs: php4 /ext/mysql config.m4 php_mysql.c

From: Date: Wed, 20 Mar 2002 07:22:15 +0000
Subject: Re: cvs: php4 /ext/mysql config.m4 php_mysql.c
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-10455@lists.php.net to get a copy of this message
This broke the build for me with a simple ./configure --prefix=.... --enable-debug command. Autoconf version 2.13 automake (GNU automake) 1.4-p4 ltmain.sh (GNU libtool) 1.4.2a (1.922.2.79 2001/11/28 21:50:31) Reverting to rev. 1.39 works as expected. ./configure itself runs fine, but the final linking fails (seems like mysql lib is missing): ext/mysql/php_mysql.o: In function `_free_mysql_result': /home/mfischer/isrc/cvs/php4/ext/mysql/php_mysql.c:223: undefined reference to `mysql_free_result' ext/mysql/php_mysql.o: In function `_close_mysql_link': /home/mfischer/isrc/cvs/php4/ext/mysql/php_mysql.c:247: undefined reference to `mysql_close' [...] - Markus On Wed, Mar 20, 2002 at 01:31:24AM -0000, Jani Taskinen wrote : > sniper Tue Mar 19 20:31:24 2002 EDT > > Modified files: > /php4/ext/mysql config.m4 php_mysql.c > Log: > - Fixed bug: #16139 (compile failure with Mysql 4.0.1) > - Some tests were only run when compiling with the bundled libs. > (caused some compile warnings with external mysql libs) > - Another try to fix the zlib issue..(uncompress) > > > Index: php4/ext/mysql/config.m4 > diff -u php4/ext/mysql/config.m4:1.39 php4/ext/mysql/config.m4:1.40 > --- php4/ext/mysql/config.m4:1.39 Thu Mar 7 09:19:23 2002 > +++ php4/ext/mysql/config.m4 Tue Mar 19 20:31:21 2002 > @@ -1,5 +1,5 @@ > dnl > -dnl $Id: config.m4,v 1.39 2002/03/07 14:19:23 sas Exp $ > +dnl $Id: config.m4,v 1.40 2002/03/20 01:31:21 sniper Exp $ > dnl > > sinclude(ext/mysql/libmysql/acinclude.m4) > @@ -39,7 +39,15 @@ > [ --with-mysql[=DIR] Include MySQL support. DIR is the MySQL base directory. > If unspecified, the bundled MySQL library will be used.], yes) > > +if test "$PHP_MYSQL" != "no"; then > + PHP_MYSQL_SOCK > + MYSQL_CHECKS > + AC_DEFINE(HAVE_MYSQL, 1, [Whether you have MySQL]) > +fi > + > if test "$PHP_MYSQL" = "yes"; then > + PHP_ADD_BUILD_DIR($ext_builddir/libmysql) > + MYSQL_MODULE_TYPE=builtin > sources="libmysql/libmysql.c libmysql/errmsg.c libmysql/net.c libmysql/violite.c > libmysql/password.c \ > libmysql/my_init.c libmysql/my_lib.c libmysql/my_static.c libmysql/my_malloc.c > libmysql/my_realloc.c libmysql/my_create.c \ > libmysql/my_delete.c libmysql/my_tempnam.c libmysql/my_open.c libmysql/mf_casecnv.c > libmysql/my_read.c \ > @@ -52,21 +60,13 @@ > libmysql/is_prefix.c libmysql/int2str.c libmysql/str2int.c libmysql/strinstr.c \ > libmysql/strcont.c libmysql/strcend.c libmysql/bchange.c libmysql/bmove.c > libmysql/bmove_upp.c \ > libmysql/longlong2str.c libmysql/strtoull.c libmysql/strtoll.c libmysql/charset.c > libmysql/ctype.c" > -else > - sources= > -fi > > -if test "$PHP_MYSQL" != "no"; then > - AC_DEFINE(HAVE_MYSQL, 1, [Whether you have MySQL]) > - PHP_NEW_EXTENSION(mysql,php_mysql.c $sources, $ext_shared,,-I@ext_srcdir@/libmysql) > -fi > + PHP_NEW_EXTENSION(mysql, php_mysql.c, $sources $ext_shared,,-I@ext_srcdir@/libmysql) > > -if test "$PHP_MYSQL" = "yes"; then > - PHP_MYSQL_SOCK > - MYSQL_CHECKS > - PHP_ADD_BUILD_DIR($ext_builddir/libmysql) > - MYSQL_MODULE_TYPE=builtin > elif test "$PHP_MYSQL" != "no"; then > + > + PHP_NEW_EXTENSION(mysql, php_mysql.c, $ext_shared) > + > for i in $PHP_MYSQL; do > if test -r $i/include/mysql/mysql.h; then > MYSQL_DIR=$i > @@ -91,10 +91,28 @@ > AC_MSG_ERROR(Cannot find mysqlclient library under $MYSQL_DIR) > fi > > - if test "$PHP_ZLIB_DIR" != "no"; then > - PHP_ADD_LIBRARY(z,, MYSQL_SHARED_LIBADD) > - MYSQL_LIBS="-L$PHP_ZLIB_DIR/lib -z" > - fi > + PHP_CHECK_LIBRARY(mysqlclient, mysql_close, [ ], > + [ > + if test "$PHP_ZLIB_DIR" != "no"; then > + PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR, MYSQL_SHARED_LIBADD) > + PHP_CHECK_LIBRARY(mysqlclient, mysql_error, [], [ > + AC_MSG_ERROR([mysql configure failed. Please check config.log for more information.]) > + ], [ > + -L$PHP_ZLIB_DIR/lib -L$MYSQL_LIB_DIR > + ]) > + MYSQL_LIBS="-L$PHP_ZLIB_DIR/lib -z" > + else > + PHP_ADD_LIBRARY(z,, MYSQL_SHARED_LIBADD) > + PHP_CHECK_LIBRARY(mysqlclient, mysql_errno, [], [ > + AC_MSG_ERROR([Try adding --with-zlib-dir=<DIR>. Please check config.log for more > information.]) > + ], [ > + -L$MYSQL_LIB_DIR > + ]) > + MYSQL_LIBS="-z" > + fi > + ], [ > + -L$MYSQL_LIB_DIR > + ]) > > PHP_ADD_LIBRARY_WITH_PATH(mysqlclient, $MYSQL_LIB_DIR, MYSQL_SHARED_LIBADD) > MYSQL_LIBS="-L$MYSQL_LIB_DIR -lmysqlclient $MYSQL_LIBS" > Index: php4/ext/mysql/php_mysql.c > diff -u php4/ext/mysql/php_mysql.c:1.117 php4/ext/mysql/php_mysql.c:1.118 > --- php4/ext/mysql/php_mysql.c:1.117 Tue Mar 12 15:17:51 2002 > +++ php4/ext/mysql/php_mysql.c Tue Mar 19 20:31:22 2002 > @@ -16,7 +16,7 @@ > +----------------------------------------------------------------------+ > */ > > -/* $Id: php_mysql.c,v 1.117 2002/03/12 20:17:51 andi Exp $ */ > +/* $Id: php_mysql.c,v 1.118 2002/03/20 01:31:22 sniper Exp $ */ > > > /* TODO: > @@ -60,11 +60,7 @@ > > #include "php_ini.h" > > -#if HAVE_MYSQL_MYSQL_H > -# include <mysql/mysql.h> > -#else > # include <mysql.h> > -#endif > > #ifdef HAVE_MYSQL_REAL_CONNECT > # ifdef HAVE_ERRMSG_H > > > > -- > PHP CVS Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- Please always Cc to me when replying to me on the lists. GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc

« previous php.cvs (#10455) next »