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