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
27 libstdcxx_srcdir=${if_topsrcdir}/libstdc++
30 if [ -f ${libstdcxx_srcdir}/Makefile.in ]; then
31 # We check libstdc++ for libstdcxx_interface.
32 libstdcxx_interface=`grep "^INTERFACE" ${libstdcxx_srcdir}/Makefile.in | sed 's/INTERFACE[ ]*=[ ]*\(.*\)/\1/'`
37 if [ -f ${if_topsrcdir}/gcc/cp/Makefile.in ]; then
38 # We check gcc/cp for cxx_interface.
39 cxx_interface=`grep "^INTERFACE" ${if_topsrcdir}/gcc/cp/Makefile.in | sed 's/INTERFACE[ ]*=[ ]*\(.*\)/\1/'`
44 # The trickiest part is libc_interface.
45 if [ -z "${libc_interface}" ]
48 *linux*libc1*|*linux*libc5*)
49 case ${target_alias} in
51 libc_interface=-libc5.9-
54 libc_interface=-libc5-
59 # We have to work harder to figure it out.
60 if [ ${target_alias} = ${build_alias} ]
69 printf("%d\n", __GLIBC_MINOR__);
73 ${CC-cc} $dummy.c -o $dummy 2>/dev/null
76 libc_interface=-libc6.`./$dummy`-
79 # It should never happen.
80 echo "Cannot find the GNU C library minor version number." >&2
85 # Cross compiling. Assume glibc 2.1.
86 libc_interface=-libc6.1-