Add additional fast library

parent 5a168676
......@@ -16,7 +16,15 @@ ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4
AM_CPPFLAGS = $(EXAMPLE_CFLAGS)
lib_LTLIBRARIES = libed25519prims.la
if FAST
lib_LTLIBRARIES += libed25519primsfast.la
endif
libed25519prims_la_SOURCES = ed25519-prims.c
libed25519primsfast_la_SOURCES = ed25519-prims.c
include_HEADERS = ed25519.h ed25519-prims.h ed25519-donna-portable-identify.h
libed25519prims_la_LIBADD =
libed25519prims_la_LDFLAGS = -version-info ${VERSION} -no-undefined
libed25519prims_la_CFLAGS = @flags@
libed25519primsfast_la_LIBADD =
libed25519primsfast_la_LDFLAGS = -version-info ${VERSION} -no-undefined
libed25519primsfast_la_CFLAGS = @fastflags@
......@@ -6,20 +6,43 @@ AC_PREREQ([2.59])
AM_INIT_AUTOMAKE([1.10 -Wall no-define])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
CFLAGS=${CFLAGS--O3}
flags="$CFLAGS"
nomflags="`echo $CFLAGS | sed -e 's/-m[[^ ]]* //g'`"
# special optimizations for some plattforms
case "$host_alias" in
arm-linux-androideabi)
flags="$CFLAGS"
fastflags="-O3 -mfpu=neon-vfpv4"
enable_fast=yes
CFLAGS=""
;;
arm-*)
CFLAGS="-O3 -mfpu=neon-vfpv4"
;;
i686-linux-android)
flags="$CFLAGS"
fastflags="-O3 -m32 -mssse3"
enable_fast=yes
CFLAGS=""
;;
i686-*)
# if you don't want sse, specify i586-linux-gnu
CFLAGS="-O3 -m32 -mssse3"
;;
esac
AC_ARG_ENABLE([fast],
[ --enable-fast Turn on optional fast library with non-standard CPU features],
[case "${enableval}" in
yes) fast=true ;;
no) fast=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-fast]) ;;
esac],[fast=false])
AM_CONDITIONAL([FAST], [test x$fast = xtrue])
AC_PROG_CC
AM_PROG_AS
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
......@@ -30,6 +53,9 @@ PRECLANG=${PRECC%clang*}
LIBTOOL=${PRECLANG}libtool
echo "Libtool: $PRECC, $PRECLANG, $LIBTOOL"
AC_SUBST(nomflags)
AC_SUBST(fastflags)
AC_SUBST(flags)
AC_SUBST(LIBTOOL)
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment