]> git.ipfire.org Git - thirdparty/gcc.git/blob - libquadmath/acinclude.m4
/
[thirdparty/gcc.git] / libquadmath / acinclude.m4
1 dnl ----------------------------------------------------------------------
2 dnl This whole bit snagged from libgfortran.
3
4 dnl Check whether the target supports __sync_*_compare_and_swap.
5 AC_DEFUN([LIBGOMP_CHECK_SYNC_BUILTINS], [
6 AC_CACHE_CHECK([whether the target supports __sync_*_compare_and_swap],
7 libgomp_cv_have_sync_builtins, [
8 AC_TRY_LINK([], [int foo; __sync_val_compare_and_swap(&foo, 0, 1);],
9 libgomp_cv_have_sync_builtins=yes, libgomp_cv_have_sync_builtins=no)])
10 if test $libgomp_cv_have_sync_builtins = yes; then
11 AC_DEFINE(HAVE_SYNC_BUILTINS, 1,
12 [Define to 1 if the target supports __sync_*_compare_and_swap])
13 fi])
14
15 dnl Check whether the target supports hidden visibility.
16 AC_DEFUN([LIBGOMP_CHECK_ATTRIBUTE_VISIBILITY], [
17 AC_CACHE_CHECK([whether the target supports hidden visibility],
18 libgomp_cv_have_attribute_visibility, [
19 save_CFLAGS="$CFLAGS"
20 CFLAGS="$CFLAGS -Werror"
21 AC_TRY_COMPILE([void __attribute__((visibility("hidden"))) foo(void) { }],
22 [], libgomp_cv_have_attribute_visibility=yes,
23 libgomp_cv_have_attribute_visibility=no)
24 CFLAGS="$save_CFLAGS"])
25 if test $libgomp_cv_have_attribute_visibility = yes; then
26 AC_DEFINE(HAVE_ATTRIBUTE_VISIBILITY, 1,
27 [Define to 1 if the target supports __attribute__((visibility(...))).])
28 fi])
29
30 dnl Check whether the target supports dllexport
31 AC_DEFUN([LIBGOMP_CHECK_ATTRIBUTE_DLLEXPORT], [
32 AC_CACHE_CHECK([whether the target supports dllexport],
33 libgomp_cv_have_attribute_dllexport, [
34 save_CFLAGS="$CFLAGS"
35 CFLAGS="$CFLAGS -Werror"
36 AC_TRY_COMPILE([void __attribute__((dllexport)) foo(void) { }],
37 [], libgomp_cv_have_attribute_dllexport=yes,
38 libgomp_cv_have_attribute_dllexport=no)
39 CFLAGS="$save_CFLAGS"])
40 if test $libgomp_cv_have_attribute_dllexport = yes; then
41 AC_DEFINE(HAVE_ATTRIBUTE_DLLEXPORT, 1,
42 [Define to 1 if the target supports __attribute__((dllexport)).])
43 fi])
44
45 sinclude(../libtool.m4)
46 dnl The lines below arrange for aclocal not to bring an installed
47 dnl libtool.m4 into aclocal.m4, while still arranging for automake to
48 dnl add a definition of LIBTOOL to Makefile.in.
49 ifelse(,,,[AC_SUBST(LIBTOOL)
50 AC_DEFUN([AM_PROG_LIBTOOL])
51 AC_DEFUN([AC_LIBTOOL_DLOPEN])
52 AC_DEFUN([AC_PROG_LD])
53 ])