hi,
is there any change to get into the upstream openssl?
it'd be very useful and important to be able to generate win32 binary on
linux.
thnaks in advance.

Alon Bar-Lev wrote:
> Hello,
>=20
> An update.
> 1. The issue with OPENSSL_IMPLEMENT_GLOBAL is gone now.
> 2. Merged with Roumen Petrov's patch:
> http://rt.openssl.org/Ticket/Display.html?id=3D1552
>=20
> Except of not postfix engine dlls with eay32.
>=20
> Best Regards,
> Alon Bar-Lev.
>=20
> ---
>=20
> diff -urNp openssl-SNAP-20070901/Configure openssl-SNAP-20070901.mingw3=

2-2/Configure
> --- openssl-SNAP-20070901/Configure 2007-08-30 12:00:13.000000000 +0300
> +++ openssl-SNAP-20070901.mingw32-2/Configure 2007-09-01 19:36:32.00000=

0000 +0300
> @@ -481,7 +481,7 @@ my %table=3D(
> "BC-32","bcc32::::WIN32::BN_LLONG DES_PTR RC4_INDEX EXPORT_VAR_AS_FN:$=

{no_asm}:win32",
> =20
> # MinGW
> -"mingw", "gcc:-mno-cygwin -DL_ENDIAN -fomit-frame-pointer -O3 -march=3D=

i486 -Wall:::MINGW32:-lws2_32 -lgdi32:BN_LLONG ${x86_gcc_des} ${x86_gcc_o=
pts} EXPORT_VAR_AS_FN:${x86_coff_asm}:win32:cygwin-shared:-D_WINDLL -DOPE=
NSSL_USE_APPLINK:-mno-cygwin -shared:.dll.a",
> +"mingw", "gcc:-mno-cygwin -DL_ENDIAN -fomit-frame-pointer -O3 -march=3D=

i486 -Wall:::MINGW32:-lws2_32 -lgdi32:BN_LLONG ${x86_gcc_des} ${x86_gcc_o=
pts} EXPORT_VAR_AS_FN:${x86_coff_asm}:win32:cygwin-shared:-D_WINDLL -DOPE=
NSSL_USE_APPLINK:-mno-cygwin:.dll.a",
> =20
> # UWIN=20
> "UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_d=

es} ${x86_gcc_opts}:${no_asm}:win32",
> @@ -1169,13 +1169,16 @@ if (!$no_shared)
> =20
> if (!$IsMK1MF)
> {
> + # add {no-}static-engine to options to allow mkdef.pl to work without=

extra arguments
> if ($no_shared)
> {
> $openssl_other_defines.=3D"#define OPENSSL_NO_DYNAMIC_ENGINE\n";
> + $options.=3D" static-engine";
> }
> else
> {
> $openssl_other_defines.=3D"#define OPENSSL_NO_STATIC_ENGINE\n";
> + $options.=3D" no-static-engine";
> }
> }
> =20
> diff -urNp openssl-SNAP-20070901/engines/ccgost/Makefile openssl-SNAP-2=

0070901.mingw32-2/engines/ccgost/Makefile
> --- openssl-SNAP-20070901/engines/ccgost/Makefile 2007-05-18 19:02:28.0=

00000000 +0300
> +++ openssl-SNAP-20070901.mingw32-2/engines/ccgost/Makefile 2007-09-01 =

19:48:02.000000000 +0300
> @@ -44,20 +44,24 @@ install: =09
> if [ -n "$(SHARED_LIBS)" ]; then \
> set -e; \
> echo installing $(LIBNAME); \
> + l=3D${LIBNAME}; \
> if [ "$(PLATFORM)" !=3D "Cygwin" ]; then \
> + pfx=3Dlib; \
> + sfx=3D"so"; \
> case "$(CFLAGS)" in \
> *DSO_BEOS*) sfx=3D"so";; \
> *DSO_DLFCN*) sfx=3D"so";; \
> *DSO_DL*) sfx=3D"sl";; \
> + *DSO_WIN32*) sfx=3D"dll"; pfx=3D;; \
> *) sfx=3D"bad";; \
> esac; \
> - cp lib$(LIBNAME).$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/l=

