SUN make and gcc 3.0

Hans-Peter Nilsson hans-peter.nilsson@axis.com
Mon May 21 00:32:00 GMT 2001


On request from Mark Mitchell, I've looked into creating patches
to make gcc 3.0 (currently the branch) buildable with SUN make.
I'm pleasantly surprised that there wasn't much tweaking needed.
Perhaps the make in Solaris 2.8 has improved compared to
previous versions.

There were two types of problems:
- Shell commands in backtick expansion must "succeed".
- VPATH is colon-delimited, not space-delimited.  (GNU make
  handles both space and colons as delimiters.)  Perhaps it can be
  seen as an automake issue.

Other than that, of course libstdc++-v3 shouldn't bail out when
it doesn't find GNU make. :-)

Here are patches that seem to fix this, and which seem to work
fine *for srcdir != objdir, from scratch* (i.e. pristine
untarred sources and empty objdir).  Bootstrapped and checked on
sparc-sun-solaris2.8, from gcc 2.95.2.

The test machine, where I don't have root access, has GNU make
installed in /usr/bin as "make" and in /usr/local/bin as gmake.
I tested the patches by putting /usr/ccs/bin (home of SUN make)
earlier in PATH and hiding GNU make behind "failing" scripts by
name of gmake and gnumake located earlier in PATH.  When running
the testsuite, I used GNU make, as the perceived need to avoid
installing SUN make is only for plain installation of gcc.

There were no testsuite regressions (from GNU make with srcdir
!= objdir) using SUN make and srcdir != objdir, but these
libstdc++-v3 regressions occurred with srcdir == objdir:

FAIL: 27_io/filebuf.cc execution test
FAIL: 27_io/filebuf_members.cc execution test
FAIL: 27_io/ifstream_members.cc execution test
FAIL: 27_io/istream_extractor_other.cc execution test
FAIL: 27_io/istream_seeks.cc execution test
FAIL: 27_io/istream_unformatted.cc execution test
FAIL: 27_io/ostream_inserter_other.cc execution test

The failures are noted as assert failures in the log.  Since
srcdir == objdir is unrecommended, I haven't looked into it
further.

I didn't really regenerate libstdc++-v3/src/Makefile.in
completely.  The automake version I've installed made lots of
"noise" in the generated Makefile.in.  However, I cut'n'pasted
the essential line in the patch from the generated
libstdc++-v3/src/Makefile.in in an attempt to avoid human
errors.  The "noise" reason is also why the three lines in
libstdc++-v3/configure.in weren't collapsed into one.  I guess
the GNU make check isn't needed unless it's made to fail if GNU
make is not found and there's no @ifGNUmake@ to expand in
Makefile.am.  (I know patches to generated files aren't
generally wanted, but these patches aren't mainly for reviewer
consumption, rather for distributor or end-user consumption.)

This is not a request to commit these patches anywhere.  I'll
try and remember to update them for the final 3.0 version and
put them on the web somewhere, so people don't have to tinker
with the version in the mailing list archives.

toplevel:
	* configure.in (libstdcxx_flags): Do not try to execute
	libstdc++-v3/testsuite_flags until it exists.  Make command always
	succeed.

gcc:
	* Makefile.in (s-mlib): Make backtick-commands always succeed.
	(DRIVER_DEFINES): Ditto.

libstdc++-v3:

	* src/Makefile.am (VPATH): Delimit with ":", not space.

	* configure.in (use of GLIBCPP_CHECK_GNU_MAKE): Don't fail if GNU
	make isn't found.
	* configure: Regenerate.

Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/configure.in,v
retrieving revision 1.90.2.14
diff -c -p -r1.90.2.14 configure.in
*** configure.in	2001/05/19 04:22:20	1.90.2.14
--- configure.in	2001/05/19 18:11:54
*************** fi
*** 50,56 ****
  
  libstdcxx_version="target-libstdc++-v3"
  # Don't use libstdc++-v3's flags to configure/build itself.
! libstdcxx_flags='`case $$dir in libstdc++-v3) ;; *) $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags --build-includes ;; esac` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
  
  # these tools are built for the host environment
  # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
