From 42459b41f04b095a3d412c0b2ca82360f3983a38 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Thu, 2 Apr 2015 15:08:34 +0200 Subject: [PATCH] configure: Check if building against a x86/x64 architecture This allows us to include compiler flags specific for them, such as MMX/SSE. --- configure.ac | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/configure.ac b/configure.ac index 95018f47e..e4d148076 100644 --- a/configure.ac +++ b/configure.ac @@ -839,6 +839,22 @@ AC_COMPILE_IFELSE( ] ) +AC_MSG_CHECKING([x86/x64 target]) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [], [[ + #if !defined(__i386__) && !defined(__x86_64__) + # error not on x86/x64 + #endif + ]])], + [ + x86x64=true + AC_MSG_RESULT([yes]) + ], + [AC_MSG_RESULT([no])] +) +AM_CONDITIONAL(USE_X86X64, [test "x$x86x64" = xtrue]) + if test x$printf_hooks = xvstr; then AC_CHECK_LIB([vstr],[main],[LIBS="$LIBS"],[AC_MSG_ERROR([Vstr string library not found])],[]) AC_DEFINE([USE_VSTR], [], [use Vstr string library for printf hooks])