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 fdopen \
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)
271 # Check for C99 (and other IEEE) math functions
272 AC_CHECK_LIB([m],[acosf],[AC_DEFINE([HAVE_ACOSF],[1],[libm includes acosf])])
273 AC_CHECK_LIB([m],[acos],[AC_DEFINE([HAVE_ACOS],[1],[libm includes acos])])
274 AC_CHECK_LIB([m],[acosl],[AC_DEFINE([HAVE_ACOSL],[1],[libm includes acosl])])
275 AC_CHECK_LIB([m],[acoshf],[AC_DEFINE([HAVE_ACOSHF],[1],[libm includes acoshf])])
276 AC_CHECK_LIB([m],[acosh],[AC_DEFINE([HAVE_ACOSH],[1],[libm includes acosh])])
277 AC_CHECK_LIB([m],[acoshl],[AC_DEFINE([HAVE_ACOSHL],[1],[libm includes acoshl])])
278 AC_CHECK_LIB([m],[asinf],[AC_DEFINE([HAVE_ASINF],[1],[libm includes asinf])])
279 AC_CHECK_LIB([m],[asin],[AC_DEFINE([HAVE_ASIN],[1],[libm includes asin])])
280 AC_CHECK_LIB([m],[asinl],[AC_DEFINE([HAVE_ASINL],[1],[libm includes asinl])])
281 AC_CHECK_LIB([m],[asinhf],[AC_DEFINE([HAVE_ASINHF],[1],[libm includes asinhf])])
282 AC_CHECK_LIB([m],[asinh],[AC_DEFINE([HAVE_ASINH],[1],[libm includes asinh])])
283 AC_CHECK_LIB([m],[asinhl],[AC_DEFINE([HAVE_ASINHL],[1],[libm includes asinhl])])
284 AC_CHECK_LIB([m],[atan2f],[AC_DEFINE([HAVE_ATAN2F],[1],[libm includes atan2f])])
285 AC_CHECK_LIB([m],[atan2],[AC_DEFINE([HAVE_ATAN2],[1],[libm includes atan2])])
286 AC_CHECK_LIB([m],[atan2l],[AC_DEFINE([HAVE_ATAN2L],[1],[libm includes atan2l])])
287 AC_CHECK_LIB([m],[atanf],[AC_DEFINE([HAVE_ATANF],[1],[libm includes atanf])])
288 AC_CHECK_LIB([m],[atan],[AC_DEFINE([HAVE_ATAN],[1],[libm includes atan])])
289 AC_CHECK_LIB([m],[atanl],[AC_DEFINE([HAVE_ATANL],[1],[libm includes atanl])])
290 AC_CHECK_LIB([m],[atanhf],[AC_DEFINE([HAVE_ATANHF],[1],[libm includes atanhf])])
291 AC_CHECK_LIB([m],[atanh],[AC_DEFINE([HAVE_ATANH],[1],[libm includes atanh])])
292 AC_CHECK_LIB([m],[atanhl],[AC_DEFINE([HAVE_ATANHL],[1],[libm includes atanhl])])
293 AC_CHECK_LIB([m],[cargf],[AC_DEFINE([HAVE_CARGF],[1],[libm includes cargf])])
294 AC_CHECK_LIB([m],[carg],[AC_DEFINE([HAVE_CARG],[1],[libm includes carg])])
295 AC_CHECK_LIB([m],[cargl],[AC_DEFINE([HAVE_CARGL],[1],[libm includes cargl])])
296 AC_CHECK_LIB([m],[ceilf],[AC_DEFINE([HAVE_CEILF],[1],[libm includes ceilf])])
297 AC_CHECK_LIB([m],[ceil],[AC_DEFINE([HAVE_CEIL],[1],[libm includes ceil])])
298 AC_CHECK_LIB([m],[ceill],[AC_DEFINE([HAVE_CEILL],[1],[libm includes ceill])])
299 AC_CHECK_LIB([m],[copysignf],[AC_DEFINE([HAVE_COPYSIGNF],[1],[libm includes copysignf])])
300 AC_CHECK_LIB([m],[copysign],[AC_DEFINE([HAVE_COPYSIGN],[1],[libm includes copysign])])
301 AC_CHECK_LIB([m],[copysignl],[AC_DEFINE([HAVE_COPYSIGNL],[1],[libm includes copysignl])])
302 AC_CHECK_LIB([m],[cosf],[AC_DEFINE([HAVE_COSF],[1],[libm includes cosf])])
303 AC_CHECK_LIB([m],[cos],[AC_DEFINE([HAVE_COS],[1],[libm includes cos])])
304 AC_CHECK_LIB([m],[cosl],[AC_DEFINE([HAVE_COSL],[1],[libm includes cosl])])
305 AC_CHECK_LIB([m],[ccosf],[AC_DEFINE([HAVE_CCOSF],[1],[libm includes ccosf])])
306 AC_CHECK_LIB([m],[ccos],[AC_DEFINE([HAVE_CCOS],[1],[libm includes ccos])])
307 AC_CHECK_LIB([m],[ccosl],[AC_DEFINE([HAVE_CCOSL],[1],[libm includes ccosl])])
308 AC_CHECK_LIB([m],[coshf],[AC_DEFINE([HAVE_COSHF],[1],[libm includes coshf])])
309 AC_CHECK_LIB([m],[cosh],[AC_DEFINE([HAVE_COSH],[1],[libm includes cosh])])
310 AC_CHECK_LIB([m],[coshl],[AC_DEFINE([HAVE_COSHL],[1],[libm includes coshl])])
311 AC_CHECK_LIB([m],[ccoshf],[AC_DEFINE([HAVE_CCOSHF],[1],[libm includes ccoshf])])
312 AC_CHECK_LIB([m],[ccosh],[AC_DEFINE([HAVE_CCOSH],[1],[libm includes ccosh])])
313 AC_CHECK_LIB([m],[ccoshl],[AC_DEFINE([HAVE_CCOSHL],[1],[libm includes ccoshl])])
314 AC_CHECK_LIB([m],[expf],[AC_DEFINE([HAVE_EXPF],[1],[libm includes expf])])
315 AC_CHECK_LIB([m],[exp],[AC_DEFINE([HAVE_EXP],[1],[libm includes exp])])
316 AC_CHECK_LIB([m],[expl],[AC_DEFINE([HAVE_EXPL],[1],[libm includes expl])])
317 AC_CHECK_LIB([m],[cexpf],[AC_DEFINE([HAVE_CEXPF],[1],[libm includes cexpf])])
318 AC_CHECK_LIB([m],[cexp],[AC_DEFINE([HAVE_CEXP],[1],[libm includes cexp])])
319 AC_CHECK_LIB([m],[cexpl],[AC_DEFINE([HAVE_CEXPL],[1],[libm includes cexpl])])
320 AC_CHECK_LIB([m],[fabsf],[AC_DEFINE([HAVE_FABSF],[1],[libm includes fabsf])])
321 AC_CHECK_LIB([m],[fabs],[AC_DEFINE([HAVE_FABS],[1],[libm includes fabs])])
322 AC_CHECK_LIB([m],[fabsl],[AC_DEFINE([HAVE_FABSL],[1],[libm includes fabsl])])
323 AC_CHECK_LIB([m],[cabsf],[AC_DEFINE([HAVE_CABSF],[1],[libm includes cabsf])])
324 AC_CHECK_LIB([m],[cabs],[AC_DEFINE([HAVE_CABS],[1],[libm includes cabs])])
325 AC_CHECK_LIB([m],[cabsl],[AC_DEFINE([HAVE_CABSL],[1],[libm includes cabsl])])
326 AC_CHECK_LIB([m],[floorf],[AC_DEFINE([HAVE_FLOORF],[1],[libm includes floorf])])
327 AC_CHECK_LIB([m],[floor],[AC_DEFINE([HAVE_FLOOR],[1],[libm includes floor])])
328 AC_CHECK_LIB([m],[floorl],[AC_DEFINE([HAVE_FLOORL],[1],[libm includes floorl])])
329 AC_CHECK_LIB([m],[fmodf],[AC_DEFINE([HAVE_FMODF],[1],[libm includes fmodf])])
330 AC_CHECK_LIB([m],[fmod],[AC_DEFINE([HAVE_FMOD],[1],[libm includes fmod])])
331 AC_CHECK_LIB([m],[fmodl],[AC_DEFINE([HAVE_FMODL],[1],[libm includes fmodl])])
332 AC_CHECK_LIB([m],[frexpf],[AC_DEFINE([HAVE_FREXPF],[1],[libm includes frexpf])])
333 AC_CHECK_LIB([m],[frexp],[AC_DEFINE([HAVE_FREXP],[1],[libm includes frexp])])
334 AC_CHECK_LIB([m],[frexpl],[AC_DEFINE([HAVE_FREXPL],[1],[libm includes frexpl])])
335 AC_CHECK_LIB([m],[hypotf],[AC_DEFINE([HAVE_HYPOTF],[1],[libm includes hypotf])])
336 AC_CHECK_LIB([m],[hypot],[AC_DEFINE([HAVE_HYPOT],[1],[libm includes hypot])])
337 AC_CHECK_LIB([m],[hypotl],[AC_DEFINE([HAVE_HYPOTL],[1],[libm includes hypotl])])
338 AC_CHECK_LIB([m],[ldexpf],[AC_DEFINE([HAVE_LDEXPF],[1],[libm includes ldexpf])])
339 AC_CHECK_LIB([m],[ldexp],[AC_DEFINE([HAVE_LDEXP],[1],[libm includes ldexp])])
340 AC_CHECK_LIB([m],[ldexpl],[AC_DEFINE([HAVE_LDEXPL],[1],[libm includes ldexpl])])
341 AC_CHECK_LIB([m],[logf],[AC_DEFINE([HAVE_LOGF],[1],[libm includes logf])])
342 AC_CHECK_LIB([m],[log],[AC_DEFINE([HAVE_LOG],[1],[libm includes log])])
343 AC_CHECK_LIB([m],[logl],[AC_DEFINE([HAVE_LOGL],[1],[libm includes logl])])
344 AC_CHECK_LIB([m],[clogf],[AC_DEFINE([HAVE_CLOGF],[1],[libm includes clogf])])
345 AC_CHECK_LIB([m],[clog],[AC_DEFINE([HAVE_CLOG],[1],[libm includes clog])])
346 AC_CHECK_LIB([m],[clogl],[AC_DEFINE([HAVE_CLOGL],[1],[libm includes clogl])])
347 AC_CHECK_LIB([m],[log10f],[AC_DEFINE([HAVE_LOG10F],[1],[libm includes log10f])])
348 AC_CHECK_LIB([m],[log10],[AC_DEFINE([HAVE_LOG10],[1],[libm includes log10])])
349 AC_CHECK_LIB([m],[log10l],[AC_DEFINE([HAVE_LOG10L],[1],[libm includes log10l])])
350 AC_CHECK_LIB([m],[clog10f],[AC_DEFINE([HAVE_CLOG10F],[1],[libm includes clog10f])])
351 AC_CHECK_LIB([m],[clog10],[AC_DEFINE([HAVE_CLOG10],[1],[libm includes clog10])])
352 AC_CHECK_LIB([m],[clog10l],[AC_DEFINE([HAVE_CLOG10L],[1],[libm includes clog10l])])
353 AC_CHECK_LIB([m],[nextafterf],[AC_DEFINE([HAVE_NEXTAFTERF],[1],[libm includes nextafterf])])
354 AC_CHECK_LIB([m],[nextafter],[AC_DEFINE([HAVE_NEXTAFTER],[1],[libm includes nextafter])])
355 AC_CHECK_LIB([m],[nextafterl],[AC_DEFINE([HAVE_NEXTAFTERL],[1],[libm includes nextafterl])])
356 AC_CHECK_LIB([m],[powf],[AC_DEFINE([HAVE_POWF],[1],[libm includes powf])])
357 AC_CHECK_LIB([m],[pow],[AC_DEFINE([HAVE_POW],[1],[libm includes pow])])
358 AC_CHECK_LIB([m],[powl],[AC_DEFINE([HAVE_POWL],[1],[libm includes powl])])
359 AC_CHECK_LIB([m],[cpowf],[AC_DEFINE([HAVE_CPOWF],[1],[libm includes cpowf])])
360 AC_CHECK_LIB([m],[cpow],[AC_DEFINE([HAVE_CPOW],[1],[libm includes cpow])])
361 AC_CHECK_LIB([m],[cpowl],[AC_DEFINE([HAVE_CPOWL],[1],[libm includes cpowl])])
362 AC_CHECK_LIB([m],[roundf],[AC_DEFINE([HAVE_ROUNDF],[1],[libm includes roundf])])
363 AC_CHECK_LIB([m],[round],[AC_DEFINE([HAVE_ROUND],[1],[libm includes round])])
364 AC_CHECK_LIB([m],[roundl],[AC_DEFINE([HAVE_ROUNDL],[1],[libm includes roundl])])
365 AC_CHECK_LIB([m],[lroundf],[AC_DEFINE([HAVE_LROUNDF],[1],[libm includes lroundf])])
366 AC_CHECK_LIB([m],[lround],[AC_DEFINE([HAVE_LROUND],[1],[libm includes lround])])
367 AC_CHECK_LIB([m],[lroundl],[AC_DEFINE([HAVE_LROUNDL],[1],[libm includes lroundl])])
368 AC_CHECK_LIB([m],[llroundf],[AC_DEFINE([HAVE_LLROUNDF],[1],[libm includes llroundf])])
369 AC_CHECK_LIB([m],[llround],[AC_DEFINE([HAVE_LLROUND],[1],[libm includes llround])])
370 AC_CHECK_LIB([m],[llroundl],[AC_DEFINE([HAVE_LLROUNDL],[1],[libm includes llroundl])])
371 AC_CHECK_LIB([m],[scalbnf],[AC_DEFINE([HAVE_SCALBNF],[1],[libm includes scalbnf])])
372 AC_CHECK_LIB([m],[scalbn],[AC_DEFINE([HAVE_SCALBN],[1],[libm includes scalbn])])
373 AC_CHECK_LIB([m],[scalbnl],[AC_DEFINE([HAVE_SCALBNL],[1],[libm includes scalbnl])])
374 AC_CHECK_LIB([m],[sinf],[AC_DEFINE([HAVE_SINF],[1],[libm includes sinf])])
375 AC_CHECK_LIB([m],[sin],[AC_DEFINE([HAVE_SIN],[1],[libm includes sin])])
376 AC_CHECK_LIB([m],[sinl],[AC_DEFINE([HAVE_SINL],[1],[libm includes sinl])])
377 AC_CHECK_LIB([m],[csinf],[AC_DEFINE([HAVE_CSINF],[1],[libm includes csinf])])
378 AC_CHECK_LIB([m],[csin],[AC_DEFINE([HAVE_CSIN],[1],[libm includes csin])])
379 AC_CHECK_LIB([m],[csinl],[AC_DEFINE([HAVE_CSINL],[1],[libm includes csinl])])
380 AC_CHECK_LIB([m],[sinhf],[AC_DEFINE([HAVE_SINHF],[1],[libm includes sinhf])])
381 AC_CHECK_LIB([m],[sinh],[AC_DEFINE([HAVE_SINH],[1],[libm includes sinh])])
382 AC_CHECK_LIB([m],[sinhl],[AC_DEFINE([HAVE_SINHL],[1],[libm includes sinhl])])
383 AC_CHECK_LIB([m],[csinhf],[AC_DEFINE([HAVE_CSINHF],[1],[libm includes csinhf])])
384 AC_CHECK_LIB([m],[csinh],[AC_DEFINE([HAVE_CSINH],[1],[libm includes csinh])])
385 AC_CHECK_LIB([m],[csinhl],[AC_DEFINE([HAVE_CSINHL],[1],[libm includes csinhl])])
386 AC_CHECK_LIB([m],[sqrtf],[AC_DEFINE([HAVE_SQRTF],[1],[libm includes sqrtf])])
387 AC_CHECK_LIB([m],[sqrt],[AC_DEFINE([HAVE_SQRT],[1],[libm includes sqrt])])
388 AC_CHECK_LIB([m],[sqrtl],[AC_DEFINE([HAVE_SQRTL],[1],[libm includes sqrtl])])
389 AC_CHECK_LIB([m],[csqrtf],[AC_DEFINE([HAVE_CSQRTF],[1],[libm includes csqrtf])])
390 AC_CHECK_LIB([m],[csqrt],[AC_DEFINE([HAVE_CSQRT],[1],[libm includes csqrt])])
391 AC_CHECK_LIB([m],[csqrtl],[AC_DEFINE([HAVE_CSQRTL],[1],[libm includes csqrtl])])
392 AC_CHECK_LIB([m],[tanf],[AC_DEFINE([HAVE_TANF],[1],[libm includes tanf])])
393 AC_CHECK_LIB([m],[tan],[AC_DEFINE([HAVE_TAN],[1],[libm includes tan])])
394 AC_CHECK_LIB([m],[tanl],[AC_DEFINE([HAVE_TANL],[1],[libm includes tanl])])
395 AC_CHECK_LIB([m],[ctanf],[AC_DEFINE([HAVE_CTANF],[1],[libm includes ctanf])])
396 AC_CHECK_LIB([m],[ctan],[AC_DEFINE([HAVE_CTAN],[1],[libm includes ctan])])
397 AC_CHECK_LIB([m],[ctanl],[AC_DEFINE([HAVE_CTANL],[1],[libm includes ctanl])])
398 AC_CHECK_LIB([m],[tanhf],[AC_DEFINE([HAVE_TANHF],[1],[libm includes tanhf])])
399 AC_CHECK_LIB([m],[tanh],[AC_DEFINE([HAVE_TANH],[1],[libm includes tanh])])
400 AC_CHECK_LIB([m],[tanhl],[AC_DEFINE([HAVE_TANHL],[1],[libm includes tanhl])])
401 AC_CHECK_LIB([m],[ctanhf],[AC_DEFINE([HAVE_CTANHF],[1],[libm includes ctanhf])])
402 AC_CHECK_LIB([m],[ctanh],[AC_DEFINE([HAVE_CTANH],[1],[libm includes ctanh])])
403 AC_CHECK_LIB([m],[ctanhl],[AC_DEFINE([HAVE_CTANHL],[1],[libm includes ctanhl])])
404 AC_CHECK_LIB([m],[truncf],[AC_DEFINE([HAVE_TRUNCF],[1],[libm includes truncf])])
405 AC_CHECK_LIB([m],[trunc],[AC_DEFINE([HAVE_TRUNC],[1],[libm includes trunc])])
406 AC_CHECK_LIB([m],[truncl],[AC_DEFINE([HAVE_TRUNCL],[1],[libm includes truncl])])
407 AC_CHECK_LIB([m],[erff],[AC_DEFINE([HAVE_ERFF],[1],[libm includes erff])])
408 AC_CHECK_LIB([m],[erf],[AC_DEFINE([HAVE_ERF],[1],[libm includes erf])])
409 AC_CHECK_LIB([m],[erfl],[AC_DEFINE([HAVE_ERFL],[1],[libm includes erfl])])
410 AC_CHECK_LIB([m],[erfcf],[AC_DEFINE([HAVE_ERFCF],[1],[libm includes erfcf])])
411 AC_CHECK_LIB([m],[erfc],[AC_DEFINE([HAVE_ERFC],[1],[libm includes erfc])])
412 AC_CHECK_LIB([m],[erfcl],[AC_DEFINE([HAVE_ERFCL],[1],[libm includes erfcl])])
413 AC_CHECK_LIB([m],[j0f],[AC_DEFINE([HAVE_J0F],[1],[libm includes j0f])])
414 AC_CHECK_LIB([m],[j0],[AC_DEFINE([HAVE_J0],[1],[libm includes j0])])
415 AC_CHECK_LIB([m],[j0l],[AC_DEFINE([HAVE_J0L],[1],[libm includes j0l])])
416 AC_CHECK_LIB([m],[j1f],[AC_DEFINE([HAVE_J1F],[1],[libm includes j1f])])
417 AC_CHECK_LIB([m],[j1],[AC_DEFINE([HAVE_J1],[1],[libm includes j1])])
418 AC_CHECK_LIB([m],[j1l],[AC_DEFINE([HAVE_J1L],[1],[libm includes j1l])])
419 AC_CHECK_LIB([m],[jnf],[AC_DEFINE([HAVE_JNF],[1],[libm includes jnf])])
420 AC_CHECK_LIB([m],[jn],[AC_DEFINE([HAVE_JN],[1],[libm includes jn])])
421 AC_CHECK_LIB([m],[jnl],[AC_DEFINE([HAVE_JNL],[1],[libm includes jnl])])
422 AC_CHECK_LIB([m],[y0f],[AC_DEFINE([HAVE_Y0F],[1],[libm includes y0f])])
423 AC_CHECK_LIB([m],[y0],[AC_DEFINE([HAVE_Y0],[1],[libm includes y0])])
424 AC_CHECK_LIB([m],[y0l],[AC_DEFINE([HAVE_Y0L],[1],[libm includes y0l])])
425 AC_CHECK_LIB([m],[y1f],[AC_DEFINE([HAVE_Y1F],[1],[libm includes y1f])])
426 AC_CHECK_LIB([m],[y1],[AC_DEFINE([HAVE_Y1],[1],[libm includes y1])])
427 AC_CHECK_LIB([m],[y1l],[AC_DEFINE([HAVE_Y1L],[1],[libm includes y1l])])
428 AC_CHECK_LIB([m],[ynf],[AC_DEFINE([HAVE_YNF],[1],[libm includes ynf])])
429 AC_CHECK_LIB([m],[yn],[AC_DEFINE([HAVE_YN],[1],[libm includes yn])])
430 AC_CHECK_LIB([m],[ynl],[AC_DEFINE([HAVE_YNL],[1],[libm includes ynl])])
431 AC_CHECK_LIB([m],[tgamma],[AC_DEFINE([HAVE_TGAMMA],[1],[libm includes tgamma])])
432 AC_CHECK_LIB([m],[tgammaf],[AC_DEFINE([HAVE_TGAMMAF],[1],[libm includes tgammaf])])
433 AC_CHECK_LIB([m],[tgammal],[AC_DEFINE([HAVE_TGAMMAL],[1],[libm includes tgammal])])
434 AC_CHECK_LIB([m],[lgamma],[AC_DEFINE([HAVE_LGAMMA],[1],[libm includes lgamma])])
435 AC_CHECK_LIB([m],[lgammaf],[AC_DEFINE([HAVE_LGAMMAF],[1],[libm includes lgammaf])])
436 AC_CHECK_LIB([m],[lgammal],[AC_DEFINE([HAVE_LGAMMAL],[1],[libm includes lgammal])])
438 # Check for GFORTRAN_C99_1.1 funcs
439 AC_CHECK_LIB([m],[cacos],[AC_DEFINE([HAVE_CACOS],[1],[libm includes cacos])])
440 AC_CHECK_LIB([m],[cacosf],[AC_DEFINE([HAVE_CACOSF],[1],[libm includes cacosf])])
441 AC_CHECK_LIB([m],[cacosh],[AC_DEFINE([HAVE_CACOSH],[1],[libm includes cacosh])])
442 AC_CHECK_LIB([m],[cacoshf],[AC_DEFINE([HAVE_CACOSHF],[1],[libm includes cacoshf])])
443 AC_CHECK_LIB([m],[cacoshl],[AC_DEFINE([HAVE_CACOSHL],[1],[libm includes cacoshl])])
444 AC_CHECK_LIB([m],[cacosl],[AC_DEFINE([HAVE_CACOSL],[1],[libm includes cacosl])])
445 AC_CHECK_LIB([m],[casin],[AC_DEFINE([HAVE_CASIN],[1],[libm includes casin])])
446 AC_CHECK_LIB([m],[casinf],[AC_DEFINE([HAVE_CASINF],[1],[libm includes casinf])])
447 AC_CHECK_LIB([m],[casinh],[AC_DEFINE([HAVE_CASINH],[1],[libm includes casinh])])
448 AC_CHECK_LIB([m],[casinhf],[AC_DEFINE([HAVE_CASINHF],[1],[libm includes casinhf])])
449 AC_CHECK_LIB([m],[casinhl],[AC_DEFINE([HAVE_CASINHL],[1],[libm includes casinhl])])
450 AC_CHECK_LIB([m],[casinl],[AC_DEFINE([HAVE_CASINL],[1],[libm includes casinl])])
451 AC_CHECK_LIB([m],[catan],[AC_DEFINE([HAVE_CATAN],[1],[libm includes catan])])
452 AC_CHECK_LIB([m],[catanf],[AC_DEFINE([HAVE_CATANF],[1],[libm includes catanf])])
453 AC_CHECK_LIB([m],[catanh],[AC_DEFINE([HAVE_CATANH],[1],[libm includes catanh])])
454 AC_CHECK_LIB([m],[catanhf],[AC_DEFINE([HAVE_CATANHF],[1],[libm includes catanhf])])
455 AC_CHECK_LIB([m],[catanhl],[AC_DEFINE([HAVE_CATANHL],[1],[libm includes catanhl])])
456 AC_CHECK_LIB([m],[catanl],[AC_DEFINE([HAVE_CATANL],[1],[libm includes catanl])])
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 and Tru64, 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.