--- 50,56 ----
  
  libstdcxx_version="target-libstdc++-v3"
  # Don't use libstdc++-v3's flags to configure/build itself.
! libstdcxx_flags='`case $$dir in libstdc++-v3) ;; *) test -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags && $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags --build-includes || true;; esac` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
  
  # these tools are built for the host environment
  # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
Index: gcc/Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.602.2.24
diff -c -p -r1.602.2.24 Makefile.in
*** gcc/Makefile.in	2001/05/17 01:34:29	1.602.2.24
--- gcc/Makefile.in	2001/05/19 18:22:07
*************** libgcc.a: $(LIBGCC_DEPS)
*** 1121,1132 ****
  multilib.h: s-mlib; @true
  s-mlib: $(srcdir)/genmultilib Makefile
  	$(SHELL) $(srcdir)/genmultilib \
! 	  "`test @enable_multilib@ = yes && echo $(MULTILIB_OPTIONS)`" \
! 	  "`test @enable_multilib@ = yes && echo $(MULTILIB_DIRNAMES)`" \
! 	  "`test @enable_multilib@ = yes && echo $(MULTILIB_MATCHES)`" \
! 	  "`test @enable_multilib@ = yes && echo $(MULTILIB_EXCEPTIONS)`" \
! 	  "`test @enable_multilib@ = yes && echo $(MULTILIB_EXTRA_OPTS)`" \
! 	  "`test @enable_multilib@ = yes && echo $(MULTILIB_EXCLUSIONS)`" \
  		> tmp-mlib.h
  	$(SHELL) $(srcdir)/move-if-change tmp-mlib.h multilib.h
  	$(STAMP) s-mlib
--- 1121,1132 ----
  multilib.h: s-mlib; @true
  s-mlib: $(srcdir)/genmultilib Makefile
  	$(SHELL) $(srcdir)/genmultilib \
! 	  "`test @enable_multilib@ != yes || echo $(MULTILIB_OPTIONS)`" \
! 	  "`test @enable_multilib@ != yes || echo $(MULTILIB_DIRNAMES)`" \
! 	  "`test @enable_multilib@ != yes || echo $(MULTILIB_MATCHES)`" \
! 	  "`test @enable_multilib@ != yes || echo $(MULTILIB_EXCEPTIONS)`" \
! 	  "`test @enable_multilib@ != yes || echo $(MULTILIB_EXTRA_OPTS)`" \
! 	  "`test @enable_multilib@ != yes || echo $(MULTILIB_EXCLUSIONS)`" \
  		> tmp-mlib.h
  	$(SHELL) $(srcdir)/move-if-change tmp-mlib.h multilib.h
  	$(STAMP) s-mlib
*************** DRIVER_DEFINES = \
*** 1322,1329 ****
    -DDEFAULT_TARGET_MACHINE=\"$(target_alias)\" \
    -DSTANDARD_BINDIR_PREFIX=\"$(bindir)/\" \
    -DTOOLDIR_BASE_PREFIX=\"$(unlibsubdir)/../\" \
!   `test "$${SHLIB_LINK}" -a "@enable_shared@" = "yes" && echo "-DENABLE_SHARED_LIBGCC"` \
!   `test "$${SHLIB_MULTILIB}" && echo "-DNO_SHARED_LIBGCC_MULTILIB"`
  
  gcc.o: gcc.c $(CONFIG_H) system.h intl.h multilib.h \
      Makefile $(lang_specs_files) prefix.h $(GCC_H)
--- 1322,1329 ----
    -DDEFAULT_TARGET_MACHINE=\"$(target_alias)\" \
    -DSTANDARD_BINDIR_PREFIX=\"$(bindir)/\" \
    -DTOOLDIR_BASE_PREFIX=\"$(unlibsubdir)/../\" \
!   `test "$${SHLIB_LINK}" -a "@enable_shared@" = "yes" && echo "-DENABLE_SHARED_LIBGCC" || true` \
!   `test "$${SHLIB_MULTILIB}" && echo "-DNO_SHARED_LIBGCC_MULTILIB" || true`
  
  gcc.o: gcc.c $(CONFIG_H) system.h intl.h multilib.h \
      Makefile $(lang_specs_files) prefix.h $(GCC_H)
