1999-04-17 08:37:12 +08:00
|
|
|
dnl $Id$ -*- sh -*-
|
|
|
|
|
2000-05-04 17:42:27 +08:00
|
|
|
divert(3)dnl
|
1999-04-22 10:48:28 +08:00
|
|
|
|
2001-03-11 18:08:27 +08:00
|
|
|
dnl
|
|
|
|
dnl Check if flush should be called explicitly after buffered io
|
|
|
|
dnl
|
|
|
|
AC_DEFUN(AC_FLUSH_IO,[
|
|
|
|
AC_CACHE_CHECK([whether flush should be called explicitly after a bufferered io], ac_cv_flush_io,[
|
|
|
|
AC_TRY_RUN( [
|
|
|
|
#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
|
|
|
])])
|
|
|
|
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
|
|
|
|
])
|
|
|
|
|
1999-04-22 10:48:28 +08:00
|
|
|
dnl
|
|
|
|
dnl Check for crypt() capabilities
|
|
|
|
dnl
|
|
|
|
AC_DEFUN(AC_CRYPT_CAP,[
|
|
|
|
|
1999-12-27 06:35:55 +08:00
|
|
|
AC_CACHE_CHECK(for standard DES crypt, ac_cv_crypt_des,[
|
1999-04-22 10:48:28 +08:00
|
|
|
AC_TRY_RUN([
|
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
|
|
|
|
}],[
|
1999-12-27 06:35:55 +08:00
|
|
|
ac_cv_crypt_des=yes
|
1999-04-22 10:48:28 +08:00
|
|
|
],[
|
1999-12-27 06:35:55 +08:00
|
|
|
ac_cv_crypt_des=no
|
1999-04-22 10:48:28 +08:00
|
|
|
],[
|
1999-12-27 06:35:55 +08:00
|
|
|
ac_cv_crypt_des=yes
|
1999-04-22 10:48:28 +08:00
|
|
|
])
|
1999-12-27 06:35:55 +08:00
|
|
|
])
|
|
|
|
if test "$ac_cv_crypt_des" = "yes"; then
|
2000-02-26 11:20:55 +08:00
|
|
|
ac_result=1
|
1999-12-27 06:35:55 +08:00
|
|
|
else
|
2000-02-26 11:20:55 +08:00
|
|
|
ac_result=0
|
1999-12-27 06:35:55 +08:00
|
|
|
fi
|
2000-02-26 11:20:55 +08:00
|
|
|
AC_DEFINE_UNQUOTED(PHP_STD_DES_CRYPT, $ac_result, [Whether the system supports standard DES salt])
|
1999-04-22 10:48:28 +08:00
|
|
|
|
1999-12-27 06:35:55 +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([
|
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","_J9..rasm"),"_J9..rasmBYk8r9AiWNc"));
|
|
|
|
#else
|
|
|
|
exit(0);
|
|
|
|
#endif
|
|
|
|
}],[
|
1999-12-27 06:35:55 +08:00
|
|
|
ac_cv_crypt_ext_des=yes
|
1999-04-22 10:48:28 +08:00
|
|
|
],[
|
1999-12-27 06:35:55 +08:00
|
|
|
ac_cv_crypt_ext_des=no
|
1999-04-22 10:48:28 +08:00
|
|
|
],[
|
1999-12-27 06:35:55 +08:00
|
|
|
ac_cv_crypt_ext_des=no
|
|
|
|
])
|
1999-04-22 10:48:28 +08:00
|
|
|
])
|
1999-12-27 06:35:55 +08:00
|
|
|
if test "$ac_cv_crypt_ext_des" = "yes"; then
|
2000-02-26 11:20:55 +08:00
|
|
|
ac_result=1
|
1999-12-27 06:35:55 +08:00
|
|
|
else
|
2000-02-26 11:20:55 +08:00
|
|
|
ac_result=0
|
1999-12-27 06:35:55 +08:00
|
|
|
fi
|
2000-02-26 11:20:55 +08:00
|
|
|
AC_DEFINE_UNQUOTED(PHP_EXT_DES_CRYPT, $ac_result, [Whether the system supports extended DES salt])
|
1999-04-22 10:48:28 +08:00
|
|
|
|
1999-12-27 06:35:55 +08:00
|
|
|
AC_CACHE_CHECK(for MD5 crypt, ac_cv_crypt_md5,[
|
1999-04-22 10:48:28 +08:00
|
|
|
AC_TRY_RUN([
|
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
|
|
|
|
}],[
|
1999-12-27 06:35:55 +08:00
|
|
|
ac_cv_crypt_md5=yes
|
1999-04-22 10:48:28 +08:00
|
|
|
],[
|
1999-12-27 06:35:55 +08:00
|
|
|
ac_cv_crypt_md5=no
|
1999-04-22 10:48:28 +08:00
|
|
|
],[
|
1999-12-27 06:35:55 +08:00
|
|
|
ac_cv_crypt_md5=no
|
1999-04-22 10:48:28 +08:00
|
|
|
])
|
1999-12-27 06:35:55 +08:00
|
|
|
])
|
|
|
|
if test "$ac_cv_crypt_md5" = "yes"; then
|
2000-02-26 11:20:55 +08:00
|
|
|
ac_result=1
|
1999-12-27 06:35:55 +08:00
|
|
|
else
|
2000-05-23 17:09:11 +08:00
|
|
|
if test "$ac_cv_crypt_des" != "yes"; then
|
|
|
|
PHP_DEBUG_MACRO(debug.log)
|
|
|
|
fi
|
2000-02-26 11:20:55 +08:00
|
|
|
ac_result=0
|
1999-12-27 06:35:55 +08:00
|
|
|
fi
|
2000-02-26 11:20:55 +08:00
|
|
|
AC_DEFINE_UNQUOTED(PHP_MD5_CRYPT, $ac_result, [Whether the system supports MD5 salt])
|
1999-04-22 10:48:28 +08:00
|
|
|
|
1999-12-27 06:35:55 +08:00
|
|
|
AC_CACHE_CHECK(for Blowfish crypt, ac_cv_crypt_blowfish,[
|
1999-04-22 10:48:28 +08:00
|
|
|
AC_TRY_RUN([
|
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
|
|
|
|
}],[
|
1999-12-27 06:35:55 +08:00
|
|
|
ac_cv_crypt_blowfish=yes
|
1999-04-22 10:48:28 +08:00
|
|
|
],[
|
1999-12-27 06:35:55 +08:00
|
|
|
ac_cv_crypt_blowfish=no
|
1999-04-22 10:48:28 +08:00
|
|
|
],[
|
1999-12-27 06:35:55 +08:00
|
|
|
ac_cv_crypt_blowfish=no
|
|
|
|
])
|
1999-04-22 10:48:28 +08:00
|
|
|
])
|
1999-12-27 06:35:55 +08:00
|
|
|
if test "$ac_cv_crypt_blowfish" = "yes"; then
|
2000-02-26 11:20:55 +08:00
|
|
|
ac_result=1
|
1999-12-27 06:35:55 +08:00
|
|
|
else
|
2000-02-26 11:20:55 +08:00
|
|
|
ac_result=0
|
1999-12-27 06:35:55 +08:00
|
|
|
fi
|
2000-02-26 11:20:55 +08:00
|
|
|
AC_DEFINE_UNQUOTED(PHP_BLOWFISH_CRYPT, $ac_result, [Whether the system supports BlowFish salt])
|
1999-04-22 10:48:28 +08:00
|
|
|
])
|
|
|
|
|
2002-03-26 19:05:18 +08:00
|
|
|
dnl AC_CHECK_LIB(pam, pam_start, [
|
|
|
|
dnl EXTRA_LIBS="$EXTRA_LIBS -lpam"
|
|
|
|
dnl AC_DEFINE(HAVE_LIBPAM,1,[ ]) ], [])
|
1999-04-23 12:54:31 +08:00
|
|
|
|
2002-10-24 20:21:07 +08:00
|
|
|
AC_CHECK_FUNCS(getcwd getwd asinh acosh atanh log1p hypot)
|
1999-09-22 04:10:53 +08:00
|
|
|
|
2000-05-05 19:23:12 +08:00
|
|
|
AC_CRYPT_CAP
|
2001-03-11 18:08:27 +08:00
|
|
|
AC_FLUSH_IO
|
1999-04-25 05:52:53 +08:00
|
|
|
|
2000-05-04 17:42:27 +08:00
|
|
|
divert(5)dnl
|
1999-04-22 10:48:28 +08:00
|
|
|
|
2002-04-09 02:43:35 +08:00
|
|
|
AC_ARG_WITH(regex,
|
|
|
|
[ --with-regex=TYPE regex library type: system, apache, php. Default: php
|
|
|
|
WARNING: Do NOT use unless you know what you are doing!],
|
|
|
|
[
|
|
|
|
case $withval in
|
|
|
|
system)
|
|
|
|
if test "$PHP_SAPI" = "apache" || test "$PHP_SAPI" = "apache2filter"; then
|
|
|
|
REGEX_TYPE=php
|
|
|
|
else
|
|
|
|
REGEX_TYPE=system
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
apache)
|
|
|
|
REGEX_TYPE=apache
|
|
|
|
;;
|
|
|
|
php)
|
|
|
|
REGEX_TYPE=php
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
REGEX_TYPE=php
|
|
|
|
AC_MSG_WARN(Invalid regex library type. Using default value: php)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
],[
|
|
|
|
REGEX_TYPE=php
|
|
|
|
])
|
2002-10-01 07:31:13 +08:00
|
|
|
|
|
|
|
AC_FUNC_FNMATCH
|
2002-03-22 03:18:13 +08:00
|
|
|
|
2002-10-30 23:11:11 +08:00
|
|
|
dnl getopt long options disabled for now
|
|
|
|
dnl as we can't be sure that we get the right getopt.h here
|
|
|
|
dnl using the standard AC_CHECK macros
|
|
|
|
dnl AC_CHECK_HEADERS(getopt.h)
|
|
|
|
dnl AC_CHECK_FUNCS(getopt_long getopt_long_only)
|
2002-10-25 04:04:16 +08:00
|
|
|
|
2002-10-30 23:11:11 +08:00
|
|
|
AC_CHECK_FUNCS(glob strfmon)
|
2002-10-22 00:07:21 +08:00
|
|
|
|
2001-09-12 10:07:46 +08:00
|
|
|
if test "$PHP_SAPI" = "cgi"; then
|
|
|
|
AC_DEFINE(ENABLE_CHROOT_FUNC, 1, [Whether to enable chroot() function])
|
|
|
|
fi
|
|
|
|
|
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 \
|
|
|
|
microtime.c pack.c pageinfo.c parsedate.c quot_print.c rand.c \
|
|
|
|
reg.c soundex.c string.c scanf.c syslog.c type.c uniqid.c url.c \
|
|
|
|
url_scanner.c var.c versioning.c assert.c strnatcmp.c levenshtein.c \
|
|
|
|
incomplete_class.c url_scanner_ex.c ftp_fopen_wrapper.c \
|
|
|
|
http_fopen_wrapper.c php_fopen_wrapper.c credits.c css.c \
|
|
|
|
var_unserializer.c ftok.c aggregation.c sha1.c )
|
2002-03-07 22:20:02 +08:00
|
|
|
|
|
|
|
PHP_ADD_MAKEFILE_FRAGMENT
|