Apply mingw patches as supplied by Roumen Petrov an Alon Bar-Lev

PR: 1552
Submitted by: Roumen Petrov <openssl@roumenpetrov.info>, "Alon Bar-Lev" <alon.barlev@gmail.com>
This commit is contained in:
Lutz Jänicke 2008-04-17 10:19:16 +00:00
parent 6e6ada18c6
commit 4c1a6e004a
31 changed files with 86 additions and 56 deletions

View File

@ -20,3 +20,4 @@ libssl.pc
*.flc *.flc
semantic.cache semantic.cache
Makefile Makefile
*.dll*

View File

@ -494,7 +494,7 @@ my %table=(
"BC-32","bcc32::::WIN32::BN_LLONG DES_PTR RC4_INDEX EXPORT_VAR_AS_FN:${no_asm}:win32", "BC-32","bcc32::::WIN32::BN_LLONG DES_PTR RC4_INDEX EXPORT_VAR_AS_FN:${no_asm}:win32",
# MinGW # MinGW
"mingw", "gcc:-mno-cygwin -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::MINGW32:-lws2_32 -lgdi32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_coff_asm}:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin -shared:.dll.a", "mingw", "gcc:-mno-cygwin -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::MINGW32:-lws2_32 -lgdi32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_coff_asm}:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin:.dll.a",
# UWIN # UWIN
"UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32", "UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32",
@ -1192,13 +1192,16 @@ if (!$no_shared)
if (!$IsMK1MF) if (!$IsMK1MF)
{ {
# add {no-}static-engine to options to allow mkdef.pl to work without extra arguments
if ($no_shared) if ($no_shared)
{ {
$openssl_other_defines.="#define OPENSSL_NO_DYNAMIC_ENGINE\n"; $openssl_other_defines.="#define OPENSSL_NO_DYNAMIC_ENGINE\n";
$options.=" static-engine";
} }
else else
{ {
$openssl_other_defines.="#define OPENSSL_NO_STATIC_ENGINE\n"; $openssl_other_defines.="#define OPENSSL_NO_STATIC_ENGINE\n";
$options.=" no-static-engine";
} }
} }

View File

@ -534,6 +534,16 @@ install_sw:
chmod 644 $(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; \ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
fi ); \ fi ); \
if expr $(PLATFORM) : 'mingw' > /dev/null; then \
( case $$i in \
*crypto*) i=libeay32.dll;; \
*ssl*) i=ssleay32.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_PREFIX)$(INSTALLTOP)/bin/$$i ); \
fi; \
fi; \ fi; \
done; \ done; \
( here="`pwd`"; \ ( here="`pwd`"; \

View File

@ -248,16 +248,21 @@ link_o.cygwin:
INHIBIT_SYMLINKS=yes; \ INHIBIT_SYMLINKS=yes; \
SHLIB=cyg$(LIBNAME); \ SHLIB=cyg$(LIBNAME); \
base=-Wl,--enable-auto-image-base; \ base=-Wl,--enable-auto-image-base; \
deffile=; \
if expr $(PLATFORM) : 'mingw' > /dev/null; then \ if expr $(PLATFORM) : 'mingw' > /dev/null; then \
SHLIB=$(LIBNAME); base=; \ SHLIB=$(LIBNAME)eay32; base=; \
if test -f $(LIBNAME)eay32.def; then \
deffile=$(LIBNAME)eay32.def; \
fi; \
fi; \ fi; \
SHLIB_SUFFIX=.dll; \ SHLIB_SUFFIX=.dll; \
LIBVERSION="$(LIBVERSION)"; \ LIBVERSION="$(LIBVERSION)"; \
SHLIB_SOVER=${LIBVERSION:+"-$(LIBVERSION)"}; \ SHLIB_SOVER=${LIBVERSION:+"-$(LIBVERSION)"}; \
ALLSYMSFLAGS='-Wl,--whole-archive'; \ ALLSYMSFLAGS='-Wl,--whole-archive'; \
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-s,-Bsymbolic"; \ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base $$deffile -Wl,-s,-Bsymbolic"; \
$(LINK_SO_O) $(LINK_SO_O)
#for mingw target if def-file is in use dll-name should match library-name
link_a.cygwin: link_a.cygwin:
@ $(CALC_VERSIONS); \ @ $(CALC_VERSIONS); \
INHIBIT_SYMLINKS=yes; \ INHIBIT_SYMLINKS=yes; \
@ -265,9 +270,13 @@ link_a.cygwin:
dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; extras=; \ dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; extras=; \
base=-Wl,--enable-auto-image-base; \ base=-Wl,--enable-auto-image-base; \
if expr $(PLATFORM) : 'mingw' > /dev/null; then \ if expr $(PLATFORM) : 'mingw' > /dev/null; then \
SHLIB=$(LIBNAME); SHLIB_SOVER=32; \ case $(LIBNAME) in \
crypto) SHLIB=libeay;; \
ssl) SHLIB=ssleay;; \
esac; \
SHLIB_SOVER=32; \
extras="$(LIBNAME).def"; \ extras="$(LIBNAME).def"; \
$(PERL) util/mkdef.pl 32 $(LIBNAME) > $$extras; \ $(PERL) util/mkdef.pl 32 $$SHLIB > $$extras; \
base=; [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \ base=; [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \
fi; \ fi; \
dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \ dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \

View File

@ -5,3 +5,4 @@ der_chop.bak
CA.pl CA.pl
*.flc *.flc
semantic.cache semantic.cache
*.dll

View File

@ -4,5 +4,5 @@ opensslconf.h
Makefile.save Makefile.save
*.flc *.flc
semantic.cache semantic.cache
x86cpuid-elf.s *cpuid.s
x86_64cpuid.s uplink-cof.s

View File

@ -2,5 +2,4 @@ lib
Makefile.save Makefile.save
*.flc *.flc
semantic.cache semantic.cache
ax86-elf.s aes-*.s
aes-x86_64.s

View File

@ -2,4 +2,4 @@ lib
Makefile.save Makefile.save
*.flc *.flc
semantic.cache semantic.cache
bx86-elf.s bf-*.s

View File

@ -2,7 +2,6 @@ lib
Makefile.save Makefile.save
*.flc *.flc
semantic.cache semantic.cache
co86-elf.s co-*.s
bn86-elf.s bn-*.s
mo86-elf.s *-mont.s
x86_64-mont.s

View File

@ -1 +1,2 @@
lib lib
Makefile.save

View File

@ -2,4 +2,4 @@ lib
Makefile.save Makefile.save
*.flc *.flc
semantic.cache semantic.cache
cx86-elf.s cx86-*.s

View File

@ -3,5 +3,5 @@ Makefile.save
des des
*.flc *.flc
semantic.cache semantic.cache
yx86-elf.s crypt*.s
dx86-elf.s des-*.s

View File

@ -2,5 +2,4 @@ lib
Makefile.save Makefile.save
*.flc *.flc
semantic.cache semantic.cache
mx86-elf.s md5-*.s
md5-x86_64.s

View File

@ -2,5 +2,4 @@ lib
Makefile.save Makefile.save
*.flc *.flc
semantic.cache semantic.cache
rx86-elf.s rc4-*.s
rc4-x86_64.s

View File

@ -2,4 +2,4 @@ lib
Makefile.save Makefile.save
*.flc *.flc
semantic.cache semantic.cache
rm86-elf.s rmd-*.s

View File

@ -2,10 +2,6 @@ lib
Makefile.save Makefile.save
*.flc *.flc
semantic.cache semantic.cache
sx86-elf.s sha1-*.s
s512sse2-elf.s sha256-*.s
sha1-x86_64.s sha512-*.s
sha256-x86_64.s
sha512-x86_64.s
sha256x86-elf.s
sha512x86-elf.s

View File

@ -1 +1,2 @@
lib lib
Makefile.save

View File

@ -1,3 +1,3 @@
lib lib
w86mmx-elf.s Makefile.save
wp-x86_64.s wp-*.s

View File

@ -48,7 +48,7 @@ lib: $(LIBOBJ)
@touch lib @touch lib
files: files:
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
links: links:
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)

View File

@ -3,3 +3,4 @@ lib
libs libs
*.flc *.flc
semantic.cache semantic.cache
*.dll

View File

@ -99,26 +99,29 @@ links:
# for shared libraries as well as for Cygwin which uses the # for shared libraries as well as for Cygwin which uses the
# dlfcn_name_converter and therefore stores the engines with .so suffix, too. # dlfcn_name_converter and therefore stores the engines with .so suffix, too.
# XXXXX This was extended to HP-UX dl targets, which use .sl suffix. # XXXXX This was extended to HP-UX dl targets, which use .sl suffix.
# XXXXX This was extended to mingw targets, which use eay32.dll suffix without lib as prefix.
install: install:
@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile... @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
@if [ -n "$(SHARED_LIBS)" ]; then \ @if [ -n "$(SHARED_LIBS)" ]; then \
set -e; \ set -e; \
for l in $(LIBNAMES); do \ for l in $(LIBNAMES); do \
( echo installing $$l; \ ( echo installing $$l; \
pfx=lib; \
if [ "$(PLATFORM)" != "Cygwin" ]; then \ if [ "$(PLATFORM)" != "Cygwin" ]; then \
case "$(CFLAGS)" in \ case "$(CFLAGS)" in \
*DSO_BEOS*) sfx="so";; \ *DSO_BEOS*) sfx=".so";; \
*DSO_DLFCN*) sfx="so";; \ *DSO_DLFCN*) sfx=".so";; \
*DSO_DL*) sfx="sl";; \ *DSO_DL*) sfx=".sl";; \
*) sfx="bad";; \ *DSO_WIN32*) sfx="eay32.dll"; pfx=;; \
*) sfx=".bad";; \
esac; \ esac; \
cp lib$$l.$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$$l.$$sfx.new; \ cp $$pfx$$l$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/$$pfx$$l$$sfx.new; \
else \ else \
sfx="so"; \ sfx=".so"; \
cp cyg$$l.dll $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$$l.$$sfx.new; \ cp cyg$$l.dll $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/$$pfx$$l$$sfx.new; \
fi; \ fi; \
chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$$l.$$sfx.new; \ chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/$$pfx$$l$$sfx.new; \
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$$l.$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$$l.$$sfx ); \ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/$$pfx$$l$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/$$pfx$$l$$sfx ); \
done; \ done; \
fi fi
@target=install; $(RECURSIVE_MAKE) @target=install; $(RECURSIVE_MAKE)

