diff --git a/acinclude.m4 b/acinclude.m4 index fa2e527f6d1..bd95759a400 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -604,3 +604,22 @@ AC_DEFUN(PHP_DECLARED_TIMEZONE,[ AC_DEFINE(HAVE_DECLARED_TIMEZONE, 1, [Whether system headers declare timezone]) fi ]) + +AC_DEFUN(PHP_EBCDIC,[ + AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[ + AC_TRY_RUN( [ +int main(void) { + return (unsigned char)'A' != (unsigned char)0xC1; +} +],[ + ac_cv_ebcdic="yes" +],[ + ac_cv_ebcdic="no" +],[ + ac_cv_ebcdic="no" +])]) + if test "$ac_cv_ebcdic" = "yes"; then + AC_DEFINE(CHARSET_EBCDIC,, [Define if system uses EBCDIC]) + fi +]) + diff --git a/configure.in b/configure.in index a8151a88ade..dfd7aec4f4a 100644 --- a/configure.in +++ b/configure.in @@ -153,6 +153,9 @@ if test -n "$PROG_SENDMAIL"; then AC_DEFINE(HAVE_SENDMAIL) fi +dnl Check whether the system uses EBCDIC (not ASCII) as its native codeset +PHP_EBCDIC + dnl dnl Check for /usr/pkg/{lib,include} which is where NetBSD puts binary dnl and source packages. This should be harmless on other OSs.