2004-11-09 23:58:16 +08:00
|
|
|
dnl $Id$ -*- autoconf -*-
|
1999-04-17 08:37:12 +08:00
|
|
|
|
2009-11-29 14:13:22 +08:00
|
|
|
divert(3)dnl
|
2009-11-29 07:06:54 +08:00
|
|
|
|
2001-03-11 18:08:27 +08:00
|
|
|
dnl
|
|
|
|
dnl Check if flush should be called explicitly after buffered io
|
|
|
|
dnl
|
2007-07-11 19:50:37 +08:00
|
|
|
AC_CACHE_CHECK([whether flush should be called explicitly after a buffered io], ac_cv_flush_io,[
|
|
|
|
AC_TRY_RUN( [
|
2001-03-11 18:08:27 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
char *filename = tmpnam(NULL);
|
|
|
|
char buffer[64];
|
|
|
|
int result = 0;
|
|
|
|
|
|
|
|
FILE *fp = fopen(filename, "wb");
|
|
|
|
if (NULL == fp)
|
|
|
|
return 0;
|
|
|
|
fputs("line 1\n", fp);
|
|
|
|
fputs("line 2\n", fp);
|
|
|
|
fclose(fp);
|
|
|
|
|
|
|
|
fp = fopen(filename, "rb+");
|
|
|
|
if (NULL == fp)
|
|
|
|
return 0;
|
|
|
|
fgets(buffer, sizeof(buffer), fp);
|
|
|
|
fputs("line 3\n", fp);
|
|
|
|
rewind(fp);
|
|
|
|
fgets(buffer, sizeof(buffer), fp);
|
|
|
|
if (0 != strcmp(buffer, "line 1\n"))
|
|
|
|
result = 1;
|
|
|
|
fgets(buffer, sizeof(buffer), fp);
|
|
|
|
if (0 != strcmp(buffer, "line 3\n"))
|
|
|
|
result = 1;
|
|
|
|
fclose(fp);
|
|
|
|
unlink(filename);
|
|
|
|
|
|
|
|
exit(result);
|
|
|
|
}
|
|
|
|
],[
|
2001-05-12 19:09:05 +08:00
|
|
|
ac_cv_flush_io=no
|
2001-03-11 18:08:27 +08:00
|
|
|
],[
|
2001-05-12 19:09:05 +08:00
|
|
|
ac_cv_flush_io=yes
|
2001-03-11 18:08:27 +08:00
|
|
|
],[
|
2001-05-12 19:09:05 +08:00
|
|
|
ac_cv_flush_io=no
|
2001-03-11 18:08:27 +08:00
|
|
|
])])
|
2007-07-11 19:50:37 +08:00
|
|
|
if test "$ac_cv_flush_io" = "yes"; then
|
|
|
|
AC_DEFINE(HAVE_FLUSHIO, 1, [Define if flush should be called explicitly after a buffered io.])
|
|
|
|
fi
|
2001-03-11 18:08:27 +08:00
|
|
|
|
1999-04-22 10:48:28 +08:00
|
|
|
dnl
|
|
|
|
dnl Check for crypt() capabilities
|
|
|
|
dnl
|
2007-07-11 19:50:37 +08:00
|
|
|
if test "$ac_cv_func_crypt" = "no"; then
|
2003-02-14 09:27:15 +08:00
|
|
|
AC_CHECK_LIB(crypt, crypt, [
|
|
|
|
LIBS="-lcrypt $LIBS -lcrypt"
|
|
|
|
AC_DEFINE(HAVE_CRYPT, 1, [ ])
|
|
|
|
])
|
2007-07-11 19:50:37 +08:00
|
|
|
fi
|
2003-02-14 09:27:15 +08:00
|
|
|
|
2007-07-11 19:50:37 +08:00
|
|
|
AC_CACHE_CHECK(for standard DES crypt, ac_cv_crypt_des,[
|
1999-04-22 10:48:28 +08:00
|
|
|
AC_TRY_RUN([
|
2004-09-29 04:42:56 +08:00
|
|
|
#if HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
|
|
|
|
2000-07-20 00:19:40 +08:00
|
|
|
#if HAVE_CRYPT_H
|
|
|
|
#include <crypt.h>
|
|
|
|
#endif
|
|
|
|
|
1999-04-22 10:48:28 +08:00
|
|
|
main() {
|
|
|
|
#if HAVE_CRYPT
|
|
|
|
exit (strcmp((char *)crypt("rasmuslerdorf","rl"),"rl.3StKT.4T8M"));
|
|
|
|
#else
|
|
|
|
exit(0);
|
|
|
|
#endif
|
|
|
|
}],[
|
2007-07-11 19:50:37 +08:00
|
|
|
ac_cv_crypt_des=yes
|
|
|
|
],[
|
|
|
|
ac_cv_crypt_des=no
|
|
|
|
],[
|
|
|
|
ac_cv_crypt_des=yes
|
|
|
|
])])
|
1999-04-22 10:48:28 +08:00
|
|
|
|
2007-07-11 19:50:37 +08:00
|
|
|
AC_CACHE_CHECK(for extended DES crypt, ac_cv_crypt_ext_des,[
|
1999-04-22 10:48:28 +08:00
|
|
|
AC_TRY_RUN([
|
2004-09-29 04:42:56 +08:00
|
|
|
#if HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
|
|
|
|
2000-07-20 00:19:40 +08:00
|
|
|
#if HAVE_CRYPT_H
|
|
|
|
#include <crypt.h>
|
|
|
|
#endif
|
|
|
|
|
1999-04-22 10:48:28 +08:00
|
|
|
main() {
|
|
|
|
#if HAVE_CRYPT
|
2007-07-11 19:50:37 +08:00
|
|
|
exit (strcmp((char *)crypt("rasmuslerdorf","_J9..rasm"),"_J9..rasmBYk8r9AiWNc"));
|
1999-04-22 10:48:28 +08:00
|
|
|
#else
|
2007-07-11 19:50:37 +08:00
|
|
|
exit(0);
|
1999-04-22 10:48:28 +08:00
|
|
|
#endif
|
|
|
|
}],[
|
2007-07-11 19:50:37 +08:00
|
|
|
ac_cv_crypt_ext_des=yes
|
|
|
|
],[
|
|
|
|
ac_cv_crypt_ext_des=no
|
|
|
|
],[
|
|
|
|
ac_cv_crypt_ext_des=no
|
|
|
|
])])
|
1999-04-22 10:48:28 +08:00
|
|
|
|
2007-07-11 19:50:37 +08:00
|
|
|
AC_CACHE_CHECK(for MD5 crypt, ac_cv_crypt_md5,[
|
|
|
|
AC_TRY_RUN([
|
2004-09-29 04:42:56 +08:00
|
|
|
#if HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
|
|
|
|
2000-07-20 00:19:40 +08:00
|
|
|
#if HAVE_CRYPT_H
|
|
|
|
#include <crypt.h>
|
|
|
|
#endif
|
|
|
|
|
1999-04-22 10:48:28 +08:00
|
|
|
main() {
|
|
|
|
#if HAVE_CRYPT
|
|
|
|
char salt[15], answer[40];
|
|
|
|
|
|
|
|
salt[0]='$'; salt[1]='1'; salt[2]='$';
|
|
|
|
salt[3]='r'; salt[4]='a'; salt[5]='s';
|
|
|
|
salt[6]='m'; salt[7]='u'; salt[8]='s';
|
|
|
|
salt[9]='l'; salt[10]='e'; salt[11]='$';
|
|
|
|
salt[12]='\0';
|
|
|
|
strcpy(answer,salt);
|
|
|
|
strcat(answer,"rISCgZzpwk3UhDidwXvin0");
|
|
|
|
exit (strcmp((char *)crypt("rasmuslerdorf",salt),answer));
|
|
|
|
#else
|
|
|
|
exit(0);
|
|
|
|
#endif
|
|
|
|
}],[
|
2007-07-11 19:50:37 +08:00
|
|
|
ac_cv_crypt_md5=yes
|
|
|
|
],[
|
|
|
|
ac_cv_crypt_md5=no
|
|
|
|
],[
|
|
|
|
ac_cv_crypt_md5=no
|
|
|
|
])])
|
1999-04-22 10:48:28 +08:00
|
|
|
|
2007-07-11 19:50:37 +08:00
|
|
|
AC_CACHE_CHECK(for Blowfish crypt, ac_cv_crypt_blowfish,[
|
|
|
|
AC_TRY_RUN([
|
2004-09-29 04:42:56 +08:00
|
|
|
#if HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
|
|
|
|
2000-07-20 00:19:40 +08:00
|
|
|
#if HAVE_CRYPT_H
|
|
|
|
#include <crypt.h>
|
|
|
|
#endif
|
|
|
|
|
1999-04-22 10:48:28 +08:00
|
|
|
main() {
|
|
|
|
#if HAVE_CRYPT
|
2001-06-07 20:18:02 +08:00
|
|
|
char salt[30], answer[70];
|
1999-04-22 10:48:28 +08:00
|
|
|
|
|
|
|
salt[0]='$'; salt[1]='2'; salt[2]='a'; salt[3]='$'; salt[4]='0'; salt[5]='7'; salt[6]='$'; salt[7]='\0';
|
2001-06-07 20:18:02 +08:00
|
|
|
strcat(salt,"rasmuslerd............");
|
1999-04-22 10:48:28 +08:00
|
|
|
strcpy(answer,salt);
|
2001-06-07 20:18:02 +08:00
|
|
|
strcpy(&answer[29],"nIdrcHdxcUxWomQX9j6kvERCFjTg7Ra");
|
1999-04-22 10:48:28 +08:00
|
|
|
exit (strcmp((char *)crypt("rasmuslerdorf",salt),answer));
|
|
|
|
#else
|
|
|
|
exit(0);
|
|
|
|
#endif
|
|
|
|
}],[
|
2007-07-11 19:50:37 +08:00
|
|
|
ac_cv_crypt_blowfish=yes
|
|
|
|
],[
|
|
|
|
ac_cv_crypt_blowfish=no
|
|
|
|
],[
|
|
|
|
ac_cv_crypt_blowfish=no
|
|
|
|
])])
|
2008-07-28 19:50:35 +08:00
|
|
|
|
2009-12-09 08:20:14 +08:00
|
|
|
AC_CACHE_CHECK(for SHA512 crypt, ac_cv_crypt_SHA512,[
|
|
|
|
AC_TRY_RUN([
|
|
|
|
#if HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if HAVE_CRYPT_H
|
|
|
|
#include <crypt.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
main() {
|
|
|
|
#if HAVE_CRYPT
|
|
|
|
char salt[30], answer[80];
|
|
|
|
|
|
|
|
salt[0]='$'; salt[1]='6'; salt[2]='$'; salt[3]='$'; salt[4]='b'; salt[5]='a'; salt[6]='r'; salt[7]='\0';
|
|
|
|
strcpy(answer, salt);
|
|
|
|
strcpy(&answer[29],"$6$$QMXjqd7rHQZPQ1yHsXkQqC1FBzDiVfTHXL.LaeDAeVV.IzMaV9VU4MQ8kPuZa2SOP1A0RPm772EaFYjpEJtdu.");
|
|
|
|
exit (strcmp((char *)crypt("foo",salt),answer));
|
|
|
|
#else
|
|
|
|
exit(0);
|
|
|
|
#endif
|
|
|
|
}],[
|
|
|
|
ac_cv_crypt_SHA512=yes
|
|
|
|
],[
|
|
|
|
ac_cv_crypt_SHA512=no
|
|
|
|
],[
|
|
|
|
ac_cv_crypt_SHA512=no
|
|
|
|
])])
|
|
|
|
|
|
|
|
AC_CACHE_CHECK(for SHA256 crypt, ac_cv_crypt_SHA256,[
|
|
|
|
AC_TRY_RUN([
|
|
|
|
#if HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if HAVE_CRYPT_H
|
|
|
|
#include <crypt.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
main() {
|
|
|
|
#if HAVE_CRYPT
|
|
|
|
char salt[30], answer[80];
|
|
|
|
salt[0]='$'; salt[1]='5'; salt[2]='$'; salt[3]='$'; salt[4]='s'; salt[5]='a'; salt[6]='l'; salt[7]='t'; salt[8]='s'; salt[9]='t'; salt[10]='r'; salt[11]='i'; salt[12]='n'; salt[13]='g'; salt[14]='\0';
|
|
|
|
strcat(salt,"");
|
|
|
|
strcpy(answer, salt);
|
|
|
|
strcpy(&answer[29], "$5$saltstring$5B8vYYiY.CVt1RlTTf8KbXBH3hsxY/GNooZaBBGWEc5");
|
|
|
|
exit (strcmp((char *)crypt("foo",salt),answer));
|
|
|
|
#else
|
|
|
|
exit(0);
|
|
|
|
#endif
|
|
|
|
}],[
|
|
|
|
ac_cv_crypt_SHA256=yes
|
|
|
|
],[
|
|
|
|
ac_cv_crypt_SHA256=no
|
|
|
|
],[
|
|
|
|
ac_cv_crypt_SHA256=no
|
|
|
|
])])
|
|
|
|
|
|
|
|
|
2008-07-28 19:50:35 +08:00
|
|
|
dnl
|
|
|
|
dnl If one of them is missing, use our own implementation, portable code is then possible
|
|
|
|
dnl
|
|
|
|
if test "$ac_cv_crypt_blowfish" = "no" || test "$ac_cv_crypt_des" = "no" || test "$ac_cv_crypt_ext_des" = "no" || test "x$php_crypt_r" = "x0"; then
|
|
|
|
AC_DEFINE_UNQUOTED(PHP_USE_PHP_CRYPT_R, 1, [Whether PHP has to use its own crypt_r for blowfish, des, ext des and md5])
|
|
|
|
AC_DEFINE_UNQUOTED(PHP_STD_DES_CRYPT, 1, [Whether the system supports standard DES salt])
|
|
|
|
AC_DEFINE_UNQUOTED(PHP_BLOWFISH_CRYPT, 1, [Whether the system supports BlowFish salt])
|
|
|
|
AC_DEFINE_UNQUOTED(PHP_EXT_DES_CRYPT, 1, [Whether the system supports extended DES salt])
|
|
|
|
AC_DEFINE_UNQUOTED(PHP_MD5_CRYPT, 1, [Whether the system supports extended DES salt])
|
2009-12-09 08:20:14 +08:00
|
|
|
AC_DEFINE_UNQUOTED(PHP_SHA512_CRYPT, 1, [Whether the system supports SHA512 salt])
|
|
|
|
AC_DEFINE_UNQUOTED(PHP_SHA256_CRYPT, 1, [Whether the system supports SHA256 salt])
|
2008-07-28 19:50:35 +08:00
|
|
|
|
2009-12-09 08:20:14 +08:00
|
|
|
PHP_ADD_SOURCES(PHP_EXT_DIR(standard), crypt_freesec.c crypt_blowfish.c crypt_sha512.c crypt_sha256.c php_crypt_r.c)
|
2007-07-11 19:50:37 +08:00
|
|
|
else
|
2008-07-28 19:50:35 +08:00
|
|
|
if test "$ac_cv_crypt_des" = "yes"; then
|
|
|
|
ac_result=1
|
|
|
|
ac_crypt_des=1
|
|
|
|
else
|
|
|
|
ac_result=0
|
|
|
|
ac_crypt_des=0
|
|
|
|
fi
|
|
|
|
AC_DEFINE_UNQUOTED(PHP_STD_DES_CRYPT, $ac_result, [Whether the system supports standard DES salt])
|
|
|
|
|
|
|
|
if test "$ac_cv_crypt_blowfish" = "yes"; then
|
|
|
|
ac_result=1
|
|
|
|
ac_crypt_blowfish=1
|
|
|
|
else
|
|
|
|
ac_result=0
|
|
|
|
ac_crypt_blowfish=0
|
|
|
|
fi
|
|
|
|
AC_DEFINE_UNQUOTED(PHP_BLOWFISH_CRYPT, $ac_result, [Whether the system supports BlowFish salt])
|
|
|
|
|
|
|
|
if test "$ac_cv_crypt_ext_des" = "yes"; then
|
|
|
|
ac_result=1
|
|
|
|
ac_crypt_edes=1
|
|
|
|
else
|
|
|
|
ac_result=0
|
|
|
|
ac_crypt_edes=0
|
|
|
|
fi
|
|
|
|
AC_DEFINE_UNQUOTED(PHP_EXT_DES_CRYPT, $ac_result, [Whether the system supports extended DES salt])
|
|
|
|
|
2009-12-09 08:20:14 +08:00
|
|
|
if test "$ac_cv_crypt_sha512" = "yes"; then
|
|
|
|
ac_result=1
|
|
|
|
ac_crypt_sha512=1
|
|
|
|
else
|
|
|
|
ac_result=0
|
|
|
|
ac_crypt_sha512=0
|
|
|
|
fi
|
|
|
|
AC_DEFINE_UNQUOTED(PHP_EXT_SHA512_CRYPT, $ac_result, [Whether the system supports SHA512 salt])
|
|
|
|
|
|
|
|
if test "$ac_cv_crypt_sha256" = "yes"; then
|
|
|
|
ac_result=1
|
|
|
|
ac_crypt_sha256=1
|
|
|
|
else
|
|
|
|
ac_result=0
|
|
|
|
ac_crypt_sha256=0
|
|
|
|
fi
|
|
|
|
AC_DEFINE_UNQUOTED(PHP_EXT_SHA256_CRYPT, $ac_result, [Whether the system supports SHA256 salt])
|
|
|
|
|
2008-07-28 19:50:35 +08:00
|
|
|
AC_DEFINE_UNQUOTED(PHP_USE_PHP_CRYPT_R, 0, [Whether PHP has to use its own crypt_r for blowfish, des and ext des])
|
2007-07-11 19:50:37 +08:00
|
|
|
fi
|
1999-09-22 04:10:53 +08:00
|
|
|
|
2007-07-11 19:50:37 +08:00
|
|
|
dnl
|
|
|
|
dnl Check for available functions
|
|
|
|
dnl
|
2009-12-09 08:20:14 +08:00
|
|
|
AC_CHECK_FUNCS(getcwd getwd asinh acosh atanh log1p hypot glob strfmon nice fpclass isinf isnan mempcpy strpncpy)
|
2007-07-11 19:50:37 +08:00
|
|
|
AC_FUNC_FNMATCH
|
1999-04-25 05:52:53 +08:00
|
|
|
|
2009-11-29 14:13:22 +08:00
|
|
|
divert(5)dnl
|
2009-11-29 07:06:54 +08:00
|
|
|
|
2007-07-11 19:50:37 +08:00
|
|
|
dnl
|
|
|
|
dnl Check if there is a support means of creating a new process
|
|
|
|
dnl and defining which handles it receives
|
|
|
|
dnl
|
|
|
|
AC_CHECK_FUNCS(fork CreateProcess, [
|
2009-11-28 07:41:13 +08:00
|
|
|
php_can_support_proc_open=yes
|
2007-07-11 19:50:37 +08:00
|
|
|
break
|
|
|
|
],[
|
2009-11-28 07:41:13 +08:00
|
|
|
php_can_support_proc_open=no
|
|
|
|
])
|
2007-07-11 19:50:37 +08:00
|
|
|
AC_MSG_CHECKING([if your OS can spawn processes with inherited handles])
|
2009-11-28 07:41:13 +08:00
|
|
|
if test "$php_can_support_proc_open" = "yes"; then
|
2007-07-11 19:50:37 +08:00
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(PHP_CAN_SUPPORT_PROC_OPEN,1, [Define if your system has fork/vfork/CreateProcess])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
2003-01-16 00:29:00 +08:00
|
|
|
|
2005-11-30 02:26:02 +08:00
|
|
|
if test "$PHP_SAPI" = "cgi" || test "$PHP_SAPI" = "cli" || test "$PHP_SAPI" = "embed"; then
|
2001-09-12 10:07:46 +08:00
|
|
|
AC_DEFINE(ENABLE_CHROOT_FUNC, 1, [Whether to enable chroot() function])
|
|
|
|
fi
|
|
|
|
|
2002-11-19 10:34:13 +08:00
|
|
|
dnl
|
|
|
|
dnl Detect library functions needed by php dns_xxx functions
|
2009-08-12 06:07:35 +08:00
|
|
|
dnl ext/standard/php_dns.h will collect these in a single define: HAVE_FULL_DNS_FUNCS
|
2002-11-19 10:34:13 +08:00
|
|
|
dnl
|
2009-08-12 06:07:35 +08:00
|
|
|
PHP_CHECK_FUNC(res_nsearch, resolv, bind, socket)
|
|
|
|
PHP_CHECK_FUNC(dns_search, resolv, bind, socket)
|
2002-11-19 10:34:13 +08:00
|
|
|
PHP_CHECK_FUNC(dn_expand, resolv, bind, socket)
|
2009-01-12 07:37:16 +08:00
|
|
|
PHP_CHECK_FUNC(dn_skipname, resolv, bind, socket)
|
|
|
|
|
|
|
|
dnl
|
2009-08-12 06:07:35 +08:00
|
|
|
dnl These are old deprecated functions
|
2009-01-12 07:37:16 +08:00
|
|
|
dnl
|
|
|
|
|
2009-08-12 06:07:35 +08:00
|
|
|
PHP_CHECK_FUNC(res_search, resolv, bind, socket)
|
2002-11-19 10:34:13 +08:00
|
|
|
|
2003-10-04 20:23:11 +08:00
|
|
|
dnl
|
2007-07-11 19:50:37 +08:00
|
|
|
dnl Check if atof() accepts NAN
|
2003-10-04 20:23:11 +08:00
|
|
|
dnl
|
2004-03-27 08:50:41 +08:00
|
|
|
AC_CACHE_CHECK(whether atof() accepts NAN, ac_cv_atof_accept_nan,[
|
2007-07-11 19:50:37 +08:00
|
|
|
AC_TRY_RUN([
|
2004-03-27 08:50:41 +08:00
|
|
|
#include <math.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#ifdef HAVE_ISNAN
|
|
|
|
#define zend_isnan(a) isnan(a)
|
|
|
|
#elif defined(HAVE_FPCLASS)
|
|
|
|
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
|
|
|
|
#else
|
|
|
|
#define zend_isnan(a) 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int main(int argc, char** argv)
|
|
|
|
{
|
|
|
|
return zend_isnan(atof("NAN")) ? 0 : 1;
|
|
|
|
}
|
2007-07-11 19:50:37 +08:00
|
|
|
],[
|
|
|
|
ac_cv_atof_accept_nan=yes
|
|
|
|
],[
|
|
|
|
ac_cv_atof_accept_nan=no
|
|
|
|
],[
|
|
|
|
ac_cv_atof_accept_nan=no
|
|
|
|
])])
|
2004-03-27 09:41:32 +08:00
|
|
|
if test "$ac_cv_atof_accept_nan" = "yes"; then
|
|
|
|
AC_DEFINE([HAVE_ATOF_ACCEPTS_NAN], 1, [whether atof() accepts NAN])
|
|
|
|
fi
|
2004-03-27 08:50:41 +08:00
|
|
|
|
2007-07-11 19:50:37 +08:00
|
|
|
dnl
|
|
|
|
dnl Check if atof() accepts INF
|
|
|
|
dnl
|
2004-03-27 08:50:41 +08:00
|
|
|
AC_CACHE_CHECK(whether atof() accepts INF, ac_cv_atof_accept_inf,[
|
2007-07-11 19:50:37 +08:00
|
|
|
AC_TRY_RUN([
|
2004-03-27 08:50:41 +08:00
|
|
|
#include <math.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#ifdef HAVE_ISINF
|
|
|
|
#define zend_isinf(a) isinf(a)
|
|
|
|
#elif defined(INFINITY)
|
|
|
|
/* Might not work, but is required by ISO C99 */
|
|
|
|
#define zend_isinf(a) (((a)==INFINITY)?1:0)
|
|
|
|
#elif defined(HAVE_FPCLASS)
|
|
|
|
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
|
|
|
|
#else
|
|
|
|
#define zend_isinf(a) 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int main(int argc, char** argv)
|
|
|
|
{
|
|
|
|
return zend_isinf(atof("INF")) && zend_isinf(atof("-INF")) ? 0 : 1;
|
|
|
|
}
|
2007-07-11 19:50:37 +08:00
|
|
|
],[
|
|
|
|
ac_cv_atof_accept_inf=yes
|
|
|
|
],[
|
|
|
|
ac_cv_atof_accept_inf=no
|
|
|
|
],[
|
|
|
|
ac_cv_atof_accept_inf=no
|
|
|
|
])])
|
2004-03-27 09:41:32 +08:00
|
|
|
if test "$ac_cv_atof_accept_inf" = "yes"; then
|
|
|
|
AC_DEFINE([HAVE_ATOF_ACCEPTS_INF], 1, [whether atof() accepts INF])
|
|
|
|
fi
|
2004-03-27 08:50:41 +08:00
|
|
|
|
2007-07-11 19:50:37 +08:00
|
|
|
dnl
|
|
|
|
dnl Check if HUGE_VAL == INF
|
|
|
|
dnl
|
2004-05-10 15:23:38 +08:00
|
|
|
AC_CACHE_CHECK(whether HUGE_VAL == INF, ac_cv_huge_val_inf,[
|
2007-07-11 19:50:37 +08:00
|
|
|
AC_TRY_RUN([
|
2004-03-30 02:51:47 +08:00
|
|
|
#include <math.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#ifdef HAVE_ISINF
|
|
|
|
#define zend_isinf(a) isinf(a)
|
|
|
|
#elif defined(INFINITY)
|
|
|
|
/* Might not work, but is required by ISO C99 */
|
|
|
|
#define zend_isinf(a) (((a)==INFINITY)?1:0)
|
|
|
|
#elif defined(HAVE_FPCLASS)
|
|
|
|
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
|
|
|
|
#else
|
|
|
|
#define zend_isinf(a) 0
|
|
|
|
#endif
|
|
|
|
|
2004-05-10 15:23:38 +08:00
|
|
|
int main(int argc, char** argv)
|
|
|
|
{
|
|
|
|
return zend_isinf(HUGE_VAL) ? 0 : 1;
|
|
|
|
}
|
2007-07-11 19:50:37 +08:00
|
|
|
],[
|
|
|
|
ac_cv_huge_val_inf=yes
|
|
|
|
],[
|
|
|
|
ac_cv_huge_val_inf=no
|
|
|
|
],[
|
|
|
|
ac_cv_huge_val_inf=yes
|
|
|
|
])])
|
2004-05-10 15:23:38 +08:00
|
|
|
dnl This is the most probable fallback so we assume yes in case of cross compile.
|
|
|
|
if test "$ac_cv_huge_val_inf" = "yes"; then
|
|
|
|
AC_DEFINE([HAVE_HUGE_VAL_INF], 1, [whether HUGE_VAL == INF])
|
|
|
|
fi
|
|
|
|
|
2007-07-11 19:50:37 +08:00
|
|
|
dnl
|
|
|
|
dnl Check if HUGE_VAL + -HUGEVAL == NAN
|
|
|
|
dnl
|
2004-05-10 15:23:38 +08:00
|
|
|
AC_CACHE_CHECK(whether HUGE_VAL + -HUGEVAL == NAN, ac_cv_huge_val_nan,[
|
2007-07-11 19:50:37 +08:00
|
|
|
AC_TRY_RUN([
|
2004-05-10 15:23:38 +08:00
|
|
|
#include <math.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2004-03-30 02:51:47 +08:00
|
|
|
#ifdef HAVE_ISNAN
|
|
|
|
#define zend_isnan(a) isnan(a)
|
|
|
|
#elif defined(HAVE_FPCLASS)
|
|
|
|
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
|
|
|
|
#else
|
|
|
|
#define zend_isnan(a) 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int main(int argc, char** argv)
|
|
|
|
{
|
2004-04-04 00:38:10 +08:00
|
|
|
#if defined(__sparc__) && !(__GNUC__ >= 3)
|
2004-04-04 20:31:12 +08:00
|
|
|
/* prevent bug #27830 */
|
2004-04-04 00:38:10 +08:00
|
|
|
return 1;
|
|
|
|
#else
|
2004-05-10 15:23:38 +08:00
|
|
|
return zend_isnan(HUGE_VAL + -HUGE_VAL) ? 0 : 1;
|
2004-04-04 00:38:10 +08:00
|
|
|
#endif
|
2004-03-30 02:51:47 +08:00
|
|
|
}
|
2007-07-11 19:50:37 +08:00
|
|
|
],[
|
|
|
|
ac_cv_huge_val_nan=yes
|
|
|
|
],[
|
|
|
|
ac_cv_huge_val_nan=no
|
|
|
|
],[
|
|
|
|
ac_cv_huge_val_nan=yes
|
|
|
|
])])
|
2004-03-30 02:51:47 +08:00
|
|
|
dnl This is the most probable fallback so we assume yes in case of cross compile.
|
|
|
|
if test "$ac_cv_huge_val_nan" = "yes"; then
|
2004-04-03 18:42:42 +08:00
|
|
|
AC_DEFINE([HAVE_HUGE_VAL_NAN], 1, [whether HUGE_VAL + -HUGEVAL == NAN])
|
2004-03-30 02:51:47 +08:00
|
|
|
fi
|
|
|
|
|
2007-07-11 19:50:37 +08:00
|
|
|
dnl
|
|
|
|
dnl Check for strptime()
|
|
|
|
dnl
|
2006-08-24 19:06:02 +08:00
|
|
|
AC_CACHE_CHECK(whether strptime() declaration fails, ac_cv_strptime_decl_fails,[
|
2007-07-11 19:50:37 +08:00
|
|
|
AC_TRY_COMPILE([
|
2006-08-24 19:06:02 +08:00
|
|
|
#include <time.h>
|
2007-07-11 19:50:37 +08:00
|
|
|
],[
|
2006-08-24 19:06:02 +08:00
|
|
|
#ifndef HAVE_STRPTIME
|
|
|
|
#error no strptime() on this platform
|
|
|
|
#else
|
|
|
|
/* use invalid strptime() declaration to see if it fails to compile */
|
|
|
|
int strptime(const char *s, const char *format, struct tm *tm);
|
|
|
|
#endif
|
2007-07-11 19:50:37 +08:00
|
|
|
],[
|
|
|
|
ac_cv_strptime_decl_fails=no
|
|
|
|
],[
|
|
|
|
ac_cv_strptime_decl_fails=yes
|
|
|
|
])])
|
2006-08-24 19:06:02 +08:00
|
|
|
if test "$ac_cv_strptime_decl_fails" = "yes"; then
|
|
|
|
AC_DEFINE([HAVE_STRPTIME_DECL_FAILS], 1, [whether strptime() declaration fails])
|
|
|
|
fi
|
|
|
|
|
2007-07-11 19:50:37 +08:00
|
|
|
dnl
|
|
|
|
dnl Check for i18n capabilities
|
|
|
|
dnl
|
|
|
|
AC_CHECK_HEADERS([wchar.h])
|
|
|
|
AC_CHECK_FUNCS([mblen])
|
|
|
|
AC_CHECK_FUNCS([mbrlen mbsinit],,,[
|
|
|
|
#ifdef HAVE_WCHAR_H
|
|
|
|
# include <wchar.h>
|
|
|
|
#endif
|
|
|
|
])
|
|
|
|
AC_CACHE_CHECK([for mbstate_t], [ac_cv_type_mbstate_t],[
|
|
|
|
AC_TRY_COMPILE([
|
|
|
|
#ifdef HAVE_WCHAR_H
|
|
|
|
# include <wchar.h>
|
|
|
|
#endif
|
|
|
|
],[
|
|
|
|
int __tmp__() { mbstate_t a; }
|
|
|
|
],[
|
|
|
|
ac_cv_type_mbstate_t=yes
|
|
|
|
],[
|
|
|
|
ac_cv_type_mbstate_t=no
|
|
|
|
])])
|
|
|
|
if test "$ac_cv_type_mbstate_t" = "yes"; then
|
|
|
|
AC_DEFINE([HAVE_MBSTATE_T], 1, [Define if your system has mbstate_t in wchar.h])
|
|
|
|
fi
|
2003-10-04 20:23:11 +08:00
|
|
|
|
2007-07-11 19:50:37 +08:00
|
|
|
dnl
|
|
|
|
dnl Setup extension sources
|
|
|
|
dnl
|
2002-10-22 07:41:38 +08:00
|
|
|
PHP_NEW_EXTENSION(standard, array.c base64.c basic_functions.c browscap.c crc32.c crypt.c \
|
|
|
|
cyr_convert.c datetime.c dir.c dl.c dns.c exec.c file.c filestat.c \
|
|
|
|
flock_compat.c formatted_print.c fsock.c head.c html.c image.c \
|
|
|
|
info.c iptc.c lcg.c link.c mail.c math.c md5.c metaphone.c \
|
2005-06-20 06:15:27 +08:00
|
|
|
microtime.c pack.c pageinfo.c quot_print.c rand.c \
|
2007-10-05 23:00:09 +08:00
|
|
|
soundex.c string.c scanf.c syslog.c type.c uniqid.c url.c \
|
2009-07-27 06:59:46 +08:00
|
|
|
var.c versioning.c assert.c strnatcmp.c levenshtein.c \
|
2002-10-22 07:41:38 +08:00
|
|
|
incomplete_class.c url_scanner_ex.c ftp_fopen_wrapper.c \
|
|
|
|
http_fopen_wrapper.c php_fopen_wrapper.c credits.c css.c \
|
2003-10-27 13:35:41 +08:00
|
|
|
var_unserializer.c ftok.c sha1.c user_filters.c uuencode.c \
|
2006-01-05 05:31:35 +08:00
|
|
|
filters.c proc_open.c streamsfuncs.c http.c)
|
2002-03-07 22:20:02 +08:00
|
|
|
|
|
|
|
PHP_ADD_MAKEFILE_FRAGMENT
|
2005-11-22 07:08:02 +08:00
|
|
|
PHP_INSTALL_HEADERS([ext/standard/])
|