View File

@ -3,3 +3,4 @@ lib
libs libs
*.flc *.flc
semantic.cache semantic.cache
*.dll

View File

@ -44,20 +44,22 @@ install:
if [ -n "$(SHARED_LIBS)" ]; then \ if [ -n "$(SHARED_LIBS)" ]; then \
set -e; \ set -e; \
echo installing $(LIBNAME); \ echo installing $(LIBNAME); \
pfx=lib; \
if [ "$(PLATFORM)" != "Cygwin" ]; then \ if [ "$(PLATFORM)" != "Cygwin" ]; then \
case "$(CFLAGS)" in \ case "$(CFLAGS)" in \
*DSO_BEOS*) sfx="so";; \ *DSO_BEOS*) sfx=".so";; \
*DSO_DLFCN*) sfx="so";; \ *DSO_DLFCN*) sfx=".so";; \
*DSO_DL*) sfx="sl";; \ *DSO_DL*) sfx=".sl";; \
*) sfx="bad";; \ *DSO_WIN32*) sfx="eay32.dll"; pfx=;; \
*) sfx=".bad";; \
esac; \ esac; \
cp lib$(LIBNAME).$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$(LIBNAME).$$sfx.new; \ cp $${pfx}$(LIBNAME)$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/$${pfx}$(LIBNAME)$$sfx.new; \
else \ else \
sfx="so"; \ sfx="so"; \
cp cyg$(LIBNAME).dll $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$(LIBNAME).$$sfx.new; \ cp cyg$(LIBNAME).dll $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/$${pfx}$(LIBNAME)$$sfx.new; \
fi; \ fi; \
chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$(LIBNAME).$$sfx.new; \ chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/$${pfx}$(LIBNAME)$$sfx.new; \
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$(LIBNAME).$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$(LIBNAME).$$sfx; \ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/$${pfx}$(LIBNAME)$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/$${pfx}$(LIBNAME)$$sfx; \
fi fi
links: links:

