]> gcc.gnu.org Git - gcc.git/blob - config.if
sh.md (mova_const): New pattern.
[gcc.git] / config.if
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.
11 if [ -z "${topsrcdir}" -a -z "${top_srcdir}" ]
12 then
13 echo "Undefined top level src dir: topsrcdir and top_srcdir are empty" >&2
14 exit 1
15 fi
16
17 if [ -n "${topsrcdir}" ]
18 then
19 if_topsrcdir=${topsrcdir}
20 else
21 if_topsrcdir=${top_srcdir}
22 fi
23
24 if [ "${enable_libstdcxx_v3}" = "yes" ] ; then
25 libstdcxx_srcdir=${if_topsrcdir}/libstdc++-v3
26 # We check libstdc++-v3/configure.in for libstdcxx_interface.
27 libstdcxx_interface=`grep "^INTERFACE" ${libstdcxx_srcdir}/configure.in | sed 's/INTERFACE[ ]*=[ ]*\(.*\)/\1/'`
28 else
29 libstdcxx_srcdir=${if_topsrcdir}/libstdc++
30 # We check libstdc++/Makefile.in for libstdcxx_interface.
31 libstdcxx_interface=`grep "^INTERFACE" ${libstdcxx_srcdir}/Makefile.in | sed 's/INTERFACE[ ]*=[ ]*\(.*\)/\1/'`
32 fi
33
34 if [ -f ${if_topsrcdir}/gcc/cp/Makefile.in ]; then
35 # We check gcc/cp for cxx_interface.
36 cxx_interface=`grep "^INTERFACE" ${if_topsrcdir}/gcc/cp/Makefile.in | sed 's/INTERFACE[ ]*=[ ]*\(.*\)/\1/'`
37 else
38 cxx_interface=
39 fi
40
41 # The trickiest part is libc_interface.
42 if [ -z "${libc_interface}" ]
43 then
44 case ${target_os} in
45 *linux*libc1*|*linux*libc5*)
46 case ${target_alias} in
47 *alpha*|*powerpc*)
48 libc_interface=-libc5.9-
49 ;;
50 *)
51 libc_interface=-libc5-
52 ;;
53 esac
54 ;;
55 *linux*gnu*)
56 # We have to work harder to figure it out.
57 if [ ${target_alias} = ${build_alias} ]
58 then
59 dummy=if$$
60 cat >$dummy.c <<EOF
61 #include <features.h>
62 main(argc, argv)
63 int argc;
64 char *argv[];
65 {
66 printf("%d\n", __GLIBC_MINOR__);
67 return 0;
68 }
69 EOF
70 ${CC-cc} $dummy.c -o $dummy 2>/dev/null
71 if [ "$?" = 0 ]
72 then
73 libc_interface=-libc6.`./$dummy`-
74 rm -f $dummy.c $dummy
75 else
76 # It should never happen.
77 echo "Cannot find the GNU C library minor version number." >&2
78 rm -f $dummy.c $dummy
79 exit 1
80 fi
81 else
82 # Cross compiling. Assume glibc 2.1.
83 libc_interface=-libc6.1-
84 fi
85 ;;
86 *)
87 libc_interface=-
88 ;;
89 esac
90 fi
This page took 0.03912 seconds and 5 git commands to generate.