1 # Process this file with autoconf to produce a configure script, like so:
2 # aclocal && autoconf && autoheader && automake
5 AC_INIT([GNU Fortran Runtime Library], 0.3,,[libgfortran])
6 AC_CONFIG_HEADER(config.h)
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]),
18 yes) version_specific_libs=yes ;;
19 no) version_specific_libs=no ;;
20 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
22 [version_specific_libs=no])
23 AC_MSG_RESULT($version_specific_libs)
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";;
34 AC_MSG_RESULT($enable_intermodule)
35 AM_CONDITIONAL(onestep,[test x$onestep = x-onestep])
38 # Gets build, host, target, *_vendor, *_cpu, *_os, etc.
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/.
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. :-)
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.
51 # Do not delete or change the following two lines. For why, see
52 # http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
54 ACX_NONCANONICAL_TARGET
56 target_alias=${target_alias-$host_alias}
57 AC_SUBST(target_alias)
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])
73 AM_ENABLE_MULTILIB(, ..)
75 # Handy for debugging:
76 #AC_MSG_NOTICE($build / $host / $target / $host_alias / $target_alias); sleep 5
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
85 LIBGFOR_IS_NATIVE=true
88 AC_USE_SYSTEM_EXTENSIONS
90 # Calculate toolexeclibdir
91 # Also toolexecdir, though it's only used in toolexeclibdir
92 case ${version_specific_libs} in
94 # Need the gcc compiler version to know where to install libraries
95 # and header files if --enable-version-specific-runtime-libs option
97 toolexecdir='$(libdir)/gcc/$(target_alias)'
98 toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
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'
107 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
108 toolexeclibdir='$(libdir)'
110 multi_os_directory=`$CC -print-multi-os-directory`
111 case $multi_os_directory in
112 .) ;; # Avoid trailing /.
113 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
117 AC_SUBST(toolexecdir)
118 AC_SUBST(toolexeclibdir)
120 # Create a spec file, so that compile/link tests don't fail
121 test -f libgfortran.spec || touch libgfortran.spec
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.
130 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
131 m4_define([_AC_ARG_VAR_PRECIOUS],[])
133 m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
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 C99 routines when available. This makes sure that
143 ## __STDC_VERSION__ is set such that libc includes make them available.
144 AM_CFLAGS="-std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings"
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"
153 # Check for symbol versioning (copied from libssp).
154 AC_MSG_CHECKING([whether symbol versioning is supported])
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)
160 if test "x$gfortran_use_symver" = xyes; then
161 save_LDFLAGS="$LDFLAGS"
162 LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
163 cat > conftest.map <<EOF
165 global: *foo*; bar; local: *;
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
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
177 global: foo; local: *;
180 AC_LINK_IFELSE([AC_LANG_PROGRAM([[int foo;]],[[]])],[gfortran_use_symver=sun],[gfortran_use_symver=no])
184 LDFLAGS="$save_LDFLAGS"
186 AC_MSG_RESULT($gfortran_use_symver)
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])
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"
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'
199 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int foo;]])], [ac_fdsections=yes], [ac_fdsections=no])
200 if test "$ac_test_CFLAGS" = set; then
201 CFLAGS="$ac_save_CFLAGS"
203 # this is the suspicious part
206 if test x"$ac_fdsections" = x"yes"; then
207 SECTION_FLAGS='-ffunction-sections -fdata-sections'
209 AC_MSG_RESULT($ac_fdsections)
210 AC_SUBST(SECTION_FLAGS)
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)
220 #AC_MSG_NOTICE([====== Starting libtool configuration])
224 AC_SUBST(enable_shared)
225 AC_SUBST(enable_static)
226 #AC_MSG_NOTICE([====== Finished libtool configuration]) ; sleep 10
228 # We need gfortran to compile parts of the library
229 #AC_PROG_FC(gfortran)
233 # extra LD Flags which are required for targets
236 # Darwin needs -single_module when linking libgfortran
237 extra_ldflags_libgfortran=-Wl,-single_module
240 AC_SUBST(extra_ldflags_libgfortran)
242 # We need a working compiler at that point, otherwise give a clear
243 # error message and bail out.
244 LIBGFOR_WORKING_GFORTRAN
252 AC_CHECK_TYPES([ptrdiff_t])
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 \
259 GCC_HEADER_STDINT(gstdint.h)
261 AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_blocks, struct stat.st_rdev])
263 # Check for library functions.
264 AC_CHECK_FUNCS_ONCE(getrusage times mkstemp strtof strtold snprintf \
265 ftruncate chsize chdir getlogin gethostname kill link symlink sleep ttyname \
266 alarm access fork execl wait setmode execve pipe dup2 close \
267 strcasestr getrlimit gettimeofday stat fstat lstat getpwuid vsnprintf dup \
268 getcwd localtime_r gmtime_r strerror_r getpwuid_r ttyname_r clock_gettime \
269 readlink getgid getpid getppid getuid geteuid umask)
271 # Check for C99 (and other IEEE) math functions
272 GCC_CHECK_MATH_FUNC([acosf],[AC_DEFINE([HAVE_ACOSF],[1],[acosf is available])])
273 GCC_CHECK_MATH_FUNC([acos],[AC_DEFINE([HAVE_ACOS],[1],[acos is available])])
274 GCC_CHECK_MATH_FUNC([acosl],[AC_DEFINE([HAVE_ACOSL],[1],[acosl is available])])
275 GCC_CHECK_MATH_FUNC([acoshf],[AC_DEFINE([HAVE_ACOSHF],[1],[acoshf is available])])
276 GCC_CHECK_MATH_FUNC([acosh],[AC_DEFINE([HAVE_ACOSH],[1],[acosh is available])])
277 GCC_CHECK_MATH_FUNC([acoshl],[AC_DEFINE([HAVE_ACOSHL],[1],[acoshl is available])])
278 GCC_CHECK_MATH_FUNC([asinf],[AC_DEFINE([HAVE_ASINF],[1],[asinf is available])])
279 GCC_CHECK_MATH_FUNC([asin],[AC_DEFINE([HAVE_ASIN],[1],[asin is available])])
280 GCC_CHECK_MATH_FUNC([asinl],[AC_DEFINE([HAVE_ASINL],[1],[asinl is available])])
281 GCC_CHECK_MATH_FUNC([asinhf],[AC_DEFINE([HAVE_ASINHF],[1],[asinhf is available])])
282 GCC_CHECK_MATH_FUNC([asinh],[AC_DEFINE([HAVE_ASINH],[1],[asinh is available])])
283 GCC_CHECK_MATH_FUNC([asinhl],[AC_DEFINE([HAVE_ASINHL],[1],[asinhl is available])])
284 GCC_CHECK_MATH_FUNC([atan2f],[AC_DEFINE([HAVE_ATAN2F],[1],[atan2f is available])])
285 GCC_CHECK_MATH_FUNC([atan2],[AC_DEFINE([HAVE_ATAN2],[1],[atan2 is available])])
286 GCC_CHECK_MATH_FUNC([atan2l],[AC_DEFINE([HAVE_ATAN2L],[1],[atan2l is available])])
287 GCC_CHECK_MATH_FUNC([atanf],[AC_DEFINE([HAVE_ATANF],[1],[atanf is available])])
288 GCC_CHECK_MATH_FUNC([atan],[AC_DEFINE([HAVE_ATAN],[1],[atan is available])])
289 GCC_CHECK_MATH_FUNC([atanl],[AC_DEFINE([HAVE_ATANL],[1],[atanl is available])])
290 GCC_CHECK_MATH_FUNC([atanhf],[AC_DEFINE([HAVE_ATANHF],[1],[atanhf is available])])
291 GCC_CHECK_MATH_FUNC([atanh],[AC_DEFINE([HAVE_ATANH],[1],[atanh is available])])
292 GCC_CHECK_MATH_FUNC([atanhl],[AC_DEFINE([HAVE_ATANHL],[1],[atanhl is available])])
293 GCC_CHECK_MATH_FUNC([cargf],[AC_DEFINE([HAVE_CARGF],[1],[cargf is available])])
294 GCC_CHECK_MATH_FUNC([carg],[AC_DEFINE([HAVE_CARG],[1],[carg is available])])
295 GCC_CHECK_MATH_FUNC([cargl],[AC_DEFINE([HAVE_CARGL],[1],[cargl is available])])
296 GCC_CHECK_MATH_FUNC([ceilf],[AC_DEFINE([HAVE_CEILF],[1],[ceilf is available])])
297 GCC_CHECK_MATH_FUNC([ceil],[AC_DEFINE([HAVE_CEIL],[1],[ceil is available])])
298 GCC_CHECK_MATH_FUNC([ceill],[AC_DEFINE([HAVE_CEILL],[1],[ceill is available])])
299 GCC_CHECK_MATH_FUNC([copysignf],[AC_DEFINE([HAVE_COPYSIGNF],[1],[copysignf is available])])
300 GCC_CHECK_MATH_FUNC([copysign],[AC_DEFINE([HAVE_COPYSIGN],[1],[copysign is available])])
301 GCC_CHECK_MATH_FUNC([copysignl],[AC_DEFINE([HAVE_COPYSIGNL],[1],[copysignl is available])])
302 GCC_CHECK_MATH_FUNC([cosf],[AC_DEFINE([HAVE_COSF],[1],[cosf is available])])
303 GCC_CHECK_MATH_FUNC([cos],[AC_DEFINE([HAVE_COS],[1],[cos is available])])
304 GCC_CHECK_MATH_FUNC([cosl],[AC_DEFINE([HAVE_COSL],[1],[cosl is available])])
305 GCC_CHECK_MATH_FUNC([ccosf],[AC_DEFINE([HAVE_CCOSF],[1],[ccosf is available])])
306 GCC_CHECK_MATH_FUNC([ccos],[AC_DEFINE([HAVE_CCOS],[1],[ccos is available])])
307 GCC_CHECK_MATH_FUNC([ccosl],[AC_DEFINE([HAVE_CCOSL],[1],[ccosl is available])])
308 GCC_CHECK_MATH_FUNC([coshf],[AC_DEFINE([HAVE_COSHF],[1],[coshf is available])])
309 GCC_CHECK_MATH_FUNC([cosh],[AC_DEFINE([HAVE_COSH],[1],[cosh is available])])
310 GCC_CHECK_MATH_FUNC([coshl],[AC_DEFINE([HAVE_COSHL],[1],[coshl is available])])
311 GCC_CHECK_MATH_FUNC([ccoshf],[AC_DEFINE([HAVE_CCOSHF],[1],[ccoshf is available])])
312 GCC_CHECK_MATH_FUNC([ccosh],[AC_DEFINE([HAVE_CCOSH],[1],[ccosh is available])])
313 GCC_CHECK_MATH_FUNC([ccoshl],[AC_DEFINE([HAVE_CCOSHL],[1],[ccoshl is available])])
314 GCC_CHECK_MATH_FUNC([expf],[AC_DEFINE([HAVE_EXPF],[1],[expf is available])])
315 GCC_CHECK_MATH_FUNC([exp],[AC_DEFINE([HAVE_EXP],[1],[exp is available])])
316 GCC_CHECK_MATH_FUNC([expl],[AC_DEFINE([HAVE_EXPL],[1],[expl is available])])
317 GCC_CHECK_MATH_FUNC([cexpf],[AC_DEFINE([HAVE_CEXPF],[1],[cexpf is available])])
318 GCC_CHECK_MATH_FUNC([cexp],[AC_DEFINE([HAVE_CEXP],[1],[cexp is available])])
319 GCC_CHECK_MATH_FUNC([cexpl],[AC_DEFINE([HAVE_CEXPL],[1],[cexpl is available])])
320 GCC_CHECK_MATH_FUNC([fabsf],[AC_DEFINE([HAVE_FABSF],[1],[fabsf is available])])
321 GCC_CHECK_MATH_FUNC([fabs],[AC_DEFINE([HAVE_FABS],[1],[fabs is available])])
322 GCC_CHECK_MATH_FUNC([fabsl],[AC_DEFINE([HAVE_FABSL],[1],[fabsl is available])])
323 GCC_CHECK_MATH_FUNC([cabsf],[AC_DEFINE([HAVE_CABSF],[1],[cabsf is available])])
324 GCC_CHECK_MATH_FUNC([cabs],[AC_DEFINE([HAVE_CABS],[1],[cabs is available])])
325 GCC_CHECK_MATH_FUNC([cabsl],[AC_DEFINE([HAVE_CABSL],[1],[cabsl is available])])
326 GCC_CHECK_MATH_FUNC([floorf],[AC_DEFINE([HAVE_FLOORF],[1],[floorf is available])])
327 GCC_CHECK_MATH_FUNC([floor],[AC_DEFINE([HAVE_FLOOR],[1],[floor is available])])
328 GCC_CHECK_MATH_FUNC([floorl],[AC_DEFINE([HAVE_FLOORL],[1],[floorl is available])])
329 GCC_CHECK_MATH_FUNC([fmodf],[AC_DEFINE([HAVE_FMODF],[1],[fmodf is available])])
330 GCC_CHECK_MATH_FUNC([fmod],[AC_DEFINE([HAVE_FMOD],[1],[fmod is available])])
331 GCC_CHECK_MATH_FUNC([fmodl],[AC_DEFINE([HAVE_FMODL],[1],[fmodl is available])])
332 GCC_CHECK_MATH_FUNC([frexpf],[AC_DEFINE([HAVE_FREXPF],[1],[frexpf is available])])
333 GCC_CHECK_MATH_FUNC([frexp],[AC_DEFINE([HAVE_FREXP],[1],[frexp is available])])
334 GCC_CHECK_MATH_FUNC([frexpl],[AC_DEFINE([HAVE_FREXPL],[1],[frexpl is available])])
335 GCC_CHECK_MATH_FUNC([hypotf],[AC_DEFINE([HAVE_HYPOTF],[1],[hypotf is available])])
336 GCC_CHECK_MATH_FUNC([hypot],[AC_DEFINE([HAVE_HYPOT],[1],[hypot is available])])
337 GCC_CHECK_MATH_FUNC([hypotl],[AC_DEFINE([HAVE_HYPOTL],[1],[hypotl is available])])
338 GCC_CHECK_MATH_FUNC([ldexpf],[AC_DEFINE([HAVE_LDEXPF],[1],[ldexpf is available])])
339 GCC_CHECK_MATH_FUNC([ldexp],[AC_DEFINE([HAVE_LDEXP],[1],[ldexp is available])])
340 GCC_CHECK_MATH_FUNC([ldexpl],[AC_DEFINE([HAVE_LDEXPL],[1],[ldexpl is available])])
341 GCC_CHECK_MATH_FUNC([logf],[AC_DEFINE([HAVE_LOGF],[1],[logf is available])])
342 GCC_CHECK_MATH_FUNC([log],[AC_DEFINE([HAVE_LOG],[1],[log is available])])
343 GCC_CHECK_MATH_FUNC([logl],[AC_DEFINE([HAVE_LOGL],[1],[logl is available])])
344 GCC_CHECK_MATH_FUNC([clogf],[AC_DEFINE([HAVE_CLOGF],[1],[clogf is available])])
345 GCC_CHECK_MATH_FUNC([clog],[AC_DEFINE([HAVE_CLOG],[1],[clog is available])])
346 GCC_CHECK_MATH_FUNC([clogl],[AC_DEFINE([HAVE_CLOGL],[1],[clogl is available])])
347 GCC_CHECK_MATH_FUNC([log10f],[AC_DEFINE([HAVE_LOG10F],[1],[log10f is available])])
348 GCC_CHECK_MATH_FUNC([log10],[AC_DEFINE([HAVE_LOG10],[1],[log10 is available])])
349 GCC_CHECK_MATH_FUNC([log10l],[AC_DEFINE([HAVE_LOG10L],[1],[log10l is available])])
350 GCC_CHECK_MATH_FUNC([clog10f],[AC_DEFINE([HAVE_CLOG10F],[1],[clog10f is available])])
351 GCC_CHECK_MATH_FUNC([clog10],[AC_DEFINE([HAVE_CLOG10],[1],[clog10 is available])])
352 GCC_CHECK_MATH_FUNC([clog10l],[AC_DEFINE([HAVE_CLOG10L],[1],[clog10l is available])])
353 GCC_CHECK_MATH_FUNC([nextafterf],[AC_DEFINE([HAVE_NEXTAFTERF],[1],[nextafterf is available])])
354 GCC_CHECK_MATH_FUNC([nextafter],[AC_DEFINE([HAVE_NEXTAFTER],[1],[nextafter is available])])
355 GCC_CHECK_MATH_FUNC([nextafterl],[AC_DEFINE([HAVE_NEXTAFTERL],[1],[nextafterl is available])])
356 GCC_CHECK_MATH_FUNC([powf],[AC_DEFINE([HAVE_POWF],[1],[powf is available])])
357 GCC_CHECK_MATH_FUNC([pow],[AC_DEFINE([HAVE_POW],[1],[pow is available])])
358 GCC_CHECK_MATH_FUNC([powl],[AC_DEFINE([HAVE_POWL],[1],[powl is available])])
359 GCC_CHECK_MATH_FUNC([cpowf],[AC_DEFINE([HAVE_CPOWF],[1],[cpowf is available])])
360 GCC_CHECK_MATH_FUNC([cpow],[AC_DEFINE([HAVE_CPOW],[1],[cpow is available])])
361 GCC_CHECK_MATH_FUNC([cpowl],[AC_DEFINE([HAVE_CPOWL],[1],[cpowl is available])])
362 GCC_CHECK_MATH_FUNC([roundf],[AC_DEFINE([HAVE_ROUNDF],[1],[roundf is available])])
363 GCC_CHECK_MATH_FUNC([round],[AC_DEFINE([HAVE_ROUND],[1],[round is available])])
364 GCC_CHECK_MATH_FUNC([roundl],[AC_DEFINE([HAVE_ROUNDL],[1],[roundl is available])])
365 GCC_CHECK_MATH_FUNC([lroundf],[AC_DEFINE([HAVE_LROUNDF],[1],[lroundf is available])])
366 GCC_CHECK_MATH_FUNC([lround],[AC_DEFINE([HAVE_LROUND],[1],[lround is available])])
367 GCC_CHECK_MATH_FUNC([lroundl],[AC_DEFINE([HAVE_LROUNDL],[1],[lroundl is available])])
368 GCC_CHECK_MATH_FUNC([llroundf],[AC_DEFINE([HAVE_LLROUNDF],[1],[llroundf is available])])
369 GCC_CHECK_MATH_FUNC([llround],[AC_DEFINE([HAVE_LLROUND],[1],[llround is available])])
370 GCC_CHECK_MATH_FUNC([llroundl],[AC_DEFINE([HAVE_LLROUNDL],[1],[llroundl is available])])
371 GCC_CHECK_MATH_FUNC([scalbnf],[AC_DEFINE([HAVE_SCALBNF],[1],[scalbnf is available])])
372 GCC_CHECK_MATH_FUNC([scalbn],[AC_DEFINE([HAVE_SCALBN],[1],[scalbn is available])])
373 GCC_CHECK_MATH_FUNC([scalbnl],[AC_DEFINE([HAVE_SCALBNL],[1],[scalbnl is available])])
374 GCC_CHECK_MATH_FUNC([sinf],[AC_DEFINE([HAVE_SINF],[1],[sinf is available])])
375 GCC_CHECK_MATH_FUNC([sin],[AC_DEFINE([HAVE_SIN],[1],[sin is available])])
376 GCC_CHECK_MATH_FUNC([sinl],[AC_DEFINE([HAVE_SINL],[1],[sinl is available])])
377 GCC_CHECK_MATH_FUNC([csinf],[AC_DEFINE([HAVE_CSINF],[1],[csinf is available])])
378 GCC_CHECK_MATH_FUNC([csin],[AC_DEFINE([HAVE_CSIN],[1],[csin is available])])
379 GCC_CHECK_MATH_FUNC([csinl],[AC_DEFINE([HAVE_CSINL],[1],[csinl is available])])
380 GCC_CHECK_MATH_FUNC([sinhf],[AC_DEFINE([HAVE_SINHF],[1],[sinhf is available])])
381 GCC_CHECK_MATH_FUNC([sinh],[AC_DEFINE([HAVE_SINH],[1],[sinh is available])])
382 GCC_CHECK_MATH_FUNC([sinhl],[AC_DEFINE([HAVE_SINHL],[1],[sinhl is available])])
383 GCC_CHECK_MATH_FUNC([csinhf],[AC_DEFINE([HAVE_CSINHF],[1],[csinhf is available])])
384 GCC_CHECK_MATH_FUNC([csinh],[AC_DEFINE([HAVE_CSINH],[1],[csinh is available])])
385 GCC_CHECK_MATH_FUNC([csinhl],[AC_DEFINE([HAVE_CSINHL],[1],[csinhl is available])])
386 GCC_CHECK_MATH_FUNC([sqrtf],[AC_DEFINE([HAVE_SQRTF],[1],[sqrtf is available])])
387 GCC_CHECK_MATH_FUNC([sqrt],[AC_DEFINE([HAVE_SQRT],[1],[sqrt is available])])
388 GCC_CHECK_MATH_FUNC([sqrtl],[AC_DEFINE([HAVE_SQRTL],[1],[sqrtl is available])])
389 GCC_CHECK_MATH_FUNC([csqrtf],[AC_DEFINE([HAVE_CSQRTF],[1],[csqrtf is available])])
390 GCC_CHECK_MATH_FUNC([csqrt],[AC_DEFINE([HAVE_CSQRT],[1],[csqrt is available])])
391 GCC_CHECK_MATH_FUNC([csqrtl],[AC_DEFINE([HAVE_CSQRTL],[1],[csqrtl is available])])
392 GCC_CHECK_MATH_FUNC([tanf],[AC_DEFINE([HAVE_TANF],[1],[tanf is available])])
393 GCC_CHECK_MATH_FUNC([tan],[AC_DEFINE([HAVE_TAN],[1],[tan is available])])
394 GCC_CHECK_MATH_FUNC([tanl],[AC_DEFINE([HAVE_TANL],[1],[tanl is available])])
395 GCC_CHECK_MATH_FUNC([ctanf],[AC_DEFINE([HAVE_CTANF],[1],[ctanf is available])])
396 GCC_CHECK_MATH_FUNC([ctan],[AC_DEFINE([HAVE_CTAN],[1],[ctan is available])])
397 GCC_CHECK_MATH_FUNC([ctanl],[AC_DEFINE([HAVE_CTANL],[1],[ctanl is available])])
398 GCC_CHECK_MATH_FUNC([tanhf],[AC_DEFINE([HAVE_TANHF],[1],[tanhf is available])])
399 GCC_CHECK_MATH_FUNC([tanh],[AC_DEFINE([HAVE_TANH],[1],[tanh is available])])
400 GCC_CHECK_MATH_FUNC([tanhl],[AC_DEFINE([HAVE_TANHL],[1],[tanhl is available])])
401 GCC_CHECK_MATH_FUNC([ctanhf],[AC_DEFINE([HAVE_CTANHF],[1],[ctanhf is available])])
402 GCC_CHECK_MATH_FUNC([ctanh],[AC_DEFINE([HAVE_CTANH],[1],[ctanh is available])])
403 GCC_CHECK_MATH_FUNC([ctanhl],[AC_DEFINE([HAVE_CTANHL],[1],[ctanhl is available])])
404 GCC_CHECK_MATH_FUNC([truncf],[AC_DEFINE([HAVE_TRUNCF],[1],[truncf is available])])
405 GCC_CHECK_MATH_FUNC([trunc],[AC_DEFINE([HAVE_TRUNC],[1],[trunc is available])])
406 GCC_CHECK_MATH_FUNC([truncl],[AC_DEFINE([HAVE_TRUNCL],[1],[truncl is available])])
407 GCC_CHECK_MATH_FUNC([erff],[AC_DEFINE([HAVE_ERFF],[1],[erff is available])])
408 GCC_CHECK_MATH_FUNC([erf],[AC_DEFINE([HAVE_ERF],[1],[erf is available])])
409 GCC_CHECK_MATH_FUNC([erfl],[AC_DEFINE([HAVE_ERFL],[1],[erfl is available])])
410 GCC_CHECK_MATH_FUNC([erfcf],[AC_DEFINE([HAVE_ERFCF],[1],[erfcf is available])])
411 GCC_CHECK_MATH_FUNC([erfc],[AC_DEFINE([HAVE_ERFC],[1],[erfc is available])])
412 GCC_CHECK_MATH_FUNC([erfcl],[AC_DEFINE([HAVE_ERFCL],[1],[erfcl is available])])
413 GCC_CHECK_MATH_FUNC([j0f],[AC_DEFINE([HAVE_J0F],[1],[j0f is available])])
414 GCC_CHECK_MATH_FUNC([j0],[AC_DEFINE([HAVE_J0],[1],[j0 is available])])
415 GCC_CHECK_MATH_FUNC([j0l],[AC_DEFINE([HAVE_J0L],[1],[j0l is available])])
416 GCC_CHECK_MATH_FUNC([j1f],[AC_DEFINE([HAVE_J1F],[1],[j1f is available])])
417 GCC_CHECK_MATH_FUNC([j1],[AC_DEFINE([HAVE_J1],[1],[j1 is available])])
418 GCC_CHECK_MATH_FUNC([j1l],[AC_DEFINE([HAVE_J1L],[1],[j1l is available])])
419 GCC_CHECK_MATH_FUNC([jnf],[AC_DEFINE([HAVE_JNF],[1],[jnf is available])])
420 GCC_CHECK_MATH_FUNC([jn],[AC_DEFINE([HAVE_JN],[1],[jn is available])])
421 GCC_CHECK_MATH_FUNC([jnl],[AC_DEFINE([HAVE_JNL],[1],[jnl is available])])
422 GCC_CHECK_MATH_FUNC([y0f],[AC_DEFINE([HAVE_Y0F],[1],[y0f is available])])
423 GCC_CHECK_MATH_FUNC([y0],[AC_DEFINE([HAVE_Y0],[1],[y0 is available])])
424 GCC_CHECK_MATH_FUNC([y0l],[AC_DEFINE([HAVE_Y0L],[1],[y0l is available])])
425 GCC_CHECK_MATH_FUNC([y1f],[AC_DEFINE([HAVE_Y1F],[1],[y1f is available])])
426 GCC_CHECK_MATH_FUNC([y1],[AC_DEFINE([HAVE_Y1],[1],[y1 is available])])
427 GCC_CHECK_MATH_FUNC([y1l],[AC_DEFINE([HAVE_Y1L],[1],[y1l is available])])
428 GCC_CHECK_MATH_FUNC([ynf],[AC_DEFINE([HAVE_YNF],[1],[ynf is available])])
429 GCC_CHECK_MATH_FUNC([yn],[AC_DEFINE([HAVE_YN],[1],[yn is available])])
430 GCC_CHECK_MATH_FUNC([ynl],[AC_DEFINE([HAVE_YNL],[1],[ynl is available])])
431 GCC_CHECK_MATH_FUNC([tgamma],[AC_DEFINE([HAVE_TGAMMA],[1],[tgamma is available])])
432 GCC_CHECK_MATH_FUNC([tgammaf],[AC_DEFINE([HAVE_TGAMMAF],[1],[tgammaf is available])])
433 GCC_CHECK_MATH_FUNC([tgammal],[AC_DEFINE([HAVE_TGAMMAL],[1],[tgammal is available])])
434 GCC_CHECK_MATH_FUNC([lgamma],[AC_DEFINE([HAVE_LGAMMA],[1],[lgamma is available])])
435 GCC_CHECK_MATH_FUNC([lgammaf],[AC_DEFINE([HAVE_LGAMMAF],[1],[lgammaf is available])])
436 GCC_CHECK_MATH_FUNC([lgammal],[AC_DEFINE([HAVE_LGAMMAL],[1],[lgammal is available])])
438 # Check for GFORTRAN_C99_1.1 funcs
439 GCC_CHECK_MATH_FUNC([cacos],[AC_DEFINE([HAVE_CACOS],[1],[cacos is available])])
440 GCC_CHECK_MATH_FUNC([cacosf],[AC_DEFINE([HAVE_CACOSF],[1],[cacosf is available])])
441 GCC_CHECK_MATH_FUNC([cacosh],[AC_DEFINE([HAVE_CACOSH],[1],[cacosh is available])])
442 GCC_CHECK_MATH_FUNC([cacoshf],[AC_DEFINE([HAVE_CACOSHF],[1],[cacoshf is available])])
443 GCC_CHECK_MATH_FUNC([cacoshl],[AC_DEFINE([HAVE_CACOSHL],[1],[cacoshl is available])])
444 GCC_CHECK_MATH_FUNC([cacosl],[AC_DEFINE([HAVE_CACOSL],[1],[cacosl is available])])
445 GCC_CHECK_MATH_FUNC([casin],[AC_DEFINE([HAVE_CASIN],[1],[casin is available])])
446 GCC_CHECK_MATH_FUNC([casinf],[AC_DEFINE([HAVE_CASINF],[1],[casinf is available])])
447 GCC_CHECK_MATH_FUNC([casinh],[AC_DEFINE([HAVE_CASINH],[1],[casinh is available])])
448 GCC_CHECK_MATH_FUNC([casinhf],[AC_DEFINE([HAVE_CASINHF],[1],[casinhf is available])])
449 GCC_CHECK_MATH_FUNC([casinhl],[AC_DEFINE([HAVE_CASINHL],[1],[casinhl is available])])
450 GCC_CHECK_MATH_FUNC([casinl],[AC_DEFINE([HAVE_CASINL],[1],[casinl is available])])
451 GCC_CHECK_MATH_FUNC([catan],[AC_DEFINE([HAVE_CATAN],[1],[catan is available])])
452 GCC_CHECK_MATH_FUNC([catanf],[AC_DEFINE([HAVE_CATANF],[1],[catanf is available])])
453 GCC_CHECK_MATH_FUNC([catanh],[AC_DEFINE([HAVE_CATANH],[1],[catanh is available])])
454 GCC_CHECK_MATH_FUNC([catanhf],[AC_DEFINE([HAVE_CATANHF],[1],[catanhf is available])])
455 GCC_CHECK_MATH_FUNC([catanhl],[AC_DEFINE([HAVE_CATANHL],[1],[catanhl is available])])
456 GCC_CHECK_MATH_FUNC([catanl],[AC_DEFINE([HAVE_CATANL],[1],[catanl is available])])
458 # On AIX, clog is present in libm as __clog
459 AC_CHECK_LIB([m],[__clog],[AC_DEFINE([HAVE_CLOG],[1],[libm includes clog])])
461 # Check whether the system has a working stat()
462 LIBGFOR_CHECK_WORKING_STAT
464 # Check whether __mingw_snprintf() is present
465 LIBGFOR_CHECK_MINGW_SNPRINTF
467 # Check for a broken powf implementation
468 LIBGFOR_CHECK_FOR_BROKEN_POWF
470 # Check whether libquadmath should be used
471 AC_ARG_ENABLE(libquadmath-support,
472 AS_HELP_STRING([--disable-libquadmath-support],
473 [disable libquadmath support for Fortran]),
474 ENABLE_LIBQUADMATH_SUPPORT=$enableval,
475 ENABLE_LIBQUADMATH_SUPPORT=yes)
476 enable_libquadmath_support=
477 if test "${ENABLE_LIBQUADMATH_SUPPORT}" = "no" ; then
478 enable_libquadmath_support=no
481 # Check whether we have a __float128 type, depends on enable_libquadmath_support
482 LIBGFOR_CHECK_FLOAT128
484 # Check for GNU libc feenableexcept
485 AC_CHECK_LIB([m],[feenableexcept],[have_feenableexcept=yes AC_DEFINE([HAVE_FEENABLEEXCEPT],[1],[libm includes feenableexcept])])
487 # At least for glibc, clock_gettime is in librt. But don't
488 # pull that in if it still doesn't give us the function we want. This
489 # test is copied from libgomp, and modified to not link in -lrt as
490 # libgfortran calls clock_gettime via a weak reference if it's found
492 if test $ac_cv_func_clock_gettime = no; then
493 AC_CHECK_LIB(rt, clock_gettime,
494 [AC_DEFINE(HAVE_CLOCK_GETTIME_LIBRT, 1,
495 [Define to 1 if you have the `clock_gettime' function in librt.])])
498 # Check for SysV fpsetmask
499 LIBGFOR_CHECK_FPSETMASK
501 # Check for AIX fp_trap and fp_enable
502 AC_CHECK_FUNC([fp_trap],[have_fp_trap=yes AC_DEFINE([HAVE_FP_TRAP],[1],[fp_trap is present])])
503 AC_CHECK_FUNC([fp_enable],[have_fp_enable=yes AC_DEFINE([HAVE_FP_ENABLE],[1],[fp_enable is present])])
505 # Runs configure.host to set up necessary host-dependent shell variables.
506 # We then display a message about it, and propagate them through the
508 . ${srcdir}/configure.host
509 AC_MSG_NOTICE([FPU dependent file will be ${fpu_host}.h])
510 FPU_HOST_HEADER=config/${fpu_host}.h
511 AC_SUBST(FPU_HOST_HEADER)
513 # Some targets require additional compiler options for IEEE compatibility.
514 IEEE_FLAGS="${ieee_flags}"
518 # Check for POSIX getpwuid_r
520 # There are two versions of getpwuid_r, the POSIX one with 5
521 # arguments, and another one with 4 arguments used by at least HP-UX
523 if test "$ac_cv_func_getpwuid_r" = "yes"; then
524 AC_CACHE_CHECK([POSIX version of getpwuid_r with 5 arguments], libgfor_cv_posix_getpwuid_r, [
525 AC_LINK_IFELSE([AC_LANG_PROGRAM([
527 #include <sys/types.h>
529 getpwuid_r(0, NULL, NULL, 0, NULL);
530 ])], [libgfor_cv_posix_getpwuid_r="yes"], [libgfor_cv_posix_getpwuid_r="no"])])
532 if test "$libgfor_cv_posix_getpwuid_r" = "yes"; then
533 AC_DEFINE([HAVE_POSIX_GETPWUID_R], [1], [Define to 1 if we have POSIX getpwuid_r which takes 5 arguments.])
537 # Check out attribute support.
538 LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY
539 LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT
540 LIBGFOR_CHECK_ATTRIBUTE_ALIAS
542 # Check out sync builtins support.
543 LIBGFOR_CHECK_SYNC_FETCH_AND_ADD
545 # Check out #pragma weak.
548 # Various other checks on target
549 LIBGFOR_CHECK_UNLINK_OPEN_FILE
551 # Check whether line terminator is LF or CRLF
554 # Check whether we have _Unwind_GetIPInfo for backtrace
555 GCC_CHECK_UNWIND_GETIPINFO
559 if test ${multilib} = yes; then
560 multilib_arg="--enable-multilib"
565 # Write our Makefile and spec file.