Mark msysGit as obsolete
[msysgit.git] / src / openssl / patches / 0004-openssl-build-DLL-directly.patch
blob3acc6ad42f5cae710874c1f0d8b52c60c9bdd27f
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
13 --- a/ms/mingw32.bat
14 +++ b/ms/mingw32.bat
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
27 :end
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
36 -$mklib='ar r';
37 +$mklib='gcc -shared -o';
38 $mlflags='';
39 $ranlib='ranlib';
40 $plib='lib';
41 -$libp=".a";
42 -$shlibp=".a";
43 +$libp=".dll";
44 +$shlibp=".dll";
45 $lfile='';
47 $asm='as';
48 @@ -86,10 +86,15 @@ sub do_lib_rule
49 $target="$target";
50 ($Name=$name) =~ tr/a-z/A-Z/;
52 + my $ex = "";
53 + if ($target =~ /O_SSL/)
54 + {
55 + $ex .= " \$(L_CRYPTO)";
56 + }
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";
65 sub do_link_rule
66 --
67 2.1.0