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