]> git.ipfire.org Git - thirdparty/gcc.git/blob - libgfortran/configure.ac
Use -std=gnu11 instead of -std=gnu99 for libgfortran C code.
[thirdparty/gcc.git] / libgfortran / configure.ac
1 # Process this file with autoconf to produce a configure script, like so:
2 # aclocal && autoconf && autoheader && automake
3
4 AC_PREREQ(2.64)
5 AC_INIT([GNU Fortran Runtime Library], 0.3,,[libgfortran])
6 AC_CONFIG_HEADER(config.h)
7 GCC_TOPLEV_SUBDIRS
8
9 # -------
10 # Options
11 # -------
12
13 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
14 AC_ARG_ENABLE(version-specific-runtime-libs,
15 AS_HELP_STRING([--enable-version-specific-runtime-libs],
16 [specify that runtime libraries should be installed in a compiler-specific directory]),
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
25 # Build with intermodule optimisations
26 AC_MSG_CHECKING([for --enable-intermodule])
27 AC_ARG_ENABLE(intermodule,
28 AS_HELP_STRING([--enable-intermodule],[build the library in one step]),
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)
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
54 ACX_NONCANONICAL_TARGET
55
56 target_alias=${target_alias-$host_alias}
57 AC_SUBST(target_alias)
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.
61 # 1.9.6: minimum required version
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.
67 # no-dist: we don't want 'dist' and related rules.
68 # -Wall: turns on all automake warnings...
69 # -Wno-portability: ...except this one, since GNU make is required.
70 AM_INIT_AUTOMAKE([1.9.6 no-define foreign no-dist -Wall -Wno-portability])
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
88 AC_USE_SYSTEM_EXTENSIONS
89
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)'
98 toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
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
120 # Create a spec file, so that compile/link tests don't fail
121 test -f libgfortran.spec || touch libgfortran.spec
122
123 AC_LANG_C
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
133 m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
134
135 AC_SUBST(CFLAGS)
136
137 AM_PROG_CC_C_O
138
139 # Add -Wall -fno-repack-arrays -fno-underscoring if we are using GCC.
140 if test "x$GCC" = "xyes"; then
141 AM_FCFLAGS="-I . -Wall -Werror -fimplicit-none -fno-repack-arrays -fno-underscoring"
142 ## We like to use C11 and C99 routines when available. This makes
143 ## sure that
144 ## __STDC_VERSION__ is set such that libc includes make them available.
145 AM_CFLAGS="-std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings"
146 ## Compile the following tests with the same system header contents
147 ## that we'll encounter when compiling our own source files.
148 CFLAGS="-std=gnu11 $CFLAGS"
149 fi
150 AC_SUBST(AM_FCFLAGS)
151 AC_SUBST(AM_CFLAGS)
152 AC_SUBST(CFLAGS)
153
154 # Check for symbol versioning (copied from libssp).
155 AC_MSG_CHECKING([whether symbol versioning is supported])
156 AC_ARG_ENABLE(symvers,
157 AS_HELP_STRING([--disable-symvers],
158 [disable symbol versioning for libgfortran]),
159 gfortran_use_symver=$enableval,
160 gfortran_use_symver=yes)
161 if test "x$gfortran_use_symver" != xno; then
162 save_LDFLAGS="$LDFLAGS"
163 LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
164 cat > conftest.map <<EOF
165 FOO_1.0 {
166 global: *foo*; bar; local: *;
167 };
168 EOF
169 AC_LINK_IFELSE([AC_LANG_PROGRAM([[int foo;]],[[]])],[gfortran_use_symver=gnu],[gfortran_use_symver=no])
170 if test x$gfortran_use_symver = xno; then
171 case "$target_os" in
172 solaris2*)
173 LDFLAGS="$save_LDFLAGS"
174 LDFLAGS="$LDFLAGS -fPIC -shared -Wl,-M,./conftest.map"
175 # Sun ld cannot handle wildcards and treats all entries as undefined.
176 cat > conftest.map <<EOF
177 FOO_1.0 {
178 global: foo; local: *;
179 };
180 EOF
181 AC_LINK_IFELSE([AC_LANG_PROGRAM([[int foo;]],[[]])],[gfortran_use_symver=sun],[gfortran_use_symver=no])
182 ;;
183 esac
184 fi
185 LDFLAGS="$save_LDFLAGS"
186 fi
187 AC_MSG_RESULT($gfortran_use_symver)
188 AM_CONDITIONAL(LIBGFOR_USE_SYMVER, [test "x$gfortran_use_symver" != xno])
189 AM_CONDITIONAL(LIBGFOR_USE_SYMVER_GNU, [test "x$gfortran_use_symver" = xgnu])
190 AM_CONDITIONAL(LIBGFOR_USE_SYMVER_SUN, [test "x$gfortran_use_symver" = xsun])
191
192 # Figure out whether the compiler supports "-ffunction-sections -fdata-sections",
193 # similarly to how libstdc++ does it
194 ac_test_CFLAGS="${CFLAGS+set}"
195 ac_save_CFLAGS="$CFLAGS"
196
197 # Check for -ffunction-sections -fdata-sections
198 AC_MSG_CHECKING([for gcc that supports -ffunction-sections -fdata-sections])
199 CFLAGS='-Werror -ffunction-sections -fdata-sections'
200 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int foo;]])], [ac_fdsections=yes], [ac_fdsections=no])
201 if test "$ac_test_CFLAGS" = set; then
202 CFLAGS="$ac_save_CFLAGS"
203 else
204 # this is the suspicious part
205 CFLAGS=""
206 fi
207 if test x"$ac_fdsections" = x"yes"; then
208 SECTION_FLAGS='-ffunction-sections -fdata-sections'
209 fi
210 AC_MSG_RESULT($ac_fdsections)
211 AC_SUBST(SECTION_FLAGS)
212
213 # Find other programs we need.
214 AC_CHECK_TOOL(AS, as)
215 AC_CHECK_TOOL(AR, ar)
216 AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error)
217 AC_PROG_MAKE_SET
218 AC_PROG_INSTALL
219
220 # Configure libtool
221 #AC_MSG_NOTICE([====== Starting libtool configuration])
222 AC_LIBTOOL_DLOPEN
223 AM_PROG_LIBTOOL
224 ACX_LT_HOST_FLAGS
225 AC_SUBST(enable_shared)
226 AC_SUBST(enable_static)
227 #AC_MSG_NOTICE([====== Finished libtool configuration]) ; sleep 10
228
229 # We need gfortran to compile parts of the library
230 #AC_PROG_FC(gfortran)
231 FC="$GFORTRAN"
232 AC_PROG_FC(gfortran)
233
234 # extra LD Flags which are required for targets
235 case "${host}" in
236 *-darwin*)
237 # Darwin needs -single_module when linking libgfortran
238 extra_ldflags_libgfortran=-Wl,-single_module
239 ;;
240 esac
241 AC_SUBST(extra_ldflags_libgfortran)
242
243 # We need a working compiler at that point, otherwise give a clear
244 # error message and bail out.
245 LIBGFOR_WORKING_GFORTRAN
246
247 AC_SYS_LARGEFILE
248
249 # Types
250 AC_TYPE_OFF_T
251 AC_TYPE_INTPTR_T
252 AC_TYPE_UINTPTR_T
253 AC_CHECK_TYPES([ptrdiff_t])
254
255 # check header files (we assume C89 is available, so don't check for that)
256 AC_CHECK_HEADERS_ONCE(unistd.h sys/time.h sys/times.h sys/resource.h \
257 sys/types.h sys/stat.h sys/wait.h floatingpoint.h ieeefp.h fenv.h fptrap.h \
258 fpxcp.h pwd.h complex.h)
259
260 GCC_HEADER_STDINT(gstdint.h)
261
262 AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_blocks, struct stat.st_rdev])
263
264 # Check for library functions.
265 if test "x${with_newlib}" = "xyes"; then
266 # We are being configured with a cross compiler. AC_REPLACE_FUNCS
267 # may not work correctly, because the compiler may not be able to
268 # link executables.
269 AC_DEFINE(HAVE_MKSTEMP, 1, [Define if you have mkstemp.])
270 AC_DEFINE(HAVE_STRTOF, 1, [Define if you have strtof.])
271 AC_DEFINE(HAVE_SNPRINTF, 1, [Define if you have snprintf.])
272 AC_DEFINE(HAVE_STRCASESTR, 1, [Define if you have strcasestr.])
273 AC_DEFINE(HAVE_VSNPRINTF, 1, [Define if you have vsnprintf.])
274 AC_DEFINE(HAVE_LOCALTIME_R, 1, [Define if you have localtime_r.])
275 AC_DEFINE(HAVE_GMTIME_R, 1, [Define if you have gmtime_r.])
276
277 # At some point, we should differentiate between architectures
278 # like x86, which have long double versions, and alpha/powerpc/etc.,
279 # which don't. For the time being, punt.
280 if test x"long_double_math_on_this_cpu" = x"yes"; then
281 AC_DEFINE(HAVE_STRTOLD, 1, [Define if you have strtold.])
282 fi
283 else
284 AC_CHECK_FUNCS_ONCE(getrusage times mkstemp strtof strtold snprintf \
285 ftruncate chsize chdir getlogin gethostname kill link symlink sleep ttyname \
286 alarm access fork execl wait setmode execve pipe dup2 close fcntl \
287 strcasestr getrlimit gettimeofday stat fstat lstat getpwuid vsnprintf dup \
288 getcwd localtime_r gmtime_r getpwuid_r ttyname_r clock_gettime \
289 readlink getgid getpid getppid getuid geteuid umask getegid \
290 secure_getenv __secure_getenv mkostemp)
291 fi
292
293 # Check strerror_r, cannot be above as versions with two and three arguments exist
294 LIBGFOR_CHECK_STRERROR_R
295
296 # Check for C99 (and other IEEE) math functions
297 GCC_CHECK_MATH_FUNC([acosf])
298 GCC_CHECK_MATH_FUNC([acos])
299 GCC_CHECK_MATH_FUNC([acosl])
300 GCC_CHECK_MATH_FUNC([acoshf])
301 GCC_CHECK_MATH_FUNC([acosh])
302 GCC_CHECK_MATH_FUNC([acoshl])
303 GCC_CHECK_MATH_FUNC([asinf])
304 GCC_CHECK_MATH_FUNC([asin])
305 GCC_CHECK_MATH_FUNC([asinl])
306 GCC_CHECK_MATH_FUNC([asinhf])
307 GCC_CHECK_MATH_FUNC([asinh])
308 GCC_CHECK_MATH_FUNC([asinhl])
309 GCC_CHECK_MATH_FUNC([atan2f])
310 GCC_CHECK_MATH_FUNC([atan2])
311 GCC_CHECK_MATH_FUNC([atan2l])
312 GCC_CHECK_MATH_FUNC([atanf])
313 GCC_CHECK_MATH_FUNC([atan])
314 GCC_CHECK_MATH_FUNC([atanl])
315 GCC_CHECK_MATH_FUNC([atanhf])
316 GCC_CHECK_MATH_FUNC([atanh])
317 GCC_CHECK_MATH_FUNC([atanhl])
318 GCC_CHECK_MATH_FUNC([cargf])
319 GCC_CHECK_MATH_FUNC([carg])
320 GCC_CHECK_MATH_FUNC([cargl])
321 GCC_CHECK_MATH_FUNC([ceilf])
322 GCC_CHECK_MATH_FUNC([ceil])
323 GCC_CHECK_MATH_FUNC([ceill])
324 GCC_CHECK_MATH_FUNC([copysignf])
325 GCC_CHECK_MATH_FUNC([copysign])
326 GCC_CHECK_MATH_FUNC([copysignl])
327 GCC_CHECK_MATH_FUNC([cosf])
328 GCC_CHECK_MATH_FUNC([cos])
329 GCC_CHECK_MATH_FUNC([cosl])
330 GCC_CHECK_MATH_FUNC([ccosf])
331 GCC_CHECK_MATH_FUNC([ccos])
332 GCC_CHECK_MATH_FUNC([ccosl])
333 GCC_CHECK_MATH_FUNC([coshf])
334 GCC_CHECK_MATH_FUNC([cosh])
335 GCC_CHECK_MATH_FUNC([coshl])
336 GCC_CHECK_MATH_FUNC([ccoshf])
337 GCC_CHECK_MATH_FUNC([ccosh])
338 GCC_CHECK_MATH_FUNC([ccoshl])
339 GCC_CHECK_MATH_FUNC([expf])
340 GCC_CHECK_MATH_FUNC([exp])
341 GCC_CHECK_MATH_FUNC([expl])
342 GCC_CHECK_MATH_FUNC([cexpf])
343 GCC_CHECK_MATH_FUNC([cexp])
344 GCC_CHECK_MATH_FUNC([cexpl])
345 GCC_CHECK_MATH_FUNC([fabsf])
346 GCC_CHECK_MATH_FUNC([fabs])
347 GCC_CHECK_MATH_FUNC([fabsl])
348 GCC_CHECK_MATH_FUNC([cabsf])
349 GCC_CHECK_MATH_FUNC([cabs])
350 GCC_CHECK_MATH_FUNC([cabsl])
351 GCC_CHECK_MATH_FUNC([floorf])
352 GCC_CHECK_MATH_FUNC([floor])
353 GCC_CHECK_MATH_FUNC([floorl])
354 GCC_CHECK_MATH_FUNC([fmodf])
355 GCC_CHECK_MATH_FUNC([fmod])
356 GCC_CHECK_MATH_FUNC([fmodl])
357 GCC_CHECK_MATH_FUNC([frexpf])
358 GCC_CHECK_MATH_FUNC([frexp])
359 GCC_CHECK_MATH_FUNC([frexpl])
360 GCC_CHECK_MATH_FUNC([hypotf])
361 GCC_CHECK_MATH_FUNC([hypot])
362 GCC_CHECK_MATH_FUNC([hypotl])
363 GCC_CHECK_MATH_FUNC([ldexpf])
364 GCC_CHECK_MATH_FUNC([ldexp])
365 GCC_CHECK_MATH_FUNC([ldexpl])
366 GCC_CHECK_MATH_FUNC([logf])
367 GCC_CHECK_MATH_FUNC([log])
368 GCC_CHECK_MATH_FUNC([logl])
369 GCC_CHECK_MATH_FUNC([clogf])
370 GCC_CHECK_MATH_FUNC([clog])
371 GCC_CHECK_MATH_FUNC([clogl])
372 GCC_CHECK_MATH_FUNC([log10f])
373 GCC_CHECK_MATH_FUNC([log10])
374 GCC_CHECK_MATH_FUNC([log10l])
375 GCC_CHECK_MATH_FUNC([clog10f])
376 GCC_CHECK_MATH_FUNC([clog10])
377 GCC_CHECK_MATH_FUNC([clog10l])
378 GCC_CHECK_MATH_FUNC([nextafterf])
379 GCC_CHECK_MATH_FUNC([nextafter])
380 GCC_CHECK_MATH_FUNC([nextafterl])
381 GCC_CHECK_MATH_FUNC([powf])
382 GCC_CHECK_MATH_FUNC([pow])
383 GCC_CHECK_MATH_FUNC([powl])
384 GCC_CHECK_MATH_FUNC([cpowf])
385 GCC_CHECK_MATH_FUNC([cpow])
386 GCC_CHECK_MATH_FUNC([cpowl])
387 GCC_CHECK_MATH_FUNC([roundf])
388 GCC_CHECK_MATH_FUNC([round])
389 GCC_CHECK_MATH_FUNC([roundl])
390 GCC_CHECK_MATH_FUNC([lroundf])
391 GCC_CHECK_MATH_FUNC([lround])
392 GCC_CHECK_MATH_FUNC([lroundl])
393 GCC_CHECK_MATH_FUNC([llroundf])
394 GCC_CHECK_MATH_FUNC([llround])
395 GCC_CHECK_MATH_FUNC([llroundl])
396 GCC_CHECK_MATH_FUNC([scalbnf])
397 GCC_CHECK_MATH_FUNC([scalbn])
398 GCC_CHECK_MATH_FUNC([scalbnl])
399 GCC_CHECK_MATH_FUNC([sinf])
400 GCC_CHECK_MATH_FUNC([sin])
401 GCC_CHECK_MATH_FUNC([sinl])
402 GCC_CHECK_MATH_FUNC([csinf])
403 GCC_CHECK_MATH_FUNC([csin])
404 GCC_CHECK_MATH_FUNC([csinl])
405 GCC_CHECK_MATH_FUNC([sinhf])
406 GCC_CHECK_MATH_FUNC([sinh])
407 GCC_CHECK_MATH_FUNC([sinhl])
408 GCC_CHECK_MATH_FUNC([csinhf])
409 GCC_CHECK_MATH_FUNC([csinh])
410 GCC_CHECK_MATH_FUNC([csinhl])
411 GCC_CHECK_MATH_FUNC([sqrtf])
412 GCC_CHECK_MATH_FUNC([sqrt])
413 GCC_CHECK_MATH_FUNC([sqrtl])
414 GCC_CHECK_MATH_FUNC([csqrtf])
415 GCC_CHECK_MATH_FUNC([csqrt])
416 GCC_CHECK_MATH_FUNC([csqrtl])
417 GCC_CHECK_MATH_FUNC([tanf])
418 GCC_CHECK_MATH_FUNC([tan])
419 GCC_CHECK_MATH_FUNC([tanl])
420 GCC_CHECK_MATH_FUNC([ctanf])
421 GCC_CHECK_MATH_FUNC([ctan])
422 GCC_CHECK_MATH_FUNC([ctanl])
423 GCC_CHECK_MATH_FUNC([tanhf])
424 GCC_CHECK_MATH_FUNC([tanh])
425 GCC_CHECK_MATH_FUNC([tanhl])
426 GCC_CHECK_MATH_FUNC([ctanhf])
427 GCC_CHECK_MATH_FUNC([ctanh])
428 GCC_CHECK_MATH_FUNC([ctanhl])
429 GCC_CHECK_MATH_FUNC([truncf])
430 GCC_CHECK_MATH_FUNC([trunc])
431 GCC_CHECK_MATH_FUNC([truncl])
432 GCC_CHECK_MATH_FUNC([erff])
433 GCC_CHECK_MATH_FUNC([erf])
434 GCC_CHECK_MATH_FUNC([erfl])
435 GCC_CHECK_MATH_FUNC([erfcf])
436 GCC_CHECK_MATH_FUNC([erfc])
437 GCC_CHECK_MATH_FUNC([erfcl])
438 GCC_CHECK_MATH_FUNC([j0f])
439 GCC_CHECK_MATH_FUNC([j0])
440 GCC_CHECK_MATH_FUNC([j0l])
441 GCC_CHECK_MATH_FUNC([j1f])
442 GCC_CHECK_MATH_FUNC([j1])
443 GCC_CHECK_MATH_FUNC([j1l])
444 GCC_CHECK_MATH_FUNC([jnf])
445 GCC_CHECK_MATH_FUNC([jn])
446 GCC_CHECK_MATH_FUNC([jnl])
447 GCC_CHECK_MATH_FUNC([y0f])
448 GCC_CHECK_MATH_FUNC([y0])
449 GCC_CHECK_MATH_FUNC([y0l])
450 GCC_CHECK_MATH_FUNC([y1f])
451 GCC_CHECK_MATH_FUNC([y1])
452 GCC_CHECK_MATH_FUNC([y1l])
453 GCC_CHECK_MATH_FUNC([ynf])
454 GCC_CHECK_MATH_FUNC([yn])
455 GCC_CHECK_MATH_FUNC([ynl])
456 GCC_CHECK_MATH_FUNC([tgamma])
457 GCC_CHECK_MATH_FUNC([tgammaf])
458 GCC_CHECK_MATH_FUNC([tgammal])
459 GCC_CHECK_MATH_FUNC([lgamma])
460 GCC_CHECK_MATH_FUNC([lgammaf])
461 GCC_CHECK_MATH_FUNC([lgammal])
462
463 # Check for GFORTRAN_C99_1.1 funcs
464 GCC_CHECK_MATH_FUNC([cacos])
465 GCC_CHECK_MATH_FUNC([cacosf])
466 GCC_CHECK_MATH_FUNC([cacosh])
467 GCC_CHECK_MATH_FUNC([cacoshf])
468 GCC_CHECK_MATH_FUNC([cacoshl])
469 GCC_CHECK_MATH_FUNC([cacosl])
470 GCC_CHECK_MATH_FUNC([casin])
471 GCC_CHECK_MATH_FUNC([casinf])
472 GCC_CHECK_MATH_FUNC([casinh])
473 GCC_CHECK_MATH_FUNC([casinhf])
474 GCC_CHECK_MATH_FUNC([casinhl])
475 GCC_CHECK_MATH_FUNC([casinl])
476 GCC_CHECK_MATH_FUNC([catan])
477 GCC_CHECK_MATH_FUNC([catanf])
478 GCC_CHECK_MATH_FUNC([catanh])
479 GCC_CHECK_MATH_FUNC([catanhf])
480 GCC_CHECK_MATH_FUNC([catanhl])
481 GCC_CHECK_MATH_FUNC([catanl])
482
483 # On AIX, clog is present in libm as __clog
484 AC_CHECK_LIB([m],[__clog],[AC_DEFINE([HAVE_CLOG],[1],[libm includes clog])])
485
486 # Check whether the system has a working stat()
487 LIBGFOR_CHECK_WORKING_STAT
488
489 # Check whether __mingw_snprintf() is present
490 LIBGFOR_CHECK_MINGW_SNPRINTF
491
492 # Check whether libquadmath should be used
493 AC_ARG_ENABLE(libquadmath-support,
494 AS_HELP_STRING([--disable-libquadmath-support],
495 [disable libquadmath support for Fortran]),
496 ENABLE_LIBQUADMATH_SUPPORT=$enableval,
497 ENABLE_LIBQUADMATH_SUPPORT=yes)
498 enable_libquadmath_support=
499 if test "${ENABLE_LIBQUADMATH_SUPPORT}" = "no" ; then
500 enable_libquadmath_support=no
501 fi
502
503 # Check whether we have a __float128 type, depends on enable_libquadmath_support
504 LIBGFOR_CHECK_FLOAT128
505
506 # Check for GNU libc feenableexcept
507 AC_CHECK_LIB([m],[feenableexcept],[have_feenableexcept=yes AC_DEFINE([HAVE_FEENABLEEXCEPT],[1],[libm includes feenableexcept])])
508
509 # At least for glibc, clock_gettime is in librt. But don't
510 # pull that in if it still doesn't give us the function we want. This
511 # test is copied from libgomp, and modified to not link in -lrt as
512 # libgfortran calls clock_gettime via a weak reference if it's found
513 # in librt.
514 if test "$ac_cv_func_clock_gettime" = no; then
515 AC_CHECK_LIB(rt, clock_gettime,
516 [AC_DEFINE(HAVE_CLOCK_GETTIME_LIBRT, 1,
517 [Define to 1 if you have the `clock_gettime' function in librt.])])
518 fi
519
520 # Check for SysV fpsetmask
521 LIBGFOR_CHECK_FPSETMASK
522 AC_CHECK_TYPES([fp_except,fp_except_t], [], [], [[#include <ieeefp.h>]])
523 AC_CHECK_TYPES([fp_rnd,fp_rnd_t], [], [], [[#include <ieeefp.h>]])
524
525 # Check for AIX fp_trap and fp_enable
526 AC_CHECK_FUNC([fp_trap],[have_fp_trap=yes AC_DEFINE([HAVE_FP_TRAP],[1],[fp_trap is present])])
527 AC_CHECK_FUNC([fp_enable],[have_fp_enable=yes AC_DEFINE([HAVE_FP_ENABLE],[1],[fp_enable is present])])
528
529 # Runs configure.host to set up necessary host-dependent shell variables.
530 # We then display a message about it, and propagate them through the
531 # build chain.
532 . ${srcdir}/configure.host
533 AC_MSG_NOTICE([FPU dependent file will be ${fpu_host}.h])
534 FPU_HOST_HEADER=config/${fpu_host}.h
535 AC_SUBST(FPU_HOST_HEADER)
536
537 # Some targets require additional compiler options for IEEE compatibility.
538 IEEE_FLAGS="${ieee_flags}"
539 AC_SUBST(IEEE_FLAGS)
540
541
542 # Check for POSIX getpwuid_r
543 #
544 # There are two versions of getpwuid_r, the POSIX one with 5
545 # arguments, and another one with 4 arguments used by at least HP-UX
546 # 10.2.
547 if test "$ac_cv_func_getpwuid_r" = "yes"; then
548 AC_CACHE_CHECK([POSIX version of getpwuid_r with 5 arguments], libgfor_cv_posix_getpwuid_r, [
549 AC_LINK_IFELSE([AC_LANG_PROGRAM([
550 #include <stdio.h>
551 #include <sys/types.h>
552 #include <pwd.h>], [
553 getpwuid_r(0, NULL, NULL, 0, NULL);
554 ])], [libgfor_cv_posix_getpwuid_r="yes"], [libgfor_cv_posix_getpwuid_r="no"])])
555 fi
556 if test "$libgfor_cv_posix_getpwuid_r" = "yes"; then
557 AC_DEFINE([HAVE_POSIX_GETPWUID_R], [1], [Define to 1 if we have POSIX getpwuid_r which takes 5 arguments.])
558 fi
559
560
561 # Check out attribute support.
562 LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY
563 LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT
564 LIBGFOR_CHECK_ATTRIBUTE_ALIAS
565
566 # Check out sync builtins support.
567 LIBGFOR_CHECK_SYNC_FETCH_AND_ADD
568
569 # Check out #pragma weak.
570 LIBGFOR_GTHREAD_WEAK
571
572 # Various other checks on target
573 LIBGFOR_CHECK_UNLINK_OPEN_FILE
574
575 # Check whether line terminator is LF or CRLF
576 LIBGFOR_CHECK_CRLF
577
578 # Check whether we have _Unwind_GetIPInfo for backtrace
579 GCC_CHECK_UNWIND_GETIPINFO
580
581 AC_CACHE_SAVE
582
583 if test ${multilib} = yes; then
584 multilib_arg="--enable-multilib"
585 else
586 multilib_arg=
587 fi
588
589 # Write our Makefile and spec file.
590 AC_CONFIG_FILES([
591 Makefile
592 libgfortran.spec
593 ])
594 AC_OUTPUT