Blame common/m4/as-gcc-inline-assembly.m4

Packit 971217
dnl as-gcc-inline-assembly.m4 0.1.0
Packit 971217
Packit 971217
dnl autostars m4 macro for detection of gcc inline assembly
Packit 971217
Packit 971217
dnl David Schleef <ds@schleef.org>
Packit 971217
Packit 971217
dnl $Id$
Packit 971217
Packit 971217
dnl AS_COMPILER_FLAG(ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED])
Packit 971217
dnl Tries to compile with the given CFLAGS.
Packit 971217
dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags,
Packit 971217
dnl and ACTION-IF-NOT-ACCEPTED otherwise.
Packit 971217
Packit 971217
AC_DEFUN([AS_GCC_INLINE_ASSEMBLY],
Packit 971217
[
Packit 971217
  AC_MSG_CHECKING([if compiler supports gcc-style inline assembly])
Packit 971217
Packit 971217
  AC_TRY_COMPILE([], [
Packit 971217
#ifdef __GNUC_MINOR__
Packit 971217
#if (__GNUC__ * 1000 + __GNUC_MINOR__) < 3004
Packit 971217
#error GCC before 3.4 has critical bugs compiling inline assembly
Packit 971217
#endif
Packit 971217
#endif
Packit 971217
__asm__ (""::) ], [flag_ok=yes], [flag_ok=no])
Packit 971217
Packit 971217
  if test "X$flag_ok" = Xyes ; then
Packit 971217
    $1
Packit 971217
    true
Packit 971217
  else
Packit 971217
    $2
Packit 971217
    true
Packit 971217
  fi
Packit 971217
  AC_MSG_RESULT([$flag_ok])
Packit 971217
])
Packit 971217
Packit 971217
Packit 971217
AC_DEFUN([AS_GCC_ASM_POWERPC_FPU],
Packit 971217
[
Packit 971217
  AC_MSG_CHECKING([if compiler supports FPU instructions on PowerPC])
Packit 971217
Packit 971217
  AC_TRY_COMPILE([], [__asm__ ("fadd 0,0,0"::) ], [flag_ok=yes], [flag_ok=no])
Packit 971217
Packit 971217
  if test "X$flag_ok" = Xyes ; then
Packit 971217
    $1
Packit 971217
    true
Packit 971217
  else
Packit 971217
    $2
Packit 971217
    true
Packit 971217
  fi
Packit 971217
  AC_MSG_RESULT([$flag_ok])
Packit 971217
])
Packit 971217