All -

Attached below are the patches necessary to get ooRexx working on AIX. Many thanks to Rainer.

Thanks,
W. David Ashley
IBM Linux Technology Center
Linux Installation & Open Object Rexx Teams
IBM Phone: 512-838-0609 T/L 678-0609
Mobile Phone: 512-289-7506

----- Forwarded by David Ashley/Austin/IBM on 04/21/2006 01:55 PM -----
Rainer Tammer <tammer@tammer.net>

04/21/2006 04:11 AM

To
David Ashley/Austin/IBM@IBMUS
cc
Subject
Re: Object Rexx on AIX 5.3





Hello,
I have build an test installp package for AIX 5.2/5.3.

URL: http://www.tammer.net/ooRexx/

The build was done on AIX 5.2 with vacpp 5.
The installation destination is /usr/local

The diff is against ooRexx-3.0.0.tar.gz

Bye
 Rainer Tammer



diff -c -r ooRexx-3.0.0-dist/rexutils/rxsock.c ooRexx-3.0.0/rexutils/rxsock.c
*** ooRexx-3.0.0-dist/rexutils/rxsock.c                 2005-03-11 10:23:18.000000000 +0100
--- ooRexx-3.0.0/rexutils/rxsock.c                 2006-04-17 18:09:37.000000000 +0200
***************
*** 59,68 ****
 
 #ifdef OPSYS_LINUX
   #define SO_USELOOPBACK  0x0040    /* bypass hardware when possible         */
! //#define SO_SNDLOWAT     0x1003    /* send low-water mark                   */
! //#define SO_RCVLOWAT     0x1004    /* receive low-water mark                */
! //#define SO_SNDTIMEO     0x1005    /* send timeout                          */
! //#define SO_RCVTIMEO     0x1006    /* receive timeout                       */
 #endif
 
 /*------------------------------------------------------------------
--- 59,68 ----
 
 #ifdef OPSYS_LINUX
   #define SO_USELOOPBACK  0x0040    /* bypass hardware when possible         */
! /* #define SO_SNDLOWAT     0x1003 */   /* send low-water mark                   */
! /* #define SO_RCVLOWAT     0x1004 */   /* receive low-water mark                */
! /* #define SO_SNDTIMEO     0x1005 */   /* send timeout                          */
! /* #define SO_RCVTIMEO     0x1006 */   /* receive timeout                       */
 #endif
 
 /*------------------------------------------------------------------
***************
*** 128,136 ****
 
 RxSockFuncTableEntry RxSockFuncTable[] =
    {
! //#if defined(WIN32) || defined(OPSYS_LINUX)
    TABLEENTRY( SockDropFuncs             )
! //#endif
    TABLEENTRY( SockAccept                )
    TABLEENTRY( SockBind                  )
    TABLEENTRY( SockClose                 )
--- 128,136 ----
 
 RxSockFuncTableEntry RxSockFuncTable[] =
    {
! /* #if defined(WIN32) || defined(OPSYS_LINUX) */
    TABLEENTRY( SockDropFuncs             )
! /*#endif */
    TABLEENTRY( SockAccept                )
    TABLEENTRY( SockBind                  )
    TABLEENTRY( SockClose                 )
***************
*** 1077,1083 ****
       RexxDeregisterFunction(RxSockFuncTable[i].pszName);
 
 #ifdef WIN32
!    WSACleanup();                       // deregister from Windows Sockets
 #endif
    return 0;
    }
--- 1077,1083 ----
       RexxDeregisterFunction(RxSockFuncTable[i].pszName);
 
 #ifdef WIN32
!    WSACleanup();                       /* deregister from Windows Sockets */
 #endif
    return 0;
    }
diff -c -r ooRexx-3.0.0-dist/rexutils/rxsock.h ooRexx-3.0.0/rexutils/rxsock.h
*** ooRexx-3.0.0-dist/rexutils/rxsock.h                 2005-02-16 03:53:26.000000000 +0100
--- ooRexx-3.0.0/rexutils/rxsock.h                 2006-04-20 22:13:00.000000000 +0200
***************
*** 50,63 ****
 typedef int socklen_t;
 #endif
 
