forked from cvvs/nec2c
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.ac
96 lines (78 loc) · 2.23 KB
/
configure.ac
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(nec2c, 0.9, mjtrangoni@gmail.com)
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_SRCDIR([src/main.c])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([no-define])
AM_MAINTAINER_MODE
AC_PREFIX_DEFAULT([/usr/local])
test "x$prefix" = xNONE && prefix="/usr/local"
dnl Checks for programs.
AC_PROG_CC
AC_PROG_RANLIB
AC_CHECK_TOOL(AR, ar, :)
dnl Check math library
AC_CHECK_LIB(m,main)
dnl Checks for library functions.
AC_CHECK_FUNCS([floor pow exp sqrt log10 log cos sin acos asin tan atan sinh \
cosh tanh fabs modf atan2 jn yn erf erfc round trunc acosh \
asinh strdup strerror strchr])
dnl Checks for complex classes and functions.
AC_CHECK_HEADERS([complex.h stdio.h signal.h math.h stdlib.h unistd.h \
string.h fcntl.h errno.h time.h sys/types.h sys/times.h \
omp.h],
[mypj_found_int_headers=yes; break;])
AS_IF([test "x$mypj_found_int_headers" != "xyes"],
[AC_MSG_ERROR([Unable to find the standard headers to nec2c.h])])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
dnl Check for type sizes.
AC_CHECK_SIZEOF([short])
AC_CHECK_SIZEOF([int])
AC_CHECK_SIZEOF([long])
type32="int"
if test $ac_cv_sizeof_short -eq 4; then
type32=short
elif test $ac_cv_sizeof_int -eq 4; then
type32=int
elif test $ac_cv_sizeof_long -eq 4; then
type32=long
fi
dnl Check for double type.
AC_ARG_ENABLE([double],
AS_HELP_STRING([--enable-double=TYPE],
[type of double representation @<:@default=double@:>@]),
[case "$enableval" in
no | yes | double)
double_type="double"
double_size=8
;;
ldouble)
double_type="long double"
AC_CHECK_SIZEOF([long double],12)
double_size=$ac_cv_sizeof_long_double
;;
float)
double_type="float"
double_size=4
;;
*)
double_type="none"
double_size=0
;;
esac],
[double_type="double"; double_size=8])
if test "$double_type" = none; then
AC_MSG_ERROR([valid types are double, float and ldouble.])
fi
dnl Check OpenMP support
AX_OPENMP([have_openmp=yes], [have_openmp=no])
AC_OUTPUT(Makefile src/Makefile)
dnl Print results.
AC_MSG_RESULT([])
AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.])
AC_MSG_RESULT([])