Patchwork [v3] libstdc++/49829

login
register
mail settings
Submitter Benjamin Kosnik
Date Jan. 25, 2012, 5:26 a.m.
Message ID <20120124212637.47fb3b10@shotwell>
Download mbox | patch
Permalink /patch/137708/
State New
Headers show

Comments

Benjamin Kosnik - Jan. 25, 2012, 5:26 a.m.
> this breaks builds configured with --enable-libstdcxx-debug.

confirmed

>  Tried
> the following (not yet working) fix.

OK. The attached is closer, but still not quite there.

-benjamin

Patch

diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am
index 87b2a16..59cc57d 100644
--- a/libstdc++-v3/src/Makefile.am
+++ b/libstdc++-v3/src/Makefile.am
@@ -172,13 +172,23 @@  endif
 # 1 debug library
 # 2 supra-convenience library
 if GLIBCXX_BUILD_DEBUG
-all-local: libstdc++convenience.la build_debug
-install-data-local: install_debug
+STAMP_DEBUG = build-debug
+STAMP_INSTALL_DEBUG = install-debug
+CLEAN_DEBUG = debug
 else
-all-local: libstdc++convenience.la
-install-data-local:
+STAMP_DEBUG =
+STAMP_INSTALL_DEBUG =
+CLEAN_DEBUG =
 endif
 
+all-local-once: libstdc++convenience.la $(STAMP_DEBUG)
+install-data-local-once: $(STAMP_INSTALL_DEBUG)
+
+all-local: all-local-once
+install-data-local: install-data-local-once
+clean-local:
+	rm -rf libstdc++convenience.la stamp* $(CLEAN_DEBUG)
+
 # Make a non-installed convenience library, so that --disable-static
 # may work.
 libstdc++convenience.la: $(toolexeclib_LTLIBRARIES)
@@ -188,13 +198,13 @@  libstdc++convenience.la: $(toolexeclib_LTLIBRARIES)
 	fi; \
 	echo `date` > stamp-libstdc++convenience;
 
-debugdir = debug
-
-# Build a set of debug objects here.
+# Build a debug variant.
 # Take care to fix all possibly-relative paths.
+debugdir = ${glibcxx_builddir}/src/debug
 stamp-debug:
 	if test ! -d ${debugdir}; then \
 	  mkdir -p ${debugdir}; \
+	  for d in $(SUBDIRS); do mkdir -p  ${debugdir}/$$d; done; \
 	  (cd ${debugdir}; \
 	  sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \
 	      -e 's/top_build_prefix = \.\./top_build_prefix = ..\/../' \
@@ -202,16 +212,25 @@  stamp-debug:
 	      -e 's/VPATH = \.\./VPATH = ..\/../' \
 	      -e 's/glibcxx_basedir = \.\./glibcxx_basedir = ..\/../' \
 	      -e 's/MKDIR_P = \.\./MKDIR_P = ..\/../' \
-	      -e 's/all-local: build_debug/all-local:/' \
-	      -e 's/install-data-local: install_debug/install-data-local:/' \
-	  < ../Makefile > Makefile) ; \
+	      -e 's/all-local: all-local-once/all-local:/' \
+	      -e 's/install-data-local: install-data-local-once/install-data-local:/' \
+	  < ../Makefile > Makefile ; \
+	  for d in . $(SUBDIRS); do \
+	  sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \
+	      -e 's/top_build_prefix = \.\./top_build_prefix = ..\/../' \
+	      -e 's/srcdir = \.\./srcdir = ..\/../' \
+	      -e 's/VPATH = \.\./VPATH = ..\/../' \
+	      -e 's/glibcxx_basedir = \.\./glibcxx_basedir = ..\/../' \
+	      -e 's/MKDIR_P = \.\./MKDIR_P = ..\/../' \
+	  < ../$$d/Makefile > $$d/Makefile ; \
+	  done) ; \
 	fi; \
 	echo `date` > stamp-debug;
 
-build_debug: stamp-debug
-	(cd ${debugdir} && $(MAKE) CXXFLAGS='$(DEBUG_FLAGS)' all)
+build-debug: stamp-debug
+	(cd ${debugdir} && $(MAKE) CXXFLAGS='$(DEBUG_FLAGS)' libstdc++.la)
 
-# Install debug library here.
-install_debug:
+# Install debug library.
+install-debug: stamp-debug
 	(cd ${debugdir} && $(MAKE) \
 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)