Commit b764ab95 authored by Richard Levitte's avatar Richard Levitte
Browse files

Netware patch submitted by Verdon Walker" <VWalker@novell.com> in PR

1107.  He says:

This is a followup to the NetWare patch that was applied to beta3.  It
does the following:

- Fixes a problem in the CLib build with undefined symbols.

- Adds the ability to use BSD sockets as the default for the OpenSSL
  socket BIO.  NetWare supports 2 flavors of sockets and our Apache
  developers need BSD sockets as a configurable option when building
  OpenSSL.  This adds that for them.

- Updates to the INSTALL.NW file to explain new options.

I have tried very hard to make sure all the changes are in NetWare
specific files or guarded carefully to make sure they only impact
NetWare builds.  I have tested the Windows build to make sure it does
not break that since we have made changes to mk1mf.pl.

We are still working the gcc cross compile for NetWare issue and hope
to have a patch for that before beta 6 is released.
parent a761b89d
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -486,7 +486,10 @@ my %table=(
# netware-clib => legacy CLib c-runtime support
"netware-clib", "mwccnlm::::::BN_LLONG ${x86_gcc_opts}::",
# netware-libc => LibC/NKS support
# NetWare defaults socket bio to WinSock sockets. However, the LibC build can be
# configured to use BSD sockets instead.
"netware-libc", "mwccnlm::::::BN_LLONG ${x86_gcc_opts}::",
"netware-libc-bsdsock", "mwccnlm::::::BN_LLONG ${x86_gcc_opts}::",
"netware-libc-gcc", "i586-netware-gcc:-nostdinc -I/ndk/libc/include -I/ndk/libc/include/winsock -DL_ENDIAN -DNETWARE_LIBC -DOPENSSL_SYSNAME_NETWARE -DTERMIO -O2 -Wall:::::BN_LLONG ${x86_gcc_opts}::",

# DJGPP
@@ -530,7 +533,7 @@ my %table=(

my @MK1MF_Builds=qw(VC-WIN64I VC-WIN64A
		    VC-NT VC-CE VC-WIN32
		    BC-32 OS2-EMX netware-clib netware-libc);
		    BC-32 OS2-EMX netware-clib netware-libc netware-libc-bsdsock);

my $idx = 0;
my $idx_cc = $idx++;
+16 −6
Original line number Diff line number Diff line
@@ -32,6 +32,10 @@ The necessary LibC functionality ships with NetWare 6. However, earlier
NetWare 5.x versions will require updates in order to run the OpenSSL LibC
build.

As of June 2005, the LibC build can be configured to use BSD sockets instead
of WinSock sockets. Call Configure (usually through netware\build.bat) using
a target of "netware-libc-bsdsock" instead of "netware-libc".


REQUIRED TOOLS:
---------------
@@ -126,7 +130,8 @@ following tools may be required:
         
         NOTE: The LibC SDK includes the necessary WinSock2 support.  It
         It is not necessary to download the WinSock2 Developer when building
         for LibC.
         for LibC. The LibC SDK also includes the appropriate BSD socket support
         if configuring to use BSD sockets.


BUILDING:
@@ -177,8 +182,9 @@ the assembly code. Always run build.bat from the "openssl" directory.

   netware\build [target] [debug opts] [assembly opts] [configure opts]

      target        - "netware-clib" - CLib NetWare build
                    - "netware-libc" - LibC NetWare build
      target        - "netware-clib" - CLib NetWare build (WinSock Sockets)
                    - "netware-libc" - LibC NetWare build (WinSock Sockets)
                    - "netware-libc-bsdsock" - LibC NetWare build (BSD Sockets)
 
      debug opts    - "debug"  - build debug

@@ -197,25 +203,29 @@ the assembly code. Always run build.bat from the "openssl" directory.
      LibC build, non-debug, using NASM assembly:
         netware\build.bat netware-libc nw-nasm

      LibC build, BSD sockets, non-debug, without assembly:
         netware\build.bat netware-libc-bsdsock no-asm

Running build.bat generates a make file to be processed by your make 
tool (gmake or nmake):

   CLIB ex: gmake -f netware\nlm_clib.mak 
   CLIB ex: gmake -f netware\nlm_clib_dbg.mak 
   LibC ex: gmake -f netware\nlm_libc.mak 
   LibC ex: gmake -f netware\nlm_libc_bsdsock.mak 


You can also run the build scripts manually if you do not want to use the
build.bat file.  Run the following scripts in the "\openssl"
subdirectory (in the order listed below):

   perl configure no-asm [other config opts] [netware-clib|netware-libc]
   perl configure no-asm [other config opts] [netware-clib|netware-libc|netware-libc-bsdsock]
      configures no assembly build for specified netware environment
      (CLIB or LibC).

   perl util\mkfiles.pl >MINFO
      generates a listing of source files (used by mk1mf)

   perl util\mk1mf.pl no-asm [other config opts] [netware-clib|netware-libc >netware\nlm.mak
   perl util\mk1mf.pl no-asm [other config opts] [netware-clib|netware-libc|netware-libc-bsdsock >netware\nlm.mak
      generates the makefile for NetWare

   gmake -f netware\nlm.mak
+11 −6
Original line number Diff line number Diff line
@@ -6,14 +6,15 @@ rem
rem   usage:
rem      build [target] [debug opts] [assembly opts] [configure opts]
rem
rem      target        - "netware-clib" - CLib NetWare build
rem                    - "netware-libc" - LibC NKS NetWare build
rem      target        - "netware-clib" - CLib NetWare build (WinSock Sockets)
rem                    - "netware-libc" - LibC NKS NetWare build (WinSock Sockets)
rem                    - "netware-libc-bsdsock" - LibC NKS NetWare build (BSD Sockets)
rem 
rem      debug opts    - "debug"  - build debug
rem
rem      assembly opts - "nw-mwasm" - use Metrowerks assembler
rem      "nw-nasm"  - use NASM assembler
rem      "no-asm"   - don't use assembly
rem                    - "nw-nasm"  - use NASM assembler
rem                    - "no-asm"   - don't use assembly
rem
rem      configure opts- all unrecognized arguments are passed to the
rem                       perl configure script
@@ -76,6 +77,8 @@ if "%1" == "netware-clib" set BLD_TARGET=netware-clib
if "%1" == "netware-clib" set ARG_PROCESSED=YES
if "%1" == "netware-libc" set BLD_TARGET=netware-libc
if "%1" == "netware-libc" set ARG_PROCESSED=YES
if "%1" == "netware-libc-bsdsock" set BLD_TARGET=netware-libc-bsdsock
if "%1" == "netware-libc-bsdsock" set ARG_PROCESSED=YES

rem   If we didn't recognize the argument, consider it an option for config
if "%ARG_PROCESSED%" == "NO" set CONFIG_OPTS=%CONFIG_OPTS% %1
@@ -92,6 +95,7 @@ rem build the nlm make file name which includes target and debug info
set NLM_MAKE=
if "%BLD_TARGET%" == "netware-clib" set NLM_MAKE=netware\nlm_clib
if "%BLD_TARGET%" == "netware-libc" set NLM_MAKE=netware\nlm_libc
if "%BLD_TARGET%" == "netware-libc-bsdsock" set NLM_MAKE=netware\nlm_libc_bsdsock
if "%DEBUG%" == "" set NLM_MAKE=%NLM_MAKE%.mak
if "%DEBUG%" == "debug" set NLM_MAKE=%NLM_MAKE%_dbg.mak

@@ -184,8 +188,9 @@ echo . No build target specified!!!
echo .
echo .  usage: build [target] [debug opts] [assembly opts] [configure opts]
echo .
echo .     target        - "netware-clib" - CLib NetWare build
echo .                   - "netware-libc" - LibC NKS NetWare build
echo .     target        - "netware-clib" - CLib NetWare build (WinSock Sockets)
echo .                   - "netware-libc" - LibC NKS NetWare build (WinSock Sockets)
echo .                   - "netware-libc-bsdsock" - LibC NKS NetWare build (BSD Sockets)
echo .
echo .     debug opts    - "debug"  - build debug
echo .
+9 −5
Original line number Diff line number Diff line
@@ -87,8 +87,12 @@ typedef unsigned int u_int;

#ifndef OPENSSL_NO_SOCK

#if defined(OPENSSL_SYS_NETWARE) && defined(NETWARE_BSDSOCK)
#include "netdb.h"
#endif

static struct hostent *GetHostByName(char *name);
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_NETWARE)
#if defined(OPENSSL_SYS_WINDOWS) || (defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK))
static void ssl_sock_cleanup(void);
#endif
static int ssl_sock_init(void);
@@ -104,7 +108,7 @@ static int host_ip(char *str, unsigned char ip[4]);
#define SOCKET_PROTOCOL	IPPROTO_TCP
#endif

#ifdef OPENSSL_SYS_NETWARE
#if defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK)
static int wsa_init_done=0;
#endif

@@ -156,7 +160,7 @@ static void ssl_sock_cleanup(void)
		WSACleanup();
		}
	}
