Have CRYPTO_MDEBUG_TIME automatically set CRYPTO_MDEBUG,
[openssl.git] / INSTALL.W32
index 20dc0fca2b1b3df8be8532b4dc8f719250659354..615d1419f13dd8ab36a951fbb7c22d03ba994c46 100644 (file)
@@ -6,13 +6,31 @@
  this is tested on Win32 but it may also work in Win 3.1 with some
  modification.  See the end of this file for Eric's original comments.
 
- You will Perl for Win32 (available from http://activestate.com/ActivePerl)
+ You need Perl for Win32 (available from http://www.activestate.com/ActivePerl)
  and one of the following C compilers:
 
   * Visual C++
   * Borland C
   * GNU C (Mingw32 or Cygwin32)
 
+ If you want to compile in the assembly language routines with Visual C++ then
+ you will need an assembler. This is worth doing because it will result in
+ faster code: for example it will typically result in a 2 times speedup in the
+ RSA routines. Currently the following assemblers are supported:
+
+  * Microsoft MASM (aka "ml")
+  * Free Netwide Assembler NASM.
+
+ MASM was I believe distributed in the past with VC++ and it is also part of
+ the MSDN SDKs. It is no longer distributed as part of VC++ and can be hard
+ to get hold of. It can be purchased: see Microsoft's site for details at:
+ http://www.microsoft.com/
+
+ NASM is freely available. Version 0.98 was used during testing: other versions
+ may also work. It is available from many places, see for example:
+ http://www.kernel.org/pub/software/devel/nasm/binaries/win32/
+ The NASM binary nasmw.exe needs to be installed anywhere on your PATH.
+
  If you are compiling from a tarball or a CVS snapshot then the Win32 files
  may well be not up to date. This may mean that some "tweaking" is required to
  get it all to work. See the trouble shooting section later on for if (when?)
  Visual C++
  ----------
 
- Firstly you should run Configure and build the Win32 Makefiles:
+ Firstly you should run Configure:
 
  > perl Configure VC-WIN32
+
+ Next you need to build the Makefiles and optionally the assembly language
+ files.
+
+ If you are using MASM then run:
+
+ > ms\do_masm
+
+ If you are using NASM then run:
+
+ > ms\do_nasm
+
+ If you don't want to use the assembly language files at all then run:
+
  > ms\do_ms
 
  If you get errors about things not having numbers assigned then check the
 
  Tweaks:
 
- There are various changes you can make to the Win32 compile environment. If
- you have the MASM assembler 'ml' then you can try the assembly language code.
- To do this remove the 'no-asm' part from do_ms.bat. You can also add 'debug'
here to make a debugging version of the library.
+ There are various changes you can make to the Win32 compile environment. By
+ default the library is not compiled with debugging symbols. If you add 'debug'
+ to the mk1mk.pl lines in the do_* batch file then debugging symbols will be
compiled in.
 
  The default Win32 environment is to leave out any Windows NT specific
  features.
 
  To build OpenSSL, you need the Mingw32 package and GNU make.
 
- Mingw32 is available from <ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/
- mingw32/egcs-1.1.2/egcs-1.1.2-mingw32.zip>. GNU make is at
- <ftp://agnes.dida.physik.uni-essen.de/home/janjaap/mingw32/binaries/
- make-3.76.1.zip>. Install both of them in C:\egcs-1.1.2 and run
- C:\egcs-1.1.2\mingw32.bat to set the PATH.
+ * Compiler installation:
 
- * Cofigure OpenSSL:
+   Mingw32 is available from <ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/
+   mingw32/egcs-1.1.2/egcs-1.1.2-mingw32.zip>. GNU make is at
+   <ftp://agnes.dida.physik.uni-essen.de/home/janjaap/mingw32/binaries/
+   make-3.76.1.zip>. Install both of them in C:\egcs-1.1.2 and run
+   C:\egcs-1.1.2\mingw32.bat to set the PATH.
 
-   > perl Configure Mingw32
-   > perl util\mkfiles.pl >MINFO
-   > perl util\mk1mf.pl Mingw32 >ms\mingw32.mak
+ * Compile OpenSSL:
 
- * If you don't have the GNU file utilities (cp, rm, etc.) installed,
-   an additional step is required:
+   > perl Configure Mingw32
+   > ms\mw.bat
 
-   > perl util\mk1mf.pl VC-WIN32 no-asm >ms\nt.mak
-   > make -f ms/nt.mak
+   This will create the library and binaries in out.
 
-   This will end with an error message. If you don't like that, install
-   the file utilities. :)
+   libcrypto.a and libssl.a are the static libraries. To use the DLLs,
+   link with libeay32.a and libssl32.a instead.
 
- * Compile the library:
-   > make -f ms/mingw32.mak
+   See troubleshooting if you get error messages about functions not having
+   a number assigned.
 
  You can now try the tests:
* You can now try the tests:
 
    > cd out
    > ..\ms\test
 
- * Build the OpenSSL DLLs:
-
-   > perl util\mkdef.pl 32 libeay > ms\libeay32.def
-   > perl util\mkdef.pl 32 ssleay > ms\ssleay32.def
-
-   [to be done]
-
  Troubleshooting
  ---------------
 
 
  > perl util\mkdef.pl crypto ssl update
 
- then ms\do_ms should not give a warning any more. However the numbers that
+ then ms\do_XXX should not give a warning any more. However the numbers that
  get assigned by this technique may not match those that eventually get
  assigned in the CVS tree: so anything linked against this version of the
  library may need to be recompiled.
  someone forgot to add a function to the header file.
 
  In this latter case check out the header file to see if the function is
- defined in the header file: it should be defined twice: once with ANSI
- prototypes and once without. If its missing from the non ASNI section then
- add an entry for it: check that ms\do_ms now reports missing numbers and
- update the numbers as above.
+ defined in the header file.
 
  If you get warnings in the code then the compilation will halt.
 
  program will almost certainly crash: see the original SSLeay description
  below for more details.
 
- Tweaks
- ------
-
 --------------------------------------------------------------------------------
 The orignal Windows build instructions from SSLeay follow. 
-Note: some of this may be out of date and no longer applicable
+Note: some of this may be out of date and no longer applicable. In particular
+the Crypto_malloc_init() comment appears to be wrong: you always need to use
+the same runtime library as the DLL itself.
 --------------------------------------------------------------------------------
 
 The Microsoft World.