* Makefile.in (AR_FOR_TARGET, RANLIB_FOR_TARGET)
[official-gcc.git] / libgfortran / configure.in
blob63e5cf8b5e4c5420a00f903f7bba58c97865c064
1 dnl configure.in for libgfor
2 dnl Copyright Free Software Foundation
3 dnl Released under the LGPL
5 dnl The rest of gcc uses autoconf 2.13, but we really need more, hence:
6 AC_PREREQ(2.54)
8 AC_INIT([GNU Fortran Runtime Library], 0.2,,[libgfortran])
9 AM_INIT_AUTOMAKE()
10 AM_CONFIG_HEADER(config.h)
11 AM_MAINTAINER_MODE
13 AC_SUBST(enable_shared)
14 AC_SUBST(enable_static)
16 # check for compiler
17 AC_PROG_CC
18 dnl Add -Wall if using gcc
19 if test "x$GCC" = "xyes"; then
20  CFLAGS="$CFLAGS -Wall"
23 # We need gfortran to compile parts of the library
24 # We can't use AC_PROG_F77 because it expects a fully working gfortran. 
25 #AC_PROG_F77(gfortran)
26 F77="$GFORTRAN"
27 AC_PROG_F77(gfortran)
28 FFLAGS="$FFLAGS -Wall -fno-repack-arrays -fno-underscoring"
30 AC_FUNC_MMAP
31 AC_TYPE_OFF_T
33 # Check for install
34 AC_PROG_INSTALL
36 # check header files
37 AC_STDC_HEADERS
38 AC_HAVE_HEADERS(stdlib.h stdio.h string.h stddef.h math.h unistd.h)
39 AC_CHECK_HEADERS(time.h sys/params.h sys/time.h sys/times.h sys/resource.h)
40 AC_CHECK_HEADER([complex.h],[AC_DEFINE([HAVE_COMPLEX_H], [1], [complex.h exists])])
41 # Check for complex math functions
42 AC_CHECK_LIB([m],[csin],[need_math="no"],[need_math="yes"])
44 # Check for complex math functions in -lmx also
45 AC_CHECK_LIB([mx],[csin],[need_math="no"],[need_math="yes"])
47 dnl Checks for library functions.
48 AC_CHECK_FUNCS(getrusage times)
50 # Let the user override this
51 AC_ARG_ENABLE(cmath,
52         AC_HELP_STRING([--enable-cmath],[Include complex math functions]),
53     [need_math=$enableval])
54 if test "$need_math" = "yes"; then
55         AC_MSG_NOTICE([Including complex math functions in libgfor]);
56   extra_math_obj='$(gfor_cmath_obj)'
59 AC_SUBST([MATH_OBJ],["$extra_math_obj"])
61 dnl The standard autoconf HAVE_STRUCT_TIMEZONE doesn't actually check
62 dnl for struct timezone, as you might think.  We also need to check how
63 dnl to call gettimeofday if we have it.
64 LIBGFOR_GETTIMEOFDAY
66 dnl These should be inherited in the recursive make, but ensure they are
67 dnl defined:
68 test "$AR" || AR=ar
69 AC_SUBST(AR)
70 if test "$RANLIB"; then :
71   AC_SUBST(RANLIB)
72 else
73   AC_PROG_RANLIB
76 dnl Don't pull is system libtool.m4, it conflicts with the gcc version.
77 dnl if test "$LIBTOOL"; then :
78 dnl   AC_SUBST(LIBTOOL)
79 dnl else
80 dnl   AC_PROG_LIBTOOL
81 dnl fi
82 AM_PROG_LIBTOOL
84 AC_PROG_MAKE_SET
85 AC_PROG_INSTALL
87 AC_OUTPUT(Makefile)