]> git.ipfire.org Git - thirdparty/gcc.git/blame - config.if
Define FLT_EVAL_METHOD and DECIMAL_DIG for C99.
[thirdparty/gcc.git] / config.if
CommitLineData
a3cbd105
L
1#! /dev/null
2# Don't call it directly. This shell script fragment is called to
3# determine:
4#
5# 1. libstcxx_interface: the interface name for libstdc++.
6# 2. cxx_interface: the interface name for c++.
7# 3. libc_interface: the interface name for libc.
8#
9
10# Get the top level src dir.
11if [ -z "${topsrcdir}" -a -z "${top_srcdir}" ]
12then
13 echo "Undefined top level src dir: topsrcdir and top_srcdir are empty" >&2
14 exit 1
15fi
16
17if [ -n "${topsrcdir}" ]
18then
19 if_topsrcdir=${topsrcdir}
20else
21 if_topsrcdir=${top_srcdir}
22fi
23
17090313
BK
24if [ "${enable_libstdcxx_v3}" = "yes" ] ; then
25 libstdcxx_srcdir=${if_topsrcdir}/libstdc++-v3
be1db873
MK
26 # We check libstdc++-v3/configure.in for libstdcxx_interface.
27 libstdcxx_interface=`grep "^INTERFACE" ${libstdcxx_srcdir}/configure.in | sed 's/INTERFACE[ ]*=[ ]*\(.*\)/\1/'`
17090313
BK
28else
29 libstdcxx_srcdir=${if_topsrcdir}/libstdc++
be1db873
MK
30 # We check libstdc++/Makefile.in for libstdcxx_interface.
31 libstdcxx_interface=`grep "^INTERFACE" ${libstdcxx_srcdir}/Makefile.in | sed 's/INTERFACE[ ]*=[ ]*\(.*\)/\1/'`
1b8a4ef3 32fi
cc330df9
BK
33libstdcxx_incdir=g++-${libstdcxx_interface}
34# Used to version libstdc++ shared libraries
35cxx_interface=2
a3cbd105
L
36
37# The trickiest part is libc_interface.
38if [ -z "${libc_interface}" ]
39then
40 case ${target_os} in
41 *linux*libc1*|*linux*libc5*)
42 case ${target_alias} in
43 *alpha*|*powerpc*)
44 libc_interface=-libc5.9-
45 ;;
46 *)
47 libc_interface=-libc5-
48 ;;
49 esac
50 ;;
51 *linux*gnu*)
52 # We have to work harder to figure it out.
53 if [ ${target_alias} = ${build_alias} ]
54 then
55 dummy=if$$
56 cat >$dummy.c <<EOF
57#include <features.h>
58main(argc, argv)
59 int argc;
60 char *argv[];
61{
62 printf("%d\n", __GLIBC_MINOR__);
63 return 0;
64}
65EOF
66 ${CC-cc} $dummy.c -o $dummy 2>/dev/null
67 if [ "$?" = 0 ]
68 then
69 libc_interface=-libc6.`./$dummy`-
70 rm -f $dummy.c $dummy
71 else
72 # It should never happen.
73 echo "Cannot find the GNU C library minor version number." >&2
74 rm -f $dummy.c $dummy
75 exit 1
76 fi
77 else
78 # Cross compiling. Assume glibc 2.1.
79 libc_interface=-libc6.1-
80 fi
81 ;;
82 *)
83 libc_interface=-
84 ;;
85 esac
86fi