From e80f7f17671d8f18c1a7dcea07fe7c2da1317c61 Mon Sep 17 00:00:00 2001
From: Pavel Chupin <pavel.v.chupin@intel.com>
Date: Wed, 10 Oct 2012 10:02:44 +0000
Subject: [PATCH] Fix missing gthr-default.h issue on separate libstdc++
 configure

        Fix missing gthr-default.h issue on separate libstdc++ configure
        * libstdc++-v3/acinclude.m4: Define glibcxx_thread_h.
        * libstdc++-v3/include/Makefile.am: Use glibcxx_thread_h.
        * libstdc++-v3/Makefile.in: Regenerate.
        * libstdc++-v3/configure: Regenerate.
        * libstdc++-v3/doc/Makefile.in: Regenerate.
        * libstdc++-v3/include/Makefile.in: Regenerate.
        * libstdc++-v3/libsupc++/Makefile.in: Regenerate.
        * libstdc++-v3/po/Makefile.in: Regenerate.
        * libstdc++-v3/python/Makefile.in: Regenerate.
        * libstdc++-v3/src/Makefile.in: Regenerate.
        * libstdc++-v3/src/c++11/Makefile.in: Regenerate.
        * libstdc++-v3/src/c++98/Makefile.in: Regenerate.
        * libstdc++-v3/testsuite/Makefile.in: Regenerate.

From-SVN: r192297
---
 ChangeLog                          | 17 +++++++++++++++++
 libstdc++-v3/Makefile.in           |  1 +
 libstdc++-v3/acinclude.m4          |  6 ++++++
 libstdc++-v3/configure             | 24 ++++++++++++++----------
 libstdc++-v3/doc/Makefile.in       |  1 +
 libstdc++-v3/include/Makefile.am   |  2 +-
 libstdc++-v3/include/Makefile.in   |  3 ++-
 libstdc++-v3/libsupc++/Makefile.in |  1 +
 libstdc++-v3/po/Makefile.in        |  1 +
 libstdc++-v3/python/Makefile.in    |  1 +
 libstdc++-v3/src/Makefile.in       |  1 +
 libstdc++-v3/src/c++11/Makefile.in |  1 +
 libstdc++-v3/src/c++98/Makefile.in |  1 +
 libstdc++-v3/testsuite/Makefile.in |  1 +
 14 files changed, 49 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 98a81624101d..9183d8080058 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2012-10-05  Pavel Chupin  <pavel.v.chupin@intel.com>
+
+	Fix missing gthr-default.h issue on separate libstdc++ configure
+	* libstdc++-v3/acinclude.m4: Define glibcxx_thread_h.
+	* libstdc++-v3/include/Makefile.am: Use glibcxx_thread_h.
+	* libstdc++-v3/Makefile.in: Regenerate.
+	* libstdc++-v3/configure: Regenerate.
+	* libstdc++-v3/doc/Makefile.in: Regenerate.
+	* libstdc++-v3/include/Makefile.in: Regenerate.
+	* libstdc++-v3/libsupc++/Makefile.in: Regenerate.
+	* libstdc++-v3/po/Makefile.in: Regenerate.
+	* libstdc++-v3/python/Makefile.in: Regenerate.
+	* libstdc++-v3/src/Makefile.in: Regenerate.
+	* libstdc++-v3/src/c++11/Makefile.in: Regenerate.
+	* libstdc++-v3/src/c++98/Makefile.in: Regenerate.
+	* libstdc++-v3/testsuite/Makefile.in: Regenerate.
+
 2012-10-10  Richard Biener  <rguenther@suse.de>
 
 	* MAINTAINERS: Adjust for changed surename.
