Commit 53c7ffe7 by Geoffrey Keating Committed by Geoffrey Keating

Index: ChangeLog

2004-11-04  Geoffrey Keating  <geoffk@apple.com>

	* Makefile.def: Build fixincludes for the host, too.
	* Makefile.in: Regenerate.
	* configure.in (host_tools): Add fixincludes.
	* configure: Regenerate.

Index: fixincludes/ChangeLog
2004-11-04  Geoffrey Keating  <geoffk@apple.com>

	* configure.ac: Add code to determine noncanonical_target,
	local_prefix, gcc_version; process mkheaders.in to make mkheaders.
	* configure: Regenerate.
	* fixinc.in: Move here from gcc/; fix many cross-hosting bugs.
	* mkfixinc.sh: Move here from gcc/; update for changes to fixinc.in.
	* mkheaders.in: Move here from gcc/; remove some unnecessary macros;
	update for changes to fixinc.in.
	* Makefile.in: Add many new macros.
	(install): New target.
	(mkheaders): New target.
	(fixinc.sh): New target.
	(all): Add mkheaders and fixinc.sh.
	* README-fixinc: Move here from gcc/.

Index: gcc/ChangeLog
2004-11-04  Geoffrey Keating  <geoffk@apple.com>

	* Makefile.in (distclean): Don't delete nonexistent fixinc/ directory.
	(install-mkheaders): Install the version built for the
	host, not for the build machine.
	* configure.ac: Always run fixincludes.
	(all_outputs): Remove mkheaders.
	* configure: Regenerate.
	* fixinc.in: Move to fixincludes/.
	* mkfixinc.sh: Likewise.
	* mkheaders.in: Likewise.
	* README-fixinc: Likewise.

