latest snapshot won't find C++ header files

Manfred Hollstein manfred@s-direktnet.de
Mon Oct 12 02:49:00 GMT 1998


On nil, 11 October 1998, 19:30:44, oliva@dcc.unicamp.br wrote:

 > Manfred Hollstein <manfred@s-direktnet.de> writes:
 > 
 > >     but simply adding "-B${exec_prefix}/${target}/bin" to the
 > >     appropriate ..._CFLAGS might be the better solution (again, this
 > >     is, what Alexandre suggested in his email).
 > 
 > Is this /bin at the end really needed?  Otherwise, the attached patch
 > that should do it...  It introduces absolute_tooldir in the top-level
 > Makefile and in the gcc subdir, and adds -B$(build_tooldir)/ wherever
 > some -B flag is issued to xgcc.  I hope this is enough, but I can't
 > test it myself now.

Yes, the "/bin/" *is* needed; the binutils like "as", "ld" ... are
installed in ${exec_prefix}/${target}"/bin", hence "xgcc" needs to be
told, to look for them in that particular directory.  If you change
your "-B$(build_tooldir)/" into "-B$(build_tooldir)/bin/" everything
should work with your patch.  Unfortunately, I cannot test it myself,
too.

 > 
 > BTW, why does gcc/Makefile.in defines tooldir as .../$(target_alias),
 > whereas the top-level Makefile defines it as .../$(target)?

The top-level Makefile is wrong; if you look at top-level configure
line 705 and 1349, you'll see, that it's using $(target_alias)
itself.  If your patch will be accepted, would you please add a
similar sed pattern to those around line 1349 in the top-level
configure to also properly replace the new "build_tooldir = ..."?

