summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2002-10-24 12:21:07 +0000
committerSascha Schumann <sas@php.net>2002-10-24 12:21:07 +0000
commit6bf422d62e67d53c334e3818e0f9a8887186a5c0 (patch)
tree05b55dd912ef18d5e90610e258a43186fa9370d3
parent938ba73be7001f6a4fb522c9cdbc1633611fce01 (diff)
downloadphp-git-6bf422d62e67d53c334e3818e0f9a8887186a5c0.tar.gz
Make PHP compile out-of-the-box with uClibc
-rw-r--r--acinclude.m47
-rw-r--r--configure.in3
-rw-r--r--ext/standard/config.m42
-rw-r--r--ext/standard/math.c10
4 files changed, 20 insertions, 2 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 50e5e5e746..47f2c242b4 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1681,6 +1681,13 @@ AC_DEFUN([PHP_CHECK_FUNC_LIB],[
])
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)
PHP_DEF_HAVE($1)
PHP_DEF_HAVE(lib$2)
diff --git a/configure.in b/configure.in
index f6c507ed33..343484779c 100644
--- a/configure.in
+++ b/configure.in
@@ -279,7 +279,7 @@ PHP_CHECK_FUNC(gethostname, nsl)
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 @@ dnl -------------------------------------------------------------------------
PHP_CONFIGURE_PART(Configuring Zend)
LIBZEND_BASIC_CHECKS
+LIBZEND_DLSYM_CHECK
LIBZEND_OTHER_CHECKS
TSRM_LIB='TSRM/libtsrm.la'
diff --git a/ext/standard/config.m4 b/ext/standard/config.m4
index af1c5798e7..69758bbe82 100644
--- a/ext/standard/config.m4
+++ b/ext/standard/config.m4
@@ -189,7 +189,7 @@ dnl AC_CHECK_LIB(pam, pam_start, [
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
diff --git a/ext/standard/math.c b/ext/standard/math.c
index 92d4d8214a..62b4b0c606 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -321,6 +321,7 @@ PHP_FUNCTION(tanh)
PHP_FUNCTION(asinh)
{
+#ifdef HAVE_ASINH
zval **num;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) {
@@ -329,6 +330,7 @@ PHP_FUNCTION(asinh)
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(asinh)
PHP_FUNCTION(acosh)
{
+#ifdef HAVE_ACOSH
zval **num;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) {
@@ -345,6 +348,7 @@ PHP_FUNCTION(acosh)
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(acosh)
PHP_FUNCTION(atanh)
{
+#ifdef HAVE_ATANH
zval **num;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) {
@@ -361,6 +366,7 @@ PHP_FUNCTION(atanh)
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(expm1)
PHP_FUNCTION(log1p)
{
+#ifdef HAVE_LOG1P
zval **num;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) {
@@ -512,6 +519,7 @@ PHP_FUNCTION(log1p)
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(sqrt)
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 @@ PHP_FUNCTION(hypot)
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
}
/* }}} */