2006-10-20 Andrew Stubbs <andrew.stubbs@st.com>
[deliverable/binutils-gdb.git] / gas / acinclude.m4
CommitLineData
9e9b66a9 1sinclude(../bfd/warning.m4)
20e95c23
DJ
2sinclude(../config/gettext-sister.m4)
3sinclude(../config/nls.m4)
4sinclude(../config/po.m4)
5sinclude(../config/progtest.m4)
9e9b66a9 6
c973bc5c
NC
7dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
8AC_DEFUN([BFD_BINARY_FOPEN],
9[AC_REQUIRE([AC_CANONICAL_TARGET])
10case "${host}" in
11changequote(,)dnl
12*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
13changequote([,])dnl
14 AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;;
15esac])dnl
16
252b5132 17dnl GAS_CHECK_DECL_NEEDED(name, typedefname, typedef, headers)
f8b73030 18AC_DEFUN([GAS_CHECK_DECL_NEEDED],[
252b5132
RH
19AC_MSG_CHECKING(whether declaration is required for $1)
20AC_CACHE_VAL(gas_cv_decl_needed_$1,
21AC_TRY_LINK([$4],
22[
23typedef $3;
24$2 x;
25x = ($2) $1;
26], gas_cv_decl_needed_$1=no, gas_cv_decl_needed_$1=yes))dnl
27AC_MSG_RESULT($gas_cv_decl_needed_$1)
28if test $gas_cv_decl_needed_$1 = yes; then
29 AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1,
30 [Define if $1 is not declared in system header files.])
31fi
32])dnl
33dnl
34dnl Some non-ANSI preprocessors botch requoting inside strings. That's bad
35dnl enough, but on some of those systems, the assert macro relies on requoting
36dnl working properly!
37dnl GAS_WORKING_ASSERT
f8b73030 38AC_DEFUN([GAS_WORKING_ASSERT],
252b5132
RH
39[AC_MSG_CHECKING([for working assert macro])
40AC_CACHE_VAL(gas_cv_assert_ok,
41AC_TRY_LINK([#include <assert.h>
42#include <stdio.h>], [
43/* check for requoting problems */
44static int a, b, c, d;
45static char *s;
46assert (!strcmp(s, "foo bar baz quux"));
47/* check for newline handling */
48assert (a == b
49 || c == d);
50], gas_cv_assert_ok=yes, gas_cv_assert_ok=no))dnl
51AC_MSG_RESULT($gas_cv_assert_ok)
52test $gas_cv_assert_ok = yes || AC_DEFINE(BROKEN_ASSERT, 1, [assert broken?])
53])dnl
54dnl
55dnl Since many Bourne shell implementations lack subroutines, use this
56dnl hack to simplify the code in configure.in.
57dnl GAS_UNIQ(listvar)
f8b73030 58AC_DEFUN([GAS_UNIQ],
252b5132
RH
59[_gas_uniq_list="[$]$1"
60_gas_uniq_newlist=""
61dnl Protect against empty input list.
62for _gas_uniq_i in _gas_uniq_dummy [$]_gas_uniq_list ; do
63 case [$]_gas_uniq_i in
64 _gas_uniq_dummy) ;;
65 *) case " [$]_gas_uniq_newlist " in
66 *" [$]_gas_uniq_i "*) ;;
67 *) _gas_uniq_newlist="[$]_gas_uniq_newlist [$]_gas_uniq_i" ;;
68 esac ;;
69 esac
70done
71$1=[$]_gas_uniq_newlist
72])dnl
ac48eca1
AO
73
74sinclude(../libtool.m4)
75dnl The lines below arrange for aclocal not to bring libtool.m4
76dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
77dnl to add a definition of LIBTOOL to Makefile.in.
78ifelse(yes,no,[
79AC_DEFUN([AM_PROG_LIBTOOL],)
80AC_DEFUN([AC_CHECK_LIBM],)
81AC_SUBST(LIBTOOL)
82])
This page took 0.731475 seconds and 4 git commands to generate.