INSTALL.NW 17 KB

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