[v3] install build_headers in target-dependent location

Benjamin Kosnik bkoz@redhat.com
Mon Dec 18 00:03:00 GMT 2000


> Another idea, to keep files within include/g++-v3 (that some people
> may already be used to, except for the version number after the dash)
> is to use (prefix)/include/g++-v3/(target)

Jason also suggested this, although he didn't seem to think either
place was much better than the other. 

To me, this idea is less clear than the current approach. I'm unaware
of this kind of target subdirectory include in other
libraries. Besides, other c-language generated and target-specific
files are in tooldir/include, the c++-language generated ones might as
well be too...

I'd prefer to keep some consistency here. I feel that the approach
offered is the most consistent. 

> As for the actual patch, it's almost ok.  The only problem I see is
> that it doesn't take care of creating $(targetincludep) when it
> doesn't exist.

Right. I'd caught this too, after sending it. The current patch
explicitly creates this directory.

-benjamin


2000-12-15  Benjamin Kosnik  <bkoz@redhat.com>

	* configure.in (gxx_target_include_dir): Install target-dependent
	include files in a target-dependent place.
	* configure: Regenerate.
	* src/Makefile.am: Add in support here.
	* src/Makefile.in: Regenerate.

Index: configure.in
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/configure.in,v
retrieving revision 1.40
diff -c -p -r1.40 configure.in
*** configure.in	2000/12/14 22:53:59	1.40
--- configure.in	2000/12/18 07:54:27
*************** include/bits/ctype_inline.h)
*** 203,212 ****
  AC_LINK_FILES($ctype_include_dir/bits/ctype_noninline.h, \
  include/bits/ctype_noninline.h)
  
- AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
  AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes)
  AM_CONDITIONAL(NATIVE, test "$NATIVE" = yes || test "$NULL_TARGET" = yes)
  AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
   
  AC_CACHE_SAVE
  AC_LC_MESSAGES
--- 203,212 ----
  AC_LINK_FILES($ctype_include_dir/bits/ctype_noninline.h, \
  include/bits/ctype_noninline.h)
  
  AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes)
  AM_CONDITIONAL(NATIVE, test "$NATIVE" = yes || test "$NULL_TARGET" = yes)
  AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
+ AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
   
  AC_CACHE_SAVE
  AC_LC_MESSAGES
*************** if test x${version_specific_libs} = xyes
*** 274,279 ****
--- 274,285 ----
    AC_MSG_WARN(version specific directory is: $gcc_version)
  fi
  
+ # We have to install all the generated or linked includes files
+ # specified as build_headers in src/Makefile.am in a target-dependent
+ # place, or else multiple installs for different compilers will
+ # overwrite these files.
+ gxx_target_include_dir='$(exec_prefix)/$(target_alias)/include/g++-$(libstdcxx_interface)'
+ AC_SUBST(gxx_target_include_dir)
  
  
  # Export all the include and flag information to makefiles.
Index: src/Makefile.am
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/src/Makefile.am,v
retrieving revision 1.58
diff -c -p -r1.58 Makefile.am
*** Makefile.am	2000/12/15 00:55:02	1.58
--- Makefile.am	2000/12/18 07:54:28
*************** myincludep = $(prefix)/include/g++-@libs
*** 233,238 ****
--- 233,240 ----
  endif
  endif
  
+ targetincludep = @gxx_target_include_dir@
+ 
  # We have our own special, ridiculously complicated installation routine
  # here, as automake/autoconf is currently brain-damaged when it comes
  # to installing sub-directories of headers. In particular, we want to
*************** myinstalldirs:
*** 253,258 ****
--- 255,261 ----
  	if test -z "$(MULTISUBDIR)"; then \
  	$(mkinstalldirs) $(DESTDIR)$(myincludep)/bits; \
  	$(mkinstalldirs) $(DESTDIR)$(myincludep)/ext; \
+ 	$(mkinstalldirs) $(DESTDIR)$(targetincludep)/bits; \
  	fi
  
  # NB: As libio_headers may be empty, need this to make sure bash doesn't
*************** myinstallheaders: 
*** 284,291 ****
  	  $(INSTALL_DATA) $(src_incdir)/std/$$i $(myincludep); \
  	done; \
  	for i in $(build_headers); do \
!         echo "$(INSTALL_DATA) $(bld_incdir)/$$i $(myincludep)/bits/"; \
! 	  $(INSTALL_DATA) $(bld_incdir)/$$i $(myincludep)/bits/; \
  	done; \
  	libio_headers_install='$(libio_headers)'; \
  	for i in $$libio_headers_install; do \
--- 287,294 ----
  	  $(INSTALL_DATA) $(src_incdir)/std/$$i $(myincludep); \
  	done; \
  	for i in $(build_headers); do \
!         echo "$(INSTALL_DATA) $(bld_incdir)/$$i $(targetincludep)/bits/"; \
! 	  $(INSTALL_DATA) $(bld_incdir)/$$i $(targetincludep)/bits/; \
  	done; \
  	libio_headers_install='$(libio_headers)'; \
  	for i in $$libio_headers_install; do \





More information about the Gcc-patches mailing list