diff options
author | Rhys Ulerich <rhys.ulerich@gmail.com> | 2010-11-07 10:16:38 -0600 |
---|---|---|
committer | Rhys Ulerich <rhys.ulerich@gmail.com> | 2010-11-07 10:16:38 -0600 |
commit | a54ecc5ca8b7a42380621c4ec90b531581cb98d3 (patch) | |
tree | 4fe02573b46650e2aff0f5b362da2f479edf80e7 /m4/ax_asm_inline.m4 | |
parent | 82ac11a5e40c32a7c7a30d2868d12e5b6c093d79 (diff) | |
download | autoconf-archive-a54ecc5ca8b7a42380621c4ec90b531581cb98d3.tar.gz |
Add new macro AX_ASM_INLINE
Diffstat (limited to 'm4/ax_asm_inline.m4')
-rw-r--r-- | m4/ax_asm_inline.m4 | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/m4/ax_asm_inline.m4 b/m4/ax_asm_inline.m4 new file mode 100644 index 0000000..ec2649c --- /dev/null +++ b/m4/ax_asm_inline.m4 @@ -0,0 +1,56 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_asm_inline.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_ASM_INLINE() +# +# DESCRIPTION +# +# Tests for C compiler support of inline assembly instructions. +# If inline assembly is supported, this macro #defines +# ASM_INLINE to be the appropriate keyword. +# +# LICENSE +# +# Copyright (c) 2008 Alan Woodland <ajw05@aber.ac.uk> +# Copyright (c) 2009 Rhys Ulerich <rhys.ulerich@gmail.com> +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 1 + +AC_DEFUN([AX_ASM_INLINE], [ + AC_LANG_PUSH([C]) + AC_MSG_CHECKING(for inline assembly style) + AC_CACHE_VAL(ac_cv_asm_inline, [ + ax_asm_inline_keywords="__asm__ __asm none" + for ax_asm_inline_keyword in $ax_asm_inline_keywords; do + case $ax_asm_inline_keyword in + none) ac_cv_asm_inline=none ; break ;; + *) + AC_TRY_COMPILE( + [#include <stdlib.h> + static void + foo(void) { + ] $ax_asm_inline_keyword [(""); + exit(1); + }], + [], + [ac_cv_asm_inline=$ax_asm_inline_keyword ; break], + ac_cv_asm_inline=none + ) + esac + done +]) + + if test "$ac_cv_asm_inline" != "none"; then + AC_DEFINE_UNQUOTED([ASM_INLINE], $ac_cv_asm_inline, [If the compiler supports inline assembly define it to that keyword here]) + fi + AC_MSG_RESULT($ac_cv_asm_inline) + AC_LANG_POP([C]) +]) |