groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Groff] OS/390 port - an introduction, patches


From: Sándor Bárány
Subject: [Groff] OS/390 port - an introduction, patches
Date: Thu, 09 Mar 2000 19:38:24 -0500

Hi all,

I copy here some parts of my previous letter to Werner. 

I want to let you know I have ported groff in the last days to OS/390.
This sytem has a bit old-fashioned, but very robust, fully
POSIX-compliant UNIX subsystem (USS). There are a lot of commercial
products available on that, from IBM (Domino, WebSphere) and others
(SAP, Peoplesoft etc.). I am a member of a small, time limited  project
titled "Using Open Source Software on OS/390 UNIX". The goal is making
OS/390 more attractive to developers through porting essential programs.
The project is fully IBM-sponsored and uses only IBM resources. However,
the results will be made available for free download (the book itself,
in pdf, and all the distribution materials, sources and binaries). 

The main problem in porting is that the IBM Mainframe machine uses
EBCDIC internally, which is a real 8bit character set. All programs
depending on hard-coded constants from the not-visible ascii ranges make
difficulities. An other problem is the really strict typecasting in the
IBM (commercial) C compiler.

My changes to the groff code are small, and concentrate on the inherent
differences mentioned above. The final version will be soon available in
form of patches. I am not an IBM employee and therefore it is unsure if
I will have access to this environment. Therefore I can not promise to
maintain this platform.

Attached you will find an raw patch file. The EBCDIC dependencies will
be done in the following way:
#ifdef IS_EBCDIC_HOST
      fputc(had_prompt ? ':' : '\057', stderr);
#else
      fputc(had_prompt ? ':' : '\007', stderr);
#endif

I deleted the changes to the font description files - they must be
completely replaced due to EBCDIC coding. It would be a nice excercise
for the autoconf step (if host=i390-ibm-mvs), include an other set of
PROTO files and define the IS_EBCDIC_HOST macro.

Regards,

Sándor Bárány, Co-Author of the RedBook 
                 "Using Open Source Software on OS/390 UNIX"
