1 dnl GAS_CHECK_DECL_NEEDED(name, typedefname, typedef, headers)
2 AC_DEFUN([GAS_CHECK_DECL_NEEDED],[
3 AC_MSG_CHECKING(whether declaration is required for $1)
4 AC_CACHE_VAL(gas_cv_decl_needed_$1,
10 ], gas_cv_decl_needed_$1=no, gas_cv_decl_needed_$1=yes))dnl
11 AC_MSG_RESULT($gas_cv_decl_needed_$1)
12 if test $gas_cv_decl_needed_$1 = yes; then
13 AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1,
14 [Define if $1 is not declared in system header files.])
18 dnl Some non-ANSI preprocessors botch requoting inside strings. That's bad
19 dnl enough, but on some of those systems, the assert macro relies on requoting
21 dnl GAS_WORKING_ASSERT
22 AC_DEFUN([GAS_WORKING_ASSERT],
23 [AC_MSG_CHECKING([for working assert macro])
24 AC_CACHE_VAL(gas_cv_assert_ok,
25 AC_TRY_LINK([#include <assert.h>
27 #include <stdio.h>], [
28 /* check for requoting problems */
29 static int a, b, c, d;
31 assert (!strcmp(s, "foo bar baz quux"));
32 /* check for newline handling */
35 ], gas_cv_assert_ok=yes, gas_cv_assert_ok=no))dnl
36 AC_MSG_RESULT($gas_cv_assert_ok)
37 test $gas_cv_assert_ok = yes || AC_DEFINE(BROKEN_ASSERT, 1, [assert broken?])
40 dnl Since many Bourne shell implementations lack subroutines, use this
41 dnl hack to simplify the code in configure.ac.
44 [_gas_uniq_list="[$]$1"
46 dnl Protect against empty input list.
47 for _gas_uniq_i in _gas_uniq_dummy [$]_gas_uniq_list ; do
48 case [$]_gas_uniq_i in
50 *) case " [$]_gas_uniq_newlist " in
51 *" [$]_gas_uniq_i "*) ;;
52 *) _gas_uniq_newlist="[$]_gas_uniq_newlist [$]_gas_uniq_i" ;;
56 $1=[$]_gas_uniq_newlist
59 dnl Check for existence of member $2 in type $1 in time.h
61 AC_DEFUN([GAS_HAVE_TIME_TYPE_MEMBER],
62 [AC_MSG_CHECKING([for $1.$2 in time.h])
63 AC_CACHE_VAL(gas_cv_have_time_type_member_$2,
67 [$1 avar; void* aref = (void*) &avar.$2],
68 gas_cv_have_time_type_member_$2=yes,
69 gas_cv_have_time_type_member_$2=no
71 if test $gas_cv_have_time_type_member_$2 = yes; then
72 AC_DEFINE([HAVE_]translit($2, [a-z], [A-Z]), 1,
73 [Define if <time.h> has $1.$2.])
75 AC_MSG_RESULT($gas_cv_have_time_type_member_$2)
78 dnl Check for existence of member $2.$3 in type $1 in sys/stat.h
80 AC_DEFUN([GAS_HAVE_SYS_STAT_TYPE_MEMBER],
81 [AC_MSG_CHECKING([for $1.$2.$3 in sys/stat.h])
82 AC_CACHE_VAL(gas_cv_have_sys_stat_type_member_$2_$3,
85 #include <sys/stat.h>],
86 [$1 avar; void* aref = (void*) &avar.$2.$3],
87 gas_cv_have_sys_stat_type_member_$2_$3=yes,
88 gas_cv_have_sys_stat_type_member_$2_$3=no
90 if test $gas_cv_have_sys_stat_type_member_$2_$3 = yes; then
91 AC_DEFINE([HAVE_]translit($2, [a-z], [A-Z])[_]translit($3, [a-z], [A-Z]), 1,
92 [Define if <sys/stat.h> has $1.$2.$3])
94 AC_MSG_RESULT($gas_cv_have_sys_stat_type_member_$2_$3)