- // #if defined(OPSYS_AIX)
- //
- //typedef ULONG RexxFunctionHandler(PUCHAR,
- //                                     ULONG,
- //                                     PRXSTRING,
- //                                     PSZ,
- //                                     PRXSTRING);
- // #endif   ***/
 /*------------------------------------------------------------------
  * declare external functions
  *------------------------------------------------------------------*/
--- 50,55 ----
diff -c -r ooRexx-3.0.0-dist/rexutils/rxsockfn.c ooRexx-3.0.0/rexutils/rxsockfn.c
*** ooRexx-3.0.0-dist/rexutils/rxsockfn.c                 2005-02-16 03:53:26.000000000 +0100
--- ooRexx-3.0.0/rexutils/rxsockfn.c                 2006-04-20 22:17:02.000000000 +0200
***************
*** 75,88 ****
 #include <sys/time.h>
 
 #if defined(OPSYS_AIX) || defined(OPSYS_LINUX)
! //#include <sys/types.h>
!   #include <unistd.h>
! //#if defined(OPSYS_AIX)
! //#include <sys/select.h>
 #endif
! //#else
!   #include <sys/select.h>
! //#endif
 #if defined(OPSYS_SUN)
 #include <sys/filio.h>
 #endif
--- 75,88 ----
 #include <sys/time.h>
 
 #if defined(OPSYS_AIX) || defined(OPSYS_LINUX)
! /* #include <sys/types.h> */
! #include <unistd.h>
! /* #if defined(OPSYS_AIX) */
! /* #include <sys/select.h> */
 #endif
! /* #else */
! #include <sys/select.h>
! /* #endif */
 #if defined(OPSYS_SUN)
 #include <sys/filio.h>
 #endif
***************
*** 94,100 ****
    typedef long NativeInt;
 #endif
 
! #if defined(WIN32)                     // define errno equivalents for windows
    #define sock_errno() WSAGetLastError()
    #define psock_errno(s) fprintf(stderr, "RxSOCK Error: %s\n", s)
 #endif
--- 94,100 ----
    typedef long NativeInt;
 #endif
 
! #if defined(WIN32)                     /* define errno equivalents for windows */
    #define sock_errno() WSAGetLastError()
    #define psock_errno(s) fprintf(stderr, "RxSOCK Error: %s\n", s)
 #endif
***************
*** 110,118 ****
 #include "rxsock.h"
 
 /*-/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\-*/
! //#if !defined(WIN32)
! //extern int h_errno;               // where is this used?
! //#endif
 /*-\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/-*/
 
 /*------------------------------------------------------------------
--- 110,118 ----
 #include "rxsock.h"
 
 /*-/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\-*/
! /* #if !defined(WIN32) */
! /* extern int h_errno;               // where is this used? */
! /* #endif */
 /*-\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/-*/
 
 /*------------------------------------------------------------------
***************
*** 473,498 ****
    char    *addr;
 
 #ifdef WIN32
!    UCHAR    pszBuff[64];                    // buffer for ip address
!    PHOSTENT pHostEnt;                       // ptr to hostent structure
    /*
     *   Retrieve my ip address.  Assuming the hosts file in
     *   in %systemroot%/system/drivers/etc/hosts contains my computer name.
!     */                                      //get our name
    if (gethostname(pszBuff, sizeof(pszBuff)))
    {
            strcpy(retStr->strptr,"0.0.0.0");
            retStr->strlength = strlen(retStr->strptr);
            return 0;
    }
!    pHostEnt = gethostbyname(pszBuff);       // get our ip address
    if (!pHostEnt)
    {
            strcpy(retStr->strptr,"0.0.0.0");
            retStr->strlength = strlen(retStr->strptr);
            return 0;
    }
