This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: latest snapshot won't find C++ header files
On nil, 12 October 1998, 07:40:28, oliva@dcc.unicamp.br wrote:
> Manfred Hollstein <manfred@s-direktnet.de> writes:
>
> > 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.
>
> I had naively assumed gcc would try to append bin/. Ok, here's what
> is probably my last try on all this unlibsubdir mess, at least for the
> next two weeks. For some reason, I had missed CXX_FOR_TARGET in the
> last patch; I fix is included here. I have also merged the includedir
> patches in; I just can't maintain two separate sets of patches for the
> same Makefile :-(
>
> Ok to install this one?
If I'd the one to commit, I'd say, yes ;-)
>
> > 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 = ..."?
>
> I'm not sure I understand what this would do, and I'm so sleepy that
> I'd rather not try to understand it now. Feel free to go ahead and
> fix it if you know what should be done.
Just a small explanation: tooldir's definition in the top-level
Makefile.in is just a "fake"; its actual value will be evaluated by
the top-level configure and emitted (as an absolute pathname) into the
generated Makefile via a suitable "sed" command. This small patch
would do a similar thing with "build_tooldir":
1998-10-12 Manfred Hollstein <manfred@s-direktnet.de>
* configure: Add pattern to replace "build_tooldir"'s
definition in the generated Makefile with "tooldir"'s
actual value.
*** configure.orig Mon Oct 12 11:55:55 1998
--- configure Mon Oct 12 11:56:52 1998
***************
*** 1333,1338 ****
--- 1333,1339 ----
-e "s:^program_suffix[ ]*=.*$:program_suffix = ${program_suffix}:" \
-e "s:^program_transform_name[ ]*=.*$:program_transform_name = ${program_transform_name}:" \
-e "s|^tooldir[ ]*=.*$|tooldir = ${tooldir}|" \
+ -e "s|^build_tooldir[ ]*=.*$|build_tooldir = ${tooldir}|" \
-e "s:^DEFAULT_YACC[ ]*=.*$:DEFAULT_YACC = ${DEFAULT_YACC}:" \
-e "s:^DEFAULT_LEX[ ]*=.*$:DEFAULT_LEX = ${DEFAULT_LEX}:" \
-e "s:^DEFAULT_M4[ ]*=.*$:DEFAULT_M4 = ${DEFAULT_M4}:" \
If you're allowed to install your patch, please add this small one,
too.
Thanks.
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 unlibsubdir.diff <application/octet-stream>]
> Index: ChangeLog
> from Alexandre Oliva <oliva@dcc.unicamp.br>
>
> * Makefile.in (build_tooldir): new variable, same as tooldir
> (CC_FOR_TARGET, GCC_FOR_TARGET, CXX_FOR_TARGET): add
> -B$(build_tooldir)/bin/
> (BASE_FLAGS_TO_PASS): pass build_tooldir down
>
> Index: 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)/bin/
> (bootstrap, bootstrap2, bootstrap3, bootstrap4): ditto
>
> * configure.in (gxx_include_dir): set default based on unlibsubdir
> * Makefile.in (tooldir): ditto
> (cccp.o, cpplib.o): use unlibsubdir implicitly through
> gxx_include_dir, includedir and tooldir
> (protoize.o, unprotoize.o): ditto
>
> Index: Makefile.in
> ===================================================================
> RCS file: /egcs/carton/cvsfiles/egcs/Makefile.in,v
> retrieving revision 1.31
> diff -u -r1.31 Makefile.in
> --- Makefile.in 1998/09/30 02:02:34 1.31
> +++ Makefile.in 1998/10/12 09:31:54
> @@ -24,7 +24,8 @@
> exec_prefix = $(prefix)
> bindir = $(exec_prefix)/bin
> libdir = $(exec_prefix)/lib
> -tooldir = $(exec_prefix)/$(target)
> +tooldir = $(exec_prefix)/$(target_alias)
> +build_tooldir = $(exec_prefix)/$(target_alias)
>
> 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)/bin/ -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)/bin/ -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)/bin/; \
> fi; \
> else \
> if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
> @@ -214,19 +215,19 @@
> # 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)/bin/
>
>
> CXX_FOR_TARGET = ` \
> 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/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)/bin/ -L$$r/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)/bin/ -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)/bin/; \
> fi; \
> else \
> if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
> @@ -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/configure.in
> ===================================================================
> RCS file: /egcs/carton/cvsfiles/egcs/gcc/configure.in,v
> retrieving revision 1.165
> diff -u -r1.165 configure.in
> --- gcc/configure.in 1998/09/30 20:35:09 1.165
> +++ gcc/configure.in 1998/10/12 09:31:55
> @@ -164,7 +164,7 @@
> gxx_include_dir='${libsubdir}/include/g++'
> else
> topsrcdir=${srcdir}/.. . ${srcdir}/../config.if
> - gxx_include_dir='${prefix}/include/g++'-${libstdcxx_interface}
> + gxx_include_dir="\$(libsubdir)/\$(unlibsubdir)/..\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/[^/]*|/..|g'\`/include/g++"-${libstdcxx_interface}
> fi
> fi
>
> Index: gcc/Makefile.in
> ===================================================================
> RCS file: /egcs/carton/cvsfiles/egcs/gcc/Makefile.in,v
> retrieving revision 1.178
> diff -u -r1.178 Makefile.in
> --- gcc/Makefile.in 1998/10/08 16:17:12 1.178
> +++ gcc/Makefile.in 1998/10/12 09:31:56
> @@ -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)/bin/
>
> # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
> # It omits XCFLAGS, and specifies -B./.
> @@ -291,7 +291,9 @@
> mandir = @mandir@/man1
> # Directory in which to find other cross-compilation tools and headers.
> # Used in install-cross.
> -tooldir = $(exec_prefix)/$(target_alias)
> +tooldir = $(libsubdir)/$(unlibsubdir)/../$(target_alias)
> +# Since tooldir does not exist at build-time, use -B$(build_tooldir)/bin/
> +build_tooldir = $(exec_prefix)/$(target_alias)
> # Dir for temp files.
> tmpdir = /tmp
>
> @@ -1864,10 +1866,10 @@
> mbchar.h
> $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
> -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
> - -DGPLUSPLUS_INCLUDE_DIR=\"$(libsubdir)/$(unlibsubdir)/..`echo $(exec_prefix) | sed -e 's|^$(prefix)||' -e 's|/[^/]*|/..|g'`/include/g++\" \
> - -DLOCAL_INCLUDE_DIR=\"$(libsubdir)/$(unlibsubdir)/..`echo $(exec_prefix) | sed -e 's|^$(prefix)||' -e 's|/[^/]*|/..|g'`/include\" \
> - -DCROSS_INCLUDE_DIR=\"$(libsubdir)/$(unlibsubdir)/../$(target_alias)/sys-include\" \
> - -DTOOL_INCLUDE_DIR=\"$(libsubdir)/$(unlibsubdir)/../$(target_alias)/include\" \
> + -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
> + -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
> + -DCROSS_INCLUDE_DIR=\"$(tooldir)/sys-include\" \
> + -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
> -c `echo $(srcdir)/cccp.c | sed 's,^\./,,'`
>
> cppmain$(exeext): cppmain.o cpplib.o cpphash.o cppalloc.o cpperror.o cppexp.o \
> @@ -1881,11 +1883,11 @@
> cpplib.o: cpplib.c $(CONFIG_H) cpplib.h cpphash.h config.status system.h \
> gansidecl.h
> $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
> - -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
> - -DGPLUSPLUS_INCLUDE_DIR=\"$(libsubdir)/$(unlibsubdir)/..`echo $(exec_prefix) | sed -e 's|^$(prefix)||' -e 's|/[^/]*|/..|g'`/include/g++\" \
> - -DLOCAL_INCLUDE_DIR=\"$(libsubdir)/$(unlibsubdir)/..`echo $(exec_prefix) | sed -e 's|^$(prefix)||' -e 's|/[^/]*|/..|g'`/include\" \
> - -DCROSS_INCLUDE_DIR=\"$(libsubdir)/$(unlibsubdir)/../$(target_alias)/sys-include\" \
> - -DTOOL_INCLUDE_DIR=\"$(libsubdir)/$(unlibsubdir)/../$(target_alias)/include\" \
> + -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
> + -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
> + -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
> + -DCROSS_INCLUDE_DIR=\"$(tooldir)/sys-include\" \
> + -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
> -c `echo $(srcdir)/cpplib.c | sed 's,^\./,,'`
>
> cpperror.o: cpperror.c $(CONFIG_H) cpplib.h system.h gansidecl.h
> @@ -1917,7 +1919,7 @@
> $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
> -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
> -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
> - -DCROSS_INCLUDE_DIR=\"$(libsubdir)/$(unlibsubdir)/../$(target_alias)/sys-include\" \
> + -DCROSS_INCLUDE_DIR=\"$(tooldir)/sys-include\" \
> -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
> -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
> -DSTD_PROTO_DIR=\"$(libsubdir)\" \
> @@ -1927,7 +1929,7 @@
> $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
> -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
> -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
> - -DCROSS_INCLUDE_DIR=\"$(libsubdir)/$(unlibsubdir)/../$(target_alias)/sys-include\" \
> + -DCROSS_INCLUDE_DIR=\"$(tooldir)/sys-include\" \
> -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
> -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
> -DSTD_PROTO_DIR=\"$(libsubdir)\" \
> @@ -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)/bin/" 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)/bin/" 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)/bin/" 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)/bin/" 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)/bin/" 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)/bin/" 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.