1dnl $MirOS: src/gnu/usr.bin/binutils/gas/acinclude.m4,v 1.3 2005/06/05 21:24:11 tg Exp $
2
3sinclude(../bfd/warning.m4)
4
5dnl GAS_CHECK_DECL_NEEDED(name, typedefname, typedef, headers)
6AC_DEFUN([GAS_CHECK_DECL_NEEDED],[
7AC_MSG_CHECKING(whether declaration is required for $1)
8AC_CACHE_VAL(gas_cv_decl_needed_$1,
9AC_TRY_LINK([$4],
10[
11typedef $3;
12$2 x;
13x = ($2) $1;
14], gas_cv_decl_needed_$1=no, gas_cv_decl_needed_$1=yes))dnl
15AC_MSG_RESULT($gas_cv_decl_needed_$1)
16if test $gas_cv_decl_needed_$1 = yes; then
17 AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1,
18	   [Define if $1 is not declared in system header files.])
19fi
20])dnl
21dnl
22dnl Some non-ANSI preprocessors botch requoting inside strings.  That's bad
23dnl enough, but on some of those systems, the assert macro relies on requoting
24dnl working properly!
25dnl GAS_WORKING_ASSERT
26AC_DEFUN([GAS_WORKING_ASSERT],
27[AC_MSG_CHECKING([for working assert macro])
28AC_CACHE_VAL(gas_cv_assert_ok,
29AC_TRY_LINK([#include <assert.h>
30#include <stdio.h>], [
31/* check for requoting problems */
32static int a, b, c, d;
33static char *s;
34assert (!strcmp(s, "foo bar baz quux"));
35/* check for newline handling */
36assert (a == b
37        || c == d);
38], gas_cv_assert_ok=yes, gas_cv_assert_ok=no))dnl
39AC_MSG_RESULT($gas_cv_assert_ok)
40test $gas_cv_assert_ok = yes || AC_DEFINE(BROKEN_ASSERT, 1, [assert broken?])
41])dnl
42dnl
43dnl Since many Bourne shell implementations lack subroutines, use this
44dnl hack to simplify the code in configure.in.
45dnl GAS_UNIQ(listvar)
46AC_DEFUN([GAS_UNIQ],
47[_gas_uniq_list="[$]$1"
48_gas_uniq_newlist=""
49dnl Protect against empty input list.
50for _gas_uniq_i in _gas_uniq_dummy [$]_gas_uniq_list ; do
51  case [$]_gas_uniq_i in
52  _gas_uniq_dummy) ;;
53  *) case " [$]_gas_uniq_newlist " in
54       *" [$]_gas_uniq_i "*) ;;
55       *) _gas_uniq_newlist="[$]_gas_uniq_newlist [$]_gas_uniq_i" ;;
56     esac ;;
57  esac
58done
59$1=[$]_gas_uniq_newlist
60])dnl
61
62sinclude(../libtool.m4)
63dnl The lines below arrange for aclocal not to bring libtool.m4
64dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
65dnl to add a definition of LIBTOOL to Makefile.in.
66ifelse(yes,no,[
67AC_DEFUN([AM_PROG_LIBTOOL],)
68AC_DEFUN([AC_CHECK_LIBM],)
69AC_SUBST(LIBTOOL)
70])
71