!    ia.s_addr = (*(ULONG *)pHostEnt->h_addr);// in network byte order already
    addr = inet_ntoa(ia);
 #else
 #if defined(OPSYS_AIX) || defined(OPSYS_LINUX)
--- 473,498 ----
    char    *addr;
 
 #ifdef WIN32
!    UCHAR    pszBuff[64];                    /* buffer for ip address */
!    PHOSTENT pHostEnt;                       /* ptr to hostent structure */
    /*
     *   Retrieve my ip address.  Assuming the hosts file in
     *   in %systemroot%/system/drivers/etc/hosts contains my computer name.
!     */                                      /* get our name */
    if (gethostname(pszBuff, sizeof(pszBuff)))
    {
            strcpy(retStr->strptr,"0.0.0.0");
            retStr->strlength = strlen(retStr->strptr);
            return 0;
    }
!    pHostEnt = gethostbyname(pszBuff);       /* get our ip address */
    if (!pHostEnt)
    {
            strcpy(retStr->strptr,"0.0.0.0");
            retStr->strlength = strlen(retStr->strptr);
            return 0;
    }
!    ia.s_addr = (*(ULONG *)pHostEnt->h_addr);/* in network byte order already */
    addr = inet_ntoa(ia);
 #else
 #if defined(OPSYS_AIX) || defined(OPSYS_LINUX)
***************
*** 515,521 ****
            retStr->strlength = strlen(retStr->strptr);
            return 0;
    }
!    ia.s_addr = (*(ULONG *)pHostEnt->h_addr);// in network byte order already
    addr = (PSZ)inet_ntoa(ia);
 #else
    ia.s_addr = htonl(gethostid());
--- 515,521 ----
            retStr->strlength = strlen(retStr->strptr);
            return 0;
    }
!    ia.s_addr = (*(ULONG *)pHostEnt->h_addr);/* in network byte order already */
    addr = (PSZ)inet_ntoa(ia);
 #else
    ia.s_addr = htonl(gethostid());
diff -c -r ooRexx-3.0.0-dist/rexxapi/unix/QueueCommand.cpp ooRexx-3.0.0/rexxapi/unix/QueueCommand.cpp
*** ooRexx-3.0.0-dist/rexxapi/unix/QueueCommand.cpp                 2005-03-21 04:58:42.000000000 +0100
--- ooRexx-3.0.0/rexxapi/unix/QueueCommand.cpp                 2006-04-20 21:55:20.000000000 +0200
***************
*** 72,78 ****
 #include <stdlib.h>            /* needed for miscellaneous functions */
 #include <string.h>            /* needed for string functions        */
 #include "RexxAPIManager.h"
! #define  SYSREXXSAA            /* needed for queue functions & codes */
 #include "RexxMessageNumbers.h"
 
 #define RXQUEUE_CLEAR    -2    /* used for queue mode CLEAR flag     */
--- 72,78 ----
 #include <stdlib.h>            /* needed for miscellaneous functions */
 #include <string.h>            /* needed for string functions        */
 #include "RexxAPIManager.h"
! #include  SYSREXXSAA           /* needed for queue functions & codes */
 #include "RexxMessageNumbers.h"
 
 #define RXQUEUE_CLEAR    -2    /* used for queue mode CLEAR flag     */
diff -c -r ooRexx-3.0.0-dist/rexxapi/unix/SUBCOMCommand.cpp ooRexx-3.0.0/rexxapi/unix/SUBCOMCommand.cpp
*** ooRexx-3.0.0-dist/rexxapi/unix/SUBCOMCommand.cpp                 2005-03-21 05:00:15.000000000 +0100
--- ooRexx-3.0.0/rexxapi/unix/SUBCOMCommand.cpp                 2006-04-20 21:56:50.000000000 +0200
***************
*** 55,64 ****
 #include <stdio.h>
 #include "rexx.h"
 
