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