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