Subversion Repositories Nec2c

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 mjames 1
dnl Process this file with autoconf to produce a configure script.
2
 
3
AC_PREREQ(2.59)
4
AC_INIT(nec2c, 0.9, mjtrangoni@gmail.com)
5
AC_CONFIG_AUX_DIR(config)
6
AC_CONFIG_SRCDIR([src/main.c])
7
 
8
AC_CANONICAL_BUILD
9
AC_CANONICAL_HOST
10
AC_CANONICAL_TARGET
11
AM_INIT_AUTOMAKE([no-define])
12
AM_MAINTAINER_MODE
13
AC_PREFIX_DEFAULT([/usr/local])
14
test "x$prefix" = xNONE && prefix="/usr/local"
15
 
16
dnl Checks for programs.
17
AC_PROG_CC
18
AC_PROG_RANLIB
19
AC_CHECK_TOOL(AR, ar, :)
20
 
21
dnl Check math library
22
AC_CHECK_LIB(m,main)
23
 
24
dnl Checks for library functions.
25
AC_CHECK_FUNCS([floor pow exp sqrt log10 log cos sin acos asin tan atan sinh \
26
		cosh tanh fabs modf atan2 jn yn erf erfc round trunc acosh \
27
		asinh strdup strerror strchr])
28
 
29
dnl Checks for complex classes and functions.
30
AC_CHECK_HEADERS([complex.h stdio.h signal.h math.h stdlib.h unistd.h \
31
		  string.h fcntl.h errno.h time.h sys/types.h sys/times.h \
32
		  omp.h],
33
	 	[mypj_found_int_headers=yes; break;])
34
 
35
AS_IF([test "x$mypj_found_int_headers" != "xyes"],
36
      	[AC_MSG_ERROR([Unable to find the standard headers to nec2c.h])])
37
 
38
 
39
dnl Checks for typedefs, structures, and compiler characteristics.
40
AC_C_CONST
41
AC_TYPE_SIZE_T
42
 
43
dnl Check for type sizes.
44
 
45
AC_CHECK_SIZEOF([short])
46
AC_CHECK_SIZEOF([int])
47
AC_CHECK_SIZEOF([long])
48
 
49
type32="int"
50
if test $ac_cv_sizeof_short -eq 4; then
51
	type32=short
52
elif test $ac_cv_sizeof_int -eq 4; then
53
	type32=int
54
elif test $ac_cv_sizeof_long -eq 4; then
55
      type32=long
56
	fi
57
 
58
dnl Check for double type.
59
 
60
AC_ARG_ENABLE([double],
61
AS_HELP_STRING([--enable-double=TYPE],
62
	[type of double representation @<:@default=double@:>@]),
63
		[case "$enableval" in
64
       		no | yes | double)
65
     		double_type="double"
66
     		double_size=8
67
     		;;
68
   		ldouble)
69
double_type="long double"
70
AC_CHECK_SIZEOF([long double],12)
71
double_size=$ac_cv_sizeof_long_double
72
;;
73
float)
74
double_type="float"
75
double_size=4
76
;;
77
*)
78
double_type="none"
79
double_size=0
80
;;
81
esac],
82
[double_type="double"; double_size=8])
83
if test "$double_type" = none; then
84
       AC_MSG_ERROR([valid types are double, float and ldouble.])
85
fi       
86
 
87
dnl Check OpenMP support
88
AX_OPENMP([have_openmp=yes], [have_openmp=no])
89
 
90
AC_OUTPUT(Makefile src/Makefile)
91
 
92
dnl Print results.
93
AC_MSG_RESULT([])
94
AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.])
95
AC_MSG_RESULT([])
96