oops, forgot the patch...
--- On Thu, 4/1/10, Ray Satiro <[email protected]> wrote:
> From: Ray Satiro <[email protected]>
> Subject: [PATCH] for compiling OpenSSL 1.0.0 (3/29/10) using MinGW
> To: [email protected]
> Date: Thursday, April 1, 2010, 1:25 PM
> Third time's the charm, hopefully...
> --
> Without this patch the make will error with "Pick one
> target type from" and a list of assembler types.
> "mingw32-make: *** [tmp\x86cpuid.asm] Error 1"
> --
>
> I had to make some changes to compile OpenSSL 1.0.0
> (3/29/10) using MinGW. The asmtype is not specified in MinGW
> builds so I added it to Mingw32.pl. I changed -mcpu back to
> -march.
> Configure was now missing its mk1mf check, so I changed
> that back.
> Also a minor type field character change in speed.c
>
> My compiler coughed a lot of errors in e_capi.c, looked
> like wintrust.h stuff. I realized I didn't have this problem
> because in previous versions no-capieng used to be a
> default option. After I passed it the compile was
> successful.
>
> I have two unknown option messages:
> Generating makefile
> unknown option - no-capieng
> unknown option - static-engine
>
> However as implied above the script seems to be picking up
> on no-capieng when I specify it, although
> -DOPENSSL_NO_CAPIENG does not appear to be added to CFLAGS
> any longer. Is this expected? Not sure why static-engine was
> there and I can't reproduce that line. INSTALL.W32 reads
> like the behavior of making libs for ENGINES has changed
> since 0.9.8 but it's my understanding this still doesn't
> apply to MinGW and so static-engine opt is probably not
> needed there.
>
> Also it appears that the resource ms\version32.rc file
> isn't compiled or added in.
>
> If anyone has trouble you might try using a clean copy with
> these steps from a command prompt (not msys):
>
> decompressed with winrar
> cd openssl-1.0.0
> unix2dos ..\openssl.patch
> patch -p1 < ..\openssl.patch
> ms\mingw32.bat no-capieng >ms_make.out 2>&1
> cd out
> ..\ms\test > ..\ms_test.out 2>&1
>
>
> Thanks,
>
> Jay
>
>
>
>
>
> ______________________________________________________________________
> OpenSSL Project
>
> http://www.openssl.org
> Development Mailing List
> [email protected]
> Automated List Manager
>
> [email protected]
>
diff -ru openssl-1.0.0-orig/apps/speed.c openssl-1.0.0/apps/speed.c
--- openssl-1.0.0-orig/apps/speed.c 2010-03-03 14:56:18.000000000 -0500
+++ openssl-1.0.0/apps/speed.c 2010-03-30 02:06:56.763000000 -0400
@@ -295,7 +295,7 @@
if (thr==NULL)
{
DWORD ret=GetLastError();
- BIO_printf(bio_err,"unable to CreateThread (%d)",ret);
+ BIO_printf(bio_err,"unable to CreateThread (%u)",ret);
ExitProcess(ret);
}
CloseHandle(thr); /* detach the thread */
diff -ru openssl-1.0.0-orig/Configure openssl-1.0.0/Configure
--- openssl-1.0.0-orig/Configure 2010-01-19 16:40:54.000000000 -0500
+++ openssl-1.0.0/Configure 2010-03-30 02:06:49.782000000 -0400
@@ -1035,6 +1035,8 @@
my $IsMK1MF=scalar grep /^$target$/,@MK1MF_Builds;
+$IsMK1MF=1 if ($target eq "mingw" && $^O ne "cygwin" && !is_msys());
+
$exe_ext=".exe" if ($target eq "Cygwin" || $target eq "DJGPP" || $target =~ /^mingw/);
$exe_ext=".nlm" if ($target =~ /netware/);
$exe_ext=".pm" if ($target =~ /vos/);
@@ -2040,3 +2042,11 @@
print STDERR "No sanity errors detected!\n" if $errorcnt == 0;
return $errorcnt;
}
+
+# Attempt to detect MSYS environment
+
+sub is_msys
+ {
+ return 1 if (exists $ENV{"TERM"} && $ENV{"TERM"} eq "msys");
+ return 0;
+ }
diff -ru openssl-1.0.0-orig/util/pl/Mingw32.pl openssl-1.0.0/util/pl/Mingw32.pl
--- openssl-1.0.0-orig/util/pl/Mingw32.pl 2008-04-17 06:19:16.000000000 -0400
+++ openssl-1.0.0/util/pl/Mingw32.pl 2010-03-30 02:06:53.097000000 -0400
@@ -19,7 +19,7 @@
if ($debug)
{ $cflags="-DL_ENDIAN -DDSO_WIN32 -g2 -ggdb"; }
else
- { $cflags="-DL_ENDIAN -DDSO_WIN32 -fomit-frame-pointer -O3 -mcpu=i486 -Wall"; }
+ { $cflags="-DL_ENDIAN -DDSO_WIN32 -fomit-frame-pointer -O3 -march=i486 -Wall"; }
if ($gaswin and !$no_asm)
{
@@ -66,6 +66,7 @@
$shlibp=".a";
$lfile='';
+$asmtype='coff';
$asm='as';
$afile='-o ';
#$bn_asm_obj="";