diff --git a/libstdc++-v3/Makefile.in b/libstdc++-v3/Makefile.in
index 34d0e02ede57..921f4edfb83a 100644
--- a/libstdc++-v3/Makefile.in
+++ b/libstdc++-v3/Makefile.in
@@ -244,6 +244,7 @@ glibcxx_localedir = @glibcxx_localedir@
 glibcxx_lt_pic_flag = @glibcxx_lt_pic_flag@
 glibcxx_prefixdir = @glibcxx_prefixdir@
 glibcxx_srcdir = @glibcxx_srcdir@
+glibcxx_thread_h = @glibcxx_thread_h@
 glibcxx_toolexecdir = @glibcxx_toolexecdir@
 glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
 gxx_include_dir = @gxx_include_dir@
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index b9aa5c746e56..bf0edb8f2850 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -3297,10 +3297,16 @@ dnl having to write complex code (the sed commands to clean the macro
 dnl namespace are complex and fragile enough as it is).  We must also
 dnl add a relative path so that -I- is supported properly.
 dnl
+dnl Substs:
+dnl  glibcxx_thread_h
+dnl
 AC_DEFUN([GLIBCXX_ENABLE_THREADS], [
   AC_MSG_CHECKING([for thread model used by GCC])
   target_thread_file=`$CXX -v 2>&1 | sed -n 's/^Thread model: //p'`
   AC_MSG_RESULT([$target_thread_file])
+
+  glibcxx_thread_h=gthr-$target_thread_file.h
+  AC_SUBST(glibcxx_thread_h)
 ])
 
 
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 6ff7148c708b..e828643df035 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -708,6 +708,7 @@ BASIC_FILE_H
 CSTDIO_H
 SECTION_FLAGS
 WERROR
+glibcxx_thread_h
 glibcxx_PCHFLAGS
 GLIBCXX_BUILD_PCH_FALSE
 GLIBCXX_BUILD_PCH_TRUE
@@ -11512,7 +11513,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11515 "configure"
+#line 11516 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11618,7 +11619,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11621 "configure"
+#line 11622 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -15032,7 +15033,7 @@ fi
     #
     # Fake what AC_TRY_COMPILE does.  XXX Look at redoing this new-style.
     cat > conftest.$ac_ext << EOF
-#line 15035 "configure"
+#line 15036 "configure"
 struct S { ~S(); };
 void bar();
 void foo()
@@ -15160,6 +15161,9 @@ $as_echo_n "checking for thread model used by GCC... " >&6; }
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $target_thread_file" >&5
 $as_echo "$target_thread_file" >&6; }
 
+  glibcxx_thread_h=gthr-$target_thread_file.h
+
+
 
 
   ac_ext=cpp
@@ -15367,7 +15371,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; }
   # Fake what AC_TRY_COMPILE does.
 
     cat > conftest.$ac_ext << EOF