IBM Resident  in Poughkeepsie, NY by 
International Technical Support Organization (ITSO)
(http://www.redbooks.ibm.com/resindex.html)
E-mail:  address@hidden
IBM Notes:  ITSO Resident 24/Poughkeepsie/address@hidden
Tel: (1-914) 433-1481 Fax: (1-914) 432-8264

diff -rbwC groff-1.15/configure s390-groff-1.15/configure
*** groff-1.15/configure Tue Dec 14 08:18:56 1999
--- s390-groff-1.15/configure Fri Mar  3 14:39:34 2000
***************
*** 2750,2754 ****
  s%\$%$$%g
  EOF
! DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
  rm -f conftest.defs
  
--- 2711,2715 ----
  s%\$%$$%g
  EOF
! DEFS=`sed -f conftest.defs confdefs.h | tr '\n' ' '`
  rm -f conftest.defs
diff -rbwC groff-1.15/libgroff/illegal.cc
s390-groff-1.15/libgroff/illegal.cc
*** groff-1.15/libgroff/illegal.cc Fri May 21 00:50:38 1999
--- s390-groff-1.15/libgroff/illegal.cc Fri Mar  3 18:24:22 2000
***************
*** 4,8 ****
  
  char illegal_char_table[256]= {
!   1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1,
    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
--- 4,10 ----
  
  char illegal_char_table[256]= {
!   1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1,
!   1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
!   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
***************
*** 12,17 ****
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
--- 14,17 ----
diff -rbwC groff-1.15/refer/refer.cc s390-groff-1.15/refer/refer.cc
*** groff-1.15/refer/refer.cc Fri Dec 24 17:18:13 1999
--- s390-groff-1.15/refer/refer.cc Fri Mar  3 18:22:34 2000
***************
*** 514,518 ****
            pending_line += PRE_LABEL_MARKER;
          pending_line += pre;
!         char lm = LABEL_MARKER + lt;
          pending_line += lm;
          pending_line += post;
--- 514,518 ----
            pending_line += PRE_LABEL_MARKER;
          pending_line += pre;
!         char lm = LABEL_MARKER + (char) lt;
          pending_line += lm;
          pending_line += post;
***************
*** 922,926 ****
  extern "C" {
  
! static int rcompare(const void *p1, const void *p2)
  {
    return compare_reference(**(reference **)p1, **(reference **)p2);
--- 922,929 ----
  extern "C" {
  
! #ifndef __MVS__
! static
! #endif
!  int rcompare(const void *p1, const void *p2)
  {
    return compare_reference(**(reference **)p1, **(reference **)p2);
diff -rbwC groff-1.15/troff/env.cc s390-groff-1.15/troff/env.cc
*** groff-1.15/troff/env.cc Fri May 21 00:50:38 1999
--- s390-groff-1.15/troff/env.cc Fri Mar  3 18:22:58 2000
***************
*** 196,200 ****
  extern "C" {
  
! static int compare_ranges(const void *p1, const void *p2)
  {
    return ((size_range *)p1)->min - ((size_range *)p2)->min;
--- 196,203 ----
  extern "C" {
  
! #ifndef __MVS__
! static
! #endif
!  int compare_ranges(const void *p1, const void *p2)
  {
    return ((size_range *)p1)->min - ((size_range *)p2)->min;
diff -rbwC groff-1.15/troff/input.cc s390-groff-1.15/troff/input.cc
*** groff-1.15/troff/input.cc Tue Dec 28 03:27:27 1999
--- s390-groff-1.15/troff/input.cc Fri Mar  3 21:09:13 2000
***************
*** 136,141 ****
  const int ESCAPE_UNDERSCORE = 023;
  const int ESCAPE_BAR = 024;
! const int ESCAPE_CIRCUMFLEX = 025;
! const int ESCAPE_LEFT_BRACE = 026;
  const int ESCAPE_RIGHT_BRACE = 027;
  const int ESCAPE_LEFT_QUOTE = 030;
--- 136,141 ----
  const int ESCAPE_UNDERSCORE = 023;
  const int ESCAPE_BAR = 024;
! const int ESCAPE_CIRCUMFLEX = 010;
! const int ESCAPE_LEFT_BRACE = 011;
  const int ESCAPE_RIGHT_BRACE = 027;
  const int ESCAPE_LEFT_QUOTE = 030;
***************
*** 148,160 ****
  const int ESCAPE_SPACE = 037;
  
! const int TITLE_REQUEST = 0200;
! const int COPY_FILE_REQUEST = 0201;
! const int TRANSPARENT_FILE_REQUEST = 0202;
  #ifdef COLUMN
! const int VJUSTIFY_REQUEST = 0203;
  #endif /* COLUMN */
! const int ESCAPE_E = 0204;
! const int LAST_PAGE_EJECTOR = 0205;
! const int ESCAPE_RIGHT_PARENTHESIS = 0206;
  
  void set_escape_char()
--- 148,160 ----
  const int ESCAPE_SPACE = 037;
  
! const int TITLE_REQUEST = 060;
! const int COPY_FILE_REQUEST = 061;
! const int TRANSPARENT_FILE_REQUEST = 062;
  #ifdef COLUMN
! const int VJUSTIFY_REQUEST = 063;
  #endif /* COLUMN */
! const int ESCAPE_E = 064;
! const int LAST_PAGE_EJECTOR = 065;
! const int ESCAPE_RIGHT_PARENTHESIS = 066;
  
  void set_escape_char()
***************
*** 3016,3020 ****
    }
    if (reading_from_terminal) {
!     fputc(had_prompt ? ':' : '\007', stderr);
      fflush(stderr);
    }
--- 3016,3020 ----
    }
    if (reading_from_terminal) {
!     fputc(had_prompt ? ':' : '\057', stderr);
      fflush(stderr);
    }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]