[v3] install build_headers in target-dependent location
Benjamin Kosnik
bkoz@redhat.com
Fri Dec 15 14:29:00 GMT 2000
More host-x-host issues.
The following patch installs target-dependent files into
target-dependent locations in (prefix). Previously, this was not done
and so multiple installs into the same prefix with different targets
would smash these files. As a result, a native x86 compiler installed
in the same prefix as a x86-x-powerpc compiler would have incorrect
atomicity.h files, and cause compiler errors.
old install location:
(prefix)/include/g++-v3/bits/atomicity.h
new install location:
(prefix)/powerpc-elf/include/g++-v3/bits/atomicity.h
I'm anticipating additional work to get g++ to find these files. As
this change will break current setups, I'll refrain from checking it
in until the compiler changes go in too. This is just a heads-up and a
request for feedback on the general approach.
tested with x86-linux
tested with x86-linux-x-powerpc-elf
tested with x86-linux-x-powerpc-linux
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/15 22:25:55
*************** 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/15 22:25:57
*************** 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
*************** 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 \
--- 286,293 ----
$(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