Issue 2560 - porting to BS2000 (OSD_POSIX)
Summary: porting to BS2000 (OSD_POSIX)
Status: VERIFIED FEEDBACK
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: build (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-30 14:42 UTC by jfrederic.clere@fujitsu-siemens.com
Modified: 2021-08-03 17:46 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description jfrederic.clere@fujitsu-siemens.com 2003-05-30 14:42:51 UTC
Full_Name: Jean-Frederic Clere
Version: HEAD
OS: BS2000
URL: ftp://ftp.openldap.org/incoming/jfrederic.clere-030530.ebcdic
Submission from: (NULL) (217.115.66.150)


Find enclosed the patch needed to get slurpd and slapd running on a BS2000.
The ITS 2558 and 2559 need to be apply togother with the attached patche.

Comment 1 Kurt Zeilenga 2003-05-30 18:38:29 UTC
moved from Incoming to Build
Comment 2 Kurt Zeilenga 2003-08-11 17:52:44 UTC
In your patch, you note:
  /* The autoconf does not detect correctly EBCDIC */

I rather see autoconf fixed to properly detect EBCDIC.  If an OpenLDAP specific
fix is needed in the short-term, I rather see this contained to configure.in
than acconfig.h.

I suggest this issue be discussed on the developers' list.

Kurt
Comment 3 Kurt Zeilenga 2003-08-11 17:53:13 UTC
changed notes
changed state Open to Feedback
Comment 4 jfrederic.clere@fujitsu-siemens.com 2003-08-12 09:26:36 UTC
Kurt Zeilenga wrote:
> In your patch, you note:
>   /* The autoconf does not detect correctly EBCDIC */
> 
> I rather see autoconf fixed to properly detect EBCDIC.  If an OpenLDAP specific
> fix is needed in the short-term, I rather see this contained to configure.in
> than acconfig.h.

+++
dnl
dnl ====================================================================
dnl Check if system uses EBCDIC instead of ASCII
AC_DEFUN([OL_CPP_EBCDIC], [# test for EBCDIC
AC_CACHE_CHECK([for EBCDIC],ol_cv_cpp_ebcdic,[
         AC_TRY_CPP([
#if !('M' == 0xd4)
#include <__ASCII__/generate_error.h>
#endif
],
         [ol_cv_cpp_ebcdic=yes],
         [ol_cv_cpp_ebcdic=no])])
if test $ol_cv_cpp_ebcdic = yes ; then
         AC_DEFINE(HAVE_EBCDIC,1, [define if system uses EBCDIC instead of ASCII])
fi
])
+++

That is the place where we detect EBCDIC. (in build/openldap.m4).
When I am using "CC=cc -K literal_encoding_ascii; export CC ; configure" the 
(pre)compiler handle the 'M' in ASCII therefore EBCDIC is not detected.

Adding a #if !defined(_OSD_POSIX) before include <__ASCII__/generate_error.h> 
solves my problem.

> 
> I suggest this issue be discussed on the developers' list.
> 
> Kurt
> 
> 


Comment 5 Kurt Zeilenga 2003-08-13 20:08:11 UTC
Using _OSD_POSIX seems counter to the purpose of autoconf
(to "detect" the feature)...  is there a better way?

Also, I assume HAVE_EBCDIC implies literals are EBCDIC.
Maybe we need another macro to say that literals are ASCII but
EBCDIC is used elsewhere.

Guess I need to review exactly how HAVE_EBCDIC is used...

Kurt

At 02:22 AM 8/12/2003, jfrederic.clere@fujitsu-siemens.com wrote:
>Kurt Zeilenga wrote:
>> In your patch, you note:
>>   /* The autoconf does not detect correctly EBCDIC */
>> 
>> I rather see autoconf fixed to properly detect EBCDIC.  If an OpenLDAP specific
>> fix is needed in the short-term, I rather see this contained to configure.in
>> than acconfig.h.
>
>+++
>dnl
>dnl ====================================================================
>dnl Check if system uses EBCDIC instead of ASCII
>AC_DEFUN([OL_CPP_EBCDIC], [# test for EBCDIC
>AC_CACHE_CHECK([for EBCDIC],ol_cv_cpp_ebcdic,[
>         AC_TRY_CPP([
>#if !('M' == 0xd4)
>#include <__ASCII__/generate_error.h>
>#endif
>],
>         [ol_cv_cpp_ebcdic=yes],
>         [ol_cv_cpp_ebcdic=no])])
>if test $ol_cv_cpp_ebcdic = yes ; then
>         AC_DEFINE(HAVE_EBCDIC,1, [define if system uses EBCDIC instead of ASCII])
>fi
>])
>+++
>
>That is the place where we detect EBCDIC. (in build/openldap.m4).
>When I am using "CC=cc -K literal_encoding_ascii; export CC ; configure" the 
>(pre)compiler handle the 'M' in ASCII therefore EBCDIC is not detected.
>
>Adding a #if !defined(_OSD_POSIX) before include <__ASCII__/generate_error.h> 
>solves my problem.
>
>> 
>> I suggest this issue be discussed on the developers' list.
>> 
>> Kurt
>> 
>> 

Comment 6 Howard Chu 2003-08-13 20:30:38 UTC
We already have a test for EBCDIC in libtool, which uses echo and od to
determine the result. Can we use the same test in the autoconf script,
instead of using the compiler to test?

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support

> -----Original Message-----
> From: owner-openldap-bugs@OpenLDAP.org
> [mailto:owner-openldap-bugs@OpenLDAP.org]On Behalf Of
> Kurt@OpenLDAP.org
> Sent: Wednesday, August 13, 2003 1:07 PM
> To: openldap-its@OpenLDAP.org
> Subject: Re: porting to BS2000 (OSD_POSIX) (ITS#2560)
>
>
> Using _OSD_POSIX seems counter to the purpose of autoconf
> (to "detect" the feature)...  is there a better way?
>
> Also, I assume HAVE_EBCDIC implies literals are EBCDIC.
> Maybe we need another macro to say that literals are ASCII but
> EBCDIC is used elsewhere.
>
> Guess I need to review exactly how HAVE_EBCDIC is used...
>
> Kurt
>
> At 02:22 AM 8/12/2003, jfrederic.clere@fujitsu-siemens.com wrote:
> >Kurt Zeilenga wrote:
> >> In your patch, you note:
> >>   /* The autoconf does not detect correctly EBCDIC */
> >>
> >> I rather see autoconf fixed to properly detect EBCDIC.  If
> an OpenLDAP specific
> >> fix is needed in the short-term, I rather see this
> contained to configure.in
> >> than acconfig.h.
> >
> >+++
> >dnl
> >dnl
> ====================================================================
> >dnl Check if system uses EBCDIC instead of ASCII
> >AC_DEFUN([OL_CPP_EBCDIC], [# test for EBCDIC
> >AC_CACHE_CHECK([for EBCDIC],ol_cv_cpp_ebcdic,[
> >         AC_TRY_CPP([
> >#if !('M' == 0xd4)
> >#include <__ASCII__/generate_error.h>
> >#endif
> >],
> >         [ol_cv_cpp_ebcdic=yes],
> >         [ol_cv_cpp_ebcdic=no])])
> >if test $ol_cv_cpp_ebcdic = yes ; then
> >         AC_DEFINE(HAVE_EBCDIC,1, [define if system uses
> EBCDIC instead of ASCII])
> >fi
> >])
> >+++
> >
> >That is the place where we detect EBCDIC. (in build/openldap.m4).
> >When I am using "CC=cc -K literal_encoding_ascii; export CC
> ; configure" the
> >(pre)compiler handle the 'M' in ASCII therefore EBCDIC is
> not detected.
> >
> >Adding a #if !defined(_OSD_POSIX) before include
> <__ASCII__/generate_error.h>
> >solves my problem.
> >
> >>
> >> I suggest this issue be discussed on the developers' list.
> >>
> >> Kurt
> >>
> >>
>
>
>

Comment 7 Howard Chu 2003-10-13 22:10:06 UTC
> -----Original Message-----
> From: owner-openldap-bugs@OpenLDAP.org
> [mailto:owner-openldap-bugs@OpenLDAP.org]On Behalf Of Kurt Zeilenga

> In your patch, you note:
>   /* The autoconf does not detect correctly EBCDIC */

> I rather see autoconf fixed to properly detect EBCDIC.  If an
> OpenLDAP specific
> fix is needed in the short-term, I rather see this contained
> to configure.in than acconfig.h.
>
> I suggest this issue be discussed on the developers' list.

Another problem I just noticed; there is a test for <ctype.h> functionality
in the check for ANSI C headers that fails on OS/390 because HAVE_EBCDIC is
defined, but the compiler is set to use ASCII literals. So configure decides
that the ANSI C headers are not available, even though they are.

On a slightly related topic, build/shtool uses hardcoded ASCII code values
for its "terminal bold sequence" which is not portable. E.g., it uses
	awk 'BEGIN { printf("%c%c%c%c", 27, 91, 49, 109); }'
so these codes are used literally on an EBCDIC host, which is garbage. If it
used the actual literals "^[[1m" instead, the same string would work on both
ASCII and EBCDIC hosts. This is hardly a tragedy, but I figured it should be
mentioned.

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support

Comment 8 OpenLDAP project 2014-08-01 21:04:04 UTC
discussion needed