aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2009-11-22 12:00:30 +0200
committerLasse Collin <lasse.collin@tukaani.org>2009-11-22 12:00:30 +0200
commitb9b5c54cd438b3ae47b44cc211b71f3bc53e35ef (patch)
treea025d3913c4cf7f55d4f3d3733db59cb53ae8d1b
parentMake fastpos.h use tuklib_integer.h instead of bsr.h (diff)
downloadxz-b9b5c54cd438b3ae47b44cc211b71f3bc53e35ef.tar.xz
Enable assembler code only if it is known to work
on that operating system. I'm too lazy to think how to make a good Autoconf test for this and it's not that important anyway. No longer define HAVE_ASM_X86 or HAVE_ASM_X86_64. Inline assembler (if any) is used if a macro like __i386__ or __x86_64__ is defined.
-rw-r--r--configure.ac26
1 files changed, 12 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac
index aa05ba4c..706ab5a8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -288,29 +288,27 @@ AC_ARG_ENABLE([assembler], AC_HELP_STRING([--disable-assembler],
for the architecture.]),
[], [enable_assembler=yes])
if test "x$enable_assembler" = xyes; then
- case $host_cpu in
- i?86) enable_assembler=x86 ;;
- x86_64) enable_assembler=x86_64 ;;
- *) enable_assembler=no ;;
+ enable_assembler=no
+ case $host_os in
+ # Darwin should work too but only if not creating universal
+ # binaries. Solaris x86 could work too but I cannot test.
+ linux* | *bsd* | mingw* | cygwin*)
+ case $host_cpu in
+ i?86) enable_assembler=x86 ;;
+ x86_64) enable_assembler=x86_64 ;;
+ esac
+ ;;
esac
fi
case $enable_assembler in
- x86)
- AC_DEFINE([HAVE_ASM_X86], [1],
- [Define to 1 if using x86 assembler optimizations.])
- ;;
- x86_64)
- AC_DEFINE([HAVE_ASM_X86_64], [1],
- [Define to 1 if using x86_64 assembler optimizations.])
- ;;
- no)
+ x86 | x86_64 | no)
+ AC_MSG_RESULT([$enable_assembler])
;;
*)
AC_MSG_RESULT([])
AC_MSG_ERROR([--enable-assembler accepts only \`yes', \`no', \`x86', or \`x86_64'.])
;;
esac
-AC_MSG_RESULT([$enable_assembler])
AM_CONDITIONAL(COND_ASM_X86, test "x$enable_assembler" = xx86)
AM_CONDITIONAL(COND_ASM_X86_64, test "x$enable_assembler" = xx86_64)