]> git.ipfire.org Git - thirdparty/gcc.git/blame - config.if
t-elf (sparc-rtems, sparc-elf): Build assembly support routines.
[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
36ca672c
MM
24libstdcxx_srcdir=${if_topsrcdir}/libstdc++-v3
25# We check libstdc++-v3/configure.in for libstdcxx_interface.
26libstdcxx_interface=`grep "^INTERFACE" ${libstdcxx_srcdir}/configure.in | sed 's/INTERFACE[ ]*=[ ]*\(.*\)/\1/'`
cc330df9
BK
27libstdcxx_incdir=g++-${libstdcxx_interface}
28# Used to version libstdc++ shared libraries
29cxx_interface=2
a3cbd105
L
30
31# The trickiest part is libc_interface.
32if [ -z "${libc_interface}" ]
33then
34 case ${target_os} in
35 *linux*libc1*|*linux*libc5*)
36 case ${target_alias} in
37 *alpha*|*powerpc*)
38 libc_interface=-libc5.9-
39 ;;
40 *)
41 libc_interface=-libc5-
42 ;;
43 esac
44 ;;
45 *linux*gnu*)
46 # We have to work harder to figure it out.
47 if [ ${target_alias} = ${build_alias} ]
48 then
49 dummy=if$$
50 cat >$dummy.c <<EOF
51#include <features.h>
52main(argc, argv)
53 int argc;
54 char *argv[];
55{
56 printf("%d\n", __GLIBC_MINOR__);
57 return 0;
58}
59EOF
60 ${CC-cc} $dummy.c -o $dummy 2>/dev/null
61 if [ "$?" = 0 ]
62 then
63 libc_interface=-libc6.`./$dummy`-
64 rm -f $dummy.c $dummy
65 else
66 # It should never happen.
67 echo "Cannot find the GNU C library minor version number." >&2
68 rm -f $dummy.c $dummy
69 exit 1
70 fi
71 else
72 # Cross compiling. Assume glibc 2.1.
73 libc_interface=-libc6.1-
74 fi
75 ;;
76 *)
77 libc_interface=-
78 ;;
79 esac
80fi