diff options
author | David Schleef <ds@ginger.bigkitten.com> | 2008-02-25 20:32:07 -0800 |
---|---|---|
committer | David Schleef <ds@ginger.bigkitten.com> | 2008-02-25 20:32:07 -0800 |
commit | 4d72f39dcb34927413e1da5b2152640508b872fd (patch) | |
tree | 8ed4f622009b720b34540663b4b51b73656b93c6 /m4 | |
parent | c77faaaa2fc48586902878ba33bd01286654dcb6 (diff) | |
download | liboil-4d72f39dcb34927413e1da5b2152640508b872fd.tar.gz |
autoconf macro for checking gas handling asm lines
Diffstat (limited to 'm4')
-rw-r--r-- | m4/as-gcc-inline-assembly.m4 | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/m4/as-gcc-inline-assembly.m4 b/m4/as-gcc-inline-assembly.m4 index 1211dde..74a231a 100644 --- a/m4/as-gcc-inline-assembly.m4 +++ b/m4/as-gcc-inline-assembly.m4 @@ -53,3 +53,28 @@ AC_DEFUN([AS_GCC_ASM_POWERPC_FPU], AC_MSG_RESULT([$flag_ok]) ]) +AC_DEFUN([AS_GCC_INLINE_ASM_INSTRUCTION], +[ + AC_MSG_CHECKING([if compiler supports '$1' asm instruction]) + + AC_TRY_COMPILE([], [ +#ifndef __GNUC__ +#error Not GCC +#endif +#ifdef __GNUC_MINOR__ +#if (__GNUC__ * 1000 + __GNUC_MINOR__) < 3004 +#error GCC before 3.4 has critical bugs compiling inline assembly +#endif +#endif +__asm__ ("$1"::) ], [flag_ok=yes], [flag_ok=no]) + + if test "X$flag_ok" = Xyes ; then + $2 + true + else + $3 + true + fi + AC_MSG_RESULT([$flag_ok]) +]) + |