This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] fixincludes to the toplevel: gcc changes
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, Nathanael Nerode <neroden at gcc dot gnu dot org>
- Date: Mon, 30 Aug 2004 18:51:34 +0200
- Subject: [PATCH] fixincludes to the toplevel: gcc changes
These are the changes, other than removing the fixinc directory, needed
for fixincludes to be moved to the toplevel. Note that
gcc/fixinc/mkfixinc.sh must be moved to the gcc subdirectory, and
gcc/fixinc/fixincl.sh must be moved to gcc/fixinc.in, so I manually
generated this diff.
Paolo
2004-08-30 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in (build_subdir): New substitution.
(fixinc.sh): Simplify heavily since fixincludes is already built.
(stmp-fixinc): Depend on specs.ready.
(install-mkheaders): Use new location of fixincludes.
(clean): Do not descend into fixinc.
* configure.ac (build_subdir): Substitute.
(all_outputs): Remove fixinc/Makefile.
(default commands): Do not create links in fixinc.
* mkfixinc.sh: New, from fixinc/mkfixinc.sh without
the fixincludes configuration steps and substituting
@FIXINCL@ in fixinc.in.
* fixinc.in: New, from fixinc/fixincl.sh.
diff -ru ../../gcc/gcc/configure.ac ../../gcc-fixinc/gcc/configure.ac
--- ../../gcc/gcc/configure.ac 2004-08-30 14:59:49.000000000 +0200
+++ ../../gcc-fixinc/gcc/configure.ac 2004-08-30 17:51:55.000000000 +0200
@@ -1354,6 +1354,7 @@
FORBUILD=../${build_subdir}
fi
AC_SUBST(FORBUILD)
+AC_SUBST(build_subdir)
tm_file="${tm_file} defaults.h"
tm_p_file="${tm_p_file} tm-preds.h"
@@ -3029,7 +3030,7 @@
all_boot_languages=
all_compilers=
all_stagestuff=
-all_outputs='Makefile fixinc/Makefile gccbug mklibgcc mkheaders libada-mk'
+all_outputs='Makefile gccbug mklibgcc mkheaders libada-mk'
# List of language makefile fragments.
all_lang_makefrags=
# List of language subdirectory makefiles. Deprecated.
@@ -3323,7 +3324,7 @@
# This is virtually a duplicate of what happens in configure.lang; we do
# an extra check to make sure this only happens if ln -s can be used.
if test "$symbolic_link" = "ln -s"; then
- for d in ${subdirs} fixinc ; do
+ for d in ${subdirs} ; do
STARTDIR=`${PWDCMD-pwd}`
cd $d
for t in stage1 stage2 stage3 stage4 stageprofile stagefeedback include
diff ../../gcc/gcc/fixinc/mkfixinc.sh ../../gcc-fixinc/gcc/mkfixinc.sh
--- ../../gcc/gcc/fixinc/mkfixinc.sh 2003-10-24 19:47:51.000000000 +0200
+++ ../../gcc-fixinc/gcc/mkfixinc.sh 2004-08-30 18:11:36.000000000 +0200
@@ -8,30 +8,7 @@
build=$1
machine=$2
-target=../fixinc.sh
-
-echo constructing ${target} for $machine to run on $build
-fixincludes="${machine}"
-
-# Choose one or two-process fix methodology. Systems that cannot handle
-# bi-directional pipes must use the two process method.
-#
-case $build in
- i?86-*-msdosdjgpp* | \
- *-*-beos* )
- MAKE="${MAKE} TARGETS=twoprocess"
- CFLAGS="${CFLAGS} -DSEPARATE_FIX_PROC"
- ;;
-
- vax-dec-bsd* )
- CFLAGS="${CFLAGS} -Dexit=xexit -Datexit=xatexit"
- MAKE="${MAKE} TARGETS=oneprocess"
- ;;
-
- * )
- MAKE="${MAKE} TARGETS=oneprocess"
- ;;
-esac
+target=fixinc.sh
# Check for special fix rules for particular targets
case $machine in
@@ -53,26 +30,15 @@
powerpc-*-rtems* | \
powerpcle-*-eabisim* | \
powerpcle-*-eabi* )
- # Don't do any fixing.
- #
- fixincludes=
+ # IF there is no include fixing,
+ # THEN create a no-op fixer and exit
+ (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
;;
-esac
-
-# IF there is no include fixing,
-# THEN create a no-op fixer and exit
-#
-if test -z "$fixincludes"
-then
- (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
- chmod 755 ${target}
- exit 0
-fi
-# OK. We gotta make the thing.
-# make and install either the binary or the default script
-
-defs="SHELL=\"$SHELL\" CC=\"$CC\" CFLAGS=\"$CFLAGS\" LDFLAGS=\"$LDFLAGS\" LIBERTY=\"$LIBERTY\""
-cmd="$MAKE ${defs} install-bin"
-echo $cmd
-eval $cmd
+ *)
+ ../${build_subdir}/fixincludes/fixincl -v < /dev/null
+ sed "s,@FIXINCL@,../${build_subdir}/fixincludes/fixincl,g" \
+ ${srcdir}/fixinc.in > ${target}
+ ;;
+esac
+chmod 755 ${target}
diff ../../gcc/gcc/fixinc/fixincl.sh ../../gcc-fixinc/gcc/fixinc.in
--- ../../gcc/gcc/fixinc/fixincl.sh 2004-08-30 15:32:56.000000000 +0200
+++ ../../gcc-fixinc/gcc/fixinc.in 2004-08-30 18:11:20.000000000 +0200
@@ -96,13 +96,10 @@
# Original directory.
ORIGDIR=`${PWDCMD}`
export ORIGDIR
-FIXINCL=${ORIGDIR}/fixinc/fixincl
+FIXINCL="${ORIGDIR}/@FIXINCL@"
if [ ! -x $FIXINCL ] ; then
- FIXINCL=${ORIGDIR}/fixincl
- if [ ! -x $FIXINCL ] ; then
- echo "Cannot find working fixincl" >&2
- exit 1
- fi
+ echo "Cannot find working fixincl" >&2
+ exit 1
fi
export FIXINCL
--- ../../gcc/gcc/Makefile.in 2004-08-30 17:22:12.000000000 +0200
+++ ../../gcc-fixinc/gcc/Makefile.in 2004-08-30 18:09:14.000000000 +0200
@@ -83,6 +83,8 @@
# It's normally the absolute path to the current directory.
objdir = @objdir@
+build_subdir=@build_subdir@
+
# --------
# Defined vpaths
# --------
@@ -2779,28 +2781,16 @@
$(STAMP) specs.ready; \
fi
-# Until someone fixes this recursive make nightmare (please note where
-# BUILD_CFLAGS is first expanded below versus which later make invocation
-# has the fine-grain -warn markings for fixinc):
-fixinc.sh-warn = -Wno-error
-
-FIXINCSRCDIR=$(srcdir)/fixinc
-fixinc.sh: $(FIXINCSRCDIR)/mkfixinc.sh $(FIXINCSRCDIR)/fixincl.c \
- $(FIXINCSRCDIR)/procopen.c $(FIXINCSRCDIR)/server.c \
- $(FIXINCSRCDIR)/server.h $(FIXINCSRCDIR)/inclhack.def specs.ready
- (MAKE="$(MAKE)"; srcdir=`cd $(srcdir)/fixinc && ${PWD_COMMAND}` ; \
- CC="$(CC_FOR_BUILD)"; CFLAGS="$(BUILD_CFLAGS)"; LDFLAGS="$(BUILD_LDFLAGS)"; \
- LIBERTY=`${PWD_COMMAND}`/"$(BUILD_LIBIBERTY)"; \
- export MAKE srcdir CC CFLAGS LDFLAGS LIBERTY; \
- cd ./fixinc && \
- $(SHELL) $${srcdir}/mkfixinc.sh $(build) $(target))
+fixinc.sh: mkfixinc.sh fixinc.in
+ build_subdir="$(build_subdir)" srcdir="$(srcdir)" \
+ $(SHELL) $(srcdir)/mkfixinc.sh $(build) $(target)
.PHONY: install-gcc-tooldir
install-gcc-tooldir:
$(mkinstalldirs) $(DESTDIR)$(gcc_tooldir)
# Build fixed copies of system files.
-stmp-fixinc: fixinc.sh gsyslimits.h
+stmp-fixinc: fixinc.sh gsyslimits.h specs.ready
@if test ! -d ${SYSTEM_HEADER_DIR}; then \
echo The directory that should contain system headers does not exist: >&2 ; \
echo " ${SYSTEM_HEADER_DIR}" >&2 ; \
@@ -3043,8 +3033,7 @@
-rm -rf fix-header$(build_exeext) xsys-protos.h deduced.h tmp-deduced.h \
gen-protos$(build_exeext) fixproto.list fixtmp.* fixhdr.ready
# Delete files generated for fixincl
- -rm -rf fixincl fixinc.sh specs.ready
- (cd fixinc && $(MAKE) clean)
+ -rm -rf fixinc.sh specs.ready
# 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
@@ -3353,7 +3342,7 @@
$(INSTALL_DATA) $(srcdir)/README-fixinc \
$(DESTDIR)$(itoolsdatadir)/include/README ; \
$(INSTALL_SCRIPT) fixinc.sh $(DESTDIR)$(itoolsdir)/fixinc.sh ; \
- $(INSTALL_PROGRAM) fixinc/fixincl $(DESTDIR)$(itoolsdir)/fixincl ; \
+ $(INSTALL_PROGRAM) ../$(build_subdir)/fixincludes/fixincl$(build_exeext) $(DESTDIR)$(itoolsdir)/fixincl ; \
$(INSTALL_DATA) $(srcdir)/gsyslimits.h \
$(DESTDIR)$(itoolsdatadir)/gsyslimits.h ; \
else :; fi