sas Thu Oct 24 08:21:07 2002 EDT
Modified files:
/php4 acinclude.m4 configure.in
/php4/ext/standard config.m4 math.c
Log:
Make PHP compile out-of-the-box with uClibc
Index: php4/acinclude.m4
diff -u php4/acinclude.m4:1.215 php4/acinclude.m4:1.216
--- php4/acinclude.m4:1.215 Thu Oct 24 06:41:36 2002
+++ php4/acinclude.m4 Thu Oct 24 08:21:06 2002
@@ -1,4 +1,4 @@
-dnl $Id: acinclude.m4,v 1.215 2002/10/24 10:41:36 sas Exp $
+dnl $Id: acinclude.m4,v 1.216 2002/10/24 12:21:06 sas Exp $
dnl
dnl This file contains local autoconf functions.
@@ -1679,6 +1679,13 @@
AC_CHECK_LIB($2, $1, [found=yes], [
AC_CHECK_LIB($2, __$1, [found=yes], [found=no])
])
+
+ if test "$found" = "yes"; then
+ ac_libs=$LIBS
+ LIBS="$LIBS -l$2"
+ AC_TRY_RUN([main() { return (0); }],[found=yes],[found=no],[found=no])
+ LIBS=$ac_libs
+ fi
if test "$found" = "yes"; then
PHP_ADD_LIBRARY($2)
Index: php4/configure.in
diff -u php4/configure.in:1.386 php4/configure.in:1.387
--- php4/configure.in:1.386 Tue Oct 22 20:21:43 2002
+++ php4/configure.in Thu Oct 24 08:21:06 2002
@@ -1,4 +1,4 @@
-dnl ## $Id: configure.in,v 1.386 2002/10/23 00:21:43 sniper Exp $ -*- sh -*-
+dnl ## $Id: configure.in,v 1.387 2002/10/24 12:21:06 sas Exp $ -*- sh -*-
dnl ## Process this file with autoconf to produce a configure script.
divert(1)
@@ -279,7 +279,7 @@
PHP_CHECK_FUNC(gethostbyaddr, nsl)
PHP_CHECK_FUNC(yp_get_default_domain, nsl)
-AC_CHECK_LIB(dl, dlopen, [PHP_ADD_LIBRARY(dl)])
+PHP_CHECK_FUNC(dlopen, dl)
AC_CHECK_LIB(m, sin)
dnl Check for resolver routines.
@@ -802,6 +802,7 @@
PHP_CONFIGURE_PART(Configuring Zend)
LIBZEND_BASIC_CHECKS
+LIBZEND_DLSYM_CHECK
LIBZEND_OTHER_CHECKS
TSRM_LIB='TSRM/libtsrm.la'
Index: php4/ext/standard/config.m4
diff -u php4/ext/standard/config.m4:1.44 php4/ext/standard/config.m4:1.45
--- php4/ext/standard/config.m4:1.44 Mon Oct 21 19:41:38 2002
+++ php4/ext/standard/config.m4 Thu Oct 24 08:21:06 2002
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.44 2002/10/21 23:41:38 sniper Exp $ -*- sh -*-
+dnl $Id: config.m4,v 1.45 2002/10/24 12:21:06 sas Exp $ -*- sh -*-
divert(3)dnl
@@ -189,7 +189,7 @@
dnl EXTRA_LIBS="$EXTRA_LIBS -lpam"
dnl AC_DEFINE(HAVE_LIBPAM,1,[ ]) ], [])
-AC_CHECK_FUNCS(getcwd getwd)
+AC_CHECK_FUNCS(getcwd getwd asinh acosh atanh log1p hypot)
AC_CRYPT_CAP
AC_FLUSH_IO
Index: php4/ext/standard/math.c
diff -u php4/ext/standard/math.c:1.90 php4/ext/standard/math.c:1.91
--- php4/ext/standard/math.c:1.90 Tue Oct 15 10:51:01 2002
+++ php4/ext/standard/math.c Thu Oct 24 08:21:07 2002
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: math.c,v 1.90 2002/10/15 14:51:01 sterling Exp $ */
+/* $Id: math.c,v 1.91 2002/10/24 12:21:07 sas Exp $ */
#include "php.h"
#include "php_math.h"
@@ -321,6 +321,7 @@
PHP_FUNCTION(asinh)
{
+#ifdef HAVE_ASINH
zval **num;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) {
@@ -329,6 +330,7 @@
convert_to_double_ex(num);
Z_DVAL_P(return_value) = asinh(Z_DVAL_PP(num));
Z_TYPE_P(return_value) = IS_DOUBLE;
+#endif
}
/* }}} */
@@ -337,6 +339,7 @@
PHP_FUNCTION(acosh)
{
+#ifdef HAVE_ACOSH
zval **num;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) {
@@ -345,6 +348,7 @@
convert_to_double_ex(num);
Z_DVAL_P(return_value) = acosh(Z_DVAL_PP(num));
Z_TYPE_P(return_value) = IS_DOUBLE;
+#endif
}
/* }}} */
@@ -353,6 +357,7 @@
PHP_FUNCTION(atanh)
{
+#ifdef HAVE_ATANH
zval **num;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) {
@@ -361,6 +366,7 @@
convert_to_double_ex(num);
Z_DVAL_P(return_value) = atanh(Z_DVAL_PP(num));
Z_TYPE_P(return_value) = IS_DOUBLE;
+#endif
}
/* }}} */
@@ -504,6 +510,7 @@
PHP_FUNCTION(log1p)
{
+#ifdef HAVE_LOG1P
zval **num;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) {
@@ -512,6 +519,7 @@
convert_to_double_ex(num);
Z_DVAL_P(return_value) = log1p(Z_DVAL_PP(num));
Z_TYPE_P(return_value) = IS_DOUBLE;
+#endif
}
/* }}} */
@@ -577,6 +585,7 @@
PHP_FUNCTION(hypot)
{
+#ifdef HAVE_HYPOT
zval **num1, **num2;
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &num1, &num2) ==
FAILURE) {
@@ -586,6 +595,7 @@
convert_to_double_ex(num2);
Z_DVAL_P(return_value) = hypot(Z_DVAL_PP(num1), Z_DVAL_PP(num2));
Z_TYPE_P(return_value) = IS_DOUBLE;
+#endif
}
/* }}} */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php