1f7cc78ecSespie#! /dev/null 2f7cc78ecSespie# Don't call it directly. This shell script fragment is called to 3f7cc78ecSespie# determine: 4f7cc78ecSespie# 5*d2201f2fSdrahn# 1. libstcxx_incdir: the interface name for libstdc++. 6f7cc78ecSespie# 7f7cc78ecSespie 8f7cc78ecSespie# Get the top level src dir. 9f7cc78ecSespieif [ -z "${topsrcdir}" -a -z "${top_srcdir}" ] 10f7cc78ecSespiethen 11f7cc78ecSespie echo "Undefined top level src dir: topsrcdir and top_srcdir are empty" >&2 12f7cc78ecSespie exit 1 13f7cc78ecSespiefi 14f7cc78ecSespie 15f7cc78ecSespieif [ -n "${topsrcdir}" ] 16f7cc78ecSespiethen 17f7cc78ecSespie if_topsrcdir=${topsrcdir} 18f7cc78ecSespieelse 19f7cc78ecSespie if_topsrcdir=${top_srcdir} 20f7cc78ecSespiefi 21f7cc78ecSespie 22*d2201f2fSdrahn# Set libstdcxx_incdir. 23*d2201f2fSdrahn# This is the same as gcc/configure.in and libstdc++-v3/acinclude.m4. 24*d2201f2fSdrahnif test -z "$gcc_version"; then 25*d2201f2fSdrahn if test -z "${gcc_version_trigger}" \ 26*d2201f2fSdrahn && test -f ${if_topsrcdir}/gcc/version.c; then 27*d2201f2fSdrahn gcc_version_trigger=${if_topsrcdir}/gcc/version.c 285f210c2aSfgsch fi 29*d2201f2fSdrahn if test -f "${gcc_version_trigger}"; then 30*d2201f2fSdrahn gcc_version_full=`grep version_string "${gcc_version_trigger}" | sed -e 's/.*"\([^"]*\)".*/\1/'` 31f7cc78ecSespie else 32*d2201f2fSdrahn gcc_version_full=`$CC -v 2>&1 | sed -n 's/^gcc version //p'` 33f7cc78ecSespie fi 34*d2201f2fSdrahn gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'` 35f7cc78ecSespiefi 36*d2201f2fSdrahnlibstdcxx_incdir=c++/${gcc_version} 37f7cc78ecSespie 38