NOTES.WIN 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. NOTES FOR THE WINDOWS PLATFORMS
  2. ===============================
  3. Requirement details for native (Visual C++) builds
  4. --------------------------------------------------
  5. In addition to the requirements and instructions listed in INSTALL,
  6. this are required as well:
  7. - You need Perl. We recommend ActiveState Perl, available from
  8. http://www.activestate.com/ActivePerl.
  9. You also need the perl module Text::Template, available on CPAN.
  10. Please read NOTES.PERL for more information.
  11. - You need a C compiler. OpenSSL has been tested to build with these:
  12. * Visual C++
  13. - Netwide Assembler, a.k.a. NASM, available from http://www.nasm.us,
  14. is required if you intend to utilize assembler modules. Note that NASM
  15. is the only supported assembler. The Microsoft provided assembler is NOT
  16. supported.
  17. Visual C++ (native Windows)
  18. ---------------------------
  19. Installation directories
  20. The default installation directories are derived from environment
  21. variables.
  22. For VC-WIN32, the following defaults are use:
  23. PREFIX: %ProgramFiles(86)%\OpenSSL
  24. OPENSSLDIR: %CommonProgramFiles(86)%\SSL
  25. For VC-WIN32, the following defaults are use:
  26. PREFIX: %ProgramW6432%\OpenSSL
  27. OPENSSLDIR: %CommonProgramW6432%\SSL
  28. Should those environment variables not exist (on a pure Win32
  29. installation for examples), these fallbacks are used:
  30. PREFIX: %ProgramFiles%\OpenSSL
  31. OPENSSLDIR: %CommonProgramFiles%\SSL
  32. GNU C (Cygwin)
  33. --------------
  34. Cygwin implements a Posix/Unix runtime system (cygwin1.dll) on top of the
  35. Windows subsystem and provides a bash shell and GNU tools environment.
  36. Consequently, a make of OpenSSL with Cygwin is virtually identical to the
  37. Unix procedure.
  38. To build OpenSSL using Cygwin, you need to:
  39. * Install Cygwin (see http://cygwin.com/)
  40. * Install Cygwin Perl and ensure it is in the path. Recall that
  41. as least 5.10.0 is required.
  42. * Run the Cygwin bash shell
  43. Apart from that, follow the Unix instructions in INSTALL.
  44. NOTE: "make test" and normal file operations may fail in directories
  45. mounted as text (i.e. mount -t c:\somewhere /home) due to Cygwin
  46. stripping of carriage returns. To avoid this ensure that a binary
  47. mount is used, e.g. mount -b c:\somewhere /home.
  48. It is also possible to create "conventional" Windows binaries that use
  49. the Microsoft C runtime system (msvcrt.dll or crtdll.dll) using MinGW
  50. development add-on for Cygwin. MinGW is supported even as a standalone
  51. setup as described in the following section. In the context you should
  52. recognize that binaries targeting Cygwin itself are not interchangeable
  53. with "conventional" Windows binaries you generate with/for MinGW.
  54. GNU C (MinGW/MSYS)
  55. ------------------
  56. * Compiler and shell environment installation:
  57. MinGW and MSYS are available from http://www.mingw.org/, both are
  58. required. Run the installers and do whatever magic they say it takes
  59. to start MSYS bash shell with GNU tools and matching Perl on its PATH.
  60. "Matching Perl" refers to chosen "shell environment", i.e. if built
  61. under MSYS, then Perl compiled for MSYS is highly recommended.
  62. Alternativelly, one can use MSYS2 from http://msys2.github.io/,
  63. which includes MingW (32-bit and 64-bit).
  64. * It is also possible to cross-compile it on Linux by configuring
  65. with './Configure --cross-compile-prefix=i386-mingw32- mingw ...'.
  66. Other possible cross compile prefixes include x86_64-w64-mingw32-
  67. and i686-w64-mingw32-.
  68. Linking your application
  69. ------------------------
  70. This section applies to non-Cygwin builds.
  71. If you link with static OpenSSL libraries then you're expected to
  72. additionally link your application with WS2_32.LIB, GDI32.LIB,
  73. ADVAPI32.LIB, CRYPT32.LIB and USER32.LIB. Those developing
  74. non-interactive service applications might feel concerned about
  75. linking with GDI32.LIB and USER32.LIB, as they are justly associated
  76. with interactive desktop, which is not available to service
  77. processes. The toolkit is designed to detect in which context it's
  78. currently executed, GUI, console app or service, and act accordingly,
  79. namely whether or not to actually make GUI calls. Additionally those
  80. who wish to /DELAYLOAD:GDI32.DLL and /DELAYLOAD:USER32.DLL and
  81. actually keep them off service process should consider implementing
  82. and exporting from .exe image in question own _OPENSSL_isservice not
  83. relying on USER32.DLL. E.g., on Windows Vista and later you could:
  84. __declspec(dllexport) __cdecl BOOL _OPENSSL_isservice(void)
  85. { DWORD sess;
  86. if (ProcessIdToSessionId(GetCurrentProcessId(),&sess))
  87. return sess==0;
  88. return FALSE;
  89. }
  90. If you link with OpenSSL .DLLs, then you're expected to include into
  91. your application code small "shim" snippet, which provides glue between
  92. OpenSSL BIO layer and your compiler run-time. See the OPENSSL_Applink
  93. manual page for further details.