]> gcc.gnu.org Git - gcc.git/blame - libgfortran/configure.ac
re PR libfortran/14923 (gfortran misses the DATE_AND_TIME intrinsic)
[gcc.git] / libgfortran / configure.ac
CommitLineData
96b8a615
AJ
1# Process this file with autoconf to produce a configure script, like so:
2# aclocal && autoconf && autoheader && automake
3
4AC_PREREQ(2.59)
5AC_INIT([GNU Fortran Runtime Library], 0.2,,[libgfortran])
6AC_CONFIG_HEADER(config.h)
7
8# For libtool versioning info, format is CURRENT:REVISION:AGE
9libtool_VERSION=6:0:0
10AC_SUBST(libtool_VERSION)
11
12# -------
13# Options
14# -------
15
16AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
17AC_ARG_ENABLE(version-specific-runtime-libs,
18[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
19[case "$enableval" in
20 yes) version_specific_libs=yes ;;
21 no) version_specific_libs=no ;;
22 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
23 esac],
24[version_specific_libs=no])
25AC_MSG_RESULT($version_specific_libs)
26
27
28# Gets build, host, target, *_vendor, *_cpu, *_os, etc.
29#
30# You will slowly go insane if you do not grok the following fact: when
31# building this library, the top-level /target/ becomes the library's /host/.
32#
33# configure then causes --target to default to --host, exactly like any
34# other package using autoconf. Therefore, 'target' and 'host' will
35# always be the same. This makes sense both for native and cross compilers
36# just think about it for a little while. :-)
37#
38# Also, if this library is being configured as part of a cross compiler, the
39# top-level configure script will pass the "real" host as $with_cross_host.
40#
41# Do not delete or change the following two lines. For why, see
42# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
43AC_CANONICAL_SYSTEM
44target_alias=${target_alias-$host_alias}
45
46# Sets up automake. Must come after AC_CANONICAL_SYSTEM. Each of the
47# following is magically included in AUTOMAKE_OPTIONS in each Makefile.am.
48# 1.8.2: minimum required version
49# no-define: PACKAGE and VERSION will not be #define'd in config.h (a bunch
50# of other PACKAGE_* variables will, however, and there's nothing
51# we can do about that; they come from AC_INIT).
52# foreign: we don't follow the normal rules for GNU packages (no COPYING
53# file in the top srcdir, etc, etc), so stop complaining.
54# no-dependencies: turns off auto dependency generation (just for now)
55# -Wall: turns on all automake warnings...
56# -Wno-portability: ...except this one, since GNU make is required.
57AM_INIT_AUTOMAKE([1.8.2 no-define foreign no-dependencies -Wall -Wno-portability])
58
59AM_MAINTAINER_MODE
60AM_ENABLE_MULTILIB(, ..)
61
62# Handy for debugging:
63#AC_MSG_NOTICE($build / $host / $target / $host_alias / $target_alias); sleep 5
64
65# Are we being configured with some form of cross compiler?
66# NB: We don't actually need to know this just now, but when, say, a test
67# suite is included, we'll have to know.
68if test "$build" != "$host"; then
69 LIBGFOR_IS_NATIVE=false
70 GCC_NO_EXECUTABLES
71else
72 LIBGFOR_IS_NATIVE=true
73fi
74
75# Process the option "--enable-version-specific-runtime-libs"
76gcc_version_trigger=${srcdir}/../gcc/version.c
77gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([[^ \"]]*\)[[ \"]].*/\1/'`
78gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
79AC_SUBST(gcc_version)
80
81# Calculate toolexeclibdir
82# Also toolexecdir, though it's only used in toolexeclibdir
83case ${version_specific_libs} in
84 yes)
85 # Need the gcc compiler version to know where to install libraries
86 # and header files if --enable-version-specific-runtime-libs option
87 # is selected.
88 toolexecdir='$(libdir)/gcc/$(target_alias)'
89 toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
90 ;;
91 no)
92 if test -n "$with_cross_host" &&
93 test x"$with_cross_host" != x"no"; then
94 # Install a library built with a cross compiler in tooldir, not libdir.
95 toolexecdir='$(exec_prefix)/$(target_alias)'
96 toolexeclibdir='$(toolexecdir)/lib'
97 else
98 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
99 toolexeclibdir='$(libdir)'
100 fi
101 multi_os_directory=`$CC -print-multi-os-directory`
102 case $multi_os_directory in
103 .) ;; # Avoid trailing /.
104 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
105 esac
106 ;;
107esac
108AC_SUBST(toolexecdir)
109AC_SUBST(toolexeclibdir)
110
111# Check the compiler.
112# The same as in boehm-gc and libstdc++. Have to borrow it from there.
113# We must force CC to /not/ be precious variables; otherwise
114# the wrong, non-multilib-adjusted value will be used in multilibs.
115# As a side effect, we have to subst CFLAGS ourselves.
116
117m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
118m4_define([_AC_ARG_VAR_PRECIOUS],[])
119AC_PROG_CC
120m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
121
122AC_SUBST(CFLAGS)
123
124# Add -Wall if we are using GCC.
125if test "x$GCC" = "xyes"; then
126 CFLAGS="$CFLAGS -Wall"
127fi
128
129# Find other programs we need.
130AC_CHECK_TOOL(AS, as)
131AC_CHECK_TOOL(AR, ar)
132AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error)
133AC_PROG_MAKE_SET
134AC_PROG_INSTALL
135
136# Configure libtool
137#AC_MSG_NOTICE([====== Starting libtool configuration])
138AC_LIBTOOL_DLOPEN
139AM_PROG_LIBTOOL
140AC_SUBST(enable_shared)
141AC_SUBST(enable_static)
142#AC_MSG_NOTICE([====== Finished libtool configuration]) ; sleep 10
143
144# We need gfortran to compile parts of the library
145# We can't use AC_PROG_F77 because it expects a fully working gfortran.
146#AC_PROG_F77(gfortran)
147F77="$GFORTRAN"
148AC_PROG_F77(gfortran)
149FFLAGS="$FFLAGS -Wall -fno-repack-arrays -fno-underscoring"
150
151AC_FUNC_MMAP
152AC_TYPE_OFF_T
153
154# check header files
155AC_STDC_HEADERS
156AC_HAVE_HEADERS(stdlib.h stdio.h string.h stddef.h math.h unistd.h)
157AC_CHECK_HEADERS(time.h sys/params.h sys/time.h sys/times.h sys/resource.h)
158AC_CHECK_HEADER([complex.h],[AC_DEFINE([HAVE_COMPLEX_H], [1], [complex.h exists])])
159
160# Check for complex math functions
161AC_CHECK_LIB([m],[csin],[need_math="no"],[need_math="yes"])
162
163# Check for complex math functions in -lmx also
164AC_CHECK_LIB([mx],[csin],[need_math="no"],[need_math="yes"])
165
166# Check for library functions.
167AC_CHECK_FUNCS(getrusage times)
168
169# Let the user override this
170AC_ARG_ENABLE(cmath,
171 AC_HELP_STRING([--enable-cmath],[Include complex math functions]),
172 [need_math=$enableval])
173if test "$need_math" = "yes"; then
174 AC_MSG_NOTICE([Including complex math functions in libgfor]);
175 extra_math_obj='$(gfor_cmath_obj)'
176fi
177
178AC_SUBST([MATH_OBJ],["$extra_math_obj"])
179
180# The standard autoconf HAVE_STRUCT_TIMEZONE doesn't actually check
181# for struct timezone, as you might think. We also need to check how
182# to call gettimeofday if we have it.
183LIBGFOR_GETTIMEOFDAY
184
185AC_CACHE_SAVE
186
187if test ${multilib} = yes; then
188 multilib_arg="--enable-multilib"
189else
190 multilib_arg=
191fi
192
193# Write our Makefile.
194AC_CONFIG_FILES(Makefile)
195AC_OUTPUT
This page took 0.0536 seconds and 5 git commands to generate.