Index: libstdc++-v3/src/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/Makefile.am,v
retrieving revision 1.71.2.6
diff -c -p -r1.71.2.6 Makefile.am
*** libstdc++-v3/src/Makefile.am	2001/05/19 04:19:31	1.71.2.6
--- libstdc++-v3/src/Makefile.am	2001/05/19 20:53:44
*************** sources = \
*** 173,181 ****
  	string-inst.cc wstring-inst.cc 
  
  
! VPATH += $(top_srcdir) $(top_srcdir)/src
! VPATH += $(GLIBCPP_INCLUDE_DIR) 
! VPATH += $(GLIBCPP_INCLUDE_DIR)/std $(C_INCLUDE_DIR)
  
  libstdc___la_SOURCES = $(sources)
  
--- 173,179 ----
  	string-inst.cc wstring-inst.cc 
  
  
! VPATH = $(top_srcdir):$(top_srcdir)/src:$(GLIBCPP_INCLUDE_DIR):$(GLIBCPP_INCLUDE_DIR)/std:$(C_INCLUDE_DIR)
  
  libstdc___la_SOURCES = $(sources)
  
Index: libstdc++-v3/src/Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/Makefile.in,v
retrieving revision 1.95.2.7
diff -c -p -r1.95.2.7 Makefile.in
*** libstdc++-v3/src/Makefile.in	2001/05/19 04:19:31	1.95.2.7
--- libstdc++-v3/src/Makefile.in	2001/05/19 20:53:44
*************** build_headers =  	bits/std_limits.h 	bit
*** 169,175 ****
  
  sources =  	limitsMEMBERS.cc 	stdexcept.cc functexcept.cc bitset.cc 	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 $(GLIBCPP_INCLUDE_DIR)  $(GLIBCPP_INCLUDE_DIR)/std $(C_INCLUDE_DIR)
  
  libstdc___la_SOURCES = $(sources)
  
--- 169,175 ----
  
  sources =  	limitsMEMBERS.cc 	stdexcept.cc functexcept.cc bitset.cc 	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:$(GLIBCPP_INCLUDE_DIR):$(GLIBCPP_INCLUDE_DIR)/std:$(C_INCLUDE_DIR)
  
  libstdc___la_SOURCES = $(sources)
  
Index: libstdc++-v3/configure.in
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/configure.in,v
retrieving revision 1.54.2.3
diff -p -c -r1.54.2.3 configure.in
*** libstdc++-v3/configure.in	2001/05/14 19:48:53	1.54.2.3
--- libstdc++-v3/configure.in	2001/05/20 02:22:24
*************** AM_PROG_LIBTOOL
*** 51,59 ****
  AC_SUBST(enable_shared)
  AC_SUBST(enable_static)
  GLIBCPP_CHECK_GNU_MAKE
!   if test "x$_cv_gnu_make_command" = "x"; then
!     AC_MSG_ERROR([GNU make not found. Please install it or correct your path.])
!   fi
  AM_CONFIG_HEADER(config.h)
  
  # Check for c++ or library specific bits that don't require linking.
--- 51,59 ----
  AC_SUBST(enable_shared)
  AC_SUBST(enable_static)
  GLIBCPP_CHECK_GNU_MAKE
! 
! 
! 
  AM_CONFIG_HEADER(config.h)
  
  # Check for c++ or library specific bits that don't require linking.
Index: libstdc++-v3/configure
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/configure,v
retrieving revision 1.148.2.10
diff -p -c -r1.148.2.10 configure
*** libstdc++-v3/configure	2001/05/19 21:05:54	1.148.2.10
--- libstdc++-v3/configure	2001/05/20 02:22:28
*************** echo "$ac_t""$_cv_gnu_make_command" 1>&6
*** 2563,2571 ****
    fi
    
  
!   if test "x$_cv_gnu_make_command" = "x"; then
!     { echo "configure: error: GNU make not found. Please install it or correct your path." 1>&2; exit 1; }
!   fi
  
  
  
--- 2563,2571 ----
    fi
    
  
! 
! 
! 
  
  
  

brgds, H-P



More information about the Gcc-patches mailing list