1 From d58a64356f563dcb5e792d1a13ecf2a0e2c63655 Mon Sep 17 00:00:00 2001
2 From: Erik Faye-Lund <kusmabite@gmail.com>
3 Date: Sun, 19 Jul 2009 23:57:36 +0200
4 Subject: [PATCH 4/7] openssl: build DLL directly
6 The mingw build system for OpenSSL links openssl.exe statically with
7 the OpenSSL libraries. This increases the size of the msysgit distribution,
8 and it would thus be better to only build the library as a DLL. This patch
9 uses "gcc -shared" instead of dllwrap to build the DLL directly.
11 diff --git a/ms/mingw32.bat b/ms/mingw32.bat
12 index f85305e..6ea371b 100644
15 @@ -82,12 +82,6 @@ echo Building the libraries
16 mingw32-make -f ms/mingw32a.mak SHELL=cmd
17 if errorlevel 1 goto end
19 -echo Generating the DLLs and input libraries
20 -dllwrap --dllname libeay32.dll --output-lib out/libeay32.a --def ms/libeay32.def out/libcrypto.a -lwsock32 -lgdi32
21 -if errorlevel 1 goto end
22 -dllwrap --dllname libssl32.dll --output-lib out/libssl32.a --def ms/ssleay32.def out/libssl.a out/libeay32.a
23 -if errorlevel 1 goto end
25 echo Done compiling OpenSSL
28 diff --git a/util/pl/Mingw32.pl b/util/pl/Mingw32.pl
29 index 8f0483f..87c2ccc 100644
30 --- a/util/pl/Mingw32.pl
31 +++ b/util/pl/Mingw32.pl
32 @@ -60,12 +60,12 @@ $exep='';
33 $ex_libs="-lwsock32 -lgdi32";
35 # static library stuff
37 +$mklib='gcc -shared -o';
48 @@ -86,10 +86,15 @@ sub do_lib_rule
50 ($Name=$name) =~ tr/a-z/A-Z/;
53 + if ($target =~ /O_SSL/)
55 + $ex .= " \$(L_CRYPTO)";
58 $ret.="$target: \$(${Name}OBJ)\n";
59 $ret.="\tif exist $target \$(RM) $target\n";
60 - $ret.="\t\$(MKLIB) $target \$(${Name}OBJ)\n";
61 - $ret.="\t\$(RANLIB) $target\n\n";
62 + $ret.="\t\$(MKLIB) $target \$(${Name}OBJ) \$(EX_LIBS) $ex\n\n";