Why is there no ms\\do_ms.bat after perl Configure VC-WIN64A?

南楼画角 提交于 2019-12-03 05:44:02

The build process has changed with the new 1.1.0 release. Probably you already figured out yourself, but anyway:

Starting with 1.1.0 there are no ms\do_*.bat files anymore.

Instead execute the following steps:

x32 compilation on Windows:

perl Configure VC-WIN32
nmake
nmake test

x64A compilation on Windows:

perl Configure VC-WIN64A
nmake
nmake test

Configure your Compiler environment as before and point your path to Perl (and NASM if used).

Source: The INSTALL file included in the 1.1.0 release.

Since the new 1.1.0 release there is no ms\ folder in the source code. And if you wonder what should you edit to build a static version nowadays (which results in a single .exe file without any DLLs). Here is the full guide.

You will need the following prerequisites:

You are expected to install all those tools system-wide and add them to your %PATH% environmental variable.

After you got everything we need, just follow this simple steps:

  1. Open VS2015 x64 Native Tools Command Prompt from your Start Menu. You will see command prompt.
  2. Create C:\build directory and issue the following command in the command prompt:

    • cd c:\build
  3. Download latest zlib & OpenSSL source codes to your build dir by using the following commands:

    • git clone https://github.com/madler/zlib
    • git clone https://github.com/openssl/openssl
  4. First we have to build static zlib. To do that first we will need to edit some configuration files:

    • Navigate to the zlib source folder: cd C:\build\zlib
    • Edit the win32\Makefile.msc file:

      1. Find the line starting with CFLAGS
      2. Replace -MD with -GL -MT -Zc:wchar_t-
      3. Find the line starting with LDFLAGS
      4. Replace -debug with -opt:icf -dynamicbase -nxcompat -ltcg /nodefaultlib:msvcrt
  5. Build zlib using the following command (should take less than a minute):

    • nmake -f win32/Makefile.msc AS=ml64 LOC="-DASMV -DASMINF -DNDEBUG -I." OBJA="inffasx64.obj gvmat64.obj inffas8664.obj"
  6. Copy resulting files to your OpenSSL directory:

    • xcopy zlib.h C:\build\openssl\
    • xcopy zconf.h C:\build\openssl\
    • xcopy zlib.lib C:\build\openssl\
    • xcopy zlib.pdb C:\build\openssl\
  7. Navigate to OpenSSL source: cd C:\build\openssl\ and configure it to use static zlib & read configuration files (openssl.cnf) from C:\Windows\ directory.

    • perl Configure VC-WIN64A no-shared zlib no-zlib-dynamic threads --prefix=C:\Windows\
  8. Now make the following edits to the C:\build\openssl\makefile:

    • Find the line that starts with: CFLAG
    • Append: /Zc:wchar_t- /GL /Zi
    • Find the line that starts with: LDFLAGS
    • Replace /debug with /incremental:no /opt:icf /dynamicbase /nxcompat /ltcg /nodefaultlib:msvcrt
    • Find the line that starts with: EX_LIBS
    • Replace ZLIB1 with zlib.lib
    • Save changes
  9. Build OpenSSL by issuing the nmake command (will take around 15 minutes).

The resulting ~3MB openssl.exe file will be located at C:\build\openssl\apps\ directory. It is fully portable, since all DLLs are included. If you need to use custom configuration file, copy C:\build\openssl\apps\openssl.cnf to your C:\Windows\ directory & edit it to your liking.

acreil

The following commands need to be executed under the administrator user

  1. perl Configure VC- WIN64A --prefix=C:\Build-OpenSSL-VC32-Debug-DLL
  2. nmake -f makefile
  3. nmake install

Starting with 1.1.0 there is no need of executed ms\do_*.bat files anymore.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!