Browse Source

Added PHP_WITH_SHARED for checking "shared,*" prefix when configuring

extensions.
experimetnal/RETURN_REF_PATCH
Stig Bakken 27 years ago
parent
commit
809198b916
  1. 21
      acinclude.m4
  2. 4
      configure.in.in
  3. 6
      ext/bcmath/config.m4
  4. 2
      ext/gettext/config.m4
  5. 2
      ext/icap/config.m4
  6. 2
      ext/mcal/config.m4
  7. 2
      ext/mhash/config.m4
  8. 134
      ext/mysql/config.m4
  9. 2
      ext/oci8/config.m4
  10. 2
      ext/yp/config.m4

21
acinclude.m4

@ -190,3 +190,24 @@ AC_DEFUN(PHP_SOLARIS_PIC_WEIRDNESS,[
AC_MSG_RESULT(no)
fi
])
dnl
dnl Checks whether $withval is "shared" or starts with "shared,XXX"
dnl and sets $shared to "yes" or "no", and removes "shared,?" stuff
dnl from $withval.
dnl
AC_DEFUN(PHP_WITH_SHARED,[
case $withval in
shared)
shared=yes
withval=yes
;;
shared,*)
shared=yes
withval=`echo $withval | sed -e 's/^shared,//'`
;;
*)
shared=no
;;
esac
])

4
configure.in.in

