# 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
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++;
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:
---------------
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:
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
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
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
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
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
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 .
#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);
#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
WSACleanup();
}
}
-#elif defined(OPENSSL_SYS_NETWARE)
+#elif defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK)
static void sock_cleanup(void)
{
if (wsa_init_done)
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;
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
#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
#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
return (-1);
#endif
-#if defined(OPENSSL_SYS_NETWARE)
+#if defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK)
WORD wVerReq;
WSADATA wsaData;
int err;
#endif
WSACleanup();
}
-#elif defined(OPENSSL_SYS_NETWARE)
+#elif defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK)
if (wsa_init_done)
{
wsa_init_done=0;
#define readsocket(s,b,n) read((s),(b),(n))
#define writesocket(s,b,n) write((s),(char *)(b),(n))
#elif defined(OPENSSL_SYS_NETWARE)
+#if defined(NETWARE_BSDSOCK)
+#define get_last_socket_error() errno
+#define clear_socket_error() errno=0
+#define closesocket(s) close(s)
+#define readsocket(s,b,n) recv((s),(b),(n),0)
+#define writesocket(s,b,n) send((s),(b),(n),0)
+#else
#define get_last_socket_error() WSAGetLastError()
#define clear_socket_error() WSASetLastError(0)
#define readsocket(s,b,n) recv((s),(b),(n),0)
#define writesocket(s,b,n) send((s),(b),(n),0)
+#endif
#else
#define get_last_socket_error() errno
#define clear_socket_error() errno=0
# define SHUTDOWN2(fd) MacSocket_close(fd)
# elif defined(OPENSSL_SYS_NETWARE)
- /* NetWare uses the WinSock2 interfaces
+ /* NetWare uses the WinSock2 interfaces by default, but can be configured for BSD
*/
-# include <novsock2.h>
+# if defined(NETWARE_BSDSOCK)
+# include <sys/socket.h>
+# include <netinet/in.h>
+# include <sys/time.h>
+# include <sys/select.h>
+# define INVALID_SOCKET (int)(~0)
+# else
+# include <novsock2.h>
+# endif
# define SSLeay_Write(a,b,c) send((a),(b),(c),0)
# define SSLeay_Read(a,b,c) recv((a),(b),(c),0)
# define SHUTDOWN(fd) { shutdown((fd),0); closesocket(fd); }
"ultrix-mips","DEC mips ultrix",
"FreeBSD","FreeBSD distribution",
"OS2-EMX", "EMX GCC OS/2",
- "netware-clib", "CodeWarrior for NetWare - CLib",
- "netware-libc", "CodeWarrior for NetWare - LibC",
+ "netware-clib", "CodeWarrior for NetWare - CLib - with WinSock Sockets",
+ "netware-libc", "CodeWarrior for NetWare - LibC - with WinSock Sockets",
+ "netware-libc-bsdsock", "CodeWarrior for NetWare - LibC - with BSD Sockets",
"default","cc under unix",
);
$wc=1;
require 'OS2-EMX.pl';
}
-elsif (($platform eq "netware-clib") || ($platform eq "netware-libc"))
+elsif (($platform eq "netware-clib") || ($platform eq "netware-libc") ||
+ ($platform eq "netware-libc-bsdsock"))
{
- $LIBC=1 if $platform eq "netware-libc";
+ $LIBC=1 if $platform eq "netware-libc" || $platform eq "netware-libc-bsdsock";
+ $BSDSOCK=1 if $platform eq "netware-libc-bsdsock";
require 'netware.pl';
}
else
#
# The import files and other misc imports needed to link
+@misc_imports = ("GetProcessSwitchCount", "RunningProcess",
+ "GetSuperHighResolutionTimer");
if ($LIBC)
{
- @import_files = ("libc.imp", "ws2nlm.imp");
+ @import_files = ("libc.imp");
@module_files = ("libc");
}
else
{
# clib build
- @import_files = ("clib.imp", "ws2nlm.imp");
+ @import_files = ("clib.imp");
@module_files = ("clib");
+ push(@misc_imports, "_rt_modu64%16", "_rt_divu64%16");
}
-@misc_imports = ("GetProcessSwitchCount", "RunningProcess",
- "GetSuperHighResolutionTimer" );
+if (!$BSDSOCK)
+{
+ push(@import_files, "ws2nlm.imp");
+}
+
# The "IMPORTS" environment variable must be set and point to the location
# where import files (*.imp) can be found.
$lflags.=" -entry _Prelude -exit _Stop";
}
+# If BSD Socket support is requested, set a define for the compiler
+if ($BSDSOCK)
+{
+ $cflags.=" -DNETWARE_BSDSOCK";
+}
+
# linking stuff
# for the output directories use the mk1mf.pl values with "_nw" appended