summaryrefslogtreecommitdiff
path: root/libgfortran/configure.in
blob: 63e5cf8b5e4c5420a00f903f7bba58c97865c064 (plain)
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
dnl configure.in for libgfor
dnl Copyright Free Software Foundation
dnl Released under the LGPL

dnl The rest of gcc uses autoconf 2.13, but we really need more, hence:
AC_PREREQ(2.54)

AC_INIT([GNU Fortran Runtime Library], 0.2,,[libgfortran])
AM_INIT_AUTOMAKE()
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE

AC_SUBST(enable_shared)
AC_SUBST(enable_static)

# check for compiler
AC_PROG_CC
dnl Add -Wall if using gcc
if test "x$GCC" = "xyes"; then
 CFLAGS="$CFLAGS -Wall"
fi

# We need gfortran to compile parts of the library
# We can't use AC_PROG_F77 because it expects a fully working gfortran. 
#AC_PROG_F77(gfortran)
F77="$GFORTRAN"
AC_PROG_F77(gfortran)
FFLAGS="$FFLAGS -Wall -fno-repack-arrays -fno-underscoring"

AC_FUNC_MMAP
AC_TYPE_OFF_T

# Check for install
AC_PROG_INSTALL

# check header files
AC_STDC_HEADERS
AC_HAVE_HEADERS(stdlib.h stdio.h string.h stddef.h math.h unistd.h)
AC_CHECK_HEADERS(time.h sys/params.h sys/time.h sys/times.h sys/resource.h)
AC_CHECK_HEADER([complex.h],[AC_DEFINE([HAVE_COMPLEX_H], [1], [complex.h exists])])
# Check for complex math functions
AC_CHECK_LIB([m],[csin],[need_math="no"],[need_math="yes"])

# Check for complex math functions in -lmx also
AC_CHECK_LIB([mx],[csin],[need_math="no"],[need_math="yes"])

dnl Checks for library functions.
AC_CHECK_FUNCS(getrusage times)

# Let the user override this
AC_ARG_ENABLE(cmath,
	AC_HELP_STRING([--enable-cmath],[Include complex math functions]),
    [need_math=$enableval])
if test "$need_math" = "yes"; then
	AC_MSG_NOTICE([Including complex math functions in libgfor]);
  extra_math_obj='$(gfor_cmath_obj)'
fi

AC_SUBST([MATH_OBJ],["$extra_math_obj"])

dnl The standard autoconf HAVE_STRUCT_TIMEZONE doesn't actually check
dnl for struct timezone, as you might think.  We also need to check how
dnl to call gettimeofday if we have it.
LIBGFOR_GETTIMEOFDAY

dnl These should be inherited in the recursive make, but ensure they are
dnl defined:
test "$AR" || AR=ar
AC_SUBST(AR)
if test "$RANLIB"; then :
  AC_SUBST(RANLIB)
else
  AC_PROG_RANLIB
fi

dnl Don't pull is system libtool.m4, it conflicts with the gcc version.
dnl if test "$LIBTOOL"; then :
dnl   AC_SUBST(LIBTOOL)
dnl else
dnl   AC_PROG_LIBTOOL
dnl fi
AM_PROG_LIBTOOL

AC_PROG_MAKE_SET
AC_PROG_INSTALL

AC_OUTPUT(Makefile)