From: Sascha Schumann Date: Thu, 24 Oct 2002 12:21:07 +0000 (+0000) Subject: Make PHP compile out-of-the-box with uClibc X-Git-Tag: php-4.3.0pre2~104 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6bf422d62e67d53c334e3818e0f9a8887186a5c0;p=php Make PHP compile out-of-the-box with uClibc --- diff --git a/acinclude.m4 b/acinclude.m4 index 50e5e5e746..47f2c242b4 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1680,6 +1680,13 @@ AC_DEFUN([PHP_CHECK_FUNC_LIB],[ 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) PHP_DEF_HAVE($1) 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 } /* }}} */