-#line 15370 "configure"
+#line 15374 "configure"
 int main()
 {
   typedef bool atomic_type;
@@ -15402,7 +15406,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 15405 "configure"
+#line 15409 "configure"
 int main()
 {
   typedef short atomic_type;
@@ -15437,7 +15441,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 15440 "configure"
+#line 15444 "configure"
 int main()
 {
   // NB: _Atomic_word not necessarily int.
@@ -15473,7 +15477,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 15476 "configure"
+#line 15480 "configure"
 int main()
 {
   typedef long long atomic_type;
@@ -15552,7 +15556,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu
   # unnecessary for this test.
 
     cat > conftest.$ac_ext << EOF
-#line 15555 "configure"
+#line 15559 "configure"
 int main()
 {
   _Decimal32 d1;
@@ -15594,7 +15598,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
   # unnecessary for this test.
 
     cat > conftest.$ac_ext << EOF
-#line 15597 "configure"
+#line 15601 "configure"
 template<typename T1, typename T2>
   struct same
   { typedef T2 type; };
@@ -15628,7 +15632,7 @@ $as_echo "$enable_int128" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 15631 "configure"
+#line 15635 "configure"
 template<typename T1, typename T2>
   struct same
   { typedef T2 type; };
diff --git a/libstdc++-v3/doc/Makefile.in b/libstdc++-v3/doc/Makefile.in
index 240a68c8fa0d..f7aa484c6e28 100644
--- a/libstdc++-v3/doc/Makefile.in
+++ b/libstdc++-v3/doc/Makefile.in
@@ -218,6 +218,7 @@ glibcxx_localedir = @glibcxx_localedir@
 glibcxx_lt_pic_flag = @glibcxx_lt_pic_flag@
 glibcxx_prefixdir = @glibcxx_prefixdir@
 glibcxx_srcdir = @glibcxx_srcdir@
+glibcxx_thread_h = @glibcxx_thread_h@
 glibcxx_toolexecdir = @glibcxx_toolexecdir@
 glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
 gxx_include_dir = @gxx_include_dir@
diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am
index 09925d583c9d..aecc9a7bb022 100644
--- a/libstdc++-v3/include/Makefile.am
+++ b/libstdc++-v3/include/Makefile.am
@@ -1148,7 +1148,7 @@ ${host_builddir}/gthr-posix.h: ${toplevel_srcdir}/libgcc/gthr-posix.h \
 	    -e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \
 	    < $< > $@
 
-${host_builddir}/gthr-default.h: ${toplevel_builddir}/libgcc/gthr-default.h \
+${host_builddir}/gthr-default.h: ${toplevel_srcdir}/libgcc/${glibcxx_thread_h} \
 				   stamp-${host_alias}
 	sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
 	    -e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
index a2536900d2e9..fa52fd7b2d4e 100644
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -216,6 +216,7 @@ glibcxx_localedir = @glibcxx_localedir@
 glibcxx_lt_pic_flag = @glibcxx_lt_pic_flag@
 glibcxx_prefixdir = @glibcxx_prefixdir@
 glibcxx_srcdir = @glibcxx_srcdir@
+glibcxx_thread_h = @glibcxx_thread_h@
 glibcxx_toolexecdir = @glibcxx_toolexecdir@
 glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
 gxx_include_dir = @gxx_include_dir@
@@ -1545,7 +1546,7 @@ ${host_builddir}/gthr-posix.h: ${toplevel_srcdir}/libgcc/gthr-posix.h \
 	    -e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \
 	    < $< > $@
 
-${host_builddir}/gthr-default.h: ${toplevel_builddir}/libgcc/gthr-default.h \
+${host_builddir}/gthr-default.h: ${toplevel_srcdir}/libgcc/${glibcxx_thread_h} \
 				   stamp-${host_alias}
 	sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
 	    -e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in
index e745179cd318..8422d4070487 100644
--- a/libstdc++-v3/libsupc++/Makefile.in
+++ b/libstdc++-v3/libsupc++/Makefile.in
@@ -276,6 +276,7 @@ glibcxx_localedir = @glibcxx_localedir@
 glibcxx_lt_pic_flag = @glibcxx_lt_pic_flag@
 glibcxx_prefixdir = @glibcxx_prefixdir@
 glibcxx_srcdir = @glibcxx_srcdir@
+glibcxx_thread_h = @glibcxx_thread_h@
 glibcxx_toolexecdir = @glibcxx_toolexecdir@
 glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
 gxx_include_dir = @gxx_include_dir@
diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in
index b6e9def9b3f2..ad583c3ea631 100644
--- a/libstdc++-v3/po/Makefile.in
+++ b/libstdc++-v3/po/Makefile.in
@@ -216,6 +216,7 @@ glibcxx_localedir = @glibcxx_localedir@
 glibcxx_lt_pic_flag = @glibcxx_lt_pic_flag@
 glibcxx_prefixdir = @glibcxx_prefixdir@
 glibcxx_srcdir = @glibcxx_srcdir@
+glibcxx_thread_h = @glibcxx_thread_h@
 glibcxx_toolexecdir = @glibcxx_toolexecdir@
 glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
 gxx_include_dir = @gxx_include_dir@
diff --git a/libstdc++-v3/python/Makefile.in b/libstdc++-v3/python/Makefile.in
index d0fd51d897ba..fa0e99d45eea 100644
--- a/libstdc++-v3/python/Makefile.in
+++ b/libstdc++-v3/python/Makefile.in
@@ -240,6 +240,7 @@ glibcxx_localedir = @glibcxx_localedir@
 glibcxx_lt_pic_flag = @glibcxx_lt_pic_flag@
 glibcxx_prefixdir = @glibcxx_prefixdir@
 glibcxx_srcdir = @glibcxx_srcdir@
+glibcxx_thread_h = @glibcxx_thread_h@
 glibcxx_toolexecdir = @glibcxx_toolexecdir@
 glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
 gxx_include_dir = @gxx_include_dir@
diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in
index 56eb09afc22f..6cd16c3476df 100644
--- a/libstdc++-v3/src/Makefile.in
+++ b/libstdc++-v3/src/Makefile.in
@@ -266,6 +266,7 @@ glibcxx_localedir = @glibcxx_localedir@
 glibcxx_lt_pic_flag = @glibcxx_lt_pic_flag@
 glibcxx_prefixdir = @glibcxx_prefixdir@
 glibcxx_srcdir = @glibcxx_srcdir@
+glibcxx_thread_h = @glibcxx_thread_h@
 glibcxx_toolexecdir = @glibcxx_toolexecdir@
 glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
 gxx_include_dir = @gxx_include_dir@
diff --git a/libstdc++-v3/src/c++11/Makefile.in b/libstdc++-v3/src/c++11/Makefile.in
index 22a8c531f254..dc46f29f148f 100644
--- a/libstdc++-v3/src/c++11/Makefile.in
+++ b/libstdc++-v3/src/c++11/Makefile.in
@@ -233,6 +233,7 @@ glibcxx_localedir = @glibcxx_localedir@
 glibcxx_lt_pic_flag = @glibcxx_lt_pic_flag@
 glibcxx_prefixdir = @glibcxx_prefixdir@
 glibcxx_srcdir = @glibcxx_srcdir@
+glibcxx_thread_h = @glibcxx_thread_h@
 glibcxx_toolexecdir = @glibcxx_toolexecdir@
 glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
 gxx_include_dir = @gxx_include_dir@
diff --git a/libstdc++-v3/src/c++98/Makefile.in b/libstdc++-v3/src/c++98/Makefile.in
index 26608c5634ee..d897274345d2 100644
--- a/libstdc++-v3/src/c++98/Makefile.in
+++ b/libstdc++-v3/src/c++98/Makefile.in
@@ -249,6 +249,7 @@ glibcxx_localedir = @glibcxx_localedir@
 glibcxx_lt_pic_flag = @glibcxx_lt_pic_flag@
 glibcxx_prefixdir = @glibcxx_prefixdir@
 glibcxx_srcdir = @glibcxx_srcdir@
+glibcxx_thread_h = @glibcxx_thread_h@
 glibcxx_toolexecdir = @glibcxx_toolexecdir@
 glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
 gxx_include_dir = @gxx_include_dir@
diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in
index d286ce2a5c7e..9169956e9afb 100644
--- a/libstdc++-v3/testsuite/Makefile.in
+++ b/libstdc++-v3/testsuite/Makefile.in
@@ -216,6 +216,7 @@ glibcxx_localedir = @glibcxx_localedir@
 glibcxx_lt_pic_flag = @glibcxx_lt_pic_flag@
 glibcxx_prefixdir = @glibcxx_prefixdir@
 glibcxx_srcdir = @glibcxx_srcdir@
+glibcxx_thread_h = @glibcxx_thread_h@
 glibcxx_toolexecdir = @glibcxx_toolexecdir@
 glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
 gxx_include_dir = @gxx_include_dir@
-- 
GitLab