-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathacsite.m4
67 lines (59 loc) · 1.16 KB
/
acsite.m4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# included in configure.ac
AC_DEFUN([PA_TRY_COMPILE],[
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([$1], [$2])],
[$3],
[$4]
)
])
AC_DEFUN([PA_TRY_LINK],[
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([$1], [$2])],
[$3],
[$4]
)
])
AC_DEFUN([PA_CHECK_MATH_FUNC_ONE_ARG],[
AC_MSG_CHECKING(for (maybe built-in) math function $1)
PA_TRY_COMPILE([
#ifdef HAVE_MATH_H
# include <math.h>
#endif
],[
double result=$1(1.6);
],
[AC_MSG_RESULT(yes)
$2],
[AC_MSG_RESULT(no)
$3])
]
)
AC_DEFUN([PA_CHECK_MATH_FUNCS_ONE_ARG],[
m4_foreach_w([AC_Func], [$1],
[AH_TEMPLATE(AS_TR_CPP([HAVE_]AC_Func),
[Define to 1 if you have the `]AC_Func[' (maybe built-in) math function function.])])dnl
for pa_func in $1
do
PA_CHECK_MATH_FUNC_ONE_ARG($pa_func,
[AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$pa_func]) $2)],
[$3])dnl
done
])
AC_DEFUN([PA_CHECK_SIGSETJMP],[
pa_func=sigsetjmp
AC_MSG_CHECKING(for (maybe built-in) function $pa_func)
PA_TRY_COMPILE([
#ifdef HAVE_SETJMP_H
# include <setjmp.h>
#endif
],[
$pa_func(0,0);
],
[AC_MSG_RESULT(yes)
AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$pa_func]))
],
[AC_MSG_RESULT(no)
])
]
)