From ccecfc93a3a5fab3a0cfc8026eb1f41c97550e17 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se>
Date: Mon, 11 Feb 2002 18:55:37 +0100
Subject: [PATCH] New command line option --enable-assembler. Selects assembler
 code depending on the host system.

Rev: src/nettle/configure.in:1.11
---
 configure.in | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/configure.in b/configure.in
index e8b4ba4d..3c2ac045 100644
--- a/configure.in
+++ b/configure.in
@@ -7,6 +7,8 @@ AC_INIT(arcfour.c)
 
 AC_PREREQ(2.50)
 
+AC_CANONICAL_HOST
+
 AM_INIT_AUTOMAKE(nettle, 1.5)
 
 AM_CONFIG_HEADER(config.h)
@@ -28,6 +30,14 @@ if test x$with_lib_path != x ; then
   LDFLAGS="-L `echo $with_lib_path | sed 's/:/ -L /g'`"
 fi
 
+AC_ARG_ENABLE(assembler,
+AC_HELP_STRING([--enable-assebler],[enable assembler code [default=yes]]),
+[ case $enableval in
+yes|no) ;;
+*) AC_MSG_ERROR([bad value $enableval for --enable-assembler, need yes or no]) ;;
+esac],
+[enable_assembler=yes])
+
 LSH_RPATH_INIT([`echo $with_lib_path | sed 's/:/ /g'` \
     `echo $exec_prefix | sed "s@^NONE@$prefix/lib@g" | sed "s@^NONE@$ac_default_prefix/lib@g"` \
     /usr/local/lib /sw/local/lib /sw/lib \
@@ -43,6 +53,37 @@ if test "x$am_cv_prog_cc_stdc" = xno ; then
   AC_ERROR([the C compiler doesn't handle ANSI-C])
 fi
 
+# Select assembler code
+path=
+case "$host" in
+  [i?86*-*-* | k[5-8]*-*-* | pentium*-*-* | athlon-*-*])
+    path=x86
+    ;;
+  *sparc*-*-*)
+    path=sparc
+    ;;
+esac
+
+echo "enable_assembler: $enable_assembler, path: $path"
+
+if test "$enable_assembler" = yes ; then
+  if test -n "$path"; then
+    found=no
+    for tmp_f in aes aes_tables; do
+      echo "Looking for $path/$tmp_f.asm"
+      if test -f "$path/$tmp_f.asm"; then
+        echo found
+        found=yes
+        AC_CONFIG_LINKS($tmp_f.asm:$path/$tmp_f.asm)
+      fi
+    done
+    if test "$found" = no; then
+      enable_assembler=no
+      AC_MSG_WARN([No assembler files found.])
+    fi
+  fi
+fi
+
 AC_PATH_PROG(M4, m4, m4)
 
 # Checks for typedefs, structures, and compiler characteristics.
-- 
GitLab