Use AC_LINK_IFELSE to check if the Loongson MMI code can link
authorMarkos Chandras <markos.chandras@imgtec.com>
Wed, 15 May 2013 16:51:20 +0000 (09:51 -0700)
committerMatt Turner <mattst88@gmail.com>
Sun, 19 May 2013 16:01:34 +0000 (09:01 -0700)
The Loongson code is compiled with -march=loongson2f to enable the MMI
instructions, but binutils refuses to link object code compiled with
different -march settings, leading to link failures later in the
compile. This avoids that problem by checking if we can link code
compiled for Loongson.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
configure.ac

index c43a0d2222978553542b4965e1c790ded215e028..221179ff14256177a6cb549504e168a5c3ebd742 100644 (file)
@@ -279,7 +279,7 @@ AC_MSG_CHECKING(whether to use Loongson MMI assembler)
 
 xserver_save_CFLAGS=$CFLAGS
 CFLAGS=" $LS_CFLAGS $CFLAGS -I$srcdir"
-AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+AC_LINK_IFELSE([AC_LANG_SOURCE([[
 #ifndef __mips_loongson_vector_rev
 #error "Loongson Multimedia Instructions are only available on Loongson"
 #endif