Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.8KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_asm_inline.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_ASM_INLINE()
  8. #
  9. # DESCRIPTION
  10. #
  11. # Tests for C compiler support of inline assembly instructions. If inline
  12. # assembly is supported, this macro #defines ASM_INLINE to be the
  13. # appropriate keyword.
  14. #
  15. # LICENSE
  16. #
  17. # Copyright (c) 2008 Alan Woodland <ajw05@aber.ac.uk>
  18. # Copyright (c) 2009 Rhys Ulerich <rhys.ulerich@gmail.com>
  19. # Copyright (c) 2017 Reini Urban <rurban@cpan.org>
  20. #
  21. # Copying and distribution of this file, with or without modification, are
  22. # permitted in any medium without royalty provided the copyright notice
  23. # and this notice are preserved. This file is offered as-is, without any
  24. # warranty.
  25. #serial 4
  26. AC_DEFUN([AX_ASM_INLINE], [
  27. AC_LANG_PUSH([C])
  28. AC_MSG_CHECKING(for inline assembly style)
  29. AC_CACHE_VAL(ac_cv_asm_inline, [
  30. ax_asm_inline_keywords="__asm__ __asm none"
  31. for ax_asm_inline_keyword in $ax_asm_inline_keywords; do
  32. case $ax_asm_inline_keyword in
  33. none) ac_cv_asm_inline=none ; break ;;
  34. *)
  35. AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
  36. [#include <stdlib.h>
  37. static void
  38. foo(void) {
  39. ] $ax_asm_inline_keyword [("");
  40. exit(1);
  41. }],
  42. [])],
  43. [ac_cv_asm_inline=$ax_asm_inline_keyword ; break],
  44. ac_cv_asm_inline=none
  45. )
  46. esac
  47. done
  48. ])
  49. if test "$ac_cv_asm_inline" != "none"; then
  50. AC_DEFINE_UNQUOTED([ASM_INLINE], $ac_cv_asm_inline, [If the compiler supports inline assembly define it to that keyword here])
  51. fi
  52. AC_MSG_RESULT($ac_cv_asm_inline)
  53. AC_LANG_POP([C])
  54. ])