Move md5_asm_src file information to build.info files
authorRichard Levitte <levitte@openssl.org>
Sun, 16 Jun 2019 19:25:52 +0000 (21:25 +0200)
committerRichard Levitte <levitte@openssl.org>
Mon, 17 Jun 2019 14:08:52 +0000 (16:08 +0200)
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9166)

Configurations/00-base-templates.conf
Configurations/README
Configure
crypto/md5/build.info

index b4eb7e9..2eb7575 100644 (file)
@@ -14,7 +14,6 @@ my %targets=(
        thread_scheme   => "(unknown)", # Assume we don't know
        thread_defines  => [],
 
-       md5_asm_src     => "",
        cast_asm_src    => "c_enc.c",
        rc4_asm_src     => "rc4_enc.c rc4_skey.c",
        rmd160_asm_src  => "",
@@ -162,7 +161,6 @@ my %targets=(
 
     x86_asm => {
        template        => 1,
-       md5_asm_src     => "md5-586.s",
        cast_asm_src    => "cast-586.s",
        sha1_asm_src    => "sha1-586.s sha256-586.s sha512-586.s",
        rc4_asm_src     => "rc4-586.s",
@@ -181,7 +179,6 @@ my %targets=(
     },
     x86_64_asm => {
        template        => 1,
-       md5_asm_src     => "md5-x86_64.s",
        sha1_asm_src    => "sha1-x86_64.s sha256-x86_64.s sha512-x86_64.s sha1-mb-x86_64.s sha256-mb-x86_64.s",
        rc4_asm_src     => "rc4-x86_64.s rc4-md5-x86_64.s",
        wp_asm_src      => "wp-x86_64.s",
@@ -201,7 +198,6 @@ my %targets=(
     },
     sparcv9_asm => {
        template        => 1,
-       md5_asm_src     => "md5-sparcv9.S",
        sha1_asm_src    => "sha1-sparcv9.S sha256-sparcv9.S sha512-sparcv9.S",
        cmll_asm_src    => "camellia.c cmll_misc.c cmll_cbc.c cmllt4-sparcv9.S",
        modes_asm_src   => "ghash-sparcv9.S",
index e8be7ff..f8d52ca 100644 (file)
@@ -240,8 +240,6 @@ In each table entry, the following keys are significant:
                                                 export vars as
                                                 accessor functions.
 
-        md5_asm_src     => Assembler implementation of core MD5
-                           functions.
         sha1_asm_src    => Assembler implementation of core SHA1,
                            functions, and also possibly SHA256 and
                            SHA512 ones.
index 68f642f..7ff3b69 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -1415,9 +1415,6 @@ unless ($disabled{asm}) {
     if ($target{rc4_asm_src} ne $table{DEFAULTS}->{rc4_asm_src}) {
         push @{$config{lib_defines}}, "RC4_ASM";
     }
-    if ($target{md5_asm_src}) {
-        push @{$config{lib_defines}}, "MD5_ASM";
-    }
     $target{cast_asm_src}=$table{DEFAULTS}->{cast_asm_src} unless $disabled{pic}; # CAST assembler is not PIC
     if ($target{rmd160_asm_src}) {
         push @{$config{lib_defines}}, "RMD160_ASM";
@@ -3366,7 +3363,6 @@ sub print_table_entry
         "loutflag",
         "ex_libs",
         "bn_ops",
-        "md5_asm_src",
         "cast_asm_src",
         "sha1_asm_src",
         "rc4_asm_src",
index 2b1444d..3b91abf 100644 (file)
@@ -1,6 +1,21 @@
 LIBS=../../libcrypto
-SOURCE[../../libcrypto]=\
-        md5_dgst.c md5_one.c md5_sha1.c {- $target{md5_asm_src} -}
+
+$MD5ASM=
+IF[{- !$disabled{asm} -}]
+  $MD5ASM_x86=md5-586.s
+  $MD5ASM_x86_64=md5-x86_64.s
+  $MD5ASM_sparcv9=md5-sparcv9.S
+
+  # Now that we have defined all the arch specific variables, use the
+  # appropriate one, and define the appropriate macros
+  IF[$MD5ASM_{- $target{asm_arch} -}]
+    $MD5ASM=$MD5ASM_{- $target{asm_arch} -}
+    $MD5DEF=MD5_ASM
+  ENDIF
+ENDIF
+
+SOURCE[../../libcrypto]=md5_dgst.c md5_one.c md5_sha1.c $MD5ASM
+DEFINE[../../libcrypto]=$MD5DEF
 
 GENERATE[md5-586.s]=asm/md5-586.pl \
         $(PERLASM_SCHEME) $(LIB_CFLAGS) $(LIB_CPPFLAGS)