@ -77,7 +77,7 @@ if test -n "$auto_cflags" && test "`uname -s 2>/dev/null`" = "HP-UX"; then
fi
dnl Checks for programs.
AM_PROG_LIBTOOL
AC_PROG_LIBTOOL
AC_PROG_YACC
if test "$YACC" != "bison -y"; then
AC_MSG_WARN(You will need bison if you want to regenerate the PHP parsers.)
@ -863,7 +863,7 @@ AC_ARG_ENABLE(url-fopen-wrapper,
DMALLOC_RESULT=no
AC_MSG_CHECKING(whether to enable dmalloc)
AC_ARG_ENABLE(dmalloc,
[ --enable-dmalloc Enable dmalloc],
[ --enable-dmalloc Enable dmalloc],
[
if test "$enableval" = "yes" ; then
AC_DEFINE(HAVE_DMALLOC, 1)

6
ext/bcmath/config.m4

@ -2,9 +2,9 @@ dnl $Id$
AC_MSG_CHECKING(whether to enable bc style precision math functions)
AC_ARG_ENABLE(bcmath,
[ --enable-bcmath Compile with bc style precision math functions.
Read README-BCMATH for instructions on how to
get this module installed. ],
[ --enable-bcmath Compile with bc style precision math functions.
Read README-BCMATH for instructions on how to
get this module installed. ],
[
if test "$enableval" = "yes"; then
AC_DEFINE(WITH_BCMATH, 1)

2
ext/gettext/config.m4

@ -5,7 +5,7 @@ dnl don't forget to call PHP_EXTENSION(gettext)
AC_MSG_CHECKING(whether to include GNU gettext support)
AC_ARG_WITH(gettext,
[ --with-gettext[=DIR] Include GNU gettext support. DIR is the gettext
install directory, defaults to /usr/local],
install directory, defaults to /usr/local],
[
if test "$withval" != "no"; then
if test "$withval" = "yes"; then

2
ext/icap/config.m4

@ -2,7 +2,7 @@ dnl $Id$
AC_MSG_CHECKING(for ICAP support)
AC_ARG_WITH(icap,
[ --with-icap[=DIR] Include ICAP support.],
[ --with-icap[=DIR] Include ICAP support.],
[
if test "$withval" != "no"; then
if test "$withval" = "yes"; then

2
ext/mcal/config.m4

@ -2,7 +2,7 @@ dnl $Id$
AC_MSG_CHECKING(for MCAL support)
AC_ARG_WITH(mcal,
[ --with-mcal[=DIR] Include MCAL support.],
[ --with-mcal[=DIR] Include MCAL support.],
[
if test "$withval" != "no"; then
if test "$withval" = "yes"; then

2
ext/mhash/config.m4

@ -4,7 +4,7 @@ dnl don't forget to call PHP_EXTENSION(mhash)
AC_MSG_CHECKING(for mhash support)
AC_ARG_WITH(mhash,
[ --with-mhash[=DIR] Include mhash support. DIR is the mhash
[ --with-mhash[=DIR] Include mhash support. DIR is the mhash
install directory.],
[
if test "$withval" != "no"; then

134
ext/mysql/config.m4

@ -8,82 +8,70 @@ AC_ARG_WITH(mysql,
Set DIR to "shared" to build as a dl, or "shared,DIR"
to build as a dl and still specify DIR.],
[
case $withval in
shared)
shared=yes
withval=yes
;;
shared,*)
shared=yes
withval=`echo $withval | sed -e 's/^shared,//'`
;;
*)
shared=no
;;
esac
if test "$withval" != "no"; then
if test "$withval" = "yes"; then
if test -f /usr/include/mysql/mysql.h; then
MYSQL_INCDIR=/usr/include/mysql
if test -d /usr/lib/mysql; then
MYSQL_LIBDIR=/usr/lib/mysql
else
MYSQL_LIBDIR=/usr/lib
fi
elif test -f /usr/include/mysql.h; then
MYSQL_INCDIR=/usr/include
MYSQL_LIBDIR=/usr/lib
elif test -f /usr/local/include/mysql/mysql.h; then
MYSQL_INCDIR=/usr/local/include/mysql
MYSQL_LIBDIR=/usr/local/lib/mysql
elif test -f /usr/local/include/mysql.h; then
MYSQL_INCDIR=/usr/local/include
MYSQL_LIBDIR=/usr/local/lib
elif test -f /usr/local/mysql/include/mysql/mysql.h; then
MYSQL_INCDIR=/usr/local/mysql/include/mysql
MYSQL_LIBDIR=/usr/local/mysql/lib/mysql
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(Invalid MySQL directory - unable to find mysql.h)
fi
else
if test -f $withval/include/mysql/mysql.h; then
MYSQL_INCDIR=$withval/include/mysql
MYSQL_LIBDIR=$withval/lib/mysql
elif test -f $withval/include/mysql.h; then
MYSQL_INCDIR=$withval/include
MYSQL_LIBDIR=$withval/lib
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(Invalid MySQL directory - unable to find mysql.h under $withval)
fi
fi
MYSQL_INCLUDE=-I$MYSQL_INCDIR
PHP_WITH_SHARED
if test "$withval" != "no"; then
if test "$withval" = "yes"; then
if test -f /usr/include/mysql/mysql.h; then
MYSQL_INCDIR=/usr/include/mysql
if test -d /usr/lib/mysql; then
MYSQL_LIBDIR=/usr/lib/mysql
else
MYSQL_LIBDIR=/usr/lib
fi
elif test -f /usr/include/mysql.h; then
MYSQL_INCDIR=/usr/include
MYSQL_LIBDIR=/usr/lib
elif test -f /usr/local/include/mysql/mysql.h; then
MYSQL_INCDIR=/usr/local/include/mysql
MYSQL_LIBDIR=/usr/local/lib/mysql
elif test -f /usr/local/include/mysql.h; then
MYSQL_INCDIR=/usr/local/include
MYSQL_LIBDIR=/usr/local/lib
elif test -f /usr/local/mysql/include/mysql/mysql.h; then
MYSQL_INCDIR=/usr/local/mysql/include/mysql
MYSQL_LIBDIR=/usr/local/mysql/lib/mysql
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(Invalid MySQL directory - unable to find mysql.h)
fi
else
if test -f $withval/include/mysql/mysql.h; then
MYSQL_INCDIR=$withval/include/mysql
MYSQL_LIBDIR=$withval/lib/mysql
elif test -f $withval/include/mysql.h; then
MYSQL_INCDIR=$withval/include
MYSQL_LIBDIR=$withval/lib
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(Invalid MySQL directory - unable to find mysql.h under $withval)
fi
fi
MYSQL_INCLUDE=-I$MYSQL_INCDIR
AC_DEFINE(HAVE_MYSQL)
if test "$shared" = "yes"; then
AC_MSG_RESULT(yes (shared))
MYSQL_LFLAGS="-L$MYSQL_LIBDIR"
MYSQL_SHARED="mysql.la"
else
AC_MSG_RESULT(yes (static))
AC_ADD_LIBRARY_WITH_PATH(mysqlclient, $MYSQL_LIBDIR)
AC_ADD_INCLUDE($MYSQL_INCDIR)
MYSQL_STATIC="libphpext_mysql.a"
fi
PHP_EXTENSION(mysql, $shared)
AC_DEFINE(HAVE_MYSQL)
if test "$shared" = "yes"; then
AC_MSG_RESULT(yes (shared))
MYSQL_LFLAGS="-L$MYSQL_LIBDIR"
MYSQL_SHARED="mysql.la"
else
AC_MSG_RESULT(yes (static))
AC_ADD_LIBRARY_WITH_PATH(mysqlclient, $MYSQL_LIBDIR)
AC_ADD_INCLUDE($MYSQL_INCDIR)
MYSQL_STATIC="libphpext_mysql.a"
fi
PHP_EXTENSION(mysql, $shared)
dnl check for errmsg.h, which isn't installed by some versions of 3.21
old_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $MYSQL_INCLUDE"
AC_CHECK_HEADERS(errmsg.h mysql.h)
CPPFLAGS="$old_CPPFLAGS"
else
AC_MSG_RESULT(no)
AC_DEFINE(HAVE_MYSQL, 0)
fi
dnl check for errmsg.h, which isn't installed by some versions of 3.21
old_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $MYSQL_INCLUDE"
AC_CHECK_HEADERS(errmsg.h mysql.h)
CPPFLAGS="$old_CPPFLAGS"
else
AC_MSG_RESULT(no)
AC_DEFINE(HAVE_MYSQL, 0)
fi
],[
AC_MSG_RESULT(no)
AC_MSG_RESULT(no)
])
AC_SUBST(MYSQL_STATIC)
AC_SUBST(MYSQL_SHARED)

2
ext/oci8/config.m4

@ -21,7 +21,7 @@ AC_DEFUN(AC_ORACLE_VERSION,[
AC_MSG_CHECKING(for Oracle-OCI8 support)
AC_ARG_WITH(oci8,
[ --with-oci8[=DIR] Include Oracle database support. DIR is Oracle's
[ --with-oci8[=DIR] Include Oracle database support. DIR is Oracle's
home directory, defaults to \$ORACLE_HOME.],
[
case "$withval" in

2
ext/yp/config.m4

@ -4,7 +4,7 @@ dnl don't forget to call PHP_EXTENSION(yp)
AC_MSG_CHECKING(whether to include YP support)
AC_ARG_WITH(yp,
[ --with-yp Include YP support],
[ --with-yp Include YP support],
[
if test "$withval" = "yes"; then
AC_MSG_RESULT(yes)

Loading…
Cancel
Save