- #define  SYSREXXSAA                    /* for REXXSAA functionality  */
 #include "SubcommandAPI.h"             /* get RexxLoadSubcom calls   */
 #include "RexxAPIManager.h"
 #include "PlatformDefinitions.h"       /* error constants            */
                                        /* old msg constants replaced!*/
 #include "RexxErrorCodes.h"
 #include "RexxMessageNumbers.h"
--- 55,64 ----
 #include <stdio.h>
 #include "rexx.h"
 
 #include "SubcommandAPI.h"             /* get RexxLoadSubcom calls   */
 #include "RexxAPIManager.h"
 #include "PlatformDefinitions.h"       /* error constants            */
+ #include  SYSREXXSAA                   /* for REXXSAA functionality  */
                                        /* old msg constants replaced!*/
 #include "RexxErrorCodes.h"
 #include "RexxMessageNumbers.h"
diff -c -r ooRexx-3.0.0-dist/samples/unix/api/Makefile.am ooRexx-3.0.0/samples/unix/api/Makefile.am
*** ooRexx-3.0.0-dist/samples/unix/api/Makefile.am                 2005-03-21 04:28:54.000000000 +0100
--- ooRexx-3.0.0/samples/unix/api/Makefile.am                 2006-04-21 11:08:16.000000000 +0200
***************
*** 37,44 ****
 
 .NOTPARALLEL:
 
! SUBDIRS                                                   = callrexx wpipe1 wpipe2 wpipe3
! DIST_SUBDIRS            = callrexx wpipe1 wpipe2 wpipe3
 
 MAINTAINERCLEANFILES                  = Makefile.in *~
 
--- 37,44 ----
 
 .NOTPARALLEL:
 
! SUBDIRS                                                   = wpipe1 wpipe2 wpipe3
! DIST_SUBDIRS            = wpipe1 wpipe2 wpipe3
 
 MAINTAINERCLEANFILES                  = Makefile.in *~
 
diff -c -r ooRexx-3.0.0-dist/samples/unix/api/Makefile.in ooRexx-3.0.0/samples/unix/api/Makefile.in
*** ooRexx-3.0.0-dist/samples/unix/api/Makefile.in                 2005-03-25 05:05:02.000000000 +0100
--- ooRexx-3.0.0/samples/unix/api/Makefile.in                 2006-04-21 11:08:03.000000000 +0200
***************
*** 196,203 ****
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
! SUBDIRS = callrexx wpipe1 wpipe2 wpipe3
! DIST_SUBDIRS = callrexx wpipe1 wpipe2 wpipe3
 MAINTAINERCLEANFILES = Makefile.in *~
 AM_CFLAGS = @CFLAGS@
 INCLUDES = -I $(top_srcdir)/rexxapi/unix
--- 196,203 ----
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
! SUBDIRS = wpipe1 wpipe2 wpipe3
! DIST_SUBDIRS = wpipe1 wpipe2 wpipe3
 MAINTAINERCLEANFILES = Makefile.in *~
 AM_CFLAGS = @CFLAGS@
 INCLUDES = -I $(top_srcdir)/rexxapi/unix
diff -c -r ooRexx-3.0.0-dist/samples/unix/api/callrexx/callrexx1.c ooRexx-3.0.0/samples/unix/api/callrexx/callrexx1.c
*** ooRexx-3.0.0-dist/samples/unix/api/callrexx/callrexx1.c                 2005-03-20 17:46:07.000000000 +0100
--- ooRexx-3.0.0/samples/unix/api/callrexx/callrexx1.c                 2006-04-17 17:47:26.000000000 +0200
***************
*** 63,70 ****
 #include "rexx.h"
 
 
! //#include <sys/ldr.h>
! //#include <filehdr.h>
 
 #include <dlfcn.h>
 #include <sys/stat.h>
--- 63,70 ----
 #include "rexx.h"
 
 
! /* #include <sys/ldr.h>  */
! /* #include <filehdr.h> */
 
 #include <dlfcn.h>
 #include <sys/stat.h>