From: Jan Schmidt Date: Tue, 26 Feb 2008 09:38:00 +0000 (+0000) Subject: m4/: Add Dave Schleef's GCC inline assembly detection macro for using in gst-plugins... X-Git-Tag: RELEASE-0_10_18~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e746d20ef536a73aea9964666c7d5f6d5c9465df;p=platform%2Fupstream%2Fgst-common.git m4/: Add Dave Schleef's GCC inline assembly detection macro for using in gst-plugins-good in the goom 2k4 plugin. Original commit message from CVS: * m4/Makefile.am: * m4/as-gcc-inline-assembly.m4: Add Dave Schleef's GCC inline assembly detection macro for using in gst-plugins-good in the goom 2k4 plugin. --- diff --git a/ChangeLog b/ChangeLog index 606a304..77dd26c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-02-26 Jan Schmidt + + * m4/Makefile.am: + * m4/as-gcc-inline-assembly.m4: + Add Dave Schleef's GCC inline assembly detection macro + for using in gst-plugins-good in the goom 2k4 plugin. + 2008-02-25 Andy Wingo * gst-autogen.sh: Instead of only passing certain arguments to diff --git a/m4/Makefile.am b/m4/Makefile.am index 3bbf0e9..99ead5c 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -5,6 +5,7 @@ EXTRA_DIST = \ as-compiler-flag.m4 \ as-compiler.m4 \ as-docbook.m4 \ + as-gcc-inline-assembly.m4 \ as-libtool.m4 \ as-libtool-tags.m4 \ as-python.m4 \ diff --git a/m4/as-gcc-inline-assembly.m4 b/m4/as-gcc-inline-assembly.m4 new file mode 100644 index 0000000..af32104 --- /dev/null +++ b/m4/as-gcc-inline-assembly.m4 @@ -0,0 +1,52 @@ +dnl as-gcc-inline-assembly.m4 0.1.0 + +dnl autostars m4 macro for detection of gcc inline assembly + +dnl David Schleef + +dnl $Id$ + +dnl AS_COMPILER_FLAG(ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED]) +dnl Tries to compile with the given CFLAGS. +dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags, +dnl and ACTION-IF-NOT-ACCEPTED otherwise. + +AC_DEFUN([AS_GCC_INLINE_ASSEMBLY], +[ + AC_MSG_CHECKING([if compiler supports gcc-style inline assembly]) + + AC_TRY_COMPILE([], [ +#ifdef __GNUC_MINOR__ +#if (__GNUC__ * 1000 + __GNUC_MINOR__) < 3004 +#error GCC before 3.4 has critical bugs compiling inline assembly +#endif +#endif +__asm__ (""::) ], [flag_ok=yes], [flag_ok=no]) + + if test "X$flag_ok" = Xyes ; then + $1 + true + else + $2 + true + fi + AC_MSG_RESULT([$flag_ok]) +]) + + +AC_DEFUN([AS_GCC_ASM_POWERPC_FPU], +[ + AC_MSG_CHECKING([if compiler supports FPU instructions on PowerPC]) + + AC_TRY_COMPILE([], [__asm__ ("fadd 0,0,0"::) ], [flag_ok=yes], [flag_ok=no]) + + if test "X$flag_ok" = Xyes ; then + $1 + true + else + $2 + true + fi + AC_MSG_RESULT([$flag_ok]) +]) +