]> gcc.gnu.org Git - gcc.git/blob - libmudflap/acinclude.m4
Fix FreeBSD failure with recursive malloc call.
[gcc.git] / libmudflap / acinclude.m4
1 dnl Check whether the target supports TLS.
2 AC_DEFUN([LIBMUDFLAP_CHECK_TLS], [
3 LIBMUDFLAP_ENABLE(tls, yes, [Use thread-local storage])
4 AC_CACHE_CHECK([whether the target supports thread-local storage],
5 have_tls, [
6 AC_RUN_IFELSE([__thread int a; int b; int main() { return a = b; }],
7 [dnl If the test case passed with dynamic linking, try again with
8 dnl static linking. This fails at least with some older Red Hat
9 dnl releases.
10 save_LDFLAGS="$LDFLAGS"
11 LDFLAGS="-static $LDFLAGS"
12 AC_RUN_IFELSE([__thread int a; int b; int main() { return a = b; }],
13 [have_tls=yes], [have_tls=no], [])
14 LDFLAGS="$save_LDFLAGS"],
15 [have_tls=no],
16 [AC_COMPILE_IFELSE([__thread int foo;], [have_tls=yes], [have_tls=no])]
17 )])
18 if test "$enable_tls $have_tls" = "yes yes"; then
19 AC_DEFINE(HAVE_TLS, 1,
20 [Define to 1 if the target supports thread-local storage.])
21 fi])
22
23 dnl ----------------------------------------------------------------------
24 dnl This whole bit snagged from libgfortran.
25
26 sinclude(../libtool.m4)
27 dnl The lines below arrange for aclocal not to bring an installed
28 dnl libtool.m4 into aclocal.m4, while still arranging for automake to
29 dnl add a definition of LIBTOOL to Makefile.in.
30 ifelse(,,,[AC_SUBST(LIBTOOL)
31 AC_DEFUN([AM_PROG_LIBTOOL])
32 AC_DEFUN([AC_LIBTOOL_DLOPEN])
33 AC_DEFUN([AC_PROG_LD])
34 ])
35
36 dnl ----------------------------------------------------------------------
37 dnl This whole bit snagged from libstdc++-v3.
38
39 dnl
40 dnl LIBMUDFLAP_ENABLE
41 dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING)
42 dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, permit a|b|c)
43 dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, SHELL-CODE-HANDLER)
44 dnl
45 dnl See docs/html/17_intro/configury.html#enable for documentation.
46 dnl
47 m4_define([LIBMUDFLAP_ENABLE],[dnl
48 m4_define([_g_switch],[--enable-$1])dnl
49 m4_define([_g_help],[AC_HELP_STRING(_g_switch$3,[$4 @<:@default=$2@:>@])])dnl
50 AC_ARG_ENABLE($1,_g_help,
51 m4_bmatch([$5],
52 [^permit ],
53 [[
54 case "$enableval" in
55 m4_bpatsubst([$5],[permit ])) ;;
56 *) AC_MSG_ERROR(Unknown argument to enable/disable $1) ;;
57 dnl Idea for future: generate a URL pointing to
58 dnl "onlinedocs/configopts.html#whatever"
59 esac
60 ]],
61 [^$],
62 [[
63 case "$enableval" in
64 yes|no) ;;
65 *) AC_MSG_ERROR(Argument to enable/disable $1 must be yes or no) ;;
66 esac
67 ]],
68 [[$5]]),
69 [enable_]m4_bpatsubst([$1],-,_)[=][$2])
70 m4_undefine([_g_switch])dnl
71 m4_undefine([_g_help])dnl
72 ])
This page took 0.040134 seconds and 5 git commands to generate.