allow selecting ed25519 implementation via ./configure

This commit is contained in:
cathugger 2017-09-27 04:07:41 +03:00
parent a452c1dfd1
commit 59f318aa64

View file

@ -4,5 +4,42 @@ AC_CONFIG_SRCDIR([main.c])
# C compiler
: ${CFLAGS="-O3 -march=native"}
AC_PROG_CC
AC_SUBST(ED25519IMPL,[ref10])
ed25519impl=""
AC_ARG_ENABLE([ref10],
[AS_HELP_STRING([--enable-ref10],
[use ref10 ed25519 implementation @<:@default=yes@:>@])],
[
AS_IF([test "x$ed25519impl" != "x" -a "$ed25519impl" != "ref10"],
[AC_ERROR([only one ed25519 implementation can be defined"])])
ed25519impl="ref10"
],
[]
)
AC_ARG_ENABLE([amd64_51_30k],
[AS_HELP_STRING([--enable-amd64_51_30k],
[use amd64_51_30k ed25519 implementation @<:@default=no@:>@])],
[
AS_IF([test "x$ed25519impl" != "x" -a "$ed25519impl" != "amd64_51_30k"],
[AC_ERROR([only one ed25519 implementation can be defined"])])
ed25519impl="amd64_51_30k"
],
[]
)
AC_ARG_ENABLE([amd64_64_24k],
[AS_HELP_STRING([--enable-amd64_64_24k],
[use amd64_64_24k ed25519 implementation @<:@default=no@:>@])],
[
AS_IF([test "x$ed25519impl" != "x" -a "$ed25519impl" != "amd64_64_24k"],
[AC_ERROR([only one ed25519 implementation can be defined"])])
ed25519impl="amd64_64_24k"
],
[]
)
AS_IF([test "x$ed25519impl" == "x"],[ed25519impl=ref10])
AC_SUBST(ED25519IMPL,["$ed25519impl"])
AC_OUTPUT(Makefile)