bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
perlasm_scheme => "coff",
dso_scheme => "win32",
- shared_target => "cygwin-shared",
+ shared_target => "mingw-shared",
shared_cflag => add(" ", "-D_WINDLL"),
shared_ldflag => "-static-libgcc",
shared_rcflag => "--target=pe-i386",
shared_extension => ".dll",
+ multilib => "",
},
"mingw64" => {
# As for OPENSSL_USE_APPLINK. Applink makes it possible to use
bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
perlasm_scheme => "mingw64",
dso_scheme => "win32",
- shared_target => "cygwin-shared",
+ shared_target => "mingw-shared",
shared_cflag => add(" ", "-D_WINDLL"),
shared_ldflag => "-static-libgcc",
shared_rcflag => "--target=pe-x86-64",
shared_extension => ".dll",
+ multilib => "64",
},
#### UEFI
cp cyg$$i-$(SHLIB_MAJOR).$(SHLIB_MINOR).dll test/; \
;; \
mingw*) \
- case $$i in \
- crypto) i=libeay32;; \
- ssl) i=ssleay32;; \
- esac; \
- rm -f apps/$$i.dll; \
- rm -f test/$$i.dll; \
- cp $$i.dll apps/; \
- cp $$i.dll test/; \
+ arch=; \
+ if expr $(PLATFORM) : mingw64 > /dev/null; then \
+ arch=-x64; \
+ fi; \
+ rm -f apps/lib$$i-$(SHLIB_MAJOR)_$(SHLIB_MINOR)$$arch.dll; \
+ rm -f test/lib$$i-$(SHLIB_MAJOR)_$(SHLIB_MINOR)$$arch.dll; \
+ cp lib$$i-$(SHLIB_MAJOR)_$(SHLIB_MINOR)$$arch.dll apps/; \
+ cp lib$$i-$(SHLIB_MAJOR)_$(SHLIB_MINOR)$$arch.dll test/; \
+ ;; \
esac; \
done
for i in $${tmp:-x}; \
do \
if [ -f "$$i" -o -f "$$i.a" ]; then \
- ( echo installing $$i; \
- if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
- c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
+ case "$(PLATFORM)" in \
+ Cygwin*) \
+ c=`echo $$i | sed 's/^lib\(.*\)\.dll/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
+ echo installing $$c; \
cp $$c $(DESTDIR)$(INSTALLTOP)/bin/$$c.new; \
chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$c.new; \
mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$c.new $(DESTDIR)$(INSTALLTOP)/bin/$$c; \
- cp $$i $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
- chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
- mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \
- else \
+ echo installing $$i.a; \
+ cp $$i.a $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a.new; \
+ chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a.new; \
+ mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a.new $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a; \
+ ;; \
+ mingw*) \
+ arch=; \
+ if expr $(PLATFORM) : mingw64 > /dev/null; then \
+ arch=-x64; \
+ fi; \
+ m=`echo $$i | sed -e 's/\.dll$$/-$(SHLIB_MAJOR)_$(SHLIB_MINOR)'"$$arch"'.dll/'`; \
+ echo installing $$m; \
+ cp $$m $(DESTDIR)$(INSTALLTOP)/bin/$$m.new; \
+ chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$m.new; \
+ mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$m.new $(DESTDIR)$(INSTALLTOP)/bin/$$m; \
+ echo installing $$i.a; \
+ cp $$i.a $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a.new; \
+ chmod 555 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a.new; \
+ mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a.new $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a; \
+ ;; \
+ *) \
+ echo installing $$i; \
cp $$i $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
chmod 555 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \
- 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 $(DESTDIR)$(INSTALLTOP)/bin/$$i.new; \
- chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$i.new; \
- mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$i.new $(DESTDIR)$(INSTALLTOP)/bin/$$i ); \
- fi; \
+ ;; \
+ esac; \
fi; \
done; \
( here="`pwd`"; \
for i in $${tmp:-x}; \
do \
if [ -f "$$i" -o -f "$$i.a" ]; then \
- if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
- c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
+ case "$(PLATFORM)" in \
+ Cygwin*) \
+ c=`echo $$i | sed 's/^lib\(.*\)\.dll/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
echo $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$c; \
$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$c; \
+ echo $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a; \
+ $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a; \
+ ;; \
+ mingw*) \
+ arch=; \
+ if expr $(PLATFORM) : mingw64 > /dev/null; then \
+ arch=-x64; \
+ fi; \
+ m=`echo $$i | sed -e 's/\.dll$$/-$(SHLIB_MAJOR)_$(SHLIB_MINOR)'"$$arch"'.dll/'`; \
+ echo $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$m; \
+ $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$m; \
+ echo $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a; \
+ $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a; \
+ ;; \
+ *) \
echo $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \
$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \
- else \
- echo $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \
- $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \
- fi; \
- if expr $(PLATFORM) : 'mingw' > /dev/null; then \
- case $$i in \
- *crypto*) i=libeay32.dll;; \
- *ssl*) i=ssleay32.dll;; \
- esac; \
- echo $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$i; \
- $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$i; \
- fi; \
+ ;; \
+ esac; \
fi; \
done; \
fi
base=-Wl,--enable-auto-image-base; \
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic"; \
$(LINK_SO_DSO)
-#for mingw target if def-file is in use dll-name should match library-name
link_shlib.cygwin:
@ $(CALC_VERSIONS); \
INHIBIT_SYMLINKS=yes; \
SHLIB=cyg$(LIBNAME); SHLIB_SOVER=-$(LIBVERSION); SHLIB_SUFFIX=.dll; \
- dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; extras=; \
- base=-Wl,--enable-auto-image-base; \
- if expr $(PLATFORM) : 'mingw' > /dev/null; then \
- case $(LIBNAME) in \
- crypto) SHLIB=libeay;; \
- ssl) SHLIB=ssleay;; \
- esac; \
- SHLIB_SOVER=32; \
- extras="$(LIBNAME).def"; \
- $(PERL) $(SRCDIR)/util/mkdef.pl 32 $$SHLIB > $$extras; \
- base=; [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \
- fi; \
dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \
echo "$(PERL) $(SRCDIR)/util/mkrc.pl $$dll_name |" \
"$(CROSS_COMPILE)windres $(SHARED_RCFLAGS) -o rc.o"; \
$(PERL) $(SRCDIR)/util/mkrc.pl $$dll_name | \
$(CROSS_COMPILE)windres $(SHARED_RCFLAGS) -o rc.o; \
- extras="$$extras rc.o"; \
ALLSYMSFLAGS='-Wl,--whole-archive'; \
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
- SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a $$extras"; \
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,--enable-auto-image-base -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a rc.o"; \
$(LINK_SO_SHLIB) || exit 1; \
- rm $$extras
+ rm rc.o
link_app.cygwin:
$(LINK_APP)
+# link_dso.mingw-shared and link_app.mingw-shared are mapped to the
+# corresponding cygwin targets, as they do the exact same thing.
+link_shlib.mingw:
+ @ $(CALC_VERSIONS); \
+ INHIBIT_SYMLINKS=yes; \
+ arch=; \
+ if expr $(PLATFORM) : mingw64 > /dev/null; then arch=-x64; fi; \
+ sover=`echo $(LIBVERSION) | sed -e 's/\./_/g'` ; \
+ SHLIB=lib$(LIBNAME); \
+ SHLIB_SOVER=-$$sover$$arch; \
+ SHLIB_SUFFIX=.dll; \
+ dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \
+ base=; [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \
+ $(PERL) $(SRCDIR)/util/mkdef.pl 32 $(LIBNAME) \
+ | sed -e 's|^\(LIBRARY *\)$(LIBNAME)32|\1'"$$dll_name"'|' \
+ > $(LIBNAME).def; \
+ echo "$(PERL) $(SRCDIR)/util/mkrc.pl $$dll_name |" \
+ "$(CROSS_COMPILE)windres $(SHARED_RCFLAGS) -o rc.o"; \
+ $(PERL) $(SRCDIR)/util/mkrc.pl $$dll_name | \
+ $(CROSS_COMPILE)windres $(SHARED_RCFLAGS) -o rc.o; \
+ ALLSYMSFLAGS='-Wl,--whole-archive'; \
+ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a $(LIBNAME).def rc.o"; \
+ $(LINK_SO_SHLIB) || exit 1; \
+ rm $(LIBNAME).def rc.o
+
link_dso.alpha-osf1:
@ if $(DETECT_GNU_LD); then \
$(DO_GNU_SO_NOCALC); \
link_shlib.cygwin-shared: link_shlib.cygwin
link_app.cygwin-shared: link_app.cygwin
symlink.cygwin-shared: symlink.cygwin
+link_dso.mingw-shared: link_dso.cygwin
+link_shlib.mingw-shared: link_shlib.mingw
+link_app.mingw-shared: link_app.cygwin
+symlink.mingw-shared: symlink.cygwin
link_dso.alpha-osf1-shared: link_dso.alpha-osf1
link_shlib.alpha-osf1-shared: link_shlib.alpha-osf1
link_app.alpha-osf1-shared: link_app.alpha-osf1
SHARED_NAME[libcrypto]=cygcrypto-{- $config{shlib_major}.".".$config{shlib_minor} -}
SHARED_NAME[libssl]=cygssl-{- $config{shlib_major}.".".$config{shlib_minor} -}
ELSIF[{- $config{target} =~ /^mingw/ -}]
- SHARED_NAME[libcrypto]=libeay32
- SHARED_NAME[libssl]=ssleay32
+ SHARED_NAME[libcrypto]=libcrypto-{- $config{shlib_major}."_".$config{shlib_minor} -}{- $config{target} eq "mingw64" ? "-x64" : "" -}
+ SHARED_NAME[libssl]=libssl-{- $config{shlib_major}."_".$config{shlib_minor} -}{- $config{target} eq "mingw64" ? "-x64" : "" -}
ENDIF
# VMS has a cultural standard where all libraries are prefixed.