]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
(ABI): Detect which ABI the compiler is using.
authorNiels Möller <nisse@lysator.liu.se>
Mon, 29 Mar 2010 09:08:03 +0000 (11:08 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Mon, 29 Mar 2010 09:08:03 +0000 (11:08 +0200)
On x86_64, also check for __arch64__.

Rev: nettle/ChangeLog:1.68
Rev: nettle/configure.ac:1.16

ChangeLog
configure.ac

index 37e0b628f99ca972c0e6759c654881b8b79ba280..0a0ba8449dac2ec49c09a2db71879297c9b55f96 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-03-29  Niels Möller  <nisse@lysator.liu.se>
+
+       * configure.ac (ABI): Detect which ABI the compiler is using.
+       On x86_64, also check for __arch64__.
+
 2010-03-28  Niels Möller  <nisse@lysator.liu.se>
 
        * configure.ac (asm_path): For x86_64, check if compiler is
index 95a4f948c809073c276500c7324d23077d7afe82..f4cfd3aa452f65986809efa2f50dec5349cb3e41 100644 (file)
@@ -116,21 +116,19 @@ if test x$enable_dependency_tracking = xyes ; then
 ])
 fi
 
-# Select assembler code
-asm_path=
+# Figure out ABI. Currently, configurable only be setting CFLAGS.
+ABI=standard
+
 case "$host_cpu" in
-  [i?86* | k[5-8]* | pentium* | athlon])
-    asm_path=x86
-    ;;
   [x86_64 | amd64])
     AC_TRY_COMPILE([
-#if defined(__i386__)
-#error 32-bit x86
+#if defined(__x86_64__) || defined(__arch64__)
+#error 64-bit x86
 #endif
     ], [], [
-      asm_path=x86_64
+      ABI=32
     ], [
-      asm_path=x86
+      ABI=64
     ])
     ;;
   *sparc*)
@@ -139,11 +137,38 @@ case "$host_cpu" in
 #error 64-bit sparc
 #endif
     ], [], [
-      asm_path=sparc32
+      ABI=32
     ], [
-      asm_path=sparc64
+      ABI=64
     ])
     ;;
+esac
+
+if test "x$ABI" != xstandard ; then
+  AC_MSG_NOTICE([Compiler uses $ABI-bit ABI. To change, set CFLAGS.])
+  AC_MSG_NOTICE([You may want to set libdir!])
+fi
+
+# Select assembler code
+asm_path=
+case "$host_cpu" in
+  [i?86* | k[5-8]* | pentium* | athlon])
+    asm_path=x86
+    ;;
+  [x86_64 | amd64])
+    if test "x$ABI" = 64 ; then
+      asm_path=x86_64
+    else
+      asm_path=x86
+    fi
+    ;;
+  *sparc*)
+    if test "x$ABI" = 64 ; then
+      asm_path=sparc64
+    else
+      asm_path=sparc32
+    fi
+    ;;
   *)
     enable_assembler=no
     ;;