manfred

 > 
 > -- 
 > Alexandre Oliva
 > mailto:oliva@dcc.unicamp.br mailto:oliva@gnu.org mailto:aoliva@acm.org
 > http://www.dcc.unicamp.br/~oliva
 > Universidade Estadual de Campinas, SP, Brasil
 > [2 tooldir.diff <application/octet-stream>]
 > for ChangeLog:
 > from  Alexandre Oliva  <oliva@dcc.unicamp.br>
 > 	* Makefile.in (build_tooldir): new variable, same as tooldir
 > 	(CC_FOR_TARGET, GCC_FOR_TARGET): add -B$(build_tooldir)/
 > 	(BASE_FLAGS_TO_PASS): pass build_tooldir down
 > 	
 > for gcc/ChangeLog:
 > from  Alexandre Oliva  <oliva@dcc.unicamp.br>
 > 	* Makefile.in (build_tooldir): new variable, same as old
 > 	$(tooldir), but without depending on $(libdir)/$(unlibsubdir)
 > 	(GCC_FOR_TARGET): add -B$(build_tooldir)/
 > 	(bootstrap, bootstrap2, bootstrap3, bootstrap4): ditto
 > 
 > Index: Makefile.in
 > --- ../egcs/Makefile.in	Tue Oct  6 00:41:25 1998
 > +++ Makefile.in	Sun Oct 11 18:51:10 1998
 > @@ -25,6 +25,7 @@
 >  bindir = $(exec_prefix)/bin
 >  libdir = $(exec_prefix)/lib
 >  tooldir = $(exec_prefix)/$(target)
 > +build_tooldir = $(exec_prefix)/$(target)
 >  
 >  program_transform_name =
 >  
 > @@ -195,12 +196,12 @@
 >    if [ -f $$r/gcc/xgcc ] ; then \
 >      if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
 >        if [ -f $$r/$(TARGET_SUBDIR)/winsup/Makefile ] ; then \
 > -        echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/$(TARGET_SUBDIR)/newlib/ -L$$r/$(TARGET_SUBDIR)/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
 > +        echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/$(TARGET_SUBDIR)/newlib/ -B$(build_tooldir)/ -L$$r/$(TARGET_SUBDIR)/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
 >        else \
 > -        echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
 > +        echo $$r/gcc/xgcc -B$$r/gcc/ -B$(build_tooldir)/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
 >        fi; \
 >      else \
 > -      echo $$r/gcc/xgcc -B$$r/gcc/; \
 > +      echo $$r/gcc/xgcc -B$$r/gcc/ -B$(build_tooldir)/; \
 >      fi; \
 >    else \
 >      if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
 > @@ -214,7 +215,7 @@
 >  # variable is passed down to the gcc Makefile, where it is used to
 >  # build libgcc2.a.  We define it here so that it can itself be
 >  # overridden on the command line.
 > -GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/
 > +GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/ -B$(build_tooldir)/
 >  
 >  
 >  CXX_FOR_TARGET = ` \
 > @@ -358,6 +359,7 @@
 >  	"exec_prefix=$(exec_prefix)" \
 >  	"prefix=$(prefix)" \
 >  	"tooldir=$(tooldir)" \
 > +	"build_tooldir=$(build_tooldir)" \
 >  	"gxx_include_dir=$(gxx_include_dir)" \
 >  	"gcc_version=$(gcc_version)" \
 >  	"gcc_version_trigger=$(gcc_version_trigger)" \
 > Index: gcc/Makefile.in
 > --- ../egcs/gcc/Makefile.in	Tue Oct  6 00:42:23 1998
 > +++ gcc/Makefile.in	Sun Oct 11 18:55:38 1998
 > @@ -155,7 +155,7 @@
 >  # The GCC to use for compiling libgcc2.a, enquire, and libgcc1-test.
 >  # Usually the one we just built.
 >  # Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS).
 > -GCC_FOR_TARGET = ./xgcc -B./
 > +GCC_FOR_TARGET = ./xgcc -B./ -B$(build_tooldir)/
 >  
 >  # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
 >  # It omits XCFLAGS, and specifies -B./.
 > @@ -279,6 +279,8 @@
 >  # Directory in which to find other cross-compilation tools and headers.
 >  # Used in install-cross.
 >  tooldir = $(libsubdir)/$(unlibsubdir)/../$(target_alias)
 > +# Since tooldir does not exist at build-time, use -B$(build_tooldir)/
 > +build_tooldir = $(exec_prefix)/$(target_alias)
 >  # assertdir is overridden in cross-make.
 >  # (But this currently agrees with what is in cross-make.)
 >  assertdir = $(tooldir)/include
 > @@ -2772,22 +2774,22 @@
 >  # To prevent `make install' from compiling alloca.o and then relinking cc1
 >  # because alloca.o is newer, we permit these recursive makes to compile
 >  # alloca.o.  Then cc1 is newer, so it won't have to be relinked.
 > -	$(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)"
 > +	$(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)"
 >  	$(MAKE) stage2
 >  	-if test $@ = bootstrap-lean; then rm -rf stage1; else true; fi
 > -	$(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
 > +	$(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
 >  
 >  bootstrap2 bootstrap2-lean: force
 > -	$(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)"
 > +	$(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)"
 >  	$(MAKE) stage2
 >  	-if test $@ = bootstrap2-lean; then rm -rf stage1; else true; fi
 > -	$(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
 > +	$(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
 >  
 >  bootstrap3 bootstrap3-lean: force
 > -	$(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
 > +	$(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
 >  
 >  bootstrap4 bootstrap4-lean: force
 > -	$(MAKE) CC="stage3/xgcc$(exeext) -Bstage3/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage3/ LANGUAGES="$(LANGUAGES)"
 > +	$(MAKE) CC="stage3/xgcc$(exeext) -Bstage3/ -B$(build_tooldir)/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage3/ LANGUAGES="$(LANGUAGES)"
 >  
 >  # Compare the object files in the current directory with those in the
 >  # stage2 directory.



More information about the Gcc-patches mailing list