This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
PATCH: Fix remaining BSD make, in-source build issues in libstdc++-v3
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Fri, 11 Jan 2002 04:37:38 -0600 (CST)
- Subject: PATCH: Fix remaining BSD make, in-source build issues in libstdc++-v3
- Reply-to: rittle at labs dot mot dot com
Gerald recently reminded me that not all the make portability patches
required to allow in-source bootstraps had been developed and tested.
Here is the last one I needed for current mainline to bootstrap and
install properly with BSD make on i386-unknown-freebsd4.4. I have
also tested GNU make. Make check with no regressions and (more
importantly) I verified that `make install' from an objdir into a
fresh, for each case, $prefix left $prefix/include/g++-v3 identical
before and after the patch. I also verified that extra junk is no
longer installed in the in-source configuration case.
[FYI, I do see the logical conflict with Phil's proposed patch to
re-introduce .h extensions into srcdir. Of course, if his patch
lands in the tree first, I will update and retest this patch before
installing it. Otherwise, I can send the extra name translation
logic required in install-data-local (it should look quite similar to
the second thunk of Phil's patch).]
I have already cooked and tested the version of this patch required on
the 3.0.X branch (the location and number of LN_S usages is different;
extra_target_headers has less entries; but the patch to the
install-data-local rule is the same barring an extra line between the
comment and the rule) and the outstanding bootstrap failures are
resolved there as well. Approval to add this patch to mainline, wait
a couple of days and install the logical equivalent patch to the 3.0.X
branch?
* include/Makefile.am (extra_target_headers): New list of all
target files built with ad hoc naming rules.
(stamp-*): Handle LN_S failure in manner portable across make
implementations.
(install-data-local): Install header files from human-maintained
file lists and directory components instead of non-robust find.
* include/Makefile.in: Rebuilt.
Index: include/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/Makefile.am,v
retrieving revision 1.21
diff -c -r1.21 Makefile.am
*** Makefile.am 2002/01/09 20:34:19 1.21
--- Makefile.am 2002/01/11 07:23:47
***************
*** 1,6 ****
## Makefile for the include subdirectory of the GNU C++ Standard library.
##
! ## Copyright (C) 2001 Free Software Foundation, Inc.
##
## This file is part of the libstdc++ version 3 distribution.
## Process this file with automake to produce Makefile.in.
--- 1,6 ----
## Makefile for the include subdirectory of the GNU C++ Standard library.
##
! ## Copyright (C) 2001, 2002 Free Software Foundation, Inc.
##
## This file is part of the libstdc++ version 3 distribution.
## Process this file with automake to produce Makefile.in.
***************
*** 224,229 ****
--- 224,237 ----
${target_srcdir}/os_defines.h \
${glibcpp_srcdir}/@ATOMICITY_INC_SRCDIR@/atomicity.h \
${glibcpp_srcdir}/@CPU_LIMITS_INC_SRCDIR@/cpu_limits.h
+ # These extra_target_headers files are all built with ad hoc naming rules.
+ extra_target_headers = \
+ ${target_builddir}/basic_file_model.h \
+ ${target_builddir}/c++config.h \
+ ${target_builddir}/c++io.h \
+ ${target_builddir}/c++locale.h \
+ ${target_builddir}/messages_members.h \
+ ${target_builddir}/codecvt_specializations.h
thread_builddir = ./${target_alias}/bits
thread_headers = \
***************
*** 244,278 ****
@if [ ! -d "${std_builddir}" ]; then \
mkdir -p ${std_builddir} ;\
fi ;\
! (cd ${std_builddir} && @LN_S@ $? .) ;\
echo `date` > stamp-std
stamp-bits: ${bits_headers}
@if [ ! -d "${bits_builddir}" ]; then \
mkdir -p ${bits_builddir} ;\
fi ;\
! (cd ${bits_builddir} && @LN_S@ $? .) ;\
echo `date` > stamp-bits
stamp-c_base: ${c_base_headers}
@if [ ! -d "${c_base_builddir}" ]; then \
mkdir -p ${c_base_builddir} ;\
fi ;\
! (cd ${c_base_builddir} && @LN_S@ $? .) ;\
echo `date` > stamp-c_base
stamp-backward: ${backward_headers}
@if [ ! -d "${backward_builddir}" ]; then \
mkdir -p ${backward_builddir} ;\
fi ;\
! (cd ${backward_builddir} && @LN_S@ $? .) ;\
echo `date` > stamp-backward
stamp-ext: ${ext_headers}
@if [ ! -d "${ext_builddir}" ]; then \
mkdir -p ${ext_builddir} ;\
fi ;\
! (cd ${ext_builddir} && @LN_S@ $? .) ;\
echo `date` > stamp-ext
# This target is special. The timestamp on a directory gets modified
--- 252,286 ----
@if [ ! -d "${std_builddir}" ]; then \
mkdir -p ${std_builddir} ;\
fi ;\
! (cd ${std_builddir} && @LN_S@ $? . || true) ;\
echo `date` > stamp-std
stamp-bits: ${bits_headers}
@if [ ! -d "${bits_builddir}" ]; then \
mkdir -p ${bits_builddir} ;\
fi ;\
! (cd ${bits_builddir} && @LN_S@ $? . || true) ;\
echo `date` > stamp-bits
stamp-c_base: ${c_base_headers}
@if [ ! -d "${c_base_builddir}" ]; then \
mkdir -p ${c_base_builddir} ;\
fi ;\
! (cd ${c_base_builddir} && @LN_S@ $? . || true) ;\
echo `date` > stamp-c_base
stamp-backward: ${backward_headers}
@if [ ! -d "${backward_builddir}" ]; then \
mkdir -p ${backward_builddir} ;\
fi ;\
! (cd ${backward_builddir} && @LN_S@ $? . || true) ;\
echo `date` > stamp-backward
stamp-ext: ${ext_headers}
@if [ ! -d "${ext_builddir}" ]; then \
mkdir -p ${ext_builddir} ;\
fi ;\
! (cd ${ext_builddir} && @LN_S@ $? . || true) ;\
echo `date` > stamp-ext
# This target is special. The timestamp on a directory gets modified
***************
*** 290,301 ****
stamp-target: ${target_headers} ${target_builddir}
@cd ${target_builddir} ;\
if [ ! -f stamp-target ]; then \
! @LN_S@ ${target_headers} . ;\
! @LN_S@ ${glibcpp_srcdir}/@BASIC_FILE_H@ basic_file_model.h ;\
! @LN_S@ ${glibcpp_srcdir}/@CSTDIO_H@ c++io.h ;\
! @LN_S@ ${glibcpp_srcdir}/@CLOCALE_H@ c++locale.h ;\
! @LN_S@ ${glibcpp_srcdir}/@CMESSAGES_H@ messages_members.h ;\
! @LN_S@ ${glibcpp_srcdir}/@CCODECVT_H@ codecvt_specializations.h ;\
echo `date` > stamp-target; \
fi
--- 298,309 ----
stamp-target: ${target_headers} ${target_builddir}
@cd ${target_builddir} ;\
if [ ! -f stamp-target ]; then \
! @LN_S@ ${target_headers} . || true ;\
! @LN_S@ ${glibcpp_srcdir}/@BASIC_FILE_H@ basic_file_model.h || true ;\
! @LN_S@ ${glibcpp_srcdir}/@CSTDIO_H@ c++io.h || true ;\
! @LN_S@ ${glibcpp_srcdir}/@CLOCALE_H@ c++locale.h || true ;\
! @LN_S@ ${glibcpp_srcdir}/@CMESSAGES_H@ messages_members.h || true ;\
! @LN_S@ ${glibcpp_srcdir}/@CCODECVT_H@ codecvt_specializations.h || true ;\
echo `date` > stamp-target; \
fi
***************
*** 335,352 ****
-e 's/\(${uppercase}*WEAK\)/_GLIBCPP_\1/g' \
< ${toplevel_srcdir}/gcc/${glibcpp_thread_h} > $@
! # One big happy istallation: just copy everything from the build to the
! # install tree (except for the build stamps).
gxx_include_dir = @gxx_include_dir@
install-data-local:
! for file in `find . ! -name stamp-\* ! -name Makefile -print`; do \
! installFile=${gxx_include_dir}/$${file} ;\
! if [ -d $${file} ]; then \
! $(INSTALL) -d $${installFile} ;\
! else \
! $(INSTALL_DATA) $${file} $${installFile} ;\
! fi ;\
! done
# By adding these files here, automake will remove them for 'make clean'
#CLEANFILES = ${allstamps}
--- 343,380 ----
-e 's/\(${uppercase}*WEAK\)/_GLIBCPP_\1/g' \
< ${toplevel_srcdir}/gcc/${glibcpp_thread_h} > $@
! # For robustness sake (in light of junk files or in-source
! # configuration), copy from the build or source tree to the install
! # tree using only the human-maintained file lists and directory
! # components. Yes, with minor differences, this is sheer duplication
! # of the staging rules above using $(INSTALL_DATA) instead of LN_S and
! # `$(INSTALL) -d' instead of `mkdir -p'. In particular,
! # extra_target_headers are taken out of the build tree staging area;
! # the rest are taken from the original source tree.
gxx_include_dir = @gxx_include_dir@
install-data-local:
! $(INSTALL) -d ${gxx_include_dir}
! $(INSTALL) -d ${gxx_include_dir}/${bits_builddir}
! for file in ${bits_headers}; do \
! $(INSTALL_DATA) $${file} ${gxx_include_dir}/${bits_builddir}; done
! $(INSTALL) -d ${gxx_include_dir}/${backward_builddir}
! for file in ${backward_headers}; do \
! $(INSTALL_DATA) $${file} ${gxx_include_dir}/${backward_builddir}; done
! $(INSTALL) -d ${gxx_include_dir}/${ext_builddir}
! for file in ${ext_headers}; do \
! $(INSTALL_DATA) $${file} ${gxx_include_dir}/${ext_builddir}; done
! $(INSTALL) -d ${gxx_include_dir}/${c_base_builddir}
! for file in ${c_base_headers}; do \
! $(INSTALL_DATA) $${file} ${gxx_include_dir}/${c_base_builddir}; done
! $(INSTALL) -d ${gxx_include_dir}/${std_builddir}
! for file in ${std_headers}; do \
! $(INSTALL_DATA) $${file} ${gxx_include_dir}/${std_builddir}; done
! $(INSTALL) -d ${gxx_include_dir}/${target_builddir}
! for file in ${target_headers} ${extra_target_headers}; do \
! $(INSTALL_DATA) $${file} ${gxx_include_dir}/${target_builddir}; done
! $(INSTALL) -d ${gxx_include_dir}/${thread_builddir}
! for file in ${thread_headers}; do \
! $(INSTALL_DATA) $${file} ${gxx_include_dir}/${thread_builddir}; done
# By adding these files here, automake will remove them for 'make clean'
#CLEANFILES = ${allstamps}