INSTALL.NW 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. INSTALLATION ON THE NETWARE PLATFORM
  2. ------------------------------------
  3. Notes about building OpenSSL for NetWare.
  4. BUILD PLATFORM:
  5. ---------------
  6. The build scripts (batch files, perl scripts, etc) have been developed and
  7. tested on W2K. The scripts should run fine on other Windows platforms
  8. (NT, Win9x, WinXP) but they have not been tested. They may require some
  9. modifications.
  10. Supported NetWare Platforms - NetWare 5.x, NetWare 6.x:
  11. -------------------------------------------------------
  12. OpenSSL can either use the WinSock interfaces introduced in NetWare 5,
  13. or the BSD socket interface. Previous versions of NetWare, 4.x and 3.x,
  14. are only supported if OpenSSL is build for CLIB and BSD sockets;
  15. WinSock builds only support NetWare 5 and up.
  16. On NetWare there are two c-runtime libraries. There is the legacy CLIB
  17. interfaces and the newer LIBC interfaces. Being ANSI-C libraries, the
  18. functionality in CLIB and LIBC is similar but the LIBC interfaces are built
  19. using Novell Kernal Services (NKS) which is designed to leverage
  20. multi-processor environments.
  21. The NetWare port of OpenSSL can be configured to build using CLIB or LIBC.
  22. The CLIB build was developed and tested using NetWare 5.0 sp6.0a. The LIBC
  23. build was developed and tested using the NetWare 6.0 FCS.
  24. The necessary LIBC functionality ships with NetWare 6. However, earlier
  25. NetWare 5.x versions will require updates in order to run the OpenSSL LIBC
  26. build (NetWare 5.1 SP8 is known to work).
  27. As of June 2005, the LIBC build can be configured to use BSD sockets instead
  28. of WinSock sockets. Call Configure (usually through netware\build.bat) using
  29. a target of "netware-libc-bsdsock" instead of "netware-libc".
  30. As of June 2007, support for CLIB and BSD sockets is also now available
  31. using a target of "netware-clib-bsdsock" instead of "netware-clib";
  32. also gcc builds are now supported on both Linux and Win32 (post 0.9.8e).
  33. REQUIRED TOOLS:
  34. ---------------
  35. Based upon the configuration and build options used, some or all of the
  36. following tools may be required:
  37. * Perl for Win32 - required (http://www.activestate.com/ActivePerl)
  38. Used to run the various perl scripts on the build platform.
  39. * Perl 5.8.0 for NetWare v3.20 (or later) - required
  40. (http://developer.novell.com) Used to run the test script on NetWare
  41. after building.
  42. * Compiler / Linker - required:
  43. Metrowerks CodeWarrior PDK 2.1 (or later) for NetWare (commercial):
  44. Provides command line tools used for building.
  45. Tools:
  46. mwccnlm.exe - C/C++ Compiler for NetWare
  47. mwldnlm.exe - Linker for NetWare
  48. mwasmnlm.exe - x86 assembler for NetWare (if using assembly option)
  49. gcc / nlmconv Cross-Compiler, available from Novell Forge (free):
  50. http://forge.novell.com/modules/xfmod/project/?aunixnw
  51. * Assemblers - optional:
  52. If you intend to build using the assembly options you will need an
  53. assembler. Work has been completed to support two assemblers, Metrowerks
  54. and NASM. However, during development, a bug was found in the Metrowerks
  55. assembler which generates incorrect code. Until this problem is fixed,
  56. the Metrowerks assembler cannot be used.
  57. mwasmnlm.exe - Metrowerks x86 assembler - part of CodeWarrior tools.
  58. (version 2.2 Built Aug 23, 1999 - not useable due to code
  59. generation bug)
  60. nasmw.exe - Netwide Assembler NASM
  61. version 0.98 was used in development and testing
  62. * Make Tool - required:
  63. In order to build you will need a make tool. Two make tools are
  64. supported, GNU make (gmake.exe) or Microsoft nmake.exe.
  65. make.exe - GNU make for Windows (version 3.75 used for development)
  66. http://gnuwin32.sourceforge.net/packages/make.htm
  67. nmake.exe - Microsoft make (Version 6.00.8168.0 used for development)
  68. http://support.microsoft.com/kb/132084/EN-US/
  69. * Novell Developer Kit (NDK) - required: (http://developer.novell.com)
  70. CLIB - BUILDS:
  71. WinSock2 Developer Components for NetWare:
  72. For initial development, the October 27, 2000 version was used.
  73. However, future versions should also work.
  74. NOTE: The WinSock2 components include headers & import files for
  75. NetWare, but you will also need the winsock2.h and supporting
  76. headers (pshpack4.h, poppack.h, qos.h) delivered in the
  77. Microsoft SDK. Note: The winsock2.h support headers may change
  78. with various versions of winsock2.h. Check the dependencies
  79. section on the NDK WinSock2 download page for the latest
  80. information on dependencies. These components are unsupported by
  81. Novell. They are provided as a courtesy, but it is strongly
  82. suggested that all development be done using LIBC, not CLIB.
  83. As of June 2005, the WinSock2 components are available at:
  84. http://forgeftp.novell.com//ws2comp/
  85. NLM and NetWare libraries for C (including CLIB and XPlat):
  86. If you are going to build a CLIB version of OpenSSL, you will
  87. need the CLIB headers and imports. The March, 2001 NDK release or
  88. later is recommended.
  89. Earlier versions should work but haven't been tested. In recent
  90. versions the import files have been consolidated and function
  91. names moved. This means you may run into link problems
  92. (undefined symbols) when using earlier versions. The functions
  93. are available in earlier versions, but you will have to modifiy
  94. the make files to include additional import files (see
  95. openssl\util\pl\netware.pl).
  96. LIBC - BUILDS:
  97. Libraries for C (LIBC) - LIBC headers and import files
  98. If you are going to build a LIBC version of OpenSSL, you will
  99. need the LIBC headers and imports. The March 14, 2002 NDK release or
  100. later is required.
  101. NOTE: The LIBC SDK includes the necessary WinSock2 support.
  102. It is not necessary to download the WinSock2 NDK when building for
  103. LIBC. The LIBC SDK also includes the appropriate BSD socket support
  104. if configuring to use BSD sockets.
  105. BUILDING:
  106. ---------
  107. Before building, you will need to set a few environment variables. You can
  108. set them manually or you can modify the "netware\set_env.bat" file.
  109. The set_env.bat file is a template you can use to set up the path
  110. and environment variables you will need to build. Modify the
  111. various lines to point to YOUR tools and run set_env.bat.
  112. netware\set_env.bat <target> [compiler]
  113. target - "netware-clib" - CLIB NetWare build
  114. - "netware-libc" - LIBC NetWare build
  115. compiler - "gnuc" - GNU GCC Compiler
  116. - "codewarrior" - MetroWerks CodeWarrior (default)
  117. If you don't use set_env.bat, you will need to set up the following
  118. environment variables:
  119. PATH - Set PATH to point to the tools you will use.
  120. INCLUDE - The location of the NDK include files.
  121. CLIB ex: set INCLUDE=c:\ndk\nwsdk\include\nlm
  122. LIBC ex: set INCLUDE=c:\ndk\libc\include
  123. PRELUDE - The absolute path of the prelude object to link with. For
  124. a CLIB build it is recommended you use the "clibpre.o" files shipped
  125. with the Metrowerks PDK for NetWare. For a LIBC build you should
  126. use the "libcpre.o" file delivered with the LIBC NDK components.
  127. CLIB ex: set PRELUDE=c:\ndk\nwsdk\imports\clibpre.o
  128. LIBC ex: set PRELUDE=c:\ndk\libc\imports\libcpre.o
  129. IMPORTS - The locaton of the NDK import files.
  130. CLIB ex: set IMPORTS=c:\ndk\nwsdk\imports
  131. LIBC ex: set IMPORTS=c:\ndk\libc\imports
  132. In order to build, you need to run the Perl scripts to configure the build
  133. process and generate a make file. There is a batch file,
  134. "netware\build.bat", to automate the process.
  135. Build.bat runs the build configuration scripts and generates a make file.
  136. If an assembly option is specified, it also runs the scripts to generate
  137. the assembly code. Always run build.bat from the "openssl" directory.
  138. netware\build [target] [debug opts] [assembly opts] [configure opts]
  139. target - "netware-clib" - CLIB NetWare build (WinSock Sockets)
  140. - "netware-clib-bsdsock" - CLIB NetWare build (BSD Sockets)
  141. - "netware-libc" - LIBC NetWare build (WinSock Sockets)
  142. - "netware-libc-bsdsock" - LIBC NetWare build (BSD Sockets)
  143. debug opts - "debug" - build debug
  144. assembly opts - "nw-mwasm" - use Metrowerks assembler
  145. "nw-nasm" - use NASM assembler
  146. "no-asm" - don't use assembly
  147. configure opts- all unrecognized arguments are passed to the
  148. perl 'configure' script. See that script for
  149. internal documentation regarding options that
  150. are available.
  151. examples:
  152. CLIB build, debug, without assembly:
  153. netware\build.bat netware-clib debug no-asm
  154. LIBC build, non-debug, using NASM assembly, add mdc2 support:
  155. netware\build.bat netware-libc nw-nasm enable-mdc2
  156. LIBC build, BSD sockets, non-debug, without assembly:
  157. netware\build.bat netware-libc-bsdsock no-asm
  158. Running build.bat generates a make file to be processed by your make
  159. tool (gmake or nmake):
  160. CLIB ex: gmake -f netware\nlm_clib_dbg.mak
  161. LIBC ex: gmake -f netware\nlm_libc.mak
  162. LIBC ex: gmake -f netware\nlm_libc_bsdsock.mak
  163. You can also run the build scripts manually if you do not want to use the
  164. build.bat file. Run the following scripts in the "\openssl"
  165. subdirectory (in the order listed below):
  166. perl configure no-asm [other config opts] [netware-clib|netware-libc|netware-libc-bsdsock]
  167. configures no assembly build for specified netware environment
  168. (CLIB or LIBC).
  169. perl util\mkfiles.pl >MINFO
  170. generates a listing of source files (used by mk1mf)
  171. perl util\mk1mf.pl no-asm [other config opts] [netware-clib|netware-libc|netware-libc-bsdsock >netware\nlm.mak
  172. generates the makefile for NetWare
  173. gmake -f netware\nlm.mak
  174. build with the make tool (nmake.exe also works)
  175. NOTE: If you are building using the assembly option, you must also run the
  176. various Perl scripts to generate the assembly files. See build.bat
  177. for an example of running the various assembly scripts. You must use the
  178. "no-asm" option to build without assembly. The configure and mk1mf scripts
  179. also have various other options. See the scripts for more information.
  180. The output from the build is placed in the following directories:
  181. CLIB Debug build:
  182. out_nw_clib.dbg - static libs & test nlm(s)
  183. tmp_nw_clib.dbg - temporary build files
  184. outinc_nw_clib - necessary include files
  185. CLIB Non-debug build:
  186. out_nw_clib - static libs & test nlm(s)
  187. tmp_nw_clib - temporary build files
  188. outinc_nw_clib - necesary include files
  189. LIBC Debug build:
  190. out_nw_libc.dbg - static libs & test nlm(s)
  191. tmp_nw_libc.dbg - temporary build files
  192. outinc_nw_libc - necessary include files
  193. LIBC Non-debug build:
  194. out_nw_libc - static libs & test nlm(s)
  195. tmp_nw_libc - temporary build files
  196. outinc_nw_libc - necesary include files
  197. TESTING:
  198. --------
  199. The build process creates the OpenSSL static libs ( crypto.lib, ssl.lib,
  200. rsaglue.lib ) and several test programs. You should copy the test programs
  201. to your NetWare server and run the tests.
  202. The batch file "netware\cpy_tests.bat" will copy all the necessary files
  203. to your server for testing. In order to run the batch file, you need a
  204. drive mapped to your target server. It will create an "OpenSSL" directory
  205. on the drive and copy the test files to it. CAUTION: If a directory with the
  206. name of "OpenSSL" already exists, it will be deleted.
  207. To run cpy_tests.bat:
  208. netware\cpy_tests [output directory] [NetWare drive]
  209. output directory - "out_nw_clib.dbg", "out_nw_libc", etc.
  210. NetWare drive - drive letter of mapped drive
  211. CLIB ex: netware\cpy_tests out_nw_clib m:
  212. LIBC ex: netware\cpy_tests out_nw_libc m:
  213. The Perl script, "do_tests.pl", in the "OpenSSL" directory on the server
  214. should be used to execute the tests. Before running the script, make sure
  215. your SEARCH PATH includes the "OpenSSL" directory. For example, if you
  216. copied the files to the "sys:" volume you use the command:
  217. SEARCH ADD SYS:\OPENSSL
  218. To run do_tests.pl type (at the console prompt):
  219. perl \openssl\do_tests.pl [options]
  220. options:
  221. -p - pause after executing each test
  222. The do_tests.pl script generates a log file "\openssl\test_out\tests.log"
  223. which should be reviewed for errors. Any errors will be denoted by the word
  224. "ERROR" in the log.
  225. DEVELOPING WITH THE OPENSSL SDK:
  226. --------------------------------
  227. Now that everything is built and tested, you are ready to use the OpenSSL
  228. libraries in your development.
  229. There is no real installation procedure, just copy the static libs and
  230. headers to your build location. The libs (crypto.lib & ssl.lib) are
  231. located in the appropriate "out_nw_XXXX" directory
  232. (out_nw_clib, out_nw_libc, etc).
  233. The headers are located in the appropriate "outinc_nw_XXX" directory
  234. (outinc_nw_clib, outinc_nw_libc).
  235. One suggestion is to create the following directory
  236. structure for the OpenSSL SDK:
  237. \openssl
  238. |- bin
  239. | |- openssl.nlm
  240. | |- (other tests you want)
  241. |
  242. |- lib
  243. | | - crypto.lib
  244. | | - ssl.lib
  245. |
  246. |- include
  247. | | - openssl
  248. | | | - (all the headers in "outinc_nw\openssl")
  249. The program "openssl.nlm" can be very useful. It has dozens of
  250. options and you may want to keep it handy for debugging, testing, etc.
  251. When building your apps using OpenSSL, define "NETWARE". It is needed by
  252. some of the OpenSSL headers. One way to do this is with a compile option,
  253. for example "-DNETWARE".
  254. NOTES:
  255. ------
  256. Resource leaks in Tests
  257. ------------------------
  258. Some OpenSSL tests do not clean up resources and NetWare reports
  259. the resource leaks when the tests unload. If this really bugs you,
  260. you can stop the messages by setting the developer option off at the console
  261. prompt (set developer option = off). Or better yet, fix the tests to
  262. clean up the resources!
  263. Multi-threaded Development
  264. ---------------------------
  265. The NetWare version of OpenSSL is thread-safe, however multi-threaded
  266. applications must provide the necessary locking function callbacks. This
  267. is described in doc\threads.doc. The file "openssl-x.x.x\crypto\threads\mttest.c"
  268. is a multi-threaded test program and demonstrates the locking functions.
  269. What is openssl2.nlm?
  270. ---------------------
  271. The openssl program has numerous options and can be used for many different
  272. things. Many of the options operate in an interactive mode requiring the
  273. user to enter data. Because of this, a default screen is created for the
  274. program. However, when running the test script it is not desirable to
  275. have a seperate screen. Therefore, the build also creates openssl2.nlm.
  276. Openssl2.nlm is functionally identical but uses the console screen.
  277. Openssl2 can be used when a non-interactive mode is desired.
  278. NOTE: There are may other possibilities (command line options, etc)
  279. which could have been used to address the screen issue. The openssl2.nlm
  280. option was chosen because it impacted only the build not the code.
  281. Why only static libraries?
  282. --------------------------
  283. Globals, globals, and more globals. The OpenSSL code uses many global
  284. variables that are allocated and initialized when used for the first time.
  285. On NetWare, most applications (at least historically) run in the kernel.
  286. When running in the kernel, there is one instance of global variables.
  287. For regular application type NLM(s) this isn't a problem because they are
  288. the only ones using the globals. However, for a library NLM (an NLM which
  289. exposes functions and has no threads of execution), the globals cause
  290. problems. Applications could inadvertently step on each other if they
  291. change some globals. Even worse, the first application that triggers a
  292. global to be allocated and initialized has the allocated memory charged to
  293. itself. Now when that application unloads, NetWare will clean up all the
  294. applicaton's memory. The global pointer variables inside OpenSSL now
  295. point to freed memory. An abend waiting to happen!
  296. To work correctly in the kernel, library NLM(s) that use globals need to
  297. provide a set of globals (instance data) for each application. Another
  298. option is to require the library only be loaded in a protected address
  299. space along with the application using it.
  300. Modifying the OpenSSL code to provide a set of globals (instance data) for
  301. each application isn't technically difficult, but due to the large number
  302. globals it would require substantial code changes and it wasn't done. Hence,
  303. the build currently only builds static libraries which are then linked
  304. into each application.
  305. NOTE: If you are building a library NLM that uses the OpenSSL static
  306. libraries, you will still have to deal with the global variable issue.
  307. This is because when you link in the OpenSSL code you bring in all the
  308. globals. One possible solution for the global pointer variables is to
  309. register memory functions with OpenSSL which allocate memory and charge it
  310. to your library NLM (see the function CRYPTO_set_mem_functions). However,
  311. be aware that now all memory allocated by OpenSSL is charged to your NLM.
  312. CodeWarrior Tools and W2K
  313. ---------------------------
  314. There have been problems reported with the CodeWarrior Linker
  315. (mwldnlm.exe) in the PDK 2.1 for NetWare when running on Windows 2000. The
  316. problems cause the link step to fail. The only work around is to obtain an
  317. updated linker from Metrowerks. It is expected Metrowerks will release
  318. PDK 3.0 (in beta testing at this time - May, 2001) in the near future which
  319. will fix these problems.
  320. Makefile "vclean"
  321. ------------------
  322. The generated makefile has a "vclean" target which cleans up the build
  323. directories. If you have been building successfully and suddenly
  324. experience problems, use "vclean" (gmake -f netware\nlm_xxxx.mak vclean) and retry.
  325. "Undefined Symbol" Linker errors
  326. --------------------------------
  327. There have been linker errors reported when doing a CLIB build. The problems
  328. occur because some versions of the CLIB SDK import files inadvertently
  329. left out some symbols. One symbol in particular is "_lrotl". The missing
  330. functions are actually delivered in the binaries, but they were left out of
  331. the import files. The issues should be fixed in the September 2001 release
  332. of the NDK. If you experience the problems you can temporarily
  333. work around it by manually adding the missing symbols to your version of
  334. "clib.imp".