From: Kurt Zeilenga Date: Mon, 15 Mar 1999 19:31:13 +0000 (+0000) Subject: Add EBCDIC test in preparation for VM port. X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~373 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8694a8395c4534c02eb140f6a26460bac42fbc3f;p=openldap Add EBCDIC test in preparation for VM port. --- diff --git a/build/openldap.m4 b/build/openldap.m4 index 9b4b8ea225..14731edda2 100644 --- a/build/openldap.m4 +++ b/build/openldap.m4 @@ -394,6 +394,28 @@ fi ]) dnl dnl ==================================================================== +dnl Check if system uses EBCDIC instead of ASCII +AC_DEFUN([OL_SYS_EBCDIC], +[ +AC_MSG_CHECKING([for EBCDIC]) +AC_CACHE_VAL(ol_cv_sys_ebcdic,[ + AC_TRY_RUN([ +main() +{ + if ('M' == 0xd4) + exit(1); + else + exit(0); +}], + [ol_cv_sys_ebcdic=no], + [ol_cv_sys_ebcdic=yes])]) +AC_MSG_RESULT($ol_cv_sys_ebcdic) +if test $ol_cv_sys_ebcdic != no ; then + AC_DEFINE(HAVE_EBCDIC,1, [define if system uses EBCDIC instead of ASCII]) +fi +]) +dnl +dnl ==================================================================== dnl Check for declaration of sys_errlist in one of stdio.h and errno.h. dnl Declaration of sys_errlist on BSD4.4 interferes with our declaration. dnl Reported by Keith Bostic. diff --git a/configure b/configure index f3d4220f09..2e1441554c 100755 --- a/configure +++ b/configure @@ -10016,14 +10016,58 @@ done # Check Configuration +echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6 +echo "configure:10021: checking for EBCDIC" >&5 +if eval "test \"`echo '$''{'ol_cv_sys_ebcdic'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ol_cv_sys_ebcdic=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ol_cv_sys_ebcdic=yes +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$ol_cv_sys_ebcdic" 1>&6 +if test $ol_cv_sys_ebcdic != no ; then + cat >> confdefs.h <<\EOF +#define HAVE_EBCDIC 1 +EOF + +fi + + echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6 -echo "configure:10021: checking declaration of sys_errlist" >&5 +echo "configure:10065: checking declaration of sys_errlist" >&5 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -10033,7 +10077,7 @@ int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:10037: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10081: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_dcl_sys_errlist=yes else @@ -10053,20 +10097,20 @@ if test $ol_cv_dcl_sys_errlist = no ; then EOF echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6 -echo "configure:10057: checking existence of sys_errlist" >&5 +echo "configure:10101: checking existence of sys_errlist" >&5 if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:10070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_have_sys_errlist=yes else @@ -10090,13 +10134,13 @@ fi echo $ac_n "checking strdup declaration""... $ac_c" 1>&6 -echo "configure:10094: checking strdup declaration" >&5 +echo "configure:10138: checking strdup declaration" >&5 if eval "test \"`echo '$''{'ol_cv_dcl_strdup'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -10104,7 +10148,7 @@ int main() { extern char *strdup(); ; return 0; } EOF -if { (eval echo configure:10108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10152: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_dcl_strdup=yes else diff --git a/configure.in b/configure.in index 38ad26b0d7..0fdab25cf3 100644 --- a/configure.in +++ b/configure.in @@ -1669,6 +1669,7 @@ AC_REPLACE_FUNCS(getopt tempnam) dnl ---------------------------------------------------------------- # Check Configuration +OL_SYS_EBCDIC OL_SYS_ERRLIST dnl ---------------------------------------------------------------- diff --git a/include/portable.h.in b/include/portable.h.in index 90a92f1e16..6b5c8c1d41 100644 --- a/include/portable.h.in +++ b/include/portable.h.in @@ -663,6 +663,9 @@ /* define if cross compiling */ #undef CROSS_COMPILING +/* define if system uses EBCDIC instead of ASCII */ +#undef HAVE_EBCDIC + /* define if sys_errlist is not declared in stdio.h or errno.h */ #undef DECL_SYS_ERRLIST