This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[v3] clean up wstring-inst.cc build rules



There was something odd with the wstring-inst.[o,lo] rules in the src
Makefile. Basically, linst-wstring.la wasn't getting cleaned up with a
'make clean' which was bad.

It looks like this might be a bug in automake. Possible work-arounds
include using CONFIG_CLEAN_FILES or re-working the Makefile.

Here's a patch based on the second approach.

I'm not convinced it's the best way to go, but it does work and it
removes all the slightly strained wstring-inst.cc rules in the
Makefile, which I consider a plus.

Pending objections, I'll check this in tonight.

2001-03-02  Benjamin Kosnik  <bkoz@redhat.com>

	* src/wstring-inst.cc: New file.
	* src/Makefile.am (EXTRA_LTLIBRARIES): Remove.
	(libinst_wstring_la_SOURCES): Remove.
	(libstdc___la_LIBADD): Remove libinst_wstring_la.
	(sources): Add wstring-inst.cc
	* acinclude.m4 (GLIBCPP_CHECK_WCHAR_T_SUPPORT): Remove
	libinst_wstring_la.

Index: acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/acinclude.m4,v
retrieving revision 1.135
diff -c -p -r1.135 acinclude.m4
*** acinclude.m4	2001/03/01 00:37:16	1.135
--- acinclude.m4	2001/03/02 19:58:31
*************** AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, 
*** 852,866 ****
      AC_MSG_CHECKING([for enabled wchar_t specializations])
      if test x"$ac_isoC99_wchar_t" = xyes \
         && test x"$ac_XPG2_wchar_t" = xyes; then
-       libinst_wstring_la="libinst-wstring.la"
        AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
        AC_MSG_RESULT("yes")
      else
-       libinst_wstring_la=""
        AC_MSG_RESULT("no")
      fi
-     AC_SUBST(libinst_wstring_la)
-   
    else
      dnl Wide characters disabled by the user. 
      AC_MSG_WARN([wchar_t support disabled.])
--- 852,862 ----
Index: src/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/Makefile.am,v
retrieving revision 1.76
diff -c -p -r1.76 Makefile.am
*** Makefile.am	2001/03/01 00:37:18	1.76
--- Makefile.am	2001/03/02 19:58:32
*************** mkinstalldirs = $(SHELL) $(toplevel_srcd
*** 32,38 ****
  toolexecdir = @glibcpp_toolexecdir@
  toolexeclibdir = @glibcpp_toolexeclibdir@
  toolexeclib_LTLIBRARIES = libstdc++.la
- EXTRA_LTLIBRARIES = libinst-string.la libinst-wstring.la
  
  # Compile flags that should be constant throughout the build, both for
  # SUBDIRS and for libstdc++-v3 in general.
--- 32,37 ----
*************** sources = \
*** 169,178 ****
          globals.cc \
  	basic_file.cc ios.cc complex_io.cc strstream.cc \
  	c++locale.cc locale.cc localename.cc codecvt.cc \
! 	locale-inst.cc stl-inst.cc misc-inst.cc valarray-inst.cc string-inst.cc
  
- wstring_sources = \
- 	wstring-inst.cc
  
  VPATH += $(top_srcdir) $(top_srcdir)/src
  VPATH += $(GLIBCPP_INCLUDE_DIR) 
--- 168,176 ----
          globals.cc \
  	basic_file.cc ios.cc complex_io.cc strstream.cc \
  	c++locale.cc locale.cc localename.cc codecvt.cc \
! 	locale-inst.cc stl-inst.cc misc-inst.cc valarray-inst.cc \
! 	string-inst.cc wstring-inst.cc 
  
  
  VPATH += $(top_srcdir) $(top_srcdir)/src
  VPATH += $(GLIBCPP_INCLUDE_DIR) 
*************** VPATH += $(GLIBCPP_INCLUDE_DIR)/std $(C_
*** 180,191 ****
  
  libstdc___la_SOURCES = $(sources)
  
- libinst_wstring_la_SOURCES = $(wstring_sources)
- 
  libstdc___la_LIBADD = \
  	../libmath/libmath.la @libio_la@ \
! 	../libsupc++/libsupc++convenience.la \
! 	@libinst_wstring_la@
  
  libstdc___la_LDFLAGS = -version-info 3:0:0 -lm
  
--- 178,186 ----
  
  libstdc___la_SOURCES = $(sources)
  
  libstdc___la_LIBADD = \
  	../libmath/libmath.la @libio_la@ \
! 	../libsupc++/libsupc++convenience.la
  
  libstdc___la_LDFLAGS = -version-info 3:0:0 -lm
  
*************** strstream.lo: strstream.cc
*** 198,210 ****
  	$(LTCXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -c $<
  strstream.o: strstream.cc
  	$(CXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -c $<
- 
- # Make wstring-inst.cc from string-inst.cc
- wstring-inst.o: string-inst.cc
- 	$(CXXCOMPILE) -c -DC=wchar_t $< -o $@
- wstring-inst.lo: string-inst.cc
- 	$(LTCXXCOMPILE) -c -DC=wchar_t $< -o $@
- 
  
  # Make sure cshadow headers are built first.
  if GLIBCPP_USE_CSHADOW
--- 193,198 ----
Index: src/wstring-inst.cc
===================================================================
RCS file: wstring-inst.cc
diff -N wstring-inst.cc
*** /dev/null	Tue May  5 13:32:27 1998
--- wstring-inst.cc	Fri Mar  2 12:00:49 2001
***************
*** 0 ****
--- 1,6 ----
+ #include <bits/c++config.h>
+ 
+ #ifdef _GLIBCPP_USE_WCHAR_T
+ #define C wchar_t
+ #include "string-inst.cc"
+ #endif


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]