View File

@ -79,7 +79,7 @@ mingw32-make -f ms/mingw32a.mak
if errorlevel 1 goto end if errorlevel 1 goto end
echo Generating the DLLs and input libraries echo Generating the DLLs and input libraries
dllwrap --dllname libeay32.dll --output-lib out/libeay32.a --def ms/libeay32.def out/libcrypto.a -lwsock32 -lgdi32 dllwrap --dllname libeay32.dll --output-lib out/libeay32.a --def ms/libeay32.def out/libcrypto.a -lws2_32 -lgdi32
if errorlevel 1 goto end if errorlevel 1 goto end
dllwrap --dllname libssl32.dll --output-lib out/libssl32.a --def ms/ssleay32.def out/libssl.a out/libeay32.a dllwrap --dllname libssl32.dll --output-lib out/libssl32.a --def ms/ssleay32.def out/libssl.a out/libeay32.a
if errorlevel 1 goto end if errorlevel 1 goto end

View File

@ -15,7 +15,7 @@ make -f ms/mingw32.mak
if errorlevel 1 goto end if errorlevel 1 goto end
@rem Generate the DLLs and input libraries @rem Generate the DLLs and input libraries
dllwrap --dllname libeay32.dll --output-lib out/libeay32.a --def ms/libeay32.def out/libcrypto.a -lwsock32 -lgdi32 dllwrap --dllname libeay32.dll --output-lib out/libeay32.a --def ms/libeay32.def out/libcrypto.a -lws2_32 -lgdi32
if errorlevel 1 goto end if errorlevel 1 goto end
dllwrap --dllname libssl32.dll --output-lib out/libssl32.a --def ms/ssleay32.def out/libssl.a out/libeay32.a dllwrap --dllname libssl32.dll --output-lib out/libssl32.a --def ms/ssleay32.def out/libssl.a out/libeay32.a
if errorlevel 1 goto end if errorlevel 1 goto end