#elif defined(OPENSSL_SYS_NETWARE)
#elif defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK)
static void sock_cleanup(void)
    {
    if (wsa_init_done)
@@ -199,7 +203,7 @@ static int ssl_sock_init(void)
		SetWindowLong(topWnd,GWL_WNDPROC,(LONG)lpTopHookProc);
#endif /* OPENSSL_SYS_WIN16 */
		}
#elif defined(OPENSSL_SYS_NETWARE)
#elif defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK)
   WORD wVerReq;
   WSADATA wsaData;
   int err;
@@ -398,7 +402,7 @@ redoit:
	ret=accept(acc_sock,(struct sockaddr *)&from,(void *)&len);
	if (ret == INVALID_SOCKET)
		{
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_NETWARE)
#if defined(OPENSSL_SYS_WINDOWS) || (defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK))
		i=WSAGetLastError();
		BIO_printf(bio_err,"accept error %d\n",i);
#else
+6 −3
Original line number Diff line number Diff line
@@ -62,6 +62,9 @@
#define USE_SOCKETS
#include "cryptlib.h"
#include <openssl/bio.h>
#if defined(OPENSSL_SYS_NETWARE) && defined(NETWARE_BSDSOCK)
#include "netdb.h"
#endif

#ifndef OPENSSL_NO_SOCK

@@ -79,7 +82,7 @@
#define MAX_LISTEN  32
#endif

#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_NETWARE)
#if defined(OPENSSL_SYS_WINDOWS) || (defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK))
static int wsa_init_done=0;
#endif

@@ -474,7 +477,7 @@ int BIO_sock_init(void)
		return (-1);
#endif

#if defined(OPENSSL_SYS_NETWARE)
#if defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK)
    WORD wVerReq;
    WSADATA wsaData;
    int err;
@@ -512,7 +515,7 @@ void BIO_sock_cleanup(void)
#endif
		WSACleanup();
		}
#elif defined(OPENSSL_SYS_NETWARE)
#elif defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK)
   if (wsa_init_done)
        {
        wsa_init_done=0;
Loading