ib$(LIBNAME).$$sfx.new; \
> else \
> + pfx=3D"cyg"; \
> sfx=3D"so"; \
> - cp cyg$(LIBNAME).dll $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib=

$(LIBNAME).$$sfx.new; \
> fi; \
> - chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$(LIBNAME).$=

$sfx.new; \
> - mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$(LIBNAME).$$sfx=

..new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$(LIBNAME).$$sfx; \
> + cp $$pfx$$l.$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/$$pfx$$=

l.$$sfx.new; \
> + chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/$$pfx$$l.$$sfx.=

new; \
> + mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/$$pfx$$l.$$sfx.new =

$(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/$$pfx$$l.$$sfx; \
> fi
> =20
> links:
> diff -urNp openssl-SNAP-20070901/engines/Makefile openssl-SNAP-20070901=

..mingw32-2/engines/Makefile
> --- openssl-SNAP-20070901/engines/Makefile 2007-05-17 21:01:28.00000000=

0 +0300
> +++ openssl-SNAP-20070901.mingw32-2/engines/Makefile 2007-09-01 19:47:3=

9.000000000 +0300
> @@ -106,19 +106,21 @@ install:
> for l in $(LIBNAMES); do \
> ( echo installing $$l; \
> if [ "$(PLATFORM)" !=3D "Cygwin" ]; then \
> + pfx=3Dlib; \
> case "$(CFLAGS)" in \
> *DSO_BEOS*) sfx=3D"so";; \
> *DSO_DLFCN*) sfx=3D"so";; \
> *DSO_DL*) sfx=3D"sl";; \
> + *DSO_WIN32*) sfx=3D"dll"; pfx=3D;; \
> *) sfx=3D"bad";; \
> esac; \
> - cp lib$$l.$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$$l.=

$$sfx.new; \
> else \
> + pfx=3D"cyg"; \
> sfx=3D"so"; \
> - cp cyg$$l.dll $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$$l.$$=

sfx.new; \
> fi; \
> - chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$$l.$$sfx=

..new; \
> - mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$$l.$$sfx.new=

$(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$$l.$$sfx ); \
> + cp $$pfx$$l.$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/$$pf=

x$$l.$$sfx.new; \
> + chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/$$pfx$$l.$$s=

fx.new; \
> + mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/$$pfx$$l.$$sfx.n=

ew $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/$$pfx$$l.$$sfx ); \
> done; \
> fi
> @target=3Dinstall; $(RECURSIVE_MAKE)
> diff -urNp openssl-SNAP-20070901/Makefile.org openssl-SNAP-20070901.min=

gw32-2/Makefile.org
> --- openssl-SNAP-20070901/Makefile.org 2007-08-29 01:00:18.000000000 +0=

300
> +++ openssl-SNAP-20070901.mingw32-2/Makefile.org 2007-09-01 19:36:32.00=

