2 # Don't call it directly. This shell script fragment is called to
5 # 1. libstcxx_incdir: the interface name for libstdc++.
6 # 2. libc_interface: the interface name for libc.
9 # Get the top level src dir.
10 if [ -z "${topsrcdir}" -a -z "${top_srcdir}" ]
12 echo "Undefined top level src dir: topsrcdir and top_srcdir are empty" >&2
16 if [ -n "${topsrcdir}" ]
18 if_topsrcdir=${topsrcdir}
20 if_topsrcdir=${top_srcdir}
23 # Set libstdcxx_incdir.
24 # This is the same as gcc/configure.in and libstdc++-v3/acinclude.m4.
25 if test -z "$gcc_version"; then
26 if test -z "${gcc_version_trigger}" \
27 && test -f ${if_topsrcdir}/gcc/version.c; then
28 gcc_version_trigger=${if_topsrcdir}/gcc/version.c
30 if test -f "${gcc_version_trigger}"; then
31 gcc_version_full=`grep version_string "${gcc_version_trigger}" | sed -e 's/.*"\([^"]*\)".*/\1/'`
33 gcc_version_full=`$CC -v 2>&1 | sed -n 's/^gcc version //p'`
35 gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
37 libstdcxx_incdir=c++/${gcc_version}
39 # The trickiest part is libc_interface.
40 if [ -z "${libc_interface}" ]
43 *linux*libc1*|*linux*libc5*)
44 case ${target_alias} in
46 libc_interface=-libc5.9-
49 libc_interface=-libc5-
54 # We have to work harder to figure it out.
55 if [ ${target_alias} = ${build_alias} ]
64 printf("%d\n", __GLIBC_MINOR__);
68 ${CC-cc} $dummy.c -o $dummy 2>/dev/null
71 libc_interface=-libc6.`./$dummy`-
74 # It should never happen.
75 echo "Cannot find the GNU C library minor version number." >&2
80 # Cross compiling. Assume glibc 2.1.
81 libc_interface=-libc6.1-