]>
Commit | Line | Data |
---|---|---|
96b8a615 AJ |
1 | # Process this file with autoconf to produce a configure script, like so: |
2 | # aclocal && autoconf && autoheader && automake | |
3 | ||
df58e648 | 4 | AC_PREREQ(2.64) |
0dce3ca1 | 5 | AC_INIT([GNU Fortran Runtime Library], 0.3,,[libgfortran]) |
96b8a615 | 6 | AC_CONFIG_HEADER(config.h) |
891c05b1 | 7 | GCC_TOPLEV_SUBDIRS |
96b8a615 | 8 | |
96b8a615 AJ |
9 | # ------- |
10 | # Options | |
11 | # ------- | |
12 | ||
13 | AC_MSG_CHECKING([for --enable-version-specific-runtime-libs]) | |
14 | AC_ARG_ENABLE(version-specific-runtime-libs, | |
87e6d9dc TB |
15 | AS_HELP_STRING([--enable-version-specific-runtime-libs], |
16 | [specify that runtime libraries should be installed in a compiler-specific directory]), | |
96b8a615 AJ |
17 | [case "$enableval" in |
18 | yes) version_specific_libs=yes ;; | |
19 | no) version_specific_libs=no ;; | |
20 | *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);; | |
21 | esac], | |
22 | [version_specific_libs=no]) | |
23 | AC_MSG_RESULT($version_specific_libs) | |
24 | ||
b808ac33 BF |
25 | # Build with intermodule optimisations |
26 | AC_MSG_CHECKING([for --enable-intermodule]) | |
27 | AC_ARG_ENABLE(intermodule, | |
87e6d9dc | 28 | AS_HELP_STRING([--enable-intermodule],[build the library in one step]), |
b808ac33 BF |
29 | [case "$enable_intermodule" in |
30 | yes) onestep="-onestep";; | |
31 | *) onestep="";; | |
32 | esac], | |
33 | [onestep=""]) | |
34 | AC_MSG_RESULT($enable_intermodule) | |
35 | AM_CONDITIONAL(onestep,[test x$onestep = x-onestep]) | |
36 | AC_SUBST(onestep) | |
96b8a615 AJ |
37 | |
38 | # Gets build, host, target, *_vendor, *_cpu, *_os, etc. | |
39 | # | |
40 | # You will slowly go insane if you do not grok the following fact: when | |
41 | # building this library, the top-level /target/ becomes the library's /host/. | |
42 | # | |
43 | # configure then causes --target to default to --host, exactly like any | |
44 | # other package using autoconf. Therefore, 'target' and 'host' will | |
45 | # always be the same. This makes sense both for native and cross compilers | |
46 | # just think about it for a little while. :-) | |
47 | # | |
48 | # Also, if this library is being configured as part of a cross compiler, the | |
49 | # top-level configure script will pass the "real" host as $with_cross_host. | |
50 | # | |
51 | # Do not delete or change the following two lines. For why, see | |
52 | # http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html | |
53 | AC_CANONICAL_SYSTEM | |
60858d8a TB |
54 | ACX_NONCANONICAL_TARGET |
55 | ||
96b8a615 | 56 | target_alias=${target_alias-$host_alias} |
60858d8a | 57 | AC_SUBST(target_alias) |
96b8a615 AJ |
58 | |
59 | # Sets up automake. Must come after AC_CANONICAL_SYSTEM. Each of the | |
60 | # following is magically included in AUTOMAKE_OPTIONS in each Makefile.am. | |
679c0f9a | 61 | # 1.9.6: minimum required version |
96b8a615 AJ |
62 | # no-define: PACKAGE and VERSION will not be #define'd in config.h (a bunch |
63 | # of other PACKAGE_* variables will, however, and there's nothing | |
64 | # we can do about that; they come from AC_INIT). | |
65 | # foreign: we don't follow the normal rules for GNU packages (no COPYING | |
66 | # file in the top srcdir, etc, etc), so stop complaining. | |
13917ae3 | 67 | # no-dist: we don't want 'dist' and related rules. |
96b8a615 AJ |
68 | # -Wall: turns on all automake warnings... |
69 | # -Wno-portability: ...except this one, since GNU make is required. | |
13917ae3 | 70 | AM_INIT_AUTOMAKE([1.9.6 no-define foreign no-dist -Wall -Wno-portability]) |
96b8a615 AJ |
71 | |
72 | AM_MAINTAINER_MODE | |
73 | AM_ENABLE_MULTILIB(, ..) | |
74 | ||
75 | # Handy for debugging: | |
76 | #AC_MSG_NOTICE($build / $host / $target / $host_alias / $target_alias); sleep 5 | |
77 | ||
78 | # Are we being configured with some form of cross compiler? | |
79 | # NB: We don't actually need to know this just now, but when, say, a test | |
80 | # suite is included, we'll have to know. | |
81 | if test "$build" != "$host"; then | |
82 | LIBGFOR_IS_NATIVE=false | |
83 | GCC_NO_EXECUTABLES | |
84 | else | |
85 | LIBGFOR_IS_NATIVE=true | |
86 | fi | |
87 | ||
21be0a5a JB |
88 | AC_USE_SYSTEM_EXTENSIONS |
89 | ||
96b8a615 AJ |
90 | # Calculate toolexeclibdir |
91 | # Also toolexecdir, though it's only used in toolexeclibdir | |
92 | case ${version_specific_libs} in | |
93 | yes) | |
94 | # Need the gcc compiler version to know where to install libraries | |
95 | # and header files if --enable-version-specific-runtime-libs option | |
96 | # is selected. | |
97 | toolexecdir='$(libdir)/gcc/$(target_alias)' | |
140e859c | 98 | toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)' |
96b8a615 AJ |
99 | ;; |
100 | no) | |
101 | if test -n "$with_cross_host" && | |
102 | test x"$with_cross_host" != x"no"; then | |
103 | # Install a library built with a cross compiler in tooldir, not libdir. | |
104 | toolexecdir='$(exec_prefix)/$(target_alias)' | |
105 | toolexeclibdir='$(toolexecdir)/lib' | |
106 | else | |
107 | toolexecdir='$(libdir)/gcc-lib/$(target_alias)' | |
108 | toolexeclibdir='$(libdir)' | |
109 | fi | |
110 | multi_os_directory=`$CC -print-multi-os-directory` | |
111 | case $multi_os_directory in | |
112 | .) ;; # Avoid trailing /. | |
113 | *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; | |
114 | esac | |
115 | ;; | |
116 | esac | |
117 | AC_SUBST(toolexecdir) | |
118 | AC_SUBST(toolexeclibdir) | |
119 | ||
1ec601bf FXC |
120 | # Create a spec file, so that compile/link tests don't fail |
121 | test -f libgfortran.spec || touch libgfortran.spec | |
122 | ||
60858d8a | 123 | AC_LANG_C |
96b8a615 AJ |
124 | # Check the compiler. |
125 | # The same as in boehm-gc and libstdc++. Have to borrow it from there. | |
126 | # We must force CC to /not/ be precious variables; otherwise | |
127 | # the wrong, non-multilib-adjusted value will be used in multilibs. | |
128 | # As a side effect, we have to subst CFLAGS ourselves. | |
129 | ||
130 | m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS]) | |
131 | m4_define([_AC_ARG_VAR_PRECIOUS],[]) | |
132 | AC_PROG_CC | |
1b3b24c2 | 133 | m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) |
96b8a615 | 134 | |
60858d8a TB |
135 | AC_SUBST(CFLAGS) |
136 | ||
137 | AM_PROG_CC_C_O | |
138 | ||
17109ecb | 139 | # Add -Wall -fno-repack-arrays -fno-underscoring if we are using GCC. |
96b8a615 | 140 | if test "x$GCC" = "xyes"; then |
c3e9b6ab | 141 | AM_FCFLAGS="-I . -Wall -Werror -fimplicit-none -fno-repack-arrays -fno-underscoring" |
e606fb39 AJ |
142 | ## We like to use C99 routines when available. This makes sure that |
143 | ## __STDC_VERSION__ is set such that libc includes make them available. | |
c5f4d1cc | 144 | AM_CFLAGS="-std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings" |
d1f37bc6 RS |
145 | ## Compile the following tests with the same system header contents |
146 | ## that we'll encounter when compiling our own source files. | |
147 | CFLAGS="-std=gnu99 $CFLAGS" | |
96b8a615 | 148 | fi |
e606fb39 AJ |
149 | AC_SUBST(AM_FCFLAGS) |
150 | AC_SUBST(AM_CFLAGS) | |
3d22e001 | 151 | AC_SUBST(CFLAGS) |
96b8a615 | 152 | |
c0e7e2bf JB |
153 | # Check for symbol versioning (copied from libssp). |
154 | AC_MSG_CHECKING([whether symbol versioning is supported]) | |
bf382f5f RO |
155 | AC_ARG_ENABLE(symvers, |
156 | AS_HELP_STRING([--disable-symvers], | |
157 | [disable symbol versioning for libgfortran]), | |
158 | gfortran_use_symver=$enableval, | |
159 | gfortran_use_symver=yes) | |
19af62db | 160 | if test "x$gfortran_use_symver" != xno; then |
bf382f5f RO |
161 | save_LDFLAGS="$LDFLAGS" |
162 | LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map" | |
163 | cat > conftest.map <<EOF | |
c0e7e2bf JB |
164 | FOO_1.0 { |
165 | global: *foo*; bar; local: *; | |
166 | }; | |
167 | EOF | |
bf382f5f RO |
168 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[int foo;]],[[]])],[gfortran_use_symver=gnu],[gfortran_use_symver=no]) |
169 | if test x$gfortran_use_symver = xno; then | |
170 | case "$target_os" in | |
171 | solaris2*) | |
172 | LDFLAGS="$save_LDFLAGS" | |
173 | LDFLAGS="$LDFLAGS -fPIC -shared -Wl,-M,./conftest.map" | |
174 | # Sun ld cannot handle wildcards and treats all entries as undefined. | |
175 | cat > conftest.map <<EOF | |
49ea7a0e RO |
176 | FOO_1.0 { |
177 | global: foo; local: *; | |
178 | }; | |
179 | EOF | |
bf382f5f RO |
180 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[int foo;]],[[]])],[gfortran_use_symver=sun],[gfortran_use_symver=no]) |
181 | ;; | |
182 | esac | |
183 | fi | |
184 | LDFLAGS="$save_LDFLAGS" | |
49ea7a0e | 185 | fi |
c0e7e2bf | 186 | AC_MSG_RESULT($gfortran_use_symver) |
49ea7a0e RO |
187 | AM_CONDITIONAL(LIBGFOR_USE_SYMVER, [test "x$gfortran_use_symver" != xno]) |
188 | AM_CONDITIONAL(LIBGFOR_USE_SYMVER_GNU, [test "x$gfortran_use_symver" = xgnu]) | |
189 | AM_CONDITIONAL(LIBGFOR_USE_SYMVER_SUN, [test "x$gfortran_use_symver" = xsun]) | |
c0e7e2bf | 190 | |
c049309d UW |
191 | # Figure out whether the compiler supports "-ffunction-sections -fdata-sections", |
192 | # similarly to how libstdc++ does it | |
193 | ac_test_CFLAGS="${CFLAGS+set}" | |
194 | ac_save_CFLAGS="$CFLAGS" | |
195 | ||
196 | # Check for -ffunction-sections -fdata-sections | |
197 | AC_MSG_CHECKING([for gcc that supports -ffunction-sections -fdata-sections]) | |
198 | CFLAGS='-Werror -ffunction-sections -fdata-sections' | |
de15ea94 | 199 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int foo;]])], [ac_fdsections=yes], [ac_fdsections=no]) |
c049309d UW |
200 | if test "$ac_test_CFLAGS" = set; then |
201 | CFLAGS="$ac_save_CFLAGS" | |
202 | else | |
203 | # this is the suspicious part | |
204 | CFLAGS="" | |
205 | fi | |
206 | if test x"$ac_fdsections" = x"yes"; then | |
207 | SECTION_FLAGS='-ffunction-sections -fdata-sections' | |
208 | fi | |
209 | AC_MSG_RESULT($ac_fdsections) | |
210 | AC_SUBST(SECTION_FLAGS) | |
211 | ||
96b8a615 AJ |
212 | # Find other programs we need. |
213 | AC_CHECK_TOOL(AS, as) | |
214 | AC_CHECK_TOOL(AR, ar) | |
215 | AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error) | |
216 | AC_PROG_MAKE_SET | |
217 | AC_PROG_INSTALL | |
218 | ||
219 | # Configure libtool | |
220 | #AC_MSG_NOTICE([====== Starting libtool configuration]) | |
221 | AC_LIBTOOL_DLOPEN | |
222 | AM_PROG_LIBTOOL | |
7de6ba7a | 223 | ACX_LT_HOST_FLAGS |
96b8a615 AJ |
224 | AC_SUBST(enable_shared) |
225 | AC_SUBST(enable_static) | |
226 | #AC_MSG_NOTICE([====== Finished libtool configuration]) ; sleep 10 | |
227 | ||
228 | # We need gfortran to compile parts of the library | |
c7a35fe9 AS |
229 | #AC_PROG_FC(gfortran) |
230 | FC="$GFORTRAN" | |
231 | AC_PROG_FC(gfortran) | |
96b8a615 | 232 | |
e87045f3 AP |
233 | # extra LD Flags which are required for targets |
234 | case "${host}" in | |
235 | *-darwin*) | |
236 | # Darwin needs -single_module when linking libgfortran | |
237 | extra_ldflags_libgfortran=-Wl,-single_module | |
238 | ;; | |
239 | esac | |
240 | AC_SUBST(extra_ldflags_libgfortran) | |
241 | ||
15e92535 FXC |
242 | # We need a working compiler at that point, otherwise give a clear |
243 | # error message and bail out. | |
244 | LIBGFOR_WORKING_GFORTRAN | |
245 | ||
9cdc381b | 246 | AC_SYS_LARGEFILE |
44720bef JB |
247 | |
248 | # Types | |
96b8a615 | 249 | AC_TYPE_OFF_T |
44720bef JB |
250 | AC_TYPE_INTPTR_T |
251 | AC_TYPE_UINTPTR_T | |
252 | AC_CHECK_TYPES([ptrdiff_t]) | |
96b8a615 | 253 | |
74544378 JB |
254 | # check header files (we assume C89 is available, so don't check for that) |
255 | AC_CHECK_HEADERS_ONCE(unistd.h sys/time.h sys/times.h sys/resource.h \ | |
256 | sys/types.h sys/stat.h sys/wait.h floatingpoint.h ieeefp.h fenv.h fptrap.h \ | |
fa86f4f9 | 257 | fpxcp.h pwd.h complex.h) |
74544378 | 258 | |
4c4b3eb0 | 259 | GCC_HEADER_STDINT(gstdint.h) |
96b8a615 | 260 | |
74544378 | 261 | AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_blocks, struct stat.st_rdev]) |
df65f093 | 262 | |
96b8a615 | 263 | # Check for library functions. |
b4005c71 SE |
264 | if test "x${with_newlib}" = "xyes"; then |
265 | # We are being configured with a cross compiler. AC_REPLACE_FUNCS | |
266 | # may not work correctly, because the compiler may not be able to | |
267 | # link executables. | |
268 | AC_DEFINE(HAVE_MKSTEMP, 1, [Define if you have mkstemp.]) | |
269 | AC_DEFINE(HAVE_STRTOF, 1, [Define if you have strtof.]) | |
b4005c71 SE |
270 | AC_DEFINE(HAVE_SNPRINTF, 1, [Define if you have snprintf.]) |
271 | AC_DEFINE(HAVE_STRCASESTR, 1, [Define if you have strcasestr.]) | |
272 | AC_DEFINE(HAVE_VSNPRINTF, 1, [Define if you have vsnprintf.]) | |
273 | AC_DEFINE(HAVE_LOCALTIME_R, 1, [Define if you have localtime_r.]) | |
274 | AC_DEFINE(HAVE_GMTIME_R, 1, [Define if you have gmtime_r.]) | |
cb83df66 SE |
275 | |
276 | # At some point, we should differentiate between architectures | |
277 | # like x86, which have long double versions, and alpha/powerpc/etc., | |
278 | # which don't. For the time being, punt. | |
279 | if test x"long_double_math_on_this_cpu" = x"yes"; then | |
280 | AC_DEFINE(HAVE_STRTOLD, 1, [Define if you have strtold.]) | |
281 | fi | |
b4005c71 SE |
282 | else |
283 | AC_CHECK_FUNCS_ONCE(getrusage times mkstemp strtof strtold snprintf \ | |
284 | ftruncate chsize chdir getlogin gethostname kill link symlink sleep ttyname \ | |
b5b58343 | 285 | alarm access fork execl wait setmode execve pipe dup2 close fcntl \ |
b4005c71 SE |
286 | strcasestr getrlimit gettimeofday stat fstat lstat getpwuid vsnprintf dup \ |
287 | getcwd localtime_r gmtime_r getpwuid_r ttyname_r clock_gettime \ | |
288 | readlink getgid getpid getppid getuid geteuid umask getegid \ | |
c20fdb91 | 289 | secure_getenv __secure_getenv mkostemp) |
b4005c71 | 290 | fi |
4c0c6b9f | 291 | |
4179e59a TB |
292 | # Check strerror_r, cannot be above as versions with two and three arguments exist |
293 | LIBGFOR_CHECK_STRERROR_R | |
294 | ||
453310d8 | 295 | # Check for C99 (and other IEEE) math functions |
f38a14ca TG |
296 | GCC_CHECK_MATH_FUNC([acosf]) |
297 | GCC_CHECK_MATH_FUNC([acos]) | |
298 | GCC_CHECK_MATH_FUNC([acosl]) | |
299 | GCC_CHECK_MATH_FUNC([acoshf]) | |
300 | GCC_CHECK_MATH_FUNC([acosh]) | |
301 | GCC_CHECK_MATH_FUNC([acoshl]) | |
302 | GCC_CHECK_MATH_FUNC([asinf]) | |
303 | GCC_CHECK_MATH_FUNC([asin]) | |
304 | GCC_CHECK_MATH_FUNC([asinl]) | |
305 | GCC_CHECK_MATH_FUNC([asinhf]) | |
306 | GCC_CHECK_MATH_FUNC([asinh]) | |
307 | GCC_CHECK_MATH_FUNC([asinhl]) | |
308 | GCC_CHECK_MATH_FUNC([atan2f]) | |
309 | GCC_CHECK_MATH_FUNC([atan2]) | |
310 | GCC_CHECK_MATH_FUNC([atan2l]) | |
311 | GCC_CHECK_MATH_FUNC([atanf]) | |
312 | GCC_CHECK_MATH_FUNC([atan]) | |
313 | GCC_CHECK_MATH_FUNC([atanl]) | |
314 | GCC_CHECK_MATH_FUNC([atanhf]) | |
315 | GCC_CHECK_MATH_FUNC([atanh]) | |
316 | GCC_CHECK_MATH_FUNC([atanhl]) | |
317 | GCC_CHECK_MATH_FUNC([cargf]) | |
318 | GCC_CHECK_MATH_FUNC([carg]) | |
319 | GCC_CHECK_MATH_FUNC([cargl]) | |
320 | GCC_CHECK_MATH_FUNC([ceilf]) | |
321 | GCC_CHECK_MATH_FUNC([ceil]) | |
322 | GCC_CHECK_MATH_FUNC([ceill]) | |
323 | GCC_CHECK_MATH_FUNC([copysignf]) | |
324 | GCC_CHECK_MATH_FUNC([copysign]) | |
325 | GCC_CHECK_MATH_FUNC([copysignl]) | |
326 | GCC_CHECK_MATH_FUNC([cosf]) | |
327 | GCC_CHECK_MATH_FUNC([cos]) | |
328 | GCC_CHECK_MATH_FUNC([cosl]) | |
329 | GCC_CHECK_MATH_FUNC([ccosf]) | |
330 | GCC_CHECK_MATH_FUNC([ccos]) | |
331 | GCC_CHECK_MATH_FUNC([ccosl]) | |
332 | GCC_CHECK_MATH_FUNC([coshf]) | |
333 | GCC_CHECK_MATH_FUNC([cosh]) | |
334 | GCC_CHECK_MATH_FUNC([coshl]) | |
335 | GCC_CHECK_MATH_FUNC([ccoshf]) | |
336 | GCC_CHECK_MATH_FUNC([ccosh]) | |
337 | GCC_CHECK_MATH_FUNC([ccoshl]) | |
338 | GCC_CHECK_MATH_FUNC([expf]) | |
339 | GCC_CHECK_MATH_FUNC([exp]) | |
340 | GCC_CHECK_MATH_FUNC([expl]) | |
341 | GCC_CHECK_MATH_FUNC([cexpf]) | |
342 | GCC_CHECK_MATH_FUNC([cexp]) | |
343 | GCC_CHECK_MATH_FUNC([cexpl]) | |
344 | GCC_CHECK_MATH_FUNC([fabsf]) | |
345 | GCC_CHECK_MATH_FUNC([fabs]) | |
346 | GCC_CHECK_MATH_FUNC([fabsl]) | |
347 | GCC_CHECK_MATH_FUNC([cabsf]) | |
348 | GCC_CHECK_MATH_FUNC([cabs]) | |
349 | GCC_CHECK_MATH_FUNC([cabsl]) | |
350 | GCC_CHECK_MATH_FUNC([floorf]) | |
351 | GCC_CHECK_MATH_FUNC([floor]) | |
352 | GCC_CHECK_MATH_FUNC([floorl]) | |
353 | GCC_CHECK_MATH_FUNC([fmodf]) | |
354 | GCC_CHECK_MATH_FUNC([fmod]) | |
355 | GCC_CHECK_MATH_FUNC([fmodl]) | |
356 | GCC_CHECK_MATH_FUNC([frexpf]) | |
357 | GCC_CHECK_MATH_FUNC([frexp]) | |
358 | GCC_CHECK_MATH_FUNC([frexpl]) | |
359 | GCC_CHECK_MATH_FUNC([hypotf]) | |
360 | GCC_CHECK_MATH_FUNC([hypot]) | |
361 | GCC_CHECK_MATH_FUNC([hypotl]) | |
362 | GCC_CHECK_MATH_FUNC([ldexpf]) | |
363 | GCC_CHECK_MATH_FUNC([ldexp]) | |
364 | GCC_CHECK_MATH_FUNC([ldexpl]) | |
365 | GCC_CHECK_MATH_FUNC([logf]) | |
366 | GCC_CHECK_MATH_FUNC([log]) | |
367 | GCC_CHECK_MATH_FUNC([logl]) | |
368 | GCC_CHECK_MATH_FUNC([clogf]) | |
369 | GCC_CHECK_MATH_FUNC([clog]) | |
370 | GCC_CHECK_MATH_FUNC([clogl]) | |
371 | GCC_CHECK_MATH_FUNC([log10f]) | |
372 | GCC_CHECK_MATH_FUNC([log10]) | |
373 | GCC_CHECK_MATH_FUNC([log10l]) | |
374 | GCC_CHECK_MATH_FUNC([clog10f]) | |
375 | GCC_CHECK_MATH_FUNC([clog10]) | |
376 | GCC_CHECK_MATH_FUNC([clog10l]) | |
377 | GCC_CHECK_MATH_FUNC([nextafterf]) | |
378 | GCC_CHECK_MATH_FUNC([nextafter]) | |
379 | GCC_CHECK_MATH_FUNC([nextafterl]) | |
380 | GCC_CHECK_MATH_FUNC([powf]) | |
381 | GCC_CHECK_MATH_FUNC([pow]) | |
382 | GCC_CHECK_MATH_FUNC([powl]) | |
383 | GCC_CHECK_MATH_FUNC([cpowf]) | |
384 | GCC_CHECK_MATH_FUNC([cpow]) | |
385 | GCC_CHECK_MATH_FUNC([cpowl]) | |
386 | GCC_CHECK_MATH_FUNC([roundf]) | |
387 | GCC_CHECK_MATH_FUNC([round]) | |
388 | GCC_CHECK_MATH_FUNC([roundl]) | |
389 | GCC_CHECK_MATH_FUNC([lroundf]) | |
390 | GCC_CHECK_MATH_FUNC([lround]) | |
391 | GCC_CHECK_MATH_FUNC([lroundl]) | |
392 | GCC_CHECK_MATH_FUNC([llroundf]) | |
393 | GCC_CHECK_MATH_FUNC([llround]) | |
394 | GCC_CHECK_MATH_FUNC([llroundl]) | |
395 | GCC_CHECK_MATH_FUNC([scalbnf]) | |
396 | GCC_CHECK_MATH_FUNC([scalbn]) | |
397 | GCC_CHECK_MATH_FUNC([scalbnl]) | |
398 | GCC_CHECK_MATH_FUNC([sinf]) | |
399 | GCC_CHECK_MATH_FUNC([sin]) | |
400 | GCC_CHECK_MATH_FUNC([sinl]) | |
401 | GCC_CHECK_MATH_FUNC([csinf]) | |
402 | GCC_CHECK_MATH_FUNC([csin]) | |
403 | GCC_CHECK_MATH_FUNC([csinl]) | |
404 | GCC_CHECK_MATH_FUNC([sinhf]) | |
405 | GCC_CHECK_MATH_FUNC([sinh]) | |
406 | GCC_CHECK_MATH_FUNC([sinhl]) | |
407 | GCC_CHECK_MATH_FUNC([csinhf]) | |
408 | GCC_CHECK_MATH_FUNC([csinh]) | |
409 | GCC_CHECK_MATH_FUNC([csinhl]) | |
410 | GCC_CHECK_MATH_FUNC([sqrtf]) | |
411 | GCC_CHECK_MATH_FUNC([sqrt]) | |
412 | GCC_CHECK_MATH_FUNC([sqrtl]) | |
413 | GCC_CHECK_MATH_FUNC([csqrtf]) | |
414 | GCC_CHECK_MATH_FUNC([csqrt]) | |
415 | GCC_CHECK_MATH_FUNC([csqrtl]) | |
416 | GCC_CHECK_MATH_FUNC([tanf]) | |
417 | GCC_CHECK_MATH_FUNC([tan]) | |
418 | GCC_CHECK_MATH_FUNC([tanl]) | |
419 | GCC_CHECK_MATH_FUNC([ctanf]) | |
420 | GCC_CHECK_MATH_FUNC([ctan]) | |
421 | GCC_CHECK_MATH_FUNC([ctanl]) | |
422 | GCC_CHECK_MATH_FUNC([tanhf]) | |
423 | GCC_CHECK_MATH_FUNC([tanh]) | |
424 | GCC_CHECK_MATH_FUNC([tanhl]) | |
425 | GCC_CHECK_MATH_FUNC([ctanhf]) | |
426 | GCC_CHECK_MATH_FUNC([ctanh]) | |
427 | GCC_CHECK_MATH_FUNC([ctanhl]) | |
428 | GCC_CHECK_MATH_FUNC([truncf]) | |
429 | GCC_CHECK_MATH_FUNC([trunc]) | |
430 | GCC_CHECK_MATH_FUNC([truncl]) | |
431 | GCC_CHECK_MATH_FUNC([erff]) | |
432 | GCC_CHECK_MATH_FUNC([erf]) | |
433 | GCC_CHECK_MATH_FUNC([erfl]) | |
434 | GCC_CHECK_MATH_FUNC([erfcf]) | |
435 | GCC_CHECK_MATH_FUNC([erfc]) | |
436 | GCC_CHECK_MATH_FUNC([erfcl]) | |
437 | GCC_CHECK_MATH_FUNC([j0f]) | |
438 | GCC_CHECK_MATH_FUNC([j0]) | |
439 | GCC_CHECK_MATH_FUNC([j0l]) | |
440 | GCC_CHECK_MATH_FUNC([j1f]) | |
441 | GCC_CHECK_MATH_FUNC([j1]) | |
442 | GCC_CHECK_MATH_FUNC([j1l]) | |
443 | GCC_CHECK_MATH_FUNC([jnf]) | |
444 | GCC_CHECK_MATH_FUNC([jn]) | |
445 | GCC_CHECK_MATH_FUNC([jnl]) | |
446 | GCC_CHECK_MATH_FUNC([y0f]) | |
447 | GCC_CHECK_MATH_FUNC([y0]) | |
448 | GCC_CHECK_MATH_FUNC([y0l]) | |
449 | GCC_CHECK_MATH_FUNC([y1f]) | |
450 | GCC_CHECK_MATH_FUNC([y1]) | |
451 | GCC_CHECK_MATH_FUNC([y1l]) | |
452 | GCC_CHECK_MATH_FUNC([ynf]) | |
453 | GCC_CHECK_MATH_FUNC([yn]) | |
454 | GCC_CHECK_MATH_FUNC([ynl]) | |
455 | GCC_CHECK_MATH_FUNC([tgamma]) | |
456 | GCC_CHECK_MATH_FUNC([tgammaf]) | |
457 | GCC_CHECK_MATH_FUNC([tgammal]) | |
458 | GCC_CHECK_MATH_FUNC([lgamma]) | |
459 | GCC_CHECK_MATH_FUNC([lgammaf]) | |
460 | GCC_CHECK_MATH_FUNC([lgammal]) | |
a2a2059f | 461 | |
db1cf15c | 462 | # Check for GFORTRAN_C99_1.1 funcs |
f38a14ca TG |
463 | GCC_CHECK_MATH_FUNC([cacos]) |
464 | GCC_CHECK_MATH_FUNC([cacosf]) | |
465 | GCC_CHECK_MATH_FUNC([cacosh]) | |
466 | GCC_CHECK_MATH_FUNC([cacoshf]) | |
467 | GCC_CHECK_MATH_FUNC([cacoshl]) | |
468 | GCC_CHECK_MATH_FUNC([cacosl]) | |
469 | GCC_CHECK_MATH_FUNC([casin]) | |
470 | GCC_CHECK_MATH_FUNC([casinf]) | |
471 | GCC_CHECK_MATH_FUNC([casinh]) | |
472 | GCC_CHECK_MATH_FUNC([casinhf]) | |
473 | GCC_CHECK_MATH_FUNC([casinhl]) | |
474 | GCC_CHECK_MATH_FUNC([casinl]) | |
475 | GCC_CHECK_MATH_FUNC([catan]) | |
476 | GCC_CHECK_MATH_FUNC([catanf]) | |
477 | GCC_CHECK_MATH_FUNC([catanh]) | |
478 | GCC_CHECK_MATH_FUNC([catanhf]) | |
479 | GCC_CHECK_MATH_FUNC([catanhl]) | |
480 | GCC_CHECK_MATH_FUNC([catanl]) | |
db1cf15c | 481 | |
e097b4f1 DE |
482 | # On AIX, clog is present in libm as __clog |
483 | AC_CHECK_LIB([m],[__clog],[AC_DEFINE([HAVE_CLOG],[1],[libm includes clog])]) | |
484 | ||
ad238e4f FXC |
485 | # Check whether the system has a working stat() |
486 | LIBGFOR_CHECK_WORKING_STAT | |
487 | ||
db8092dc FXC |
488 | # Check whether __mingw_snprintf() is present |
489 | LIBGFOR_CHECK_MINGW_SNPRINTF | |
490 | ||
87e6d9dc TB |
491 | # Check whether libquadmath should be used |
492 | AC_ARG_ENABLE(libquadmath-support, | |
493 | AS_HELP_STRING([--disable-libquadmath-support], | |
494 | [disable libquadmath support for Fortran]), | |
495 | ENABLE_LIBQUADMATH_SUPPORT=$enableval, | |
496 | ENABLE_LIBQUADMATH_SUPPORT=yes) | |
497 | enable_libquadmath_support= | |
498 | if test "${ENABLE_LIBQUADMATH_SUPPORT}" = "no" ; then | |
499 | enable_libquadmath_support=no | |
500 | fi | |
501 | ||
502 | # Check whether we have a __float128 type, depends on enable_libquadmath_support | |
1ec601bf FXC |
503 | LIBGFOR_CHECK_FLOAT128 |
504 | ||
944b8b35 FXC |
505 | # Check for GNU libc feenableexcept |
506 | AC_CHECK_LIB([m],[feenableexcept],[have_feenableexcept=yes AC_DEFINE([HAVE_FEENABLEEXCEPT],[1],[libm includes feenableexcept])]) | |
507 | ||
5c30094f | 508 | # At least for glibc, clock_gettime is in librt. But don't |
2aadeae2 JB |
509 | # pull that in if it still doesn't give us the function we want. This |
510 | # test is copied from libgomp, and modified to not link in -lrt as | |
511 | # libgfortran calls clock_gettime via a weak reference if it's found | |
512 | # in librt. | |
deb9dd74 | 513 | if test "$ac_cv_func_clock_gettime" = no; then |
b6e7a3d1 | 514 | AC_CHECK_LIB(rt, clock_gettime, |
2aadeae2 JB |
515 | [AC_DEFINE(HAVE_CLOCK_GETTIME_LIBRT, 1, |
516 | [Define to 1 if you have the `clock_gettime' function in librt.])]) | |
b6e7a3d1 JB |
517 | fi |
518 | ||
3b14f664 FXC |
519 | # Check for SysV fpsetmask |
520 | LIBGFOR_CHECK_FPSETMASK | |
7ae346c3 | 521 | AC_CHECK_TYPES([fp_except,fp_except_t], [], [], [[#include <ieeefp.h>]]) |
82a4f54c | 522 | AC_CHECK_TYPES([fp_rnd,fp_rnd_t], [], [], [[#include <ieeefp.h>]]) |
3b14f664 FXC |
523 | |
524 | # Check for AIX fp_trap and fp_enable | |
525 | AC_CHECK_FUNC([fp_trap],[have_fp_trap=yes AC_DEFINE([HAVE_FP_TRAP],[1],[fp_trap is present])]) | |
526 | AC_CHECK_FUNC([fp_enable],[have_fp_enable=yes AC_DEFINE([HAVE_FP_ENABLE],[1],[fp_enable is present])]) | |
527 | ||
944b8b35 FXC |
528 | # Runs configure.host to set up necessary host-dependent shell variables. |
529 | # We then display a message about it, and propagate them through the | |
530 | # build chain. | |
531 | . ${srcdir}/configure.host | |
532 | AC_MSG_NOTICE([FPU dependent file will be ${fpu_host}.h]) | |
533 | FPU_HOST_HEADER=config/${fpu_host}.h | |
534 | AC_SUBST(FPU_HOST_HEADER) | |
535 | ||
9fc77574 KK |
536 | # Some targets require additional compiler options for IEEE compatibility. |
537 | IEEE_FLAGS="${ieee_flags}" | |
538 | AC_SUBST(IEEE_FLAGS) | |
539 | ||
23e6d4a5 JB |
540 | |
541 | # Check for POSIX getpwuid_r | |
542 | # | |
543 | # There are two versions of getpwuid_r, the POSIX one with 5 | |
544 | # arguments, and another one with 4 arguments used by at least HP-UX | |
545 | # 10.2. | |
546 | if test "$ac_cv_func_getpwuid_r" = "yes"; then | |
547 | AC_CACHE_CHECK([POSIX version of getpwuid_r with 5 arguments], libgfor_cv_posix_getpwuid_r, [ | |
548 | AC_LINK_IFELSE([AC_LANG_PROGRAM([ | |
549 | #include <stdio.h> | |
550 | #include <sys/types.h> | |
551 | #include <pwd.h>], [ | |
552 | getpwuid_r(0, NULL, NULL, 0, NULL); | |
553 | ])], [libgfor_cv_posix_getpwuid_r="yes"], [libgfor_cv_posix_getpwuid_r="no"])]) | |
554 | fi | |
555 | if test "$libgfor_cv_posix_getpwuid_r" = "yes"; then | |
556 | AC_DEFINE([HAVE_POSIX_GETPWUID_R], [1], [Define to 1 if we have POSIX getpwuid_r which takes 5 arguments.]) | |
557 | fi | |
558 | ||
559 | ||
7d7b8bfe RH |
560 | # Check out attribute support. |
561 | LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY | |
562 | LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT | |
563 | LIBGFOR_CHECK_ATTRIBUTE_ALIAS | |
564 | ||
5e805e44 JJ |
565 | # Check out sync builtins support. |
566 | LIBGFOR_CHECK_SYNC_FETCH_AND_ADD | |
567 | ||
5e805e44 | 568 | # Check out #pragma weak. |
e669bd2b | 569 | LIBGFOR_GTHREAD_WEAK |
5e805e44 | 570 | |
10c682a0 FXC |
571 | # Various other checks on target |
572 | LIBGFOR_CHECK_UNLINK_OPEN_FILE | |
573 | ||
3c127520 FXC |
574 | # Check whether line terminator is LF or CRLF |
575 | LIBGFOR_CHECK_CRLF | |
576 | ||
1ff101ff JB |
577 | # Check whether we have _Unwind_GetIPInfo for backtrace |
578 | GCC_CHECK_UNWIND_GETIPINFO | |
579 | ||
96b8a615 AJ |
580 | AC_CACHE_SAVE |
581 | ||
582 | if test ${multilib} = yes; then | |
583 | multilib_arg="--enable-multilib" | |
584 | else | |
585 | multilib_arg= | |
586 | fi | |
587 | ||
1ec601bf FXC |
588 | # Write our Makefile and spec file. |
589 | AC_CONFIG_FILES([ | |
590 | Makefile | |
591 | libgfortran.spec | |
592 | ]) | |
96b8a615 | 593 | AC_OUTPUT |