0000000 +0300
> @@ -279,6 +279,8 @@ clean-shared:
> ( set -x; rm -f lib$$i$(SHLIB_EXT) ); \
> if [ "$(PLATFORM)" =3D "Cygwin" ]; then \
> ( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
> + elif [ "$(PLATFORM)" =3D "mingw" ]; then \
> + ( set -x; rm -f $$i32$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
> fi; \
> done
> =20
> @@ -516,19 +518,37 @@ install_sw:
> do \
> if [ -f "$$i" -o -f "$$i.a" ]; then \
> ( echo installing $$i; \
> - if [ "$(PLATFORM)" !=3D "Cygwin" ]; then \
> + if [ "$(PLATFORM)" =3D "Cygwin" ]; then \
> + c=3D`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_N=

UMBER).dll/'`; \
> + cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
> + chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
> + mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX=

)$(INSTALLTOP)/bin/$$c; \
> cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
> - chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
> + chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
> mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX=

)$(INSTALLTOP)/lib/$$i; \
> - else \
> - c=3D`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_N=

UMBER).dll/'`; \
> + elif [ "$(PLATFORM)" =3D "mingw" ]; then \
> + c=3D`echo $$i | sed 's/^lib\(.*\)\.dll\.a/\132.dll/'`; \
> cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
> chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
> mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX=

)$(INSTALLTOP)/bin/$$c; \
> cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
> chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
> mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX=

)$(INSTALLTOP)/lib/$$i; \
> + else \
> + cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
> + chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
> + mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX=

)$(INSTALLTOP)/lib/$$i; \
> fi ); \
> + if expr $(PLATFORM) : 'mingw' > /dev/null; then \
> + ( case $$i in \
> + *crypto*) i=3Dlibeay32.dll;; \
> + *ssl*) i=3Dssleay32.dll;; \
> + esac; \
> + echo installing $$i; \
> + cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
> + chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
> + mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new $(INSTALL_PREFI=

X)$(INSTALLTOP)/bin/$$i ); \
> + fi; \
> fi; \
> done; \
> ( here=3D"`pwd`"; \
> diff -urNp openssl-SNAP-20070901/Makefile.shared openssl-SNAP-20070901.=

mingw32-2/Makefile.shared
> --- openssl-SNAP-20070901/Makefile.shared 2007-08-26 18:00:10.000000000=

+0300
> +++ openssl-SNAP-20070901.mingw32-2/Makefile.shared 2007-09-01 19:36:32=

..000000000 +0300
> @@ -248,16 +248,21 @@ link_o.cygwin:
> INHIBIT_SYMLINKS=3Dyes; \
> SHLIB=3Dcyg$(LIBNAME); \
> base=3D-Wl,--enable-auto-image-base; \
> + deffile=3D; \
> if expr $(PLATFORM) : 'mingw' > /dev/null; then \
> - SHLIB=3D$(LIBNAME); base=3D; \
> + SHLIB=3D$(LIBNAME); base=3D; \
> + if test -f $(LIBNAME).def; then \
> + deffile=3D$(LIBNAME).def; \
> + fi; \
> fi; \
> SHLIB_SUFFIX=3D.dll; \
> LIBVERSION=3D"$(LIBVERSION)"; \
> SHLIB_SOVER=3D${LIBVERSION:+"-$(LIBVERSION)"}; \
> ALLSYMSFLAGS=3D'-Wl,--whole-archive'; \
> NOALLSYMSFLAGS=3D'-Wl,--no-whole-archive'; \
> - SHAREDFLAGS=3D"$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-s,-Bsy=

mbolic"; \
> + SHAREDFLAGS=3D"$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base $$deffile -=

Wl,-s,-Bsymbolic"; \
> $(LINK_SO_O)
> +#for mingw target if def-file is in use dll-name should match library-=

name
> link_a.cygwin:
> @ $(CALC_VERSIONS); \
> INHIBIT_SYMLINKS=3Dyes; \
> @@ -265,9 +270,13 @@ link_a.cygwin:
> dll_name=3D$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; extras=3D; \
> base=3D-Wl,--enable-auto-image-base; \
> if expr $(PLATFORM) : 'mingw' > /dev/null; then \
> - SHLIB=3D$(LIBNAME); SHLIB_SOVER=3D32; \
> + case $(LIBNAME) in \
> + crypto) SHLIB=3Dlibeay;; \
> + ssl) SHLIB=3Dssleay;; \
> + esac; \
> + SHLIB_SOVER=3D32; \
> extras=3D"$(LIBNAME).def"; \
> - $(PERL) util/mkdef.pl 32 $(LIBNAME) > $$extras; \
> + $(PERL) util/mkdef.pl 32 $$SHLIB > $$extras; \
> base=3D; [ $(LIBNAME) =3D "crypto" ] && base=3D-Wl,--image-base,0x63=

000000; \
> fi; \
> dll_name=3D$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \
> diff -urNp openssl-SNAP-20070901/ms/mingw32.bat openssl-SNAP-20070901.m=

ingw32-2/ms/mingw32.bat
> --- openssl-SNAP-20070901/ms/mingw32.bat 2003-02-22 21:15:49.000000000 =

+0200
> +++ openssl-SNAP-20070901.mingw32-2/ms/mingw32.bat 2007-09-01 19:36:32.=

