On Monday 20 June 2005 18:48, Andy Polyakov wrote:
> - gaswin option is being phased out and should not be used;
> - can you confirm that just issuing 'make' right after 'perl Configure
> mingwx' doesn't work?
> - if you can confirm that it doesn't, can you show how does it fail?
>
> Point is that I'd rather see it cross-built by 'make' [which is known to
> work at least under cygwin], than by an extra script. In other words you
> should be able to get away with single extra mingwx line to ./Configure
> and patch for $exe_ext line... No extra scripts should be required...
so you want a Configure based approach, but still using mk1mf.pl,
or do you want native Configure / make / make install based system?
I guess the second option, so I tried implementing it. But I need some
help, as the openssl make system is quite complex, and I don't know
all nuances.
The attached diff should be a step in the right direction. but
linking libcrypto.dll fails, as there are still references to:
libcrypto.exp:fake:(.edata+0x2964): undefined reference to
`_ENGINE_load_ubsec'
libcrypto.exp:fake:(.edata+0x2f80): undefined reference to
`_ENGINE_load_cswift'
...
even though I used
-DOPENSSL_NO_HW.
the command that creates this problem is
i586-mingw32msvc-dllwrap --dllname libcrypto.dll \
--output-lib libcrypto.a \
--def ms/libeay32.def libcrypto.a \
-lwsock32 -lgdi32
I guess it has to do with the definition files,
but as I don't know what those exactly do, I'm pretty much lost.
Regards, Andreas
diff -udrNP openssl-0.9.8-stable-SNAP-20050703.orig/Configure openssl-0.9.8-stable-SNAP-20050703/Configure
--- openssl-0.9.8-stable-SNAP-20050703.orig/Configure 2005-07-04 00:27:11.169168808 +0200
+++ openssl-0.9.8-stable-SNAP-20050703/Configure 2005-07-04 00:56:17.650663264 +0200
@@ -469,6 +469,7 @@
# MinGW
"mingw", "gcc:-mno-cygwin -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall -D_WIN32_WINNT=0x333:::MINGW32:-lwsock32 -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",
+"mingwx", "i586-mingw32msvc-cc:-mno-cygwin -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall -D_WIN32_WINNT=0x333 -DOPENSSL_NO_HW:::MINGW32:-lwsock32 -lgdi32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_coff_asm}:win32:mingw-shared:-D_WINDLL:-mno-cygwin -shared:.dll:i586-mingw32msvc-ranlib",
# UWIN
"UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32",
@@ -909,7 +910,7 @@
$IsMK1MF=1 if ($target eq "mingw" && $^O ne "cygwin");
-$exe_ext=".exe" if ($target eq "Cygwin" || $target eq "DJGPP" || $target eq "mingw");
+$exe_ext=".exe" if ($target eq "Cygwin" || $target eq "DJGPP" || $target eq "mingw" || $target eq "mingwx");
$exe_ext=".pm" if ($target =~ /vos/);
$openssldir="/usr/local/ssl" if ($openssldir eq "" and $prefix eq "");
$prefix=$openssldir if $prefix eq "";
diff -udrNP openssl-0.9.8-stable-SNAP-20050703.orig/Makefile.org openssl-0.9.8-stable-SNAP-20050703/Makefile.org
--- openssl-0.9.8-stable-SNAP-20050703.orig/Makefile.org 2005-07-04 00:27:11.182166832 +0200
+++ openssl-0.9.8-stable-SNAP-20050703/Makefile.org 2005-07-04 00:27:21.282631328 +0200
@@ -496,7 +496,7 @@
@pod2man="`cd util; ./pod2mantest $(PERL)`"; \
here="`pwd`"; \
filecase=; \
- if [ "$(PLATFORM)" = "DJGPP" -o "$(PLATFORM)" = "Cygwin" -o "$(PLATFORM)" = "mingw" ]; then \
+ if [ "$(PLATFORM)" = "DJGPP" -o "$(PLATFORM)" = "Cygwin" -o "$(PLATFORM)" = "mingw" -o $(PLATFORM) = "mingwx" ]; then \
filecase=-i; \
fi; \
set -e; for i in doc/apps/*.pod; do \
diff -udrNP openssl-0.9.8-stable-SNAP-20050703.orig/Makefile.shared openssl-0.9.8-stable-SNAP-20050703/Makefile.shared
--- openssl-0.9.8-stable-SNAP-20050703.orig/Makefile.shared 2005-07-04 00:27:11.182166832 +0200
+++ openssl-0.9.8-stable-SNAP-20050703/Makefile.shared 2005-07-04 00:37:31.029935648 +0200
@@ -258,6 +258,55 @@
link_app.cygwin:
$(LINK_APP)
+link_o.mingw:
+ @ $(CALC_VERSIONS); \
+ INHIBIT_SYMLINKS=yes; \
+ SHLIB=$(LIBNAME)eay32; \
+ SHLIB_SUFFIX=.dll; \
+ LIBVERSION="$(LIBVERSION)"; \
+ SHLIB_SOVER=${LIBVERSION:+"-$(LIBVERSION)"}; \
+ ALLSYMSFLAGS='-Wl,--whole-archive'; \
+ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -o lib$(LIBNAME).dll"; \
+ expr $(LIBNAME) : 'crypto' > /dev/null && ( \
+ perl util/mkdef.pl 32 libeay > ms/libeay32.def ; \
+ i586-mingw32msvc-dllwrap --dllname lib$(LIBNAME).dll \
+ --output-lib lib$(LIBNAME).a \
+ --def ms/libeay32.def lib$(LIBNAME).a \
+ -lwsock32 -lgdi32 ) || ( \
+ perl util/mkdef.pl 32 ssleay > ms/ssleay32.def ; \
+ i586-mingw32msvc-dllwrap --dllname lib$(LIBNAME).dll \
+ --output-lib lib$(LIBNAME).a \
+ --def ms/ssleay32.def lib$(LIBNAME).a \
+ -lwsock32 -lgdi32 )
+link_a.mingw:
+ @ $(CALC_VERSIONS); \
+ INHIBIT_SYMLINKS=yes; \
+ SHLIB=$(LIBNAME)eay32; \
+ SHLIB_SUFFIX=.dll; \
+ SHLIB_SOVER=-$(LIBVERSION); \
+ ALLSYMSFLAGS='-Wl,--whole-archive'; \
+ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
+ base=; [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -o lib$(LIBNAME).dll"; \
+ [ -f apps/$$SHLIB$$SHLIB_SUFFIX ] && rm apps/$$SHLIB$$SHLIB_SUFFIX; \
+ [ -f test/$$SHLIB$$SHLIB_SUFFIX ] && rm test/$$SHLIB$$SHLIB_SUFFIX; \
+ expr $(LIBNAME) : 'crypto' > /dev/null && ( \
+ perl util/mkdef.pl 32 libeay > ms/libeay32.def ; \
+ i586-mingw32msvc-dllwrap --dllname lib$(LIBNAME).dll \
+ --output-lib lib$(LIBNAME).a \
+ --def ms/libeay32.def lib$(LIBNAME).a \
+ -lwsock32 -lgdi32 ) || ( \
+ perl util/mkdef.pl 32 ssleay > ms/ssleay32.def ; \
+ i586-mingw32msvc-dllwrap --dllname lib$(LIBNAME).dll \
+ --output-lib lib$(LIBNAME).a \
+ --def ms/ssleay32.def lib$(LIBNAME).a \
+ -lwsock32 -lgdi32 )
+ cp -p $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX apps/; \
+ cp -p $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX test/
+link_app.mingw:
+ $(LINK_APP)
+
link_o.alpha-osf1:
@ if ${DETECT_GNU_LD}; then \
$(DO_GNU_SO); \
@@ -523,7 +572,7 @@
# Targets to build symbolic links when needed
symlink.gnu symlink.solaris symlink.svr3 symlink.svr5 symlink.irix \
-symlink.aix symlink.reliantunix:
+symlink.aix symlink.reliantunix symlink.mingw:
@ $(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).so; \
$(SYMLINK_SO)
@@ -556,6 +605,10 @@
link_a.cygwin-shared: link_a.cygwin
link_app.cygwin-shared: link_app.cygwin
symlink.cygwin-shared: symlink.cygwin
+link_o.mingw-shared: link_o.mingw
+link_a.mingw-shared: link_a.mingw
+link_app.mingw-shared: link_app.mingw
+symlink.mingw-shared: symlink.mingw
link_o.alpha-osf1-shared: link_o.alpha-osf1
link_a.alpha-osf1-shared: link_a.alpha-osf1
link_app.alpha-osf1-shared: link_app.alpha-osf1