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 [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
17 yes) version_specific_libs=yes ;;
18 no) version_specific_libs=no ;;
19 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
21 [version_specific_libs=no])
22 AC_MSG_RESULT($version_specific_libs)
25 # Gets build, host, target, *_vendor, *_cpu, *_os, etc.
27 # You will slowly go insane if you do not grok the following fact: when
28 # building this library, the top-level /target/ becomes the library's /host/.
30 # configure then causes --target to default to --host, exactly like any
31 # other package using autoconf. Therefore, 'target' and 'host' will
32 # always be the same. This makes sense both for native and cross compilers
33 # just think about it for a little while. :-)
35 # Also, if this library is being configured as part of a cross compiler, the
36 # top-level configure script will pass the "real" host as $with_cross_host.
38 # Do not delete or change the following two lines. For why, see
39 # http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
41 target_alias=${target_alias-$host_alias}
43 # Sets up automake. Must come after AC_CANONICAL_SYSTEM. Each of the
44 # following is magically included in AUTOMAKE_OPTIONS in each Makefile.am.
45 # 1.9.6: minimum required version
46 # no-define: PACKAGE and VERSION will not be #define'd in config.h (a bunch
47 # of other PACKAGE_* variables will, however, and there's nothing
48 # we can do about that; they come from AC_INIT).
49 # foreign: we don't follow the normal rules for GNU packages (no COPYING
50 # file in the top srcdir, etc, etc), so stop complaining.
51 # -Wall: turns on all automake warnings...
52 # -Wno-portability: ...except this one, since GNU make is required.
53 AM_INIT_AUTOMAKE([1.9.6 no-define foreign -Wall -Wno-portability])
56 AM_ENABLE_MULTILIB(, ..)
58 # Handy for debugging:
59 #AC_MSG_NOTICE($build / $host / $target / $host_alias / $target_alias); sleep 5
61 # Are we being configured with some form of cross compiler?
62 # NB: We don't actually need to know this just now, but when, say, a test
63 # suite is included, we'll have to know.
64 if test "$build" != "$host"; then
65 LIBGFOR_IS_NATIVE=false
68 LIBGFOR_IS_NATIVE=true
71 # Calculate toolexeclibdir
72 # Also toolexecdir, though it's only used in toolexeclibdir
73 case ${version_specific_libs} in
75 # Need the gcc compiler version to know where to install libraries
76 # and header files if --enable-version-specific-runtime-libs option
78 toolexecdir='$(libdir)/gcc/$(target_alias)'
79 toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
82 if test -n "$with_cross_host" &&
83 test x"$with_cross_host" != x"no"; then
84 # Install a library built with a cross compiler in tooldir, not libdir.
85 toolexecdir='$(exec_prefix)/$(target_alias)'
86 toolexeclibdir='$(toolexecdir)/lib'
88 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
89 toolexeclibdir='$(libdir)'
91 multi_os_directory=`$CC -print-multi-os-directory`
92 case $multi_os_directory in
93 .) ;; # Avoid trailing /.
94 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
99 AC_SUBST(toolexeclibdir)
101 # Check the compiler.
102 # The same as in boehm-gc and libstdc++. Have to borrow it from there.
103 # We must force CC to /not/ be precious variables; otherwise
104 # the wrong, non-multilib-adjusted value will be used in multilibs.
105 # As a side effect, we have to subst CFLAGS ourselves.
107 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
108 m4_define([_AC_ARG_VAR_PRECIOUS],[])
110 m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
112 # Add -Wall -fno-repack-arrays -fno-underscoring if we are using GCC.
113 if test "x$GCC" = "xyes"; then
114 AM_FCFLAGS="-I . -Wall -fno-repack-arrays -fno-underscoring"
115 ## We like to use C99 routines when available. This makes sure that
116 ## __STDC_VERSION__ is set such that libc includes make them available.
117 AM_CFLAGS="-std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings"
118 ## Compile the following tests with the same system header contents
119 ## that we'll encounter when compiling our own source files.
120 CFLAGS="-std=gnu99 $CFLAGS"
125 # Find other programs we need.
126 AC_CHECK_TOOL(AS, as)
127 AC_CHECK_TOOL(AR, ar)
128 AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error)
133 #AC_MSG_NOTICE([====== Starting libtool configuration])
136 AC_SUBST(enable_shared)
137 AC_SUBST(enable_static)
138 #AC_MSG_NOTICE([====== Finished libtool configuration]) ; sleep 10
140 # We need gfortran to compile parts of the library
141 #AC_PROG_FC(gfortran)
145 # extra LD Flags which are required for targets
148 # Darwin needs -single_module when linking libgfortran
149 extra_ldflags_libgfortran=-Wl,-single_module
152 AC_SUBST(extra_ldflags_libgfortran)
154 # We need a working compiler at that point, otherwise give a clear
155 # error message and bail out.
156 LIBGFOR_WORKING_GFORTRAN
164 AC_HAVE_HEADERS(stdlib.h stdio.h string.h stddef.h math.h unistd.h signal.h)
165 AC_CHECK_HEADERS(time.h sys/params.h sys/time.h sys/times.h sys/resource.h)
166 AC_CHECK_HEADERS(sys/types.h sys/stat.h sys/wait.h floatingpoint.h ieeefp.h)
167 AC_CHECK_HEADERS(fenv.h fptrap.h float.h execinfo.h)
168 AC_CHECK_HEADER([complex.h],[AC_DEFINE([HAVE_COMPLEX_H], [1], [complex.h exists])])
169 GCC_HEADER_STDINT(gstdint.h)
171 AC_CHECK_MEMBERS([struct stat.st_blksize])
172 AC_CHECK_MEMBERS([struct stat.st_blocks])
173 AC_CHECK_MEMBERS([struct stat.st_rdev])
175 # Check for library functions.
176 AC_CHECK_FUNCS(getrusage times mkstemp strtof strtold snprintf ftruncate chsize)
177 AC_CHECK_FUNCS(chdir strerror getlogin gethostname kill link symlink perror)
178 AC_CHECK_FUNCS(sleep time ttyname signal alarm ctime clock access fork execl)
179 AC_CHECK_FUNCS(wait setmode execvp pipe dup2 close fdopen strcasestr getrlimit)
180 AC_CHECK_FUNCS(gettimeofday)
182 # Check for glibc backtrace functions
183 AC_CHECK_FUNCS(backtrace backtrace_symbols)
186 AC_CHECK_TYPES([intptr_t])
188 # Check libc for getgid, getpid, getuid
189 AC_CHECK_LIB([c],[getgid],[AC_DEFINE([HAVE_GETGID],[1],[libc includes getgid])])
190 AC_CHECK_LIB([c],[getpid],[AC_DEFINE([HAVE_GETPID],[1],[libc includes getpid])])
191 AC_CHECK_LIB([c],[getppid],[AC_DEFINE([HAVE_GETPPID],[1],[libc includes getppid])])
192 AC_CHECK_LIB([c],[getuid],[AC_DEFINE([HAVE_GETUID],[1],[libc includes getuid])])
194 # Check for C99 (and other IEEE) math functions
195 # ??? This list seems awful long. Is there a better way to test for these?
196 AC_CHECK_LIB([m],[acosf],[AC_DEFINE([HAVE_ACOSF],[1],[libm includes acosf])])
197 AC_CHECK_LIB([m],[acos],[AC_DEFINE([HAVE_ACOS],[1],[libm includes acos])])
198 AC_CHECK_LIB([m],[acosl],[AC_DEFINE([HAVE_ACOSL],[1],[libm includes acosl])])
199 AC_CHECK_LIB([m],[acoshf],[AC_DEFINE([HAVE_ACOSHF],[1],[libm includes acoshf])])
200 AC_CHECK_LIB([m],[acosh],[AC_DEFINE([HAVE_ACOSH],[1],[libm includes acosh])])
201 AC_CHECK_LIB([m],[acoshl],[AC_DEFINE([HAVE_ACOSHL],[1],[libm includes acoshl])])
202 AC_CHECK_LIB([m],[asinf],[AC_DEFINE([HAVE_ASINF],[1],[libm includes asinf])])
203 AC_CHECK_LIB([m],[asin],[AC_DEFINE([HAVE_ASIN],[1],[libm includes asin])])
204 AC_CHECK_LIB([m],[asinl],[AC_DEFINE([HAVE_ASINL],[1],[libm includes asinl])])
205 AC_CHECK_LIB([m],[asinhf],[AC_DEFINE([HAVE_ASINHF],[1],[libm includes asinhf])])
206 AC_CHECK_LIB([m],[asinh],[AC_DEFINE([HAVE_ASINH],[1],[libm includes asinh])])
207 AC_CHECK_LIB([m],[asinhl],[AC_DEFINE([HAVE_ASINHL],[1],[libm includes asinhl])])
208 AC_CHECK_LIB([m],[atan2f],[AC_DEFINE([HAVE_ATAN2F],[1],[libm includes atan2f])])
209 AC_CHECK_LIB([m],[atan2],[AC_DEFINE([HAVE_ATAN2],[1],[libm includes atan2])])
210 AC_CHECK_LIB([m],[atan2l],[AC_DEFINE([HAVE_ATAN2L],[1],[libm includes atan2l])])
211 AC_CHECK_LIB([m],[atanf],[AC_DEFINE([HAVE_ATANF],[1],[libm includes atanf])])
212 AC_CHECK_LIB([m],[atan],[AC_DEFINE([HAVE_ATAN],[1],[libm includes atan])])
213 AC_CHECK_LIB([m],[atanl],[AC_DEFINE([HAVE_ATANL],[1],[libm includes atanl])])
214 AC_CHECK_LIB([m],[atanhf],[AC_DEFINE([HAVE_ATANHF],[1],[libm includes atanhf])])
215 AC_CHECK_LIB([m],[atanh],[AC_DEFINE([HAVE_ATANH],[1],[libm includes atanh])])
216 AC_CHECK_LIB([m],[atanhl],[AC_DEFINE([HAVE_ATANHL],[1],[libm includes atanhl])])
217 AC_CHECK_LIB([m],[cargf],[AC_DEFINE([HAVE_CARGF],[1],[libm includes cargf])])
218 AC_CHECK_LIB([m],[carg],[AC_DEFINE([HAVE_CARG],[1],[libm includes carg])])
219 AC_CHECK_LIB([m],[cargl],[AC_DEFINE([HAVE_CARGL],[1],[libm includes cargl])])
220 AC_CHECK_LIB([m],[ceilf],[AC_DEFINE([HAVE_CEILF],[1],[libm includes ceilf])])
221 AC_CHECK_LIB([m],[ceil],[AC_DEFINE([HAVE_CEIL],[1],[libm includes ceil])])
222 AC_CHECK_LIB([m],[ceill],[AC_DEFINE([HAVE_CEILL],[1],[libm includes ceill])])
223 AC_CHECK_LIB([m],[copysignf],[AC_DEFINE([HAVE_COPYSIGNF],[1],[libm includes copysignf])])
224 AC_CHECK_LIB([m],[copysign],[AC_DEFINE([HAVE_COPYSIGN],[1],[libm includes copysign])])
225 AC_CHECK_LIB([m],[copysignl],[AC_DEFINE([HAVE_COPYSIGNL],[1],[libm includes copysignl])])
226 AC_CHECK_LIB([m],[cosf],[AC_DEFINE([HAVE_COSF],[1],[libm includes cosf])])
227 AC_CHECK_LIB([m],[cos],[AC_DEFINE([HAVE_COS],[1],[libm includes cos])])
228 AC_CHECK_LIB([m],[cosl],[AC_DEFINE([HAVE_COSL],[1],[libm includes cosl])])
229 AC_CHECK_LIB([m],[ccosf],[AC_DEFINE([HAVE_CCOSF],[1],[libm includes ccosf])])
230 AC_CHECK_LIB([m],[ccos],[AC_DEFINE([HAVE_CCOS],[1],[libm includes ccos])])
231 AC_CHECK_LIB([m],[ccosl],[AC_DEFINE([HAVE_CCOSL],[1],[libm includes ccosl])])
232 AC_CHECK_LIB([m],[coshf],[AC_DEFINE([HAVE_COSHF],[1],[libm includes coshf])])
233 AC_CHECK_LIB([m],[cosh],[AC_DEFINE([HAVE_COSH],[1],[libm includes cosh])])
234 AC_CHECK_LIB([m],[coshl],[AC_DEFINE([HAVE_COSHL],[1],[libm includes coshl])])
235 AC_CHECK_LIB([m],[ccoshf],[AC_DEFINE([HAVE_CCOSHF],[1],[libm includes ccoshf])])
236 AC_CHECK_LIB([m],[ccosh],[AC_DEFINE([HAVE_CCOSH],[1],[libm includes ccosh])])
237 AC_CHECK_LIB([m],[ccoshl],[AC_DEFINE([HAVE_CCOSHL],[1],[libm includes ccoshl])])
238 AC_CHECK_LIB([m],[expf],[AC_DEFINE([HAVE_EXPF],[1],[libm includes expf])])
239 AC_CHECK_LIB([m],[exp],[AC_DEFINE([HAVE_EXP],[1],[libm includes exp])])
240 AC_CHECK_LIB([m],[expl],[AC_DEFINE([HAVE_EXPL],[1],[libm includes expl])])
241 AC_CHECK_LIB([m],[cexpf],[AC_DEFINE([HAVE_CEXPF],[1],[libm includes cexpf])])
242 AC_CHECK_LIB([m],[cexp],[AC_DEFINE([HAVE_CEXP],[1],[libm includes cexp])])
243 AC_CHECK_LIB([m],[cexpl],[AC_DEFINE([HAVE_CEXPL],[1],[libm includes cexpl])])
244 AC_CHECK_LIB([m],[fabsf],[AC_DEFINE([HAVE_FABSF],[1],[libm includes fabsf])])
245 AC_CHECK_LIB([m],[fabs],[AC_DEFINE([HAVE_FABS],[1],[libm includes fabs])])
246 AC_CHECK_LIB([m],[fabsl],[AC_DEFINE([HAVE_FABSL],[1],[libm includes fabsl])])
247 AC_CHECK_LIB([m],[cabsf],[AC_DEFINE([HAVE_CABSF],[1],[libm includes cabsf])])
248 AC_CHECK_LIB([m],[cabs],[AC_DEFINE([HAVE_CABS],[1],[libm includes cabs])])
249 AC_CHECK_LIB([m],[cabsl],[AC_DEFINE([HAVE_CABSL],[1],[libm includes cabsl])])
250 AC_CHECK_LIB([m],[floorf],[AC_DEFINE([HAVE_FLOORF],[1],[libm includes floorf])])
251 AC_CHECK_LIB([m],[floor],[AC_DEFINE([HAVE_FLOOR],[1],[libm includes floor])])
252 AC_CHECK_LIB([m],[floorl],[AC_DEFINE([HAVE_FLOORL],[1],[libm includes floorl])])
253 AC_CHECK_LIB([m],[fmodf],[AC_DEFINE([HAVE_FMODF],[1],[libm includes fmodf])])
254 AC_CHECK_LIB([m],[fmod],[AC_DEFINE([HAVE_FMOD],[1],[libm includes fmod])])
255 AC_CHECK_LIB([m],[fmodl],[AC_DEFINE([HAVE_FMODL],[1],[libm includes fmodl])])
256 AC_CHECK_LIB([m],[frexpf],[AC_DEFINE([HAVE_FREXPF],[1],[libm includes frexpf])])
257 AC_CHECK_LIB([m],[frexp],[AC_DEFINE([HAVE_FREXP],[1],[libm includes frexp])])
258 AC_CHECK_LIB([m],[frexpl],[AC_DEFINE([HAVE_FREXPL],[1],[libm includes frexpl])])
259 AC_CHECK_LIB([m],[hypotf],[AC_DEFINE([HAVE_HYPOTF],[1],[libm includes hypotf])])
260 AC_CHECK_LIB([m],[hypot],[AC_DEFINE([HAVE_HYPOT],[1],[libm includes hypot])])
261 AC_CHECK_LIB([m],[hypotl],[AC_DEFINE([HAVE_HYPOTL],[1],[libm includes hypotl])])
262 AC_CHECK_LIB([m],[ldexpf],[AC_DEFINE([HAVE_LDEXPF],[1],[libm includes ldexpf])])
263 AC_CHECK_LIB([m],[ldexp],[AC_DEFINE([HAVE_LDEXP],[1],[libm includes ldexp])])
264 AC_CHECK_LIB([m],[ldexpl],[AC_DEFINE([HAVE_LDEXPL],[1],[libm includes ldexpl])])
265 AC_CHECK_LIB([m],[logf],[AC_DEFINE([HAVE_LOGF],[1],[libm includes logf])])
266 AC_CHECK_LIB([m],[log],[AC_DEFINE([HAVE_LOG],[1],[libm includes log])])
267 AC_CHECK_LIB([m],[logl],[AC_DEFINE([HAVE_LOGL],[1],[libm includes logl])])
268 AC_CHECK_LIB([m],[clogf],[AC_DEFINE([HAVE_CLOGF],[1],[libm includes clogf])])
269 AC_CHECK_LIB([m],[clog],[AC_DEFINE([HAVE_CLOG],[1],[libm includes clog])])
270 AC_CHECK_LIB([m],[clogl],[AC_DEFINE([HAVE_CLOGL],[1],[libm includes clogl])])
271 AC_CHECK_LIB([m],[log10f],[AC_DEFINE([HAVE_LOG10F],[1],[libm includes log10f])])
272 AC_CHECK_LIB([m],[log10],[AC_DEFINE([HAVE_LOG10],[1],[libm includes log10])])
273 AC_CHECK_LIB([m],[log10l],[AC_DEFINE([HAVE_LOG10L],[1],[libm includes log10l])])
274 AC_CHECK_LIB([m],[clog10f],[AC_DEFINE([HAVE_CLOG10F],[1],[libm includes clog10f])])
275 AC_CHECK_LIB([m],[clog10],[AC_DEFINE([HAVE_CLOG10],[1],[libm includes clog10])])
276 AC_CHECK_LIB([m],[clog10l],[AC_DEFINE([HAVE_CLOG10L],[1],[libm includes clog10l])])
277 AC_CHECK_LIB([m],[nextafterf],[AC_DEFINE([HAVE_NEXTAFTERF],[1],[libm includes nextafterf])])
278 AC_CHECK_LIB([m],[nextafter],[AC_DEFINE([HAVE_NEXTAFTER],[1],[libm includes nextafter])])
279 AC_CHECK_LIB([m],[nextafterl],[AC_DEFINE([HAVE_NEXTAFTERL],[1],[libm includes nextafterl])])
280 AC_CHECK_LIB([m],[powf],[AC_DEFINE([HAVE_POWF],[1],[libm includes powf])])
281 AC_CHECK_LIB([m],[pow],[AC_DEFINE([HAVE_POW],[1],[libm includes pow])])
282 AC_CHECK_LIB([m],[powl],[AC_DEFINE([HAVE_POWL],[1],[libm includes powl])])
283 AC_CHECK_LIB([m],[cpowf],[AC_DEFINE([HAVE_CPOWF],[1],[libm includes cpowf])])
284 AC_CHECK_LIB([m],[cpow],[AC_DEFINE([HAVE_CPOW],[1],[libm includes cpow])])
285 AC_CHECK_LIB([m],[cpowl],[AC_DEFINE([HAVE_CPOWL],[1],[libm includes cpowl])])
286 AC_CHECK_LIB([m],[roundf],[AC_DEFINE([HAVE_ROUNDF],[1],[libm includes roundf])])
287 AC_CHECK_LIB([m],[round],[AC_DEFINE([HAVE_ROUND],[1],[libm includes round])])
288 AC_CHECK_LIB([m],[roundl],[AC_DEFINE([HAVE_ROUNDL],[1],[libm includes roundl])])
289 AC_CHECK_LIB([m],[scalbnf],[AC_DEFINE([HAVE_SCALBNF],[1],[libm includes scalbnf])])
290 AC_CHECK_LIB([m],[scalbn],[AC_DEFINE([HAVE_SCALBN],[1],[libm includes scalbn])])
291 AC_CHECK_LIB([m],[scalbnl],[AC_DEFINE([HAVE_SCALBNL],[1],[libm includes scalbnl])])
292 AC_CHECK_LIB([m],[sinf],[AC_DEFINE([HAVE_SINF],[1],[libm includes sinf])])
293 AC_CHECK_LIB([m],[sin],[AC_DEFINE([HAVE_SIN],[1],[libm includes sin])])
294 AC_CHECK_LIB([m],[sinl],[AC_DEFINE([HAVE_SINL],[1],[libm includes sinl])])
295 AC_CHECK_LIB([m],[csinf],[AC_DEFINE([HAVE_CSINF],[1],[libm includes csinf])])
296 AC_CHECK_LIB([m],[csin],[AC_DEFINE([HAVE_CSIN],[1],[libm includes csin])])
297 AC_CHECK_LIB([m],[csinl],[AC_DEFINE([HAVE_CSINL],[1],[libm includes csinl])])
298 AC_CHECK_LIB([m],[sinhf],[AC_DEFINE([HAVE_SINHF],[1],[libm includes sinhf])])
299 AC_CHECK_LIB([m],[sinh],[AC_DEFINE([HAVE_SINH],[1],[libm includes sinh])])
300 AC_CHECK_LIB([m],[sinhl],[AC_DEFINE([HAVE_SINHL],[1],[libm includes sinhl])])
301 AC_CHECK_LIB([m],[csinhf],[AC_DEFINE([HAVE_CSINHF],[1],[libm includes csinhf])])
302 AC_CHECK_LIB([m],[csinh],[AC_DEFINE([HAVE_CSINH],[1],[libm includes csinh])])
303 AC_CHECK_LIB([m],[csinhl],[AC_DEFINE([HAVE_CSINHL],[1],[libm includes csinhl])])
304 AC_CHECK_LIB([m],[sqrtf],[AC_DEFINE([HAVE_SQRTF],[1],[libm includes sqrtf])])
305 AC_CHECK_LIB([m],[sqrt],[AC_DEFINE([HAVE_SQRT],[1],[libm includes sqrt])])
306 AC_CHECK_LIB([m],[sqrtl],[AC_DEFINE([HAVE_SQRTL],[1],[libm includes sqrtl])])
307 AC_CHECK_LIB([m],[csqrtf],[AC_DEFINE([HAVE_CSQRTF],[1],[libm includes csqrtf])])
308 AC_CHECK_LIB([m],[csqrt],[AC_DEFINE([HAVE_CSQRT],[1],[libm includes csqrt])])
309 AC_CHECK_LIB([m],[csqrtl],[AC_DEFINE([HAVE_CSQRTL],[1],[libm includes csqrtl])])
310 AC_CHECK_LIB([m],[tanf],[AC_DEFINE([HAVE_TANF],[1],[libm includes tanf])])
311 AC_CHECK_LIB([m],[tan],[AC_DEFINE([HAVE_TAN],[1],[libm includes tan])])
312 AC_CHECK_LIB([m],[tanl],[AC_DEFINE([HAVE_TANL],[1],[libm includes tanl])])
313 AC_CHECK_LIB([m],[ctanf],[AC_DEFINE([HAVE_CTANF],[1],[libm includes ctanf])])
314 AC_CHECK_LIB([m],[ctan],[AC_DEFINE([HAVE_CTAN],[1],[libm includes ctan])])
315 AC_CHECK_LIB([m],[ctanl],[AC_DEFINE([HAVE_CTANL],[1],[libm includes ctanl])])
316 AC_CHECK_LIB([m],[tanhf],[AC_DEFINE([HAVE_TANHF],[1],[libm includes tanhf])])
317 AC_CHECK_LIB([m],[tanh],[AC_DEFINE([HAVE_TANH],[1],[libm includes tanh])])
318 AC_CHECK_LIB([m],[tanhl],[AC_DEFINE([HAVE_TANHL],[1],[libm includes tanhl])])
319 AC_CHECK_LIB([m],[ctanhf],[AC_DEFINE([HAVE_CTANHF],[1],[libm includes ctanhf])])
320 AC_CHECK_LIB([m],[ctanh],[AC_DEFINE([HAVE_CTANH],[1],[libm includes ctanh])])
321 AC_CHECK_LIB([m],[ctanhl],[AC_DEFINE([HAVE_CTANHL],[1],[libm includes ctanhl])])
322 AC_CHECK_LIB([m],[truncf],[AC_DEFINE([HAVE_TRUNCF],[1],[libm includes truncf])])
323 AC_CHECK_LIB([m],[trunc],[AC_DEFINE([HAVE_TRUNC],[1],[libm includes trunc])])
324 AC_CHECK_LIB([m],[truncl],[AC_DEFINE([HAVE_TRUNCL],[1],[libm includes truncl])])
325 AC_CHECK_LIB([m],[erff],[AC_DEFINE([HAVE_ERFF],[1],[libm includes erff])])
326 AC_CHECK_LIB([m],[erf],[AC_DEFINE([HAVE_ERF],[1],[libm includes erf])])
327 AC_CHECK_LIB([m],[erfl],[AC_DEFINE([HAVE_ERFL],[1],[libm includes erfl])])
328 AC_CHECK_LIB([m],[erfcf],[AC_DEFINE([HAVE_ERFCF],[1],[libm includes erfcf])])
329 AC_CHECK_LIB([m],[erfc],[AC_DEFINE([HAVE_ERFC],[1],[libm includes erfc])])
330 AC_CHECK_LIB([m],[erfcl],[AC_DEFINE([HAVE_ERFCL],[1],[libm includes erfcl])])
331 AC_CHECK_LIB([m],[j0f],[AC_DEFINE([HAVE_J0F],[1],[libm includes j0f])])
332 AC_CHECK_LIB([m],[j0],[AC_DEFINE([HAVE_J0],[1],[libm includes j0])])
333 AC_CHECK_LIB([m],[j0l],[AC_DEFINE([HAVE_J0L],[1],[libm includes j0l])])
334 AC_CHECK_LIB([m],[j1f],[AC_DEFINE([HAVE_J1F],[1],[libm includes j1f])])
335 AC_CHECK_LIB([m],[j1],[AC_DEFINE([HAVE_J1],[1],[libm includes j1])])
336 AC_CHECK_LIB([m],[j1l],[AC_DEFINE([HAVE_J1L],[1],[libm includes j1l])])
337 AC_CHECK_LIB([m],[jnf],[AC_DEFINE([HAVE_JNF],[1],[libm includes jnf])])
338 AC_CHECK_LIB([m],[jn],[AC_DEFINE([HAVE_JN],[1],[libm includes jn])])
339 AC_CHECK_LIB([m],[jnl],[AC_DEFINE([HAVE_JNL],[1],[libm includes jnl])])
340 AC_CHECK_LIB([m],[y0f],[AC_DEFINE([HAVE_Y0F],[1],[libm includes y0f])])
341 AC_CHECK_LIB([m],[y0],[AC_DEFINE([HAVE_Y0],[1],[libm includes y0])])
342 AC_CHECK_LIB([m],[y0l],[AC_DEFINE([HAVE_Y0L],[1],[libm includes y0l])])
343 AC_CHECK_LIB([m],[y1f],[AC_DEFINE([HAVE_Y1F],[1],[libm includes y1f])])
344 AC_CHECK_LIB([m],[y1],[AC_DEFINE([HAVE_Y1],[1],[libm includes y1])])
345 AC_CHECK_LIB([m],[y1l],[AC_DEFINE([HAVE_Y1L],[1],[libm includes y1l])])
346 AC_CHECK_LIB([m],[ynf],[AC_DEFINE([HAVE_YNF],[1],[libm includes ynf])])
347 AC_CHECK_LIB([m],[yn],[AC_DEFINE([HAVE_YN],[1],[libm includes yn])])
348 AC_CHECK_LIB([m],[ynl],[AC_DEFINE([HAVE_YNL],[1],[libm includes ynl])])
350 # On AIX, clog is present in libm as __clog
351 AC_CHECK_LIB([m],[__clog],[AC_DEFINE([HAVE_CLOG],[1],[libm includes clog])])
353 # Check for a isfinite macro that works on long doubles.
354 LIBGFOR_CHECK_FOR_BROKEN_ISFINITE
356 # Check for a isnan macro that works on long doubles.
357 LIBGFOR_CHECK_FOR_BROKEN_ISNAN
359 # Check for a fpclassify macro that works on long doubles.
360 LIBGFOR_CHECK_FOR_BROKEN_FPCLASSIFY
362 # Check whether the system has a working stat()
363 LIBGFOR_CHECK_WORKING_STAT
365 # Fallback in case isfinite is not available.
366 AC_CHECK_LIB([m],[finite],[AC_DEFINE([HAVE_FINITE],[1],[libm includes finite])])
368 # Check for GNU libc feenableexcept
369 AC_CHECK_LIB([m],[feenableexcept],[have_feenableexcept=yes AC_DEFINE([HAVE_FEENABLEEXCEPT],[1],[libm includes feenableexcept])])
371 # Check for SysV fpsetmask
372 LIBGFOR_CHECK_FPSETMASK
374 # Check for AIX fp_trap and fp_enable
375 AC_CHECK_FUNC([fp_trap],[have_fp_trap=yes AC_DEFINE([HAVE_FP_TRAP],[1],[fp_trap is present])])
376 AC_CHECK_FUNC([fp_enable],[have_fp_enable=yes AC_DEFINE([HAVE_FP_ENABLE],[1],[fp_enable is present])])
378 # Runs configure.host to set up necessary host-dependent shell variables.
379 # We then display a message about it, and propagate them through the
381 . ${srcdir}/configure.host
382 AC_MSG_NOTICE([FPU dependent file will be ${fpu_host}.h])
383 FPU_HOST_HEADER=config/${fpu_host}.h
384 AC_SUBST(FPU_HOST_HEADER)
386 # Attempt to assert that the target is of common type in case we don't
387 # have C99 integer types at all.
390 # Check out attribute support.
391 LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY
392 LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT
393 LIBGFOR_CHECK_ATTRIBUTE_ALIAS
395 # Check out sync builtins support.
396 LIBGFOR_CHECK_SYNC_FETCH_AND_ADD
398 # Check out thread support.
399 LIBGFOR_CHECK_GTHR_DEFAULT
401 # Check out #pragma weak.
404 # Various other checks on target
405 LIBGFOR_CHECK_UNLINK_OPEN_FILE
407 # Check whether line terminator is LF or CRLF
412 if test ${multilib} = yes; then
413 multilib_arg="--enable-multilib"
418 # Write our Makefile.
419 AC_CONFIG_FILES(Makefile)