000000000 +0300
> @@ -79,7 +79,7 @@ mingw32-make -f ms/mingw32a.mak
> if errorlevel 1 goto end
> =20
> echo Generating the DLLs and input libraries
> -dllwrap --dllname libeay32.dll --output-lib out/libeay32.a --def ms/li=

beay32.def out/libcrypto.a -lwsock32 -lgdi32
> +dllwrap --dllname libeay32.dll --output-lib out/libeay32.a --def ms/li=

beay32.def out/libcrypto.a -lws2_32 -lgdi32
> if errorlevel 1 goto end
> dllwrap --dllname libssl32.dll --output-lib out/libssl32.a --def ms/ss=

leay32.def out/libssl.a out/libeay32.a
> if errorlevel 1 goto end
> diff -urNp openssl-SNAP-20070901/ms/mw.bat openssl-SNAP-20070901.mingw3=

2-2/ms/mw.bat
> --- openssl-SNAP-20070901/ms/mw.bat 2003-02-22 21:15:49.000000000 +0200
> +++ openssl-SNAP-20070901.mingw32-2/ms/mw.bat 2007-09-01 19:36:32.00000=

0000 +0300
> @@ -15,7 +15,7 @@ make -f ms/mingw32.mak
> if errorlevel 1 goto end
> =20
> @rem Generate the DLLs and input libraries
> -dllwrap --dllname libeay32.dll --output-lib out/libeay32.a --def ms/li=

beay32.def out/libcrypto.a -lwsock32 -lgdi32
> +dllwrap --dllname libeay32.dll --output-lib out/libeay32.a --def ms/li=

beay32.def out/libcrypto.a -lws2_32 -lgdi32
> if errorlevel 1 goto end
> dllwrap --dllname libssl32.dll --output-lib out/libssl32.a --def ms/ss=

leay32.def out/libssl.a out/libeay32.a
> if errorlevel 1 goto end
> diff -urNp openssl-SNAP-20070901/shlib/win32.bat openssl-SNAP-20070901.=

mingw32-2/shlib/win32.bat
> --- openssl-SNAP-20070901/shlib/win32.bat 1998-12-21 12:52:46.000000000=

+0200
> +++ openssl-SNAP-20070901.mingw32-2/shlib/win32.bat 2007-09-01 19:36:32=

..000000000 +0300
> @@ -14,5 +14,5 @@ cl /Focrypto.obj -DWIN32 %OPTIONS% -c cr
> cl /Fossl.obj -DWIN32 %OPTIONS% -c ssl\ssl.c
> cl /Foeay.obj -DWIN32 %OPTIONS% -c apps\eay.c
> =20
> -cl /Fessleay.exe %OPTIONS% eay.obj ssl.obj crypto.obj crypto\bf\asm\b-=

win32.obj crypto\des\asm\c-win32.obj crypto\des\asm\d-win32.obj crypto\bn=
\asm\x86nt32.obj user32.lib gdi32.lib wsock32.lib
> +cl /Fessleay.exe %OPTIONS% eay.obj ssl.obj crypto.obj crypto\bf\asm\b-=

win32.obj crypto\des\asm\c-win32.obj crypto\des\asm\d-win32.obj crypto\bn=
\asm\x86nt32.obj user32.lib gdi32.lib ws2_32.lib
> =20
> diff -urNp openssl-SNAP-20070901/shlib/win32dll.bat openssl-SNAP-200709=

01.mingw32-2/shlib/win32dll.bat
> --- openssl-SNAP-20070901/shlib/win32dll.bat 1998-12-21 12:52:46.000000=

000 +0200
> +++ openssl-SNAP-20070901.mingw32-2/shlib/win32dll.bat 2007-09-01 19:36=

:32.000000000 +0300
> @@ -5,9 +5,9 @@ set OPTIONS2=3D/W3 /WX /Ox /Gf /nologo
> =20
> set OPTIONS=3D%OPTIONS1% %OPTIONS2%
> =20
> -cl /Felibeay32.dll /GD /MD /LD -DWIN32 %OPTIONS% ms\libeay32.def crypt=

