diff -brc orig/apache_1.3.9/src/include/ap_config.h apache_1.3.9/src/include/ap_config.h *** orig/apache_1.3.9/src/include/ap_config.h Mon Aug 9 01:38:45 1999 --- apache_1.3.9/src/include/ap_config.h Thu Oct 21 19:16:43 1999 *************** *** 115,121 **** #include "os.h" #endif ! #if !defined(QNX) && !defined(MPE) && !defined(WIN32) && !defined(TPF) #include #endif --- 115,122 ---- #include "os.h" #endif ! #if !defined(QNX) && !defined(MPE) && !defined(WIN32) && !defined(TPF) \ ! && !defined(OS390) #include #endif *************** *** 905,910 **** --- 906,914 ---- /* All windows stuff is now in os/win32/os.h */ + #elif defined(OS390) /* IBM OS/390 Unix Services */ + #include + #elif defined(TPF) /* IBM Transaction Processing Facility operating system */ #include *************** *** 1050,1055 **** --- 1054,1062 ---- #include #endif /* TPF */ #include + #if defined(OS390) && !defined(NO_ADDRESS) + #define NO_ADDRESS NO_DATA /* Not defined properly by OS/390 v1r2 */ + #endif #include #if !defined(MPE) && !defined(BEOS) && !defined(TPF) #include /* for inet_ntoa */ diff -brc orig/apache_1.3.9/src/main/http_main.c apache_1.3.9/src/main/http_main.c *** orig/apache_1.3.9/src/main/http_main.c Tue Aug 10 07:54:48 1999 --- apache_1.3.9/src/main/http_main.c Sat Oct 16 16:21:09 1999 *************** *** 116,122 **** #endif #ifdef WIN32 #include "../os/win32/getopt.h" ! #elif !defined(BEOS) && !defined(TPF) #include #endif --- 116,122 ---- #endif #ifdef WIN32 #include "../os/win32/getopt.h" ! #elif !defined(BEOS) && !defined(TPF) && !defined(OS390) #include #endif *************** *** 3817,3823 **** usr1_just_die = 0; for (;;) { clen = sizeof(sa_client); ! csd = ap_accept(sd, &sa_client, &clen); if (csd >= 0 || errno != EINTR) break; if (deferred_die) { --- 3817,3823 ---- usr1_just_die = 0; for (;;) { clen = sizeof(sa_client); ! csd = ap_accept(sd, &sa_client, (unsigned int *)&clen); if (csd >= 0 || errno != EINTR) break; if (deferred_die) { *************** *** 3967,3973 **** */ clen = sizeof(sa_server); ! if (getsockname(csd, &sa_server, &clen) < 0) { ap_log_error(APLOG_MARK, APLOG_ERR, server_conf, "getsockname"); continue; } --- 3967,3973 ---- */ clen = sizeof(sa_server); ! if (getsockname(csd, &sa_server, (unsigned int *)&clen) < 0) { ap_log_error(APLOG_MARK, APLOG_ERR, server_conf, "getsockname"); continue; } *************** *** 4916,4929 **** #endif l = sizeof(sa_client); ! if ((getpeername(sock_in, &sa_client, &l)) < 0) { /* get peername will fail if the input isn't a socket */ perror("getpeername"); memset(&sa_client, '\0', sizeof(sa_client)); } l = sizeof(sa_server); ! if (getsockname(sock_in, &sa_server, &l) < 0) { perror("getsockname"); fprintf(stderr, "Error getting local address\n"); exit(1); --- 4916,4929 ---- #endif l = sizeof(sa_client); ! if ((getpeername(sock_in, &sa_client, (unsigned int *)&l)) < 0) { /* get peername will fail if the input isn't a socket */ perror("getpeername"); memset(&sa_client, '\0', sizeof(sa_client)); } l = sizeof(sa_server); ! if (getsockname(sock_in, &sa_server, (unsigned int *)&l) < 0) { perror("getsockname"); fprintf(stderr, "Error getting local address\n"); exit(1); diff -brc orig/apache_1.3.9/src/main/rfc1413.c apache_1.3.9/src/main/rfc1413.c *** orig/apache_1.3.9/src/main/rfc1413.c Fri Jul 30 08:06:56 1999 --- apache_1.3.9/src/main/rfc1413.c Sat Oct 16 16:21:09 1999 *************** *** 148,154 **** /* send query to server. Handle short write. */ #ifdef CHARSET_EBCDIC ! ebcdic2ascii(&buffer, &buffer, buflen); #endif i = 0; while(i < strlen(buffer)) { --- 148,154 ---- /* send query to server. Handle short write. */ #ifdef CHARSET_EBCDIC ! ebcdic2ascii(buffer, buffer, buflen); #endif i = 0; while(i < strlen(buffer)) { *************** *** 191,197 **** /* RFC1413_USERLEN = 512 */ #ifdef CHARSET_EBCDIC ! ascii2ebcdic(&buffer, &buffer, (size_t)i); #endif if (sscanf(buffer, "%u , %u : USERID :%*[^:]:%512s", &rmt_port, &our_port, user) != 3 || ntohs(rmt_sin->sin_port) != rmt_port --- 191,197 ---- /* RFC1413_USERLEN = 512 */ #ifdef CHARSET_EBCDIC ! ascii2ebcdic(buffer, buffer, (size_t)i); #endif if (sscanf(buffer, "%u , %u : USERID :%*[^:]:%512s", &rmt_port, &our_port, user) != 3 || ntohs(rmt_sin->sin_port) != rmt_port diff -brc orig/apache_1.3.9/src/os/bs2000/ebcdic.c apache_1.3.9/src/os/bs2000/ebcdic.c *** orig/apache_1.3.9/src/os/bs2000/ebcdic.c Fri Jan 1 12:05:27 1999 --- apache_1.3.9/src/os/bs2000/ebcdic.c Sat Oct 16 16:21:11 1999 *************** *** 224,249 **** 0x70, 0xc0, 0xde, 0xdb, 0xdc, 0x8d, 0x8e, 0xdf /*................*/ }; /* Translate a memory block from EBCDIC (host charset) to ASCII (net charset) * dest and srce may be identical, or separate memory blocks, but * should not overlap. */ void ! ebcdic2ascii(unsigned char *dest, const unsigned char *srce, size_t count) { while (count-- != 0) { *dest++ = os_toascii[*srce++]; } } void ! ebcdic2ascii_strictly(unsigned char *dest, const unsigned char *srce, size_t count) { while (count-- != 0) { *dest++ = os_toascii_strictly[*srce++]; } } void ! ascii2ebcdic(unsigned char *dest, const unsigned char *srce, size_t count) { while (count-- != 0) { *dest++ = os_toebcdic[*srce++]; --- 224,257 ---- 0x70, 0xc0, 0xde, 0xdb, 0xdc, 0x8d, 0x8e, 0xdf /*................*/ }; + /* Insert a dummy token so function definitions will not be taken for + * OS/390 casting macros in ebcdic.h. + */ + #define NOTHING + /* Translate a memory block from EBCDIC (host charset) to ASCII (net charset) * dest and srce may be identical, or separate memory blocks, but * should not overlap. */ void ! ebcdic2ascii ! NOTHING (unsigned char *dest, const unsigned char *srce, size_t count) { while (count-- != 0) { *dest++ = os_toascii[*srce++]; } } void ! ebcdic2ascii_strictly ! NOTHING (unsigned char *dest, const unsigned char *srce, size_t count) { while (count-- != 0) { *dest++ = os_toascii_strictly[*srce++]; } } void ! ascii2ebcdic ! NOTHING (unsigned char *dest, const unsigned char *srce, size_t count) { while (count-- != 0) { *dest++ = os_toebcdic[*srce++]; diff -brc orig/apache_1.3.9/src/os/bs2000/ebcdic.h apache_1.3.9/src/os/bs2000/ebcdic.h *** orig/apache_1.3.9/src/os/bs2000/ebcdic.h Wed May 13 09:31:00 1998 --- apache_1.3.9/src/os/bs2000/ebcdic.h Sat Oct 16 16:21:11 1999 *************** *** 6,8 **** --- 6,19 ---- void ebcdic2ascii_strictly(unsigned char *dest, const unsigned char *srce, size_t count); void ascii2ebcdic(unsigned char *dest, const unsigned char *srce, size_t count); + /* OS/390's C compiler is particularly strict about (char *) <-> (unsigned char *). + * For that system define macros to perform casts. + */ + #if defined(OS390) + #define ebcdic2ascii(x, y, z) (ebcdic2ascii((unsigned char *)(x), \ + (unsigned char *)(y), (z))) + #define ebcdic2ascii_strictly(x, y, z) (ebcdic2ascii_strictly( \ + (unsigned char *)(x), (unsigned char *)(y), (z))) + #define ascii2ebcdic(x, y, z) (ascii2ebcdic((unsigned char *)(x), \ + (unsigned char *)(y), (z))) + #endif diff -brc orig/apache_1.3.9/src/os/bs2000/os.h apache_1.3.9/src/os/bs2000/os.h *** orig/apache_1.3.9/src/os/bs2000/os.h Mon Jul 26 01:48:59 1999 --- apache_1.3.9/src/os/bs2000/os.h Sun Oct 17 12:11:44 1999 *************** *** 1,7 **** --- 1,11 ---- #ifndef APACHE_OS_H #define APACHE_OS_H + #ifdef OS390 + #define PLATFORM "OS/390" + #else #define PLATFORM "BS2000" + #endif /* * This file in included in all Apache source code. It contains definitions diff -brc orig/apache_1.3.9/src/support/htdigest.c apache_1.3.9/src/support/htdigest.c *** orig/apache_1.3.9/src/support/htdigest.c Mon Aug 2 04:45:36 1999 --- apache_1.3.9/src/support/htdigest.c Sat Oct 16 16:21:11 1999 *************** *** 72,78 **** #include "ap_md5.h" #if defined(MPE) || defined(QNX) || defined(WIN32) || defined(__TANDEM) #include ! #else #include #endif --- 72,78 ---- #include "ap_md5.h" #if defined(MPE) || defined(QNX) || defined(WIN32) || defined(__TANDEM) #include ! #elif !defined(OS390) #include #endif diff -brc orig/apache_1.3.9/src/Configure apache_1.3.9/src/Configure *** orig/apache_1.3.9/src/Configure Sun Aug 15 18:49:08 1999 --- apache_1.3.9/src/Configure Sun Oct 17 12:35:00 1999 *************** *** 616,621 **** --- 616,631 ---- LIBS="$LIBS" SUBTARGET="target_compile_only" ;; + *-*-OS/390*) + OS='OS390' + OSDIR='os/bs2000' + CC="_C89_CCMODE=1 c89" + CFLAGS="$CFLAGS -DCHARSET_EBCDIC -DOS390" + CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE" + ##### CFLAGS="$CFLAGS -D_OE_SOCKETS" + DEF_WANTHSREGEX=yes + DBM_LIB="" + ;; BS2000*-siemens-sysv4*) OS='BS2000' OSDIR='os/bs2000' *************** *** 848,854 **** # # If $TCC is null, then no such line exists in Configuration # ! TCC=`egrep '^CC=' Makefile.config | tail -1 | awk -F= '{print $2}'` if [ "x$TCC" = "x" ]; then if [ "x$CC" = "x" ]; then # At this point, CC is not set in Configuration or above, so we --- 858,864 ---- # # If $TCC is null, then no such line exists in Configuration # ! TCC=`egrep '^CC=' Makefile.config | tail -1 | sed -e 's!^[^=]*=!!'` if [ "x$TCC" = "x" ]; then if [ "x$CC" = "x" ]; then # At this point, CC is not set in Configuration or above, so we *************** *** 870,877 **** fi CC=$COMPILER fi - echo " + setting C compiler to $CC" - fi #################################################################### ## Write the value of $CC to Makefile.config... We only do this --- 880,885 ---- *************** *** 879,885 **** ## If there was an entry for it, then set $CC for our own internal ## use. ## ! if [ "x$TCC" = "x" ]; then echo "CC=$CC" >> Makefile.config else CC=$TCC --- 887,893 ---- ## If there was an entry for it, then set $CC for our own internal ## use. ## ! echo " + setting C compiler to $CC" echo "CC=$CC" >> Makefile.config else CC=$TCC *************** *** 888,898 **** #################################################################### ## Now check how we can _directly_ run the C pre-processor ## ! TCPP=`egrep '^CPP=' Makefile.config | tail -1 | awk -F= '{print $2}'` if [ "x$TCPP" != "x" ]; then ! CPP=`CC=$CC CPP=$TCPP ./helpers/findcpp.sh` else ! CPP=`CC=$CC ./helpers/findcpp.sh` fi if [ "x$TCPP" = "x" ]; then echo "CPP=$CPP" >> Makefile.config --- 896,906 ---- #################################################################### ## Now check how we can _directly_ run the C pre-processor ## ! TCPP=`egrep '^CPP=' Makefile.config | tail -1 | sed -e 's!^[^=]*=!!'` if [ "x$TCPP" != "x" ]; then ! CPP=`CC="$CC" CPP="$TCPP" export CC CPP; ./helpers/findcpp.sh` else ! CPP=`CC="$CC" export CC; ./helpers/findcpp.sh` fi if [ "x$TCPP" = "x" ]; then echo "CPP=$CPP" >> Makefile.config