2 # Don't call it directly. This shell script fragment is called to
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.
10 # Get the top level src dir.
11 if [ -z "${topsrcdir}" -a -z "${top_srcdir}" ]
13 echo "Undefined top level src dir: topsrcdir and top_srcdir are empty" >&2
17 if [ -n "${topsrcdir}" ]
19 if_topsrcdir=${topsrcdir}
21 if_topsrcdir=${top_srcdir}
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/'`
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/'`
33 libstdcxx_incdir=g++-${libstdcxx_interface}
34 # Used to version libstdc++ shared libraries
37 # The trickiest part is libc_interface.
38 if [ -z "${libc_interface}" ]
41 *linux*libc1*|*linux*libc5*)
42 case ${target_alias} in
44 libc_interface=-libc5.9-
47 libc_interface=-libc5-
52 # We have to work harder to figure it out.
53 if [ ${target_alias} = ${build_alias} ]
62 printf("%d\n", __GLIBC_MINOR__);
66 ${CC-cc} $dummy.c -o $dummy 2>/dev/null
69 libc_interface=-libc6.`./$dummy`-
72 # It should never happen.
73 echo "Cannot find the GNU C library minor version number." >&2
78 # Cross compiling. Assume glibc 2.1.
79 libc_interface=-libc6.1-