o\crypto.c crypto\bf\asm\b-win32.obj crypto\des\asm\c-win32.obj crypto\de=
s\asm\d-win32.obj crypto\bn\asm\x86nt32.obj user32.lib gdi32.lib wsock32.=
lib
> +cl /Felibeay32.dll /GD /MD /LD -DWIN32 %OPTIONS% ms\libeay32.def crypt=

o\crypto.c crypto\bf\asm\b-win32.obj crypto\des\asm\c-win32.obj crypto\de=
s\asm\d-win32.obj crypto\bn\asm\x86nt32.obj user32.lib gdi32.lib ws2_32.l=
ib
> =20
> cl /Fessleay32.dll /GD /MD /LD -DWIN32 %OPTIONS% ms\ssleay32.def ssl\s=

sl.c libeay32.lib
> =20
> -cl /Fessleay.exe /MD -DWIN32 %OPTIONS% apps\eay.c ssleay32.lib libeay3=

2.lib user32.lib wsock32.lib
> +cl /Fessleay.exe /MD -DWIN32 %OPTIONS% apps\eay.c ssleay32.lib libeay3=

2.lib user32.lib ws2_32.lib
> =20
> diff -urNp openssl-SNAP-20070901/util/mkerr.pl openssl-SNAP-20070901.mi=

ngw32-2/util/mkerr.pl
> --- openssl-SNAP-20070901/util/mkerr.pl 2007-04-05 21:01:50.000000000 +=

0300
> +++ openssl-SNAP-20070901.mingw32-2/util/mkerr.pl 2007-09-01 19:36:32.0=

00000000 +0300
> @@ -377,6 +377,10 @@ foreach $lib (keys %csrc)
> "#ifndef HEADER_${lib}_ERR_H\n",
> "#define HEADER_${lib}_ERR_H\n",
> "\n",
> +"#ifdef __cplusplus\n",
> +"extern \"C\" {\n",
> +"#endif\n",
> +"\n",
> "/* BEGIN ERROR CODES */\n";
> }
> open (OUT, ">$hfile") || die "Can't Open File $hfile for writing\n";
> diff -urNp openssl-SNAP-20070901/util/pl/BC-32.pl openssl-SNAP-20070901=

..mingw32-2/util/pl/BC-32.pl
> --- openssl-SNAP-20070901/util/pl/BC-32.pl 2005-09-20 11:00:28.00000000=

0 +0300
> +++ openssl-SNAP-20070901.mingw32-2/util/pl/BC-32.pl 2007-09-01 19:36:3=

2.000000000 +0300
> @@ -117,7 +117,7 @@ ___
> else
> {
> local($ex)=3D($target =3D~ /O_SSL/)?' $(L_CRYPTO)':'';
> - $ex.=3D' wsock32.lib gdi32.lib';
> + $ex.=3D' ws2_32.lib gdi32.lib';
> $ret.=3D"\t\$(LINK) \$(MLFLAGS) $efile$target /def:ms/${Name}.def @<=

<\n \$(SHLIB_EX_OBJ) $objs $ex\n<<\n";
> }
> $ret.=3D"\n";
> diff -urNp openssl-SNAP-20070901/util/pl/Mingw32.pl openssl-SNAP-200709=

01.mingw32-2/util/pl/Mingw32.pl
> --- openssl-SNAP-20070901/util/pl/Mingw32.pl 2003-06-26 15:00:14.000000=

000 +0300
> +++ openssl-SNAP-20070901.mingw32-2/util/pl/Mingw32.pl 2007-09-01 19:36=

:32.000000000 +0300
> @@ -55,7 +55,7 @@ $link=3D'${CC}';
> $lflags=3D'${CFLAGS}';
> $efile=3D'-o ';
> $exep=3D'';
> -$ex_libs=3D"-lwsock32 -lgdi32";
> +$ex_libs=3D"-lws2_32 -lgdi32";
> =20
> # static library stuff
> $mklib=3D'ar r';
>=20



--=20
Levente "Si vis pacem para bellum!"


__________________________________________________ ____________________
OpenSSL Project http://www.openssl.org
Development Mailing List openssl-dev@openssl.org
Automated List Manager majordomo@openssl.org