latest snapshot won't find C++ header files

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


On nil, 11 October 1998, 15:26:12, oliva@dcc.unicamp.br wrote:

 > Jeffrey A Law <law@cygnus.com> writes:
 > 
 > >   In message < oriuhvssr2.fsf@araguaia.dcc.unicamp.br >you write:
 > 
 > >> I'm just trying to make the Makefile consistent and homogeneous.  The
 > >> current Makefile produces inconsistent behavior (i.e., different
 > >> search dirs) depending on whether you enable cpplib or not, it breaks
 > >> support for --with-gxx-include-dir and --with-local-prefix, and it
 > >> causes cppp to search for C++ header-files in the wrong directory.
 > 
 > > I made cpplib consistent (I think) with cccp, though apparently
 > > we're still having trouble with the include files right?!?
 > 
 > Sure, libstdc++ installs itself in include/g++-2, and the current
 > sources make cppp look for it in include/g++.  Furthermore, if you
 > specify --with-gxx-include-dir and --with-local-prefix, these will
 > just be ignored, which is not an improvement, IMO.  My patch fixes
 > just these two problems, nothing else.  It also introduces the
 > unsublibdir modification for include-files in a single point, which
 > makes it easier to fix in the future, if there's any need for that.
 > The latest version of the patch, that fixes the modification in
 > cpplib.o too, can be found below.  Please look carefully at it this
 > time :-)  Ok to install?
 > 
 > 
 > The unsublibdir patch currently installed also presents another
 > serious failure, that is the assumption that exec_prefix is the same
 > as prefix or a subdir thereof.  IMO, this is too strong an assumption, 
 > but I'm not trying to fix this problem with this patch.

Your patch is mostly correct; but, the $(tooldir) part won't work, as
this particular macro is being passed down from the top-level make
via $(BASE_FLAGS_TO_PASS) and hence overridden :-(

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 include.diff <application/octet-stream>]
 > Index: gcc/ChangeLog
 > from  Alexandre Oliva  <oliva@dcc.unicamp.br>
 > 	
 > 	* configure.in (gxx_include_dir): set default based on unlibsubdir
 > 	* Makefile.in (tooldir): ditto, but define it before first use
 > 	(cccp.o, cpplib.o): use unlibsubdir implicitly through
 > 	gxx_include_dir, includedir and tooldir
 > 	(protoize.o, unprotoize.o): ditto
 > 	
 > from  Ken Raeburn  <raeburn@cygnus.com>
 > 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/11 18:21:27
 > @@ -276,6 +276,9 @@
 >  gxx_include_dir= @gxx_include_dir@
 >  # Directory to search for site-specific includes.
 >  includedir = $(local_prefix)/include
 > +# Directory in which to find other cross-compilation tools and headers.
 > +# Used in install-cross.
 > +tooldir = $(libsubdir)/$(unlibsubdir)/../$(target_alias)
 >  # assertdir is overridden in cross-make.
 >  # (But this currently agrees with what is in cross-make.)
 >  assertdir = $(tooldir)/include
 > @@ -289,9 +292,6 @@
 >  
 >  # Directory in which to put man pages.
 >  mandir = @mandir@/man1
 > -# Directory in which to find other cross-compilation tools and headers.
 > -# Used in install-cross.
 > -tooldir = $(exec_prefix)/$(target_alias)
 >  # Dir for temp files.
 >  tmpdir = /tmp
 >  
 > @@ -1864,10 +1864,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 +1881,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 +1917,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 +1927,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)\" \
 > 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/11 18:21:27
 > @@ -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
 >  



More information about the Gcc-bugs mailing list