php-src/ext/mysql/config.m4
Sascha Schumann a481fddfb3 Improved in-tree shared libraries build system
The following new/revived shared modules are available now:

  ... MySQL (*)
  ... PCRE (*)
  ... Session
  ... SWF

  (*) capable of using bundled library or external library

All changes:

  The m4 macro PHP_EXTENSION was revamped. Uses LIB_BUILD now.
  This effectively means that all extensions have to use dynlib.

  ext/mysql/config.m4 was revamped.
  Uses LIB_BUILD for building bundled library.

  ext/pcre/config.m4 was revamped.
  Uses LIB_BUILD for building bundled library.

  ext/ext_skel was changed to reflect that more modules should be
  compileable as shared module.

  ext/Makefile.in has been simplified enormously.

  Dependencies are now stored in the build tree.

  Empty dependencies are not generated by buildconf anymore. They
  are now dynamically created during the build process.

  Implicit rules for .S were removed.

  The NO_RECURSION feature was removed.

  "libs.mk" has been added to all cvsignore files in ext.
2000-05-01 02:42:55 +00:00

68 lines
1.8 KiB
Plaintext

dnl $Id$
sinclude(ext/mysql/libmysql/acinclude.m4)
sinclude(ext/mysql/libmysql/mysql.m4)
AC_DEFUN(PHP_MYSQL_SOCK,[
AC_MSG_CHECKING(for MySQL UNIX socket)
MYSQL_SOCK=/tmp/mysql.sock
for i in \
/var/run/mysqld/mysqld.sock \
/var/tmp/mysql.sock \
/var/lib/mysql/mysql.sock \
; do
if test -r $i; then
MYSQL_SOCK=$i
fi
done
AC_DEFINE_UNQUOTED(MYSQL_UNIX_ADDR, "$MYSQL_SOCK", [ ])
AC_MSG_RESULT($MYSQL_SOCK)
])
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
will be used.], yes)
if test "$PHP_MYSQL" != "no"; then
AC_DEFINE(HAVE_MYSQL, 1, [Whether you have MySQL])
PHP_EXTENSION(mysql,$ext_shared)
fi
if test "$PHP_MYSQL" = "yes"; then
PHP_MYSQL_SOCK
MYSQL_CHECKS
MYSQL_LIBADD=libmysql/libmysql_client.la
MYSQL_SHARED_LIBADD=libmysql/libmysql_client.la
MYSQL_SUBDIRS=libmysql
PHP_SUBST(MYSQL_LIBADD)
PHP_SUBST(MYSQL_SUBDIRS)
LIB_BUILD($ext_builddir/libmysql,$ext_shared,yes)
AC_ADD_INCLUDE($ext_srcdir/libmysql)
elif test "$PHP_MYSQL" != "no"; then
for i in $PHP_MYSQL; do
if test -r $i/include/mysql/mysql.h; then
MYSQL_DIR=$i
MYSQL_INC_DIR=$i/include/mysql
elif test -r $i/include/mysql.h; then
MYSQL_DIR=$i
MYSQL_INC_DIR=$i/include
fi
done
if test -z "$MYSQL_DIR"; then
AC_MSG_ERROR(Cannot find header files under $PHP_MYSQL)
fi
if test "$ext_shared" = "yes"; then
MYSQL_SHARED_LIBADD="-R$MYSQL_DIR/lib/mysql -L$MYSQL_DIR/lib/mysql -lmysqlclient"
else
AC_ADD_LIBPATH($MYSQL_DIR/lib/mysql)
AC_ADD_LIBRARY(mysqlclient)
fi
AC_ADD_INCLUDE($MYSQL_INC_DIR)
fi
PHP_SUBST(MYSQL_SHARED_LIBADD)