OSDN Git Service

* approved by rth
[pf3gnuchains/gcc-fork.git] / config.if
index f8e086d..aa35a3f 100644 (file)
--- a/config.if
+++ b/config.if
@@ -2,9 +2,8 @@
 # Don't call it directly. This shell script fragment is called to
 # determine:
 #
-#      1. libstcxx_interface: the interface name for libstdc++.
-#      2. cxx_interface: the interface name for c++.
-#      3. libc_interface: the interface name for libc.
+#      1. libstcxx_incdir: the interface name for libstdc++.
+#      2. libc_interface: the interface name for libc.
 #
 
 # Get the top level src dir.
@@ -21,26 +20,12 @@ else
   if_topsrcdir=${top_srcdir}
 fi
 
-if [ "${enable_libstdcxx_v3}" = "yes" ] ; then
-  libstdcxx_srcdir=${if_topsrcdir}/libstdc++-v3
-else
-  libstdcxx_srcdir=${if_topsrcdir}/libstdc++
-fi
-
-echo "${libstdcxx_srcdir} is where"
-if [ -f ${libstdcxx_srcdir}/Makefile.in ]; then
-# We check libstdc++ for libstdcxx_interface.
-libstdcxx_interface=`grep "^INTERFACE" ${libstdcxx_srcdir}/Makefile.in | sed 's/INTERFACE[     ]*=[    ]*\(.*\)/\1/'`
-else
-libstdcxx_interface=
-fi
-
-if [ -f ${if_topsrcdir}/gcc/cp/Makefile.in ]; then
-# We check gcc/cp for cxx_interface.
-cxx_interface=`grep "^INTERFACE" ${if_topsrcdir}/gcc/cp/Makefile.in | sed 's/INTERFACE[        ]*=[    ]*\(.*\)/\1/'`
-else
-cxx_interface=
-fi
+# Set libstdcxx_incdir.
+# This is the same as gcc/configure.in and libstdc++-v3/acinclude.m4. 
+gcc_version_trigger=${if_topsrcdir}/gcc/version.c
+gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^"]*\)".*/\1/'`
+gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
+libstdcxx_incdir=c++/${gcc_version}
 
 # The trickiest part is libc_interface.
 if [ -z "${libc_interface}" ]