From-SVN: r90117
parent 9a399055
2004-11-04 Geoffrey Keating <geoffk@apple.com>
* Makefile.def: Build fixincludes for the host, too.
* Makefile.in: Regenerate.
* configure.in (host_tools): Add fixincludes.
* configure: Regenerate.
2004-11-04 Daniel Jacobowitz <dan@debian.org> 2004-11-04 Daniel Jacobowitz <dan@debian.org>
* configure.in (arm-*-oabi*, thumb-*-oabi*): Remove. * configure.in (arm-*-oabi*, thumb-*-oabi*): Remove.
......
...@@ -51,6 +51,7 @@ host_modules= { module= fastjar; no_check_cross= true; }; ...@@ -51,6 +51,7 @@ host_modules= { module= fastjar; no_check_cross= true; };
host_modules= { module= fileutils; }; host_modules= { module= fileutils; };
host_modules= { module= findutils; }; host_modules= { module= findutils; };
host_modules= { module= find; }; host_modules= { module= find; };
host_modules= { module= fixincludes; };
host_modules= { module= flex; no_check_cross= true; }; host_modules= { module= flex; no_check_cross= true; };
host_modules= { module= gas; bootstrap=true; }; host_modules= { module= gas; bootstrap=true; };
host_modules= { module= gcc; bootstrap=true; host_modules= { module= gcc; bootstrap=true;
...@@ -253,13 +254,16 @@ dependencies = { module=all-gcc; on=all-gas; }; ...@@ -253,13 +254,16 @@ dependencies = { module=all-gcc; on=all-gas; };
dependencies = { module=all-gcc; on=all-ld; }; dependencies = { module=all-gcc; on=all-ld; };
dependencies = { module=all-gcc; on=all-zlib; }; dependencies = { module=all-gcc; on=all-zlib; };
dependencies = { module=all-gcc; on=all-libcpp; hard=true; }; dependencies = { module=all-gcc; on=all-libcpp; hard=true; };
dependencies = { module=all-gcc; on=all-build-libiberty; }; dependencies = { module=all-gcc; on=all-libiberty; };
dependencies = { module=all-gcc; on=all-fixincludes; };
dependencies = { module=configure-libcpp; on=configure-libiberty; hard=true; }; dependencies = { module=configure-libcpp; on=configure-libiberty; hard=true; };
dependencies = { module=configure-libcpp; on=configure-intl; }; dependencies = { module=configure-libcpp; on=configure-intl; };
dependencies = { module=all-libcpp; on=all-libiberty; hard=true; }; dependencies = { module=all-libcpp; on=all-libiberty; hard=true; };
dependencies = { module=all-libcpp; on=all-intl; }; dependencies = { module=all-libcpp; on=all-intl; };
dependencies = { module=all-fixincludes; on=all-libiberty; };
// Host modules specific to gdb. // Host modules specific to gdb.
dependencies = { module=configure-gdb; on=configure-itcl; }; dependencies = { module=configure-gdb; on=configure-itcl; };
dependencies = { module=configure-gdb; on=configure-tcl; }; dependencies = { module=configure-gdb; on=configure-tcl; };
......
...@@ -903,7 +903,7 @@ host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib l ...@@ -903,7 +903,7 @@ host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib l
# know that we are building the simulator. # know that we are building the simulator.
# binutils, gas and ld appear in that order because it makes sense to run # binutils, gas and ld appear in that order because it makes sense to run
# "make check" in that particular order. # "make check" in that particular order.
host_tools="texinfo byacc flex bison binutils gas ld gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar" host_tools="texinfo byacc flex bison binutils gas ld fixincludes gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar"
# libgcj represents the runtime libraries only used by gcj. # libgcj represents the runtime libraries only used by gcj.
libgcj="target-libffi \ libgcj="target-libffi \
......
...@@ -150,7 +150,7 @@ host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib l ...@@ -150,7 +150,7 @@ host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib l
# know that we are building the simulator. # know that we are building the simulator.
# binutils, gas and ld appear in that order because it makes sense to run # binutils, gas and ld appear in that order because it makes sense to run
# "make check" in that particular order. # "make check" in that particular order.
host_tools="texinfo byacc flex bison binutils gas ld gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar" host_tools="texinfo byacc flex bison binutils gas ld fixincludes gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar"
# libgcj represents the runtime libraries only used by gcj. # libgcj represents the runtime libraries only used by gcj.
libgcj="target-libffi \ libgcj="target-libffi \
......
2004-11-04 Geoffrey Keating <geoffk@apple.com>
* configure.ac: Add code to determine noncanonical_target,
local_prefix, gcc_version; process mkheaders.in to make mkheaders.
* configure: Regenerate.
* fixinc.in: Move here from gcc/; fix many cross-hosting bugs.
* mkfixinc.sh: Move here from gcc/; update for changes to fixinc.in.
* mkheaders.in: Move here from gcc/; remove some unnecessary macros;
update for changes to fixinc.in.
* Makefile.in: Add many new macros.
(install): New target.
(mkheaders): New target.
(fixinc.sh): New target.
(all): Add mkheaders and fixinc.sh.
* README-fixinc: Move here from gcc/.
2004-11-01 Mike Stump <mrs@apple.com> 2004-11-01 Mike Stump <mrs@apple.com>
* inclhack.def (stdio_va_list): Break out clients from here... * inclhack.def (stdio_va_list): Break out clients from here...
......
...@@ -37,8 +37,32 @@ FIXINC_CFLAGS = -DHAVE_CONFIG_H $(INCLUDES) ...@@ -37,8 +37,32 @@ FIXINC_CFLAGS = -DHAVE_CONFIG_H $(INCLUDES)
srcdir = @srcdir@ srcdir = @srcdir@
VPATH = $(srcdir) VPATH = $(srcdir)
# Directory in which to put the directories used by the compiler.
libdir = @libdir@
# Directory in which GCC puts its executables.
libexecdir = @libexecdir@
# End of variables for you to override. # End of variables for you to override.
# The target that we're configured for.
target = @target@
target_noncanonical:=@target_noncanonical@
# The version of GCC in this tree
gcc_version=@gcc_version@
# Directory in which the compiler finds libraries etc.
libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(version)
# Directory in which the compiler finds executables
libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
# Where our executable files go
itoolsdir = $(libexecsubdir)/install-tools
# Where our data files go
itoolsdatadir = $(libsubdir)/install-tools
# Locate mkinstalldirs.
mkinstalldirs=$(SHELL) $(srcdir)/../mkinstalldirs
default : all default : all
# Now figure out from those variables how to compile and link. # Now figure out from those variables how to compile and link.
...@@ -70,7 +94,7 @@ HDR = server.h fixlib.h ...@@ -70,7 +94,7 @@ HDR = server.h fixlib.h
FI = fixincl@EXEEXT@ FI = fixincl@EXEEXT@
AF = applyfix@EXEEXT@ AF = applyfix@EXEEXT@
all : @TARGET@ all : @TARGET@ fixinc.sh mkheaders
gen : $(srcdir)/fixincl.x gen : $(srcdir)/fixincl.x
...@@ -96,6 +120,9 @@ server.o : server.c ...@@ -96,6 +120,9 @@ server.o : server.c
procopen.o : procopen.c procopen.o : procopen.c
fixlib.o : fixlib.c fixlib.o : fixlib.c
fixinc.sh : fixinc.in mkfixinc.sh Makefile
srcdir="$(srcdir)" $(SHELL) $(srcdir)/mkfixinc.sh $(target)
$(srcdir)/fixincl.x: @MAINT@ fixincl.tpl inclhack.def $(srcdir)/fixincl.x: @MAINT@ fixincl.tpl inclhack.def
cd $(srcdir) ; $(SHELL) ./genfixes cd $(srcdir) ; $(SHELL) ./genfixes
...@@ -108,6 +135,9 @@ maintainer-clean : clean ...@@ -108,6 +135,9 @@ maintainer-clean : clean
Makefile: $(srcdir)/Makefile.in config.status Makefile: $(srcdir)/Makefile.in config.status
$(SHELL) ./config.status Makefile $(SHELL) ./config.status Makefile
mkheaders: $(srcdir)/mkheaders.in config.status
CONFIG_FILES=mkheaders CONFIG_HEADERS= ./config.status
config.h: stamp-h config.h: stamp-h
stamp-h: $(srcdir)/config.h.in config.status stamp-h: $(srcdir)/config.h.in config.status
$(SHELL) ./config.status config.h $(SHELL) ./config.status config.h
...@@ -128,3 +158,14 @@ check : all ...@@ -128,3 +158,14 @@ check : all
autogen -T $(srcdir)/check.tpl $(srcdir)/inclhack.def autogen -T $(srcdir)/check.tpl $(srcdir)/inclhack.def
$(SHELL) ./check.sh $(srcdir)/tests/base $(SHELL) ./check.sh $(srcdir)/tests/base
@rm -f ./check.sh @rm -f ./check.sh
install : all
-rm -rf $(DESTDIR)$(itoolsdir)
$(mkinstalldirs) $(DESTDIR)$(itoolsdir)
$(mkinstalldirs) $(DESTDIR)$(itoolsdatadir)/include
$(INSTALL_DATA) $(srcdir)/README-fixinc \
$(DESTDIR)$(itoolsdatadir)/include/README
$(INSTALL_SCRIPT) fixinc.sh $(DESTDIR)$(itoolsdir)/fixinc.sh
$(INSTALL_PROGRAM) fixincl$(build_exeext) \
$(DESTDIR)$(itoolsdir)/fixincl
$(INSTALL_SCRIPT) mkheaders $(DESTDIR)$(itoolsdir)/mkheaders
...@@ -6,6 +6,24 @@ AC_CONFIG_AUX_DIR(..) ...@@ -6,6 +6,24 @@ AC_CONFIG_AUX_DIR(..)
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM
AC_PROG_CC AC_PROG_CC
# Determine the noncanonical target name, for directory use.
ACX_NONCANONICAL_TARGET
# Specify the local prefix
local_prefix=
AC_ARG_WITH(local-prefix,
[ --with-local-prefix=DIR specifies directory to put local include],
[case "${withval}" in
yes) AC_MSG_ERROR(bad value ${withval} given for local include directory prefix) ;;
no) ;;
*) local_prefix=$with_local_prefix ;;
esac])
# Default local prefix if it is empty
if test x$local_prefix = x; then
local_prefix=/usr/local
fi
# Choose one or two-process fix methodology. Systems that cannot handle # Choose one or two-process fix methodology. Systems that cannot handle
# bi-directional pipes must use the two process method. # bi-directional pipes must use the two process method.
# #
...@@ -34,6 +52,12 @@ if test $TARGET = twoprocess; then ...@@ -34,6 +52,12 @@ if test $TARGET = twoprocess; then
[Define if testing and fixing are done by separate process]) [Define if testing and fixing are done by separate process])
fi fi
# Get GCC's version number.
changequote(,)dnl
gcc_version=`sed -n '/version_string/ { s/.*"\([^ "]*\)[^"]*".*/\1/p ; }' ${srcdir}/../gcc/version.c`
changequote([,])dnl
AC_SUBST(gcc_version)
case $host in case $host in
vax-dec-bsd* ) vax-dec-bsd* )
AC_DEFINE(exit, xexit, [Define to xexit if the host system does not support atexit]) AC_DEFINE(exit, xexit, [Define to xexit if the host system does not support atexit])
...@@ -74,5 +98,5 @@ fi ...@@ -74,5 +98,5 @@ fi
AC_SUBST(MAINT) AC_SUBST(MAINT)
AC_CONFIG_HEADERS(config.h, [echo timestamp > stamp-h]) AC_CONFIG_HEADERS(config.h, [echo timestamp > stamp-h])
AC_CONFIG_FILES(Makefile) AC_CONFIG_FILES(Makefile mkheaders)
AC_OUTPUT AC_OUTPUT
...@@ -96,9 +96,9 @@ esac ...@@ -96,9 +96,9 @@ esac
# Original directory. # Original directory.
ORIGDIR=`${PWDCMD}` ORIGDIR=`${PWDCMD}`
export ORIGDIR export ORIGDIR
FIXINCL="@FIXINCL@" FIXINCL=`${PWDCMD}`/fixincl
if [ ! -x $FIXINCL ] ; then if [ ! -x $FIXINCL ] ; then
echo "Cannot find working fixincl" >&2 echo "Cannot find fixincl" >&2
exit 1 exit 1
fi fi
export FIXINCL export FIXINCL
...@@ -130,33 +130,27 @@ fi ...@@ -130,33 +130,27 @@ fi
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# Extract from the gcc -dM and from the specs file all the predefined # In the file macro_list are listed all the predefined
# macros that are not in the C89 reserved namespace (the reserved # macros that are not in the C89 reserved namespace (the reserved
# namespace is all identifiers beginnning with two underscores or one # namespace is all identifiers beginnning with two underscores or one
# underscore followed by a capital letter). The specs file is in # underscore followed by a capital letter). A regular expression to find
# ${ORIGDIR}, as is cc1. A regular expression to find any of those # any of those macros in a header file is written to MN_NAME_PAT.
# macros in a header file is written to MN_NAME_PAT.
# #
# Note dependency on ASCII. \012 = newline. # Note dependency on ASCII. \012 = newline.
# tr ' ' '\n' is, alas, not portable. # tr ' ' '\n' is, alas, not portable.
echo | ${ORIGDIR}/cc1 -quiet -dM -E - | if test -s ${MACRO_LIST}
sed -n 's/^#define \([a-zA-Z][a-zA-Z0-9_]*\).*/\1/p' > mn.T
tr -s '\040\011' '\012\012' < ${ORIGDIR}/specs |
sed -n 's/^.*-D\([a-zA-Z_][a-zA-Z0-9_]*\).*/\1/p' >> mn.T
if sort -u mn.T | grep -v '^_[_A-Z]' > mn.U
then then
if test $VERBOSE -gt 0 if test $VERBOSE -gt 0; then
then echo "Forbidden identifiers: `tr '\012' ' ' <mn.U`" ; fi echo "Forbidden identifiers: `tr '\012' ' ' < ${MACRO_LIST}`"
sed 's/^/\\\\</; s/$/\\\\>/; $!s/$/|/' < mn.U | tr -d '\012' > mn.V fi
MN_NAME_PAT="`cat mn.V`" MN_NAME_PAT="`sed 's/^/\\\\</; s/$/\\\\>/; $!s/$/|/' \
< ${MACRO_LIST} | tr -d '\012'`"
export MN_NAME_PAT export MN_NAME_PAT
else else
if test $VERBOSE -gt 0 if test $VERBOSE -gt 0
then echo "No forbidden identifiers defined by this target" ; fi then echo "No forbidden identifiers defined by this target" ; fi
fi fi
rm -f mn.[TUV]
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
......
#! /bin/sh #! /bin/sh
if [ $# -ne 2 ] if [ $# -ne 1 ]
then then
echo "Usage: $0 <build-mach-triplet> <target-mach-triplet>" echo "Usage: $0 <target-mach-triplet>"
exit 1 exit 1
fi fi
build=$1 machine=$1
machine=$2
target=fixinc.sh target=fixinc.sh
# Check for special fix rules for particular targets # Check for special fix rules for particular targets
...@@ -37,8 +36,7 @@ case $machine in ...@@ -37,8 +36,7 @@ case $machine in
*) *)
../${build_subdir}/fixincludes/fixincl -v < /dev/null ../${build_subdir}/fixincludes/fixincl -v < /dev/null
sed "s,@FIXINCL@,\${ORIGDIR}/../${build_subdir}/fixincludes/fixincl,g" \ cat < ${srcdir}/fixinc.in > ${target}
${srcdir}/fixinc.in > ${target}
;; ;;
esac esac
chmod 755 ${target} chmod 755 ${target}
...@@ -55,11 +55,6 @@ if [ x$1 != x ] ; then ...@@ -55,11 +55,6 @@ if [ x$1 != x ] ; then
else else
prefix=@prefix@ prefix=@prefix@
fi fi
# Directory in which to put localized header files. On the systems with
# gcc as the native cc, `local_prefix' may not be `prefix' which is
# `/usr'.
# NOTE: local_prefix *should not* default from prefix.
local_prefix=@local_prefix@
# Directory in which to put host dependent programs and libraries # Directory in which to put host dependent programs and libraries
exec_prefix=@exec_prefix@ exec_prefix=@exec_prefix@
# Directory in which to put the directories used by the compiler. # Directory in which to put the directories used by the compiler.
...@@ -69,11 +64,6 @@ libexecdir=@libexecdir@ ...@@ -69,11 +64,6 @@ libexecdir=@libexecdir@
libsubdir=${libdir}/gcc/${target_noncanonical}/${version} libsubdir=${libdir}/gcc/${target_noncanonical}/${version}
# Directory in which the compiler finds executables # Directory in which the compiler finds executables
libexecsubdir=${libexecdir}/gcc/${target_noncanonical}/${version} libexecsubdir=${libexecdir}/gcc/${target_noncanonical}/${version}
# Since gcc_tooldir does not exist at build-time, use -B${build_tooldir}/bin/
build_tooldir=${exec_prefix}/${target_noncanonical}
# Directory to search for site-specific includes.
local_includedir=${local_prefix}/include
includedir=${prefix}/include
itoolsdir=${libexecsubdir}/install-tools itoolsdir=${libexecsubdir}/install-tools
itoolsdatadir=${libsubdir}/install-tools itoolsdatadir=${libsubdir}/install-tools
...@@ -86,6 +76,7 @@ rm -rf ${incdir}/* ...@@ -86,6 +76,7 @@ rm -rf ${incdir}/*
if [ x${STMP_FIXINC} != x ] ; then if [ x${STMP_FIXINC} != x ] ; then
TARGET_MACHINE="${target}" target_canonical="${target}" \ TARGET_MACHINE="${target}" target_canonical="${target}" \
MACRO_LIST="${itoolsdatadir}/macro_list" \
${SHELL} ./fixinc.sh ${incdir} \ ${SHELL} ./fixinc.sh ${incdir} \
${SYSTEM_HEADER_DIR} ${OTHER_FIXINCLUDES_DIRS} ${SYSTEM_HEADER_DIR} ${OTHER_FIXINCLUDES_DIRS}
rm -f ${incdir}/syslimits.h rm -f ${incdir}/syslimits.h
......
2004-11-04 Geoffrey Keating <geoffk@apple.com>
* Makefile.in (distclean): Don't delete nonexistent fixinc/ directory.
(install-mkheaders): Install the version built for the
host, not for the build machine.
* configure.ac: Always run fixincludes.
(all_outputs): Remove mkheaders.
* configure: Regenerate.
* fixinc.in: Move to fixincludes/.
* mkfixinc.sh: Likewise.
* mkheaders.in: Likewise.
* README-fixinc: Likewise.
2004-11-05 Ramana Radhakrishnan <ramana.radhakrishnan@codito.com> 2004-11-05 Ramana Radhakrishnan <ramana.radhakrishnan@codito.com>
PR target/18263 PR target/18263
......
...@@ -1080,9 +1080,6 @@ gccbug: $(srcdir)/gccbug.in ...@@ -1080,9 +1080,6 @@ gccbug: $(srcdir)/gccbug.in
mklibgcc: $(srcdir)/mklibgcc.in mklibgcc: $(srcdir)/mklibgcc.in
CONFIG_FILES=mklibgcc CONFIG_HEADERS= ./config.status CONFIG_FILES=mklibgcc CONFIG_HEADERS= ./config.status
mkheaders: $(srcdir)/mkheaders.in
CONFIG_FILES=mkheaders CONFIG_HEADERS= ./config.status
# cstamp-h.in controls rebuilding of config.in. # cstamp-h.in controls rebuilding of config.in.
# It is named cstamp-h.in and not stamp-h.in so the mostlyclean rule doesn't # It is named cstamp-h.in and not stamp-h.in so the mostlyclean rule doesn't
# delete it. A stamp file is needed as autoheader won't update the file if # delete it. A stamp file is needed as autoheader won't update the file if
...@@ -2783,31 +2780,24 @@ stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) xlimits.h ...@@ -2783,31 +2780,24 @@ stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) xlimits.h
chmod a+r include/limits.h chmod a+r include/limits.h
# Install the README # Install the README
rm -f include/README rm -f include/README
cp $(srcdir)/README-fixinc include/README cp $(srcdir)/../fixincludes/README-fixinc include/README
chmod a+r include/README chmod a+r include/README
$(STAMP) $@ $(STAMP) $@
# fixinc.sh depends on this, not on specs directly.
# The idea is to make sure specs gets built, but not rerun fixinc.sh
# after each stage just because specs' mtime has changed.
# It also depends on cc1 since fixinc.sh uses it.
specs.ready: specs cc1$(exeext)
-if [ -f specs.ready ] ; then \
true; \
else \
$(STAMP) specs.ready; \
fi
fixinc.sh: mkfixinc.sh fixinc.in
build_subdir="$(build_subdir)" srcdir="$(srcdir)" \
$(SHELL) $(srcdir)/mkfixinc.sh $(build) $(target)
.PHONY: install-gcc-tooldir .PHONY: install-gcc-tooldir
install-gcc-tooldir: install-gcc-tooldir:
$(mkinstalldirs) $(DESTDIR)$(gcc_tooldir) $(mkinstalldirs) $(DESTDIR)$(gcc_tooldir)
macro_list : $(GCC_PASSES)
echo | $(GCC_FOR_TARGET) -E -dM - | \
sed -n 's/^#define \([^_][a-zA-Z0-9_]*\).*/\1/p ; \
s/^#define \(_[^_A-Z][a-zA-Z0-9_]*\).*/\1/p' | \
sort -u > $@
# Build fixed copies of system files. # Build fixed copies of system files.
stmp-fixinc: fixinc.sh gsyslimits.h specs.ready stmp-fixinc: gsyslimits.h macro_list \
../$(build_subdir)/fixincludes/fixincl \
../$(build_subdir)/fixincludes/fixinc.sh
@if test ! -d ${SYSTEM_HEADER_DIR}; then \ @if test ! -d ${SYSTEM_HEADER_DIR}; then \
echo The directory that should contain system headers does not exist: >&2 ; \ echo The directory that should contain system headers does not exist: >&2 ; \
echo " ${SYSTEM_HEADER_DIR}" >&2 ; \ echo " ${SYSTEM_HEADER_DIR}" >&2 ; \
...@@ -2817,24 +2807,20 @@ stmp-fixinc: fixinc.sh gsyslimits.h specs.ready ...@@ -2817,24 +2807,20 @@ stmp-fixinc: fixinc.sh gsyslimits.h specs.ready
rm -rf include; mkdir include rm -rf include; mkdir include
-chmod a+rx include -chmod a+rx include
(TARGET_MACHINE='$(target)'; srcdir=`cd $(srcdir); ${PWD_COMMAND}`; \ (TARGET_MACHINE='$(target)'; srcdir=`cd $(srcdir); ${PWD_COMMAND}`; \
SHELL='$(SHELL)' ;\ SHELL='$(SHELL)'; MACRO_LIST=`${PWD_COMMAND}`/macro_list ; \
export TARGET_MACHINE srcdir SHELL ; \ export TARGET_MACHINE srcdir SHELL MACRO_LIST && \
$(SHELL) ./fixinc.sh `${PWD_COMMAND}`/include $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS); \ cd ../$(build_subdir)/fixincludes && \
rm -f include/syslimits.h; \ $(SHELL) ./fixinc.sh ../../gcc/include \
$(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS) )
rm -f include/syslimits.h
if [ -f include/limits.h ]; then \ if [ -f include/limits.h ]; then \
mv include/limits.h include/syslimits.h; \ mv include/limits.h include/syslimits.h; \
else \ else \
cp $(srcdir)/gsyslimits.h include/syslimits.h; \ cp $(srcdir)/gsyslimits.h include/syslimits.h; \
fi; \ fi
chmod a+r include/syslimits.h) chmod a+r include/syslimits.h
$(STAMP) stmp-fixinc $(STAMP) stmp-fixinc
# We can't run fixinc (it's being built for a different host), but we still
# need to install it so that the user can run it when the compiler is
# installed.
stmp-install-fixinc: fixinc.sh gsyslimits.h
$(STAMP) $@
# Files related to the fixproto script. # Files related to the fixproto script.
# gen-protos and fix-header are compiled with CC_FOR_BUILD, but they are only # gen-protos and fix-header are compiled with CC_FOR_BUILD, but they are only
# used in native and host-x-target builds, so it's safe to link them with # used in native and host-x-target builds, so it's safe to link them with
...@@ -3065,10 +3051,8 @@ mostlyclean: lang.mostlyclean ...@@ -3065,10 +3051,8 @@ mostlyclean: lang.mostlyclean
-rm -f specs $(SPECS) SYSCALLS.c.X SYSCALLS.c -rm -f specs $(SPECS) SYSCALLS.c.X SYSCALLS.c
-rm -f collect collect2 mips-tfile mips-tdump -rm -f collect collect2 mips-tfile mips-tdump
# Delete files generated for fixproto # Delete files generated for fixproto
-rm -rf fix-header$(build_exeext) xsys-protos.h deduced.h tmp-deduced.h \ -rm -rf $(build_exeext) xsys-protos.h deduced.h tmp-deduced.h \
gen-protos$(build_exeext) fixproto.list fixtmp.* fixhdr.ready gen-protos$(build_exeext) fixproto.list fixtmp.* fixhdr.ready
# Delete files generated for fixincl
-rm -rf fixinc.sh specs.ready
# Delete unwanted output files from TeX. # Delete unwanted output files from TeX.
-rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg -rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg
-rm -f */*.toc */*.log */*.vr */*.fn */*.cp */*.tp */*.ky */*.pg -rm -f */*.toc */*.log */*.vr */*.fn */*.cp */*.tp */*.ky */*.pg
...@@ -3126,12 +3110,11 @@ distclean: clean lang.distclean ...@@ -3126,12 +3110,11 @@ distclean: clean lang.distclean
-cd testsuite && rm -f *.out *.gcov *$(coverageexts) -cd testsuite && rm -f *.out *.gcov *$(coverageexts)
-rm -rf ${QMTEST_DIR} stamp-qmtest -rm -rf ${QMTEST_DIR} stamp-qmtest
-rm -f cxxmain.c -rm -f cxxmain.c
-rm -f mklibgcc mkheaders gccbug .gdbinit configargs.h -rm -f mklibgcc gccbug .gdbinit configargs.h
-rm -f gcov.pod -rm -f gcov.pod
-rm -f fixinc/Makefile
# Delete po/*.gmo only if we are not building in the source directory. # Delete po/*.gmo only if we are not building in the source directory.
-if [ ! -f po/exgettext ]; then rm -f po/*.gmo; fi -if [ ! -f po/exgettext ]; then rm -f po/*.gmo; fi
-rmdir ada cp f java objc fixinc intl po testsuite 2>/dev/null -rmdir ada cp f java objc intl po testsuite 2>/dev/null
# Get rid of every file that's generated from some other file, except for `configure'. # Get rid of every file that's generated from some other file, except for `configure'.
# Most of these files ARE PRESENT in the GCC distribution. # Most of these files ARE PRESENT in the GCC distribution.
...@@ -3361,28 +3344,18 @@ install-headers-cp: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir ...@@ -3361,28 +3344,18 @@ install-headers-cp: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir
itoolsdir = $(libexecsubdir)/install-tools itoolsdir = $(libexecsubdir)/install-tools
itoolsdatadir = $(libsubdir)/install-tools itoolsdatadir = $(libsubdir)/install-tools
# Don't install the headers. Instead, install appropriate scripts # Install supporting files for fixincludes to be run later.
# and supporting files for fixincludes to be run later.
install-mkheaders: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir \ install-mkheaders: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir \
mkheaders xlimits.h macro_list xlimits.h
-rm -rf $(DESTDIR)$(itoolsdir) $(DESTDIR)$(itoolsdatadir)
$(mkinstalldirs) $(DESTDIR)$(itoolsdatadir)/include
$(mkinstalldirs) $(DESTDIR)$(itoolsdir)
for file in $(USER_H); do \ for file in $(USER_H); do \
realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \ realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
$(INSTALL_DATA) $$file \ $(INSTALL_DATA) $$file \
$(DESTDIR)$(itoolsdatadir)/include/$$realfile ; \ $(DESTDIR)$(itoolsdatadir)/include/$$realfile ; \
done done
$(INSTALL_DATA) xlimits.h $(DESTDIR)$(itoolsdatadir)/include/limits.h $(INSTALL_DATA) xlimits.h $(DESTDIR)$(itoolsdatadir)/include/limits.h
if [ x$(STMP_FIXINC) != x ] ; then \
$(INSTALL_DATA) $(srcdir)/README-fixinc \
$(DESTDIR)$(itoolsdatadir)/include/README ; \
$(INSTALL_SCRIPT) fixinc.sh $(DESTDIR)$(itoolsdir)/fixinc.sh ; \
$(INSTALL_PROGRAM) ../$(build_subdir)/fixincludes/fixincl$(build_exeext) \
$(DESTDIR)$(itoolsdir)/fixincl ; \
$(INSTALL_DATA) $(srcdir)/gsyslimits.h \ $(INSTALL_DATA) $(srcdir)/gsyslimits.h \
$(DESTDIR)$(itoolsdatadir)/gsyslimits.h ; \ $(DESTDIR)$(itoolsdatadir)/gsyslimits.h
else :; fi $(INSTALL_DATA) macro_list $(DESTDIR)$(itoolsdatadir)/macro_list
if [ x$(STMP_FIXPROTO) != x ] ; then \ if [ x$(STMP_FIXPROTO) != x ] ; then \
$(INSTALL_SCRIPT) $(mkinstalldirs) \ $(INSTALL_SCRIPT) $(mkinstalldirs) \
$(DESTDIR)$(itoolsdir)/mkinstalldirs ; \ $(DESTDIR)$(itoolsdir)/mkinstalldirs ; \
...@@ -3390,7 +3363,6 @@ install-mkheaders: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir \ ...@@ -3390,7 +3363,6 @@ install-mkheaders: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir \
$(INSTALL_PROGRAM) build/fix-header$(build_exeext) \ $(INSTALL_PROGRAM) build/fix-header$(build_exeext) \
$(DESTDIR)$(itoolsdir)/fix-header$(build_exeext) ; \ $(DESTDIR)$(itoolsdir)/fix-header$(build_exeext) ; \
else :; fi else :; fi
$(INSTALL_SCRIPT) mkheaders $(DESTDIR)$(itoolsdir)/mkheaders
echo 'SYSTEM_HEADER_DIR="'"$(SYSTEM_HEADER_DIR)"'"' \ echo 'SYSTEM_HEADER_DIR="'"$(SYSTEM_HEADER_DIR)"'"' \
> $(DESTDIR)$(itoolsdatadir)/mkheaders.conf > $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
echo 'OTHER_FIXINCLUDES_DIRS="$(OTHER_FIXINCLUDES_DIRS)"' \ echo 'OTHER_FIXINCLUDES_DIRS="$(OTHER_FIXINCLUDES_DIRS)"' \
......
...@@ -12683,20 +12683,12 @@ then ...@@ -12683,20 +12683,12 @@ then
BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)'
if test "x$TARGET_SYSTEM_ROOT" = x; then if test "x$TARGET_SYSTEM_ROOT" = x; then
STMP_FIXINC=stmp-install-fixinc
if "x$STMP_FIXPROTO" != x ; then if "x$STMP_FIXPROTO" != x ; then
STMP_FIXPROTO=stmp-install-fixproto STMP_FIXPROTO=stmp-install-fixproto
fi fi
fi fi
fi fi
# When bootstrapping from the toplevel, only run fixincludes during stage1
if test -d ../prev-gcc
then
STMP_FIXINC=stmp-install-fixinc
cp -R ../prev-gcc/include include
fi
# Expand extra_headers to include complete path. # Expand extra_headers to include complete path.
# This substitutes for lots of t-* files. # This substitutes for lots of t-* files.
extra_headers_list= extra_headers_list=
...@@ -14992,7 +14984,7 @@ all_languages= ...@@ -14992,7 +14984,7 @@ all_languages=
all_boot_languages= all_boot_languages=
all_compilers= all_compilers=
all_stagestuff= all_stagestuff=
all_outputs='Makefile gccbug mklibgcc mkheaders libada-mk' all_outputs='Makefile gccbug mklibgcc libada-mk'
# List of language makefile fragments. # List of language makefile fragments.
all_lang_makefrags= all_lang_makefrags=
# List of language subdirectory makefiles. Deprecated. # List of language subdirectory makefiles. Deprecated.
......
...@@ -1684,20 +1684,12 @@ then ...@@ -1684,20 +1684,12 @@ then
BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)'
if test "x$TARGET_SYSTEM_ROOT" = x; then if test "x$TARGET_SYSTEM_ROOT" = x; then
STMP_FIXINC=stmp-install-fixinc
if [ "x$STMP_FIXPROTO" != x ] ; then if [ "x$STMP_FIXPROTO" != x ] ; then
STMP_FIXPROTO=stmp-install-fixproto STMP_FIXPROTO=stmp-install-fixproto
fi fi
fi fi
fi fi
# When bootstrapping from the toplevel, only run fixincludes during stage1
if test -d ../prev-gcc
then
STMP_FIXINC=stmp-install-fixinc
cp -R ../prev-gcc/include include
fi
# Expand extra_headers to include complete path. # Expand extra_headers to include complete path.
# This substitutes for lots of t-* files. # This substitutes for lots of t-* files.
extra_headers_list= extra_headers_list=
...@@ -3034,7 +3026,7 @@ all_languages= ...@@ -3034,7 +3026,7 @@ all_languages=
all_boot_languages= all_boot_languages=
all_compilers= all_compilers=
all_stagestuff= all_stagestuff=
all_outputs='Makefile gccbug mklibgcc mkheaders libada-mk' all_outputs='Makefile gccbug mklibgcc libada-mk'
# List of language makefile fragments. # List of language makefile fragments.
all_lang_makefrags= all_lang_makefrags=
# List of language subdirectory makefiles. Deprecated. # List of language subdirectory makefiles. Deprecated.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment