Support assembler for Mingw32.
authorUlf Möller <ulf@openssl.org>
Mon, 28 Feb 2000 19:16:41 +0000 (19:16 +0000)
committerUlf Möller <ulf@openssl.org>
Mon, 28 Feb 2000 19:16:41 +0000 (19:16 +0000)
CHANGES
config
crypto/perlasm/x86asm.pl
crypto/perlasm/x86unix.pl
ms/mingw32.bat [new file with mode: 0644]
util/mk1mf.pl
util/pl/Mingw32.pl

diff --git a/CHANGES b/CHANGES
index 62d2ec1829a809d5af0ef3414def0cfa1fc7a6ef..336be9804c37d00bfdffc2e299b6d16772531043 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,9 @@
 
  Changes between 0.9.5 and 0.9.6  [XX XXX 2000]
 
 
  Changes between 0.9.5 and 0.9.6  [XX XXX 2000]
 
+  *) Assembler module support for Mingw32.
+     [Ulf Möller]
+
   *) Shared library support for HPUX (in shlib/).
      [Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE> and Anonymous]
 
   *) Shared library support for HPUX (in shlib/).
      [Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE> and Anonymous]
 
diff --git a/config b/config
index f57969bb44439fff7c8eae837800ef14cb24c666..d85fbde3aa74afa16622c9083e3448aeaa42eab4 100755 (executable)
--- a/config
+++ b/config
@@ -292,6 +292,8 @@ TEST="false"
 for i
 do
 case "$i" in 
 for i
 do
 case "$i" in 
+# shared library support (behnke@trustcenter.de)
+-shared) SHARED=true;;
 -d*) PREFIX="debug-";;
 -t*) TEST="true";;
 -h*) TEST="true"; cat <<EOF
 -d*) PREFIX="debug-";;
 -t*) TEST="true";;
 -h*) TEST="true"; cat <<EOF
@@ -476,6 +478,16 @@ then
   options="$options -DATALLA"
 fi
 
   options="$options -DATALLA"
 fi
 
+#get some basic shared lib support (behnke@trustcenter.de)
+case "$OUT" in
+   solaris-*-gcc)
+       if  [ "$SHARED" = "true" ] 
+        then
+         options="$options -DPIC -fPIC"
+        fi
+     ;;
+esac
+
 # gcc < 2.8 does not support -mcpu=ultrasparc
 if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ]
 then
 # gcc < 2.8 does not support -mcpu=ultrasparc
 if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ]
 then
index 44e330eb8d16d145a88dfb3bc1e8c75608178db8..81c6e64e871a7593ec646fa1f8cc1378ee751dbe 100644 (file)
@@ -18,11 +18,13 @@ sub main'asm_init
        ($type,$fn,$i386)=@_;
        $filename=$fn;
 
        ($type,$fn,$i386)=@_;
        $filename=$fn;
 
-       $cpp=$sol=$aout=$win32=0;
+       $cpp=$sol=$aout=$win32=$gaswin=0;
        if (    ($type eq "elf"))
                { require "x86unix.pl"; }
        elsif ( ($type eq "a.out"))
                { $aout=1; require "x86unix.pl"; }
        if (    ($type eq "elf"))
                { require "x86unix.pl"; }
        elsif ( ($type eq "a.out"))
                { $aout=1; require "x86unix.pl"; }
+       elsif ( ($type eq "gaswin"))
+               { $gaswin=1; $aout=1; require "x86unix.pl"; }
        elsif ( ($type eq "sol"))
                { $sol=1; require "x86unix.pl"; }
        elsif ( ($type eq "cpp"))
        elsif ( ($type eq "sol"))
                { $sol=1; require "x86unix.pl"; }
        elsif ( ($type eq "cpp"))
@@ -50,7 +52,7 @@ EOF
 &comment("Don't even think of reading this code");
 &comment("It was automatically generated by $filename");
 &comment("Which is a perl program used to generate the x86 assember for");
 &comment("Don't even think of reading this code");
 &comment("It was automatically generated by $filename");
 &comment("Which is a perl program used to generate the x86 assember for");
-&comment("any of elf, a.out, BSDI,Win32, or Solaris");
+&comment("any of elf, a.out, BSDI, Win32, gaswin (for GNU as on Win32) or Solaris");
 &comment("eric <eay\@cryptsoft.com>");
 &comment("");
 
 &comment("eric <eay\@cryptsoft.com>");
 &comment("");
 
index 60d75f5ce4b1bb31b74ca5b9b074becceba86d48..309060ea001856b9eb8616b0edadffeb9b8660c4 100644 (file)
@@ -292,6 +292,8 @@ EOF
        push(@out,$tmp);
        if ($main'cpp)
                { $tmp=push(@out,"\tTYPE($func,\@function)\n"); }
        push(@out,$tmp);
        if ($main'cpp)
                { $tmp=push(@out,"\tTYPE($func,\@function)\n"); }
+       elsif ($main'gaswin)
+               { $tmp=push(@out,"\t.def\t$func;\t.scl\t2;\t.type\t32;\t.endef\n"); }
        else    { $tmp=push(@out,"\t.type\t$func,\@function\n"); }
        push(@out,"$func:\n");
        $tmp=<<"EOF";
        else    { $tmp=push(@out,"\t.type\t$func,\@function\n"); }
        push(@out,"$func:\n");
        $tmp=<<"EOF";
@@ -320,6 +322,8 @@ EOF
        push(@out,$tmp);
        if ($main'cpp)
                { push(@out,"\tTYPE($func,\@function)\n"); }
        push(@out,$tmp);
        if ($main'cpp)
                { push(@out,"\tTYPE($func,\@function)\n"); }
+       elsif ($main'gaswin)
+               { $tmp=push(@out,"\t.def\t$func;\t.scl\t2;\t.type\t32;\t.endef\n"); }
        else    { push(@out,"\t.type    $func,\@function\n"); }
        push(@out,"$func:\n");
        $stack=4;
        else    { push(@out,"\t.type    $func,\@function\n"); }
        push(@out,"$func:\n");
        $stack=4;
@@ -342,6 +346,8 @@ EOF
        push(@out,$tmp);
        if ($main'cpp)
                { push(@out,"\tSIZE($func,.${func}_end-$func)\n"); }
        push(@out,$tmp);
        if ($main'cpp)
                { push(@out,"\tSIZE($func,.${func}_end-$func)\n"); }
+       elsif ($main'gaswin)
+                { $tmp=push(@out,"\t.align 4\n"); }
        else    { push(@out,"\t.size\t$func,.${func}_end-$func\n"); }
        push(@out,".ident       \"$func\"\n");
        $stack=0;
        else    { push(@out,"\t.size\t$func,.${func}_end-$func\n"); }
        push(@out,".ident       \"$func\"\n");
        $stack=0;
@@ -371,6 +377,8 @@ sub main'function_end_B
        push(@out,".L_${func}_end:\n");
        if ($main'cpp)
                { push(@out,"\tSIZE($func,.L_${func}_end-$func)\n"); }
        push(@out,".L_${func}_end:\n");
        if ($main'cpp)
                { push(@out,"\tSIZE($func,.L_${func}_end-$func)\n"); }
+        elsif ($main'gaswin)
+                { push(@out,"\t.align 4\n"); }
        else    { push(@out,"\t.size\t$func,.L_${func}_end-$func\n"); }
        push(@out,".ident       \"desasm.pl\"\n");
        $stack=0;
        else    { push(@out,"\t.size\t$func,.L_${func}_end-$func\n"); }
        push(@out,".ident       \"desasm.pl\"\n");
        $stack=0;
diff --git a/ms/mingw32.bat b/ms/mingw32.bat
new file mode 100644 (file)
index 0000000..87294d0
--- /dev/null
@@ -0,0 +1,86 @@
+@rem OpenSSL with Mingw32+GNU as\r
+@rem ---------------------------\r
+\r
+perl Configure Mingw32 %1 %2 %3 %4 %5 %6 %7 %8\r
+\r
+@echo off\r
+echo Generating x86 for GNU assember\r
+\r
+echo Bignum\r
+cd crypto\bn\asm\r
+perl x86.pl gaswin > bn-win32.s\r
+cd ..\..\..\r
+\r
+echo DES\r
+cd crypto\des\asm\r
+perl des-586.pl gaswin > d-win32.s\r
+cd ..\..\..\r
+\r
+echo crypt\r
+cd crypto\des\asm\r
+perl crypt586.pl gaswin > y-win32.s\r
+cd ..\..\..\r
+\r
+echo Blowfish\r
+cd crypto\bf\asm\r
+perl bf-586.pl gaswin > b-win32.s\r
+cd ..\..\..\r
+\r
+echo CAST5\r
+cd crypto\cast\asm\r
+perl cast-586.pl gaswin > c-win32.s\r
+cd ..\..\..\r
+\r
+echo RC4\r
+cd crypto\rc4\asm\r
+perl rc4-586.pl gaswin > r4-win32.s\r
+cd ..\..\..\r
+\r
+echo MD5\r
+cd crypto\md5\asm\r
+perl md5-586.pl gaswin > m5-win32.s\r
+cd ..\..\..\r
+\r
+echo SHA1\r
+cd crypto\sha\asm\r
+perl sha1-586.pl gaswin > s1-win32.s\r
+cd ..\..\..\r
+\r
+echo RIPEMD160\r
+cd crypto\ripemd\asm\r
+perl rmd-586.pl gaswin > rm-win32.s\r
+cd ..\..\..\r
+\r
+echo RC5\32\r
+cd crypto\rc5\asm\r
+perl rc5-586.pl gaswin > r5-win32.s\r
+cd ..\..\..\r
+\r
+@rem Makefile\r
+perl util\mkfiles.pl >MINFO\r
+perl util\mk1mf.pl gaswin Mingw32 >ms\mingw32a.mak\r
+perl util\mk1mf.pl gaswin Mingw32-files >ms\mingw32f.mak\r
+@rem DLL definition files\r
+perl util\mkdef.pl 32 libeay >ms\libeay32.def\r
+if errorlevel 1 goto end\r
+perl util\mkdef.pl 32 ssleay >ms\ssleay32.def\r
+if errorlevel 1 goto end\r
+\r
+@rem Create files -- this can be skipped if using the GNU file utilities\r
+make -f ms/mingw32f.mak\r
+echo You can ignore the error messages above\r
+\r
+@rem Build the libraries\r
+make -f ms/mingw32a.mak\r
+if errorlevel 1 goto end\r
+\r
+@rem Generate the DLLs and input libraries\r
+dllwrap --dllname libeay32.dll --output-lib out/libeay32.a --def ms/libeay32.def out/libcrypto.a -lwsock32 -lgdi32\r
+if errorlevel 1 goto end\r
+dllwrap --dllname libssl32.dll --output-lib out/libssl32.a --def ms/ssleay32.def out/libssl.a out/libeay32.a\r
+if errorlevel 1 goto end\r
+\r
+echo Done compiling OpenSSL\r
+\r
+:end\r
+\r
index 6fbf3ceca6a4aa613834b89e269fd64c86e8a724..bbeb7b62fe51b755eb831e1ffdae3c63a993a90b 100755 (executable)
@@ -59,6 +59,7 @@ and [options] can be one of
        just-ssl                                - remove all non-ssl keys/digest
        no-asm                                  - No x86 asm
        nasm                                    - Use NASM for x86 asm
        just-ssl                                - remove all non-ssl keys/digest
        no-asm                                  - No x86 asm
        nasm                                    - Use NASM for x86 asm
+       gaswin                                  - Use GNU as with Mingw32
        no-socks                                - No socket code
        no-err                                  - No error strings
        dll/shlib                               - Build shared libraries (MS)
        no-socks                                - No socket code
        no-err                                  - No error strings
        dll/shlib                               - Build shared libraries (MS)
@@ -850,6 +851,7 @@ sub read_options
        elsif (/^no-hmac$/)     { $no_hmac=1; }
        elsif (/^no-asm$/)      { $no_asm=1; }
        elsif (/^nasm$/)        { $nasm=1; }
        elsif (/^no-hmac$/)     { $no_hmac=1; }
        elsif (/^no-asm$/)      { $no_asm=1; }
        elsif (/^nasm$/)        { $nasm=1; }
+       elsif (/^gaswin$/)      { $gaswin=1; }
        elsif (/^no-ssl2$/)     { $no_ssl2=1; }
        elsif (/^no-ssl3$/)     { $no_ssl3=1; }
        elsif (/^no-err$/)      { $no_err=1; }
        elsif (/^no-ssl2$/)     { $no_ssl2=1; }
        elsif (/^no-ssl3$/)     { $no_ssl3=1; }
        elsif (/^no-err$/)      { $no_err=1; }
index 585cacd82035f38954686303eafacbd689984bed..c687d9b118525a0c6427de0914fe202ee443949d 100644 (file)
@@ -21,6 +21,30 @@ if ($debug)
 else
        { $cflags="-DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall"; }
 
 else
        { $cflags="-DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall"; }
 
+if ($gaswin and !$no_asm)
+       {
+        $bn_asm_obj='$(OBJ_D)/bn-win32.o';
+        $bn_asm_src='crypto/bn/asm/bn-win32.s';
+        $des_enc_obj='$(OBJ_D)/d-win32.o $(OBJ_D)/y-win32.o';
+        $des_enc_src='crypto/des/asm/d-win32.s crypto/des/asm/y-win32.s';
+        $bf_enc_obj='$(OBJ_D)/b-win32.o';
+        $bf_enc_src='crypto/bf/asm/b-win32.s';
+#       $cast_enc_obj='$(OBJ_D)/c-win32.o';
+#       $cast_enc_src='crypto/cast/asm/c-win32.s';
+        $rc4_enc_obj='$(OBJ_D)/r4-win32.o';
+        $rc4_enc_src='crypto/rc4/asm/r4-win32.s';
+        $rc5_enc_obj='$(OBJ_D)/r5-win32.o';
+        $rc5_enc_src='crypto/rc5/asm/r5-win32.s';
+        $md5_asm_obj='$(OBJ_D)/m5-win32.o';
+        $md5_asm_src='crypto/md5/asm/m5-win32.s';
+        $rmd160_asm_obj='$(OBJ_D)/rm-win32.o';
+        $rmd160_asm_src='crypto/ripemd/asm/rm-win32.s';
+        $sha1_asm_obj='$(OBJ_D)/s1-win32.o';
+        $sha1_asm_src='crypto/sha/asm/s1-win32.s';
+       $cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM";
+       }
+
+
 $obj='.o';
 $ofile='-o ';
 
 $obj='.o';
 $ofile='-o ';
 
@@ -76,4 +100,3 @@ sub do_link_rule
        return($ret);
        }
 1;
        return($ret);
        }
 1;
-