xref: /AOO41X/main/openssl/opensslmingw.patch (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir--- misc/openssl-0.9.8o/Makefile.shared	2008-09-17 17:56:40.000000000 +0200
2*cdf0e10cSrcweir+++ misc/build/openssl-0.9.8o/Makefile.shared	2009-03-30 11:52:53.684538000 +0200
3*cdf0e10cSrcweir@@ -254,13 +254,17 @@
4*cdf0e10cSrcweir 	base=-Wl,--enable-auto-image-base; \
5*cdf0e10cSrcweir 	if expr $(PLATFORM) : 'mingw' > /dev/null; then \
6*cdf0e10cSrcweir 		SHLIB=$(LIBNAME)eay32; \
7*cdf0e10cSrcweir-		base=;  [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \
8*cdf0e10cSrcweir+		base=;  \
9*cdf0e10cSrcweir+                if test $(LIBNAME) = "crypto"; then \
10*cdf0e10cSrcweir+                        SHLIB=libeay32; \
11*cdf0e10cSrcweir+                        base=-Wl,--image-base,0x63000000; \
12*cdf0e10cSrcweir+                fi; \
13*cdf0e10cSrcweir 	fi; \
14*cdf0e10cSrcweir 	SHLIB_SUFFIX=.dll; \
15*cdf0e10cSrcweir-	SHLIB_SOVER=-$(LIBVERSION); \
16*cdf0e10cSrcweir+	SHLIB_SOVER=; \
17*cdf0e10cSrcweir 	ALLSYMSFLAGS='-Wl,--whole-archive'; \
18*cdf0e10cSrcweir 	NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
19*cdf0e10cSrcweir-	SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a"; \
20*cdf0e10cSrcweir+	SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic -Wl,--export-all-symbols -Wl,--out-implib,lib$(LIBNAME).dll.a"; \
21*cdf0e10cSrcweir 	[ -f apps/$$SHLIB$$SHLIB_SUFFIX ] && rm apps/$$SHLIB$$SHLIB_SUFFIX; \
22*cdf0e10cSrcweir 	[ -f test/$$SHLIB$$SHLIB_SUFFIX ] && rm test/$$SHLIB$$SHLIB_SUFFIX; \
23*cdf0e10cSrcweir 	$(LINK_SO_A) || exit 1; \
24*cdf0e10cSrcweir--- misc/openssl-0.9.8o/e_os2.h	2005-12-19 03:57:07.000000000 +0900
25*cdf0e10cSrcweir+++ misc/build/openssl-0.9.8o/e_os2.h	2009-04-04 23:07:15.324250000 +0900
26*cdf0e10cSrcweir@@ -264,7 +264,7 @@
27*cdf0e10cSrcweir # define OPENSSL_IMPLEMENT_GLOBAL(type,name)			     \
28*cdf0e10cSrcweir 	extern type _hide_##name;				     \
29*cdf0e10cSrcweir 	type *_shadow_##name(void) { return &_hide_##name; }	     \
30*cdf0e10cSrcweir-	static type _hide_##name
31*cdf0e10cSrcweir+	type _hide_##name
32*cdf0e10cSrcweir # define OPENSSL_DECLARE_GLOBAL(type,name) type *_shadow_##name(void)
33*cdf0e10cSrcweir # define OPENSSL_GLOBAL_REF(name) (*(_shadow_##name()))
34*cdf0e10cSrcweir #else
35*cdf0e10cSrcweir--- misc/openssl-0.9.8o/ms/mingw32.bat	2006-05-05 15:19:32.000000000 +0200
36*cdf0e10cSrcweir+++ misc/build/openssl-0.9.8o/ms/mingw32.bat	2009-03-30 11:54:10.000000000 +0200
37*cdf0e10cSrcweir@@ -79,15 +79,41 @@
38*cdf0e10cSrcweir rem copy ms\tlhelp32.h outinc
39*cdf0e10cSrcweir
40*cdf0e10cSrcweir echo Building the libraries
41*cdf0e10cSrcweir-mingw32-make -f ms/mingw32a.mak
42*cdf0e10cSrcweir+make -f ms/mingw32a.mak
43*cdf0e10cSrcweir if errorlevel 1 goto end
44*cdf0e10cSrcweir
45*cdf0e10cSrcweir echo Generating the DLLs and input libraries
46*cdf0e10cSrcweir-dllwrap --dllname libeay32.dll --output-lib out/libeay32.a --def ms/libeay32.def out/libcrypto.a -lwsock32 -lgdi32
47*cdf0e10cSrcweir+mv out/libcrypto.a out/libcrypto_static.a
48*cdf0e10cSrcweir+mv out/libssl.a out/libssl_static.a
49*cdf0e10cSrcweir+dlltool --dllname libeay32.dll --output-lib out/libcrypto.a --input-def ms/libeay32.def
50*cdf0e10cSrcweir if errorlevel 1 goto end
51*cdf0e10cSrcweir-dllwrap --dllname libssl32.dll --output-lib out/libssl32.a --def ms/ssleay32.def out/libssl.a out/libeay32.a
52*cdf0e10cSrcweir+gcc --shared --enable-pseudo-reloc -Wl,-Map,out/libeay32.map ms/libeay32.def -o out/libeay32.dll out/libcrypto_static.a -lwsock32 -lgdi32
53*cdf0e10cSrcweir if errorlevel 1 goto end
54*cdf0e10cSrcweir+dlltool --dllname ssleay32.dll --output-lib out/libssl.a --input-def ms/ssleay32.def
55*cdf0e10cSrcweir+if errorlevel 1 goto end
56*cdf0e10cSrcweir+if "%MINGW_SHARED_GXXLIB%"=="YES" goto shared_gxxlib
57*cdf0e10cSrcweir+if "%MINGW_SHARED_GCCLIB%"=="YES" goto shared_gcclib
58*cdf0e10cSrcweir+gcc --shared --enable-pseudo-reloc -Wl,-Map,out/libeay32.map ms/libeay32.def -o out/libeay32.dll out/libcrypto_static.a -lwsock32 -lgdi32
59*cdf0e10cSrcweir+if errorlevel 1 goto end
60*cdf0e10cSrcweir+gcc --shared --enable-pseudo-reloc -Wl,-Map,out/ssleay32.map -Lout ms/ssleay32.def -o out/ssleay32.dll out/libssl_static.a -lcrypto
61*cdf0e10cSrcweir+if errorlevel 1 goto end
62*cdf0e10cSrcweir+goto finished
63*cdf0e10cSrcweir+
64*cdf0e10cSrcweir+:shared_gcclib
65*cdf0e10cSrcweir+gcc --shared -shared-libgcc --enable-pseudo-reloc -Wl,-Map,out/libeay32.map ms/libeay32.def -o out/libeay32.dll out/libcrypto_static.a -lwsock32 -lgdi32
66*cdf0e10cSrcweir+if errorlevel 1 goto end
67*cdf0e10cSrcweir+gcc --shared -shared-libgcc --enable-pseudo-reloc -Wl,-Map,out/ssleay32.map -Lout ms/ssleay32.def -o out/ssleay32.dll out/libssl_static.a -lcrypto
68*cdf0e10cSrcweir+if errorlevel 1 goto end
69*cdf0e10cSrcweir+goto finished
70*cdf0e10cSrcweir+
71*cdf0e10cSrcweir+:shared_gxxlib
72*cdf0e10cSrcweir+gcc --shared -shared-libgcc --enable-pseudo-reloc -Wl,-Map,out/libeay32.map ms/libeay32.def -o out/libeay32.dll out/libcrypto_static.a -lwsock32 -lgdi32 %MINGW_SHARED_LIBSTDSPP%
73*cdf0e10cSrcweir+if errorlevel 1 goto end
74*cdf0e10cSrcweir+gcc --shared -shared-libgcc --enable-pseudo-reloc -Wl,-Map,out/ssleay32.map -Lout ms/ssleay32.def -o out/ssleay32.dll out/libssl_static.a -lcrypto %MINGW_SHARED_LIBSTDSPP%
75*cdf0e10cSrcweir+if errorlevel 1 goto end
76*cdf0e10cSrcweir+goto finished
77*cdf0e10cSrcweir
78*cdf0e10cSrcweir+:finished
79*cdf0e10cSrcweir echo Done compiling OpenSSL
80*cdf0e10cSrcweir
81*cdf0e10cSrcweir :end
82*cdf0e10cSrcweir--- misc/openssl-0.9.8o/util/pl/Mingw32.pl	2006-05-05 15:19:34.000000000 +0200
83*cdf0e10cSrcweir+++ misc/build/openssl-0.9.8o/util/pl/Mingw32.pl	2009-03-30 11:55:04.000000000 +0200
84*cdf0e10cSrcweir@@ -6,11 +6,11 @@
85*cdf0e10cSrcweir $o='/';
86*cdf0e10cSrcweir $cp='cp';
87*cdf0e10cSrcweir $rm='rm -f';
88*cdf0e10cSrcweir-$mkdir='gmkdir';
89*cdf0e10cSrcweir+#$mkdir='gmkdir';
90*cdf0e10cSrcweir
91*cdf0e10cSrcweir-$o='\\';
92*cdf0e10cSrcweir-$cp='copy';
93*cdf0e10cSrcweir-$rm='del';
94*cdf0e10cSrcweir+#$o='\\';
95*cdf0e10cSrcweir+#$cp='copy';
96*cdf0e10cSrcweir+#$rm='del';
97*cdf0e10cSrcweir $mkdir='mkdir';
98*cdf0e10cSrcweir
99*cdf0e10cSrcweir # C compiler stuff
100*cdf0e10cSrcweir@@ -87,7 +87,8 @@
101*cdf0e10cSrcweir 	($Name=$name) =~ tr/a-z/A-Z/;
102*cdf0e10cSrcweir
103*cdf0e10cSrcweir 	$ret.="$target: \$(${Name}OBJ)\n";
104*cdf0e10cSrcweir-	$ret.="\tif exist $target \$(RM) $target\n";
105*cdf0e10cSrcweir+    $ret.="\t\$(RM) $target\n";
106*cdf0e10cSrcweir+#	$ret.="\tif exist $target \$(RM) $target\n";
107*cdf0e10cSrcweir 	$ret.="\t\$(MKLIB) $target \$(${Name}OBJ)\n";
108*cdf0e10cSrcweir 	$ret.="\t\$(RANLIB) $target\n\n";
109*cdf0e10cSrcweir 	}
110