View File

@ -14,5 +14,5 @@ cl /Focrypto.obj -DWIN32 %OPTIONS% -c crypto\crypto.c
cl /Fossl.obj -DWIN32 %OPTIONS% -c ssl\ssl.c cl /Fossl.obj -DWIN32 %OPTIONS% -c ssl\ssl.c
cl /Foeay.obj -DWIN32 %OPTIONS% -c apps\eay.c cl /Foeay.obj -DWIN32 %OPTIONS% -c apps\eay.c
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

View File

@ -5,9 +5,9 @@ set OPTIONS2=/W3 /WX /Ox /Gf /nologo
set OPTIONS=%OPTIONS1% %OPTIONS2% set OPTIONS=%OPTIONS1% %OPTIONS2%
cl /Felibeay32.dll /GD /MD /LD -DWIN32 %OPTIONS% ms\libeay32.def crypto\crypto.c 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 /Felibeay32.dll /GD /MD /LD -DWIN32 %OPTIONS% ms\libeay32.def crypto\crypto.c 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
cl /Fessleay32.dll /GD /MD /LD -DWIN32 %OPTIONS% ms\ssleay32.def ssl\ssl.c libeay32.lib cl /Fessleay32.dll /GD /MD /LD -DWIN32 %OPTIONS% ms\ssleay32.def ssl\ssl.c libeay32.lib
cl /Fessleay.exe /MD -DWIN32 %OPTIONS% apps\eay.c ssleay32.lib libeay32.lib user32.lib wsock32.lib cl /Fessleay.exe /MD -DWIN32 %OPTIONS% apps\eay.c ssleay32.lib libeay32.lib user32.lib ws2_32.lib

View File

@ -31,3 +31,4 @@ sha512t
*.flc *.flc
semantic.cache semantic.cache
newkey.pem newkey.pem
*.dll

View File

@ -377,6 +377,10 @@ foreach $lib (keys %csrc)
"#ifndef HEADER_${lib}_ERR_H\n", "#ifndef HEADER_${lib}_ERR_H\n",
"#define HEADER_${lib}_ERR_H\n", "#define HEADER_${lib}_ERR_H\n",
"\n", "\n",
"#ifdef __cplusplus\n",
"extern \"C\" {\n",
"#endif\n",
"\n",
"/* BEGIN ERROR CODES */\n"; "/* BEGIN ERROR CODES */\n";
} }
open (OUT, ">$hfile") || die "Can't Open File $hfile for writing\n"; open (OUT, ">$hfile") || die "Can't Open File $hfile for writing\n";

View File

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

View File

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