Skip to content

Commit cf8f9a8

Browse files
committed
configure.ac: add --enable-all-asm, and add it to --enable-all and --enable-all-crypto.
1 parent 3cb66ad commit cf8f9a8

1 file changed

Lines changed: 74 additions & 2 deletions

File tree

configure.ac

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ then
316316
fi
317317
AC_SUBST([ENABLED_ASM])
318318

319-
320319
# Default math is SP Math all and not fast math
321320
# FIPS v1 and v2 must use fast math
322321
DEF_SP_MATH="yes"
@@ -1029,12 +1028,21 @@ then
10291028

10301029
# More thorough error queue usage.
10311030
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_VERBOSE_ERRORS"
1031+
1032+
# enable all applicable assembly accelerations
1033+
if test "$ENABLED_ASM" != "no" &&
1034+
test "$enable_sp_asm" != "no" &&
1035+
test "$enable_all_asm" = "" &&
1036+
test "$ENABLED_LINUXKM_DEFAULTS" = "no"
1037+
then
1038+
enable_all_asm=yes
1039+
fi
10321040
fi
10331041

10341042

10351043
# ALL CRYPTO FEATURES
10361044
AC_ARG_ENABLE([all-crypto],
1037-
[AS_HELP_STRING([--enable-all-crypto],[Enable all wolfcrypt algorithms (default: disabled)])],
1045+
[AS_HELP_STRING([--enable-all-crypto],[Enable all available wolfcrypt algorithm support (default: disabled)])],
10381046
[ ENABLED_ALL_CRYPT=$enableval ],
10391047
[ ENABLED_ALL_CRYPT=no ]
10401048
)
@@ -1157,6 +1165,15 @@ then
11571165

11581166
# Store issuer name components when parsing certificates.
11591167
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_ISSUER_NAMES"
1168+
1169+
# enable all applicable assembly accelerations
1170+
if test "$ENABLED_ASM" != "no" &&
1171+
test "$enable_sp_asm" != "no" &&
1172+
test "$enable_all_asm" = "" &&
1173+
test "$ENABLED_LINUXKM_DEFAULTS" = "no"
1174+
then
1175+
enable_all_asm=yes
1176+
fi
11601177
fi
11611178

11621179
# liboqs
@@ -2845,6 +2862,61 @@ then
28452862
fi
28462863

28472864

2865+
# Auto-selected activation of all applicable asm accelerations
2866+
AC_ARG_ENABLE([all-asm],
2867+
[AS_HELP_STRING([--enable-all-asm],[Enable all applicable assembly accelerations (default: disabled)])],
2868+
[ ENABLED_ALL_ASM=$enableval ],
2869+
[ ENABLED_ALL_ASM=no ]
2870+
)
2871+
2872+
if test "$ENABLED_ALL_ASM" != "no"
2873+
then
2874+
if test "$ENABLED_ASM" = "no"
2875+
then
2876+
AC_MSG_ERROR([--enable-all-asm is incompatible with --disable-asm])
2877+
fi
2878+
2879+
if test "$enable_sp_asm" = "no"
2880+
then
2881+
AC_MSG_ERROR([--enable-all-asm is incompatible with --disable-sp-asm])
2882+
fi
2883+
2884+
if test "$enable_intelasm" = "no"
2885+
then
2886+
AC_MSG_ERROR([--enable-all-asm is incompatible with --disable-intelasm])
2887+
fi
2888+
2889+
if test "$enable_armasm" = "no"
2890+
then
2891+
AC_MSG_ERROR([--enable-all-asm is incompatible with --disable-armasm])
2892+
fi
2893+
2894+
if test "$ENABLED_SP" != "no"
2895+
then
2896+
ENABLED_SP_ASM=yes
2897+
if test "$ENABLED_SP" = ""
2898+
then
2899+
ENABLED_SP=yes
2900+
fi
2901+
fi
2902+
2903+
case "$host_cpu" in
2904+
*x86_64*|*amd64*)
2905+
if test "$enable_intelasm" = ""
2906+
then
2907+
enable_intelasm=yes
2908+
fi
2909+
;;
2910+
*aarch64*|*arm*|*cortex*)
2911+
if test "$enable_armasm" = ""
2912+
then
2913+
enable_armasm=yes
2914+
fi
2915+
;;
2916+
esac
2917+
fi
2918+
2919+
28482920
ENABLED_ARMASM_INLINE="no"
28492921
ENABLED_ARMASM_SHA3="no"
28502922
ENABLED_ARMASM_CRYPTO_SM4="no"

0 commit comments

Comments
 (0)