Commit ac1284f9 by Per Bothner

Add fixproto support.

From-SVN: r4987
parent 7936052f
...@@ -121,6 +121,9 @@ RANLIB_TEST_FOR_TARGET = [ -f $(TARGET_TOOLPREFIX)ranlib ] ...@@ -121,6 +121,9 @@ RANLIB_TEST_FOR_TARGET = [ -f $(TARGET_TOOLPREFIX)ranlib ]
# Dir to search for system headers. Overridden by cross-make. # Dir to search for system headers. Overridden by cross-make.
SYSTEM_HEADER_DIR = /usr/include SYSTEM_HEADER_DIR = /usr/include
# Uncomment following line for fixproto support. (May become the default!)
# STMP_FIXPROTO = stmp-fixproto
# There may be a premade insn-attrtab.c for this machine. # There may be a premade insn-attrtab.c for this machine.
# (You could rebuild it with genattrtab as usual, but it takes a long time.) # (You could rebuild it with genattrtab as usual, but it takes a long time.)
# PREMADE_ATTRTAB is the file name of the file to use. # PREMADE_ATTRTAB is the file name of the file to use.
...@@ -466,7 +469,7 @@ all.internal: start.encap rest.encap ...@@ -466,7 +469,7 @@ all.internal: start.encap rest.encap
# This is what to compile if making a cross-compiler. # This is what to compile if making a cross-compiler.
# Note that we can compile enquire using the cross-compiler just build, # Note that we can compile enquire using the cross-compiler just build,
# although we can't run it on this machine. # although we can't run it on this machine.
all.cross: native gcc-cross specs $(LIBGCC) stmp-headers cross-test enquire $(EXTRA_PARTS) all.cross: native gcc-cross specs $(LIBGCC) stmp-headers $(STMP_FIXPROTO) cross-test enquire $(EXTRA_PARTS)
# This is what to compile if making gcc with a cross-compiler. # This is what to compile if making gcc with a cross-compiler.
all.build: native xgcc $(EXTRA_PARTS) all.build: native xgcc $(EXTRA_PARTS)
# This is what must be made before installing GCC and converting libraries. # This is what must be made before installing GCC and converting libraries.
...@@ -474,7 +477,7 @@ start.encap: native xgcc specs $(LIBGCC1) xlimits.h ...@@ -474,7 +477,7 @@ start.encap: native xgcc specs $(LIBGCC1) xlimits.h
# Use this to make a GCC that will be used only to recompile GCC. # Use this to make a GCC that will be used only to recompile GCC.
for-bootstrap: start.encap $(LIBGCC) for-bootstrap: start.encap $(LIBGCC)
# These can't be made, with COFF encapsulation, until after GCC can run. # These can't be made, with COFF encapsulation, until after GCC can run.
rest.encap: $(LIBGCC) stmp-headers $(EXTRA_PARTS) rest.encap: $(LIBGCC) stmp-headers $(STMP_FIXPROTO) $(EXTRA_PARTS)
# This is what is made with the host's compiler # This is what is made with the host's compiler
# whether making a cross compiler or not. # whether making a cross compiler or not.
native: config.status cpp $(LANGUAGES) $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2) native: config.status cpp $(LANGUAGES) $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2)
...@@ -1292,6 +1295,7 @@ SYSCALLS.c.X: $(srcdir)/sys-types.h $(srcdir)/sys-protos.h $(GCC_PASSES) ...@@ -1292,6 +1295,7 @@ SYSCALLS.c.X: $(srcdir)/sys-types.h $(srcdir)/sys-protos.h $(GCC_PASSES)
-aux-info $@ -S -o tmp-SYSCALLS.s SYSCALLS.c -aux-info $@ -S -o tmp-SYSCALLS.s SYSCALLS.c
-rm -f SYSCALLS.c tmp-SYSCALLS.s -rm -f SYSCALLS.c tmp-SYSCALLS.s
test-protoize-simple: ./protoize ./unprotoize $(GCC_PASSES) test-protoize-simple: ./protoize ./unprotoize $(GCC_PASSES)
-rm -f tmp-proto.[cso] -rm -f tmp-proto.[cso]
cp $(srcdir)/protoize.c tmp-proto.c cp $(srcdir)/protoize.c tmp-proto.c
...@@ -1396,6 +1400,35 @@ objc-headers: ...@@ -1396,6 +1400,35 @@ objc-headers:
GCC_FOR_TARGET="$${thisdir1}/xgcc -B$${thisdir1}/" \ GCC_FOR_TARGET="$${thisdir1}/xgcc -B$${thisdir1}/" \
GCC_CFLAGS="$(GCC_CFLAGS)" incinstalldir=$${thisdir1}/include GCC_CFLAGS="$(GCC_CFLAGS)" incinstalldir=$${thisdir1}/include
touch objc-headers touch objc-headers
# Files related to the fixproto script.
deduced.h: $(srcdir)/scan-types.sh
CC="$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -nostdinc -Iinclude -I${SYSTEM_HEADER_DIR}"; \
export CC; \
$(srcdir)/scan-types.sh >tmp-deduced.h
mv tmp-deduced.h deduced.h
gen-protos: gen-protos.o scan.o
${HOST_CC} -o gen-protos gen-protos.o scan.o
xsys-protos.h: $(srcdir)/sys-protos.h deduced.h gen-protos Makefile
cat deduced.h $(srcdir)/sys-protos.h |\
sed -e 's/ / /g' -e 's/ *(/ (/g' -e 's/ [ ]*/ /g' >tmp.c
$(GCC_FOR_TARGET) tmp.c -E | ./gen-protos >xsys-protos.h
scan-decls: scan-decls.o scan.o
$(HOST_CC) -o scan-decls scan-decls.o scan.o
patch-header: patch-header.o scan.o xsys-protos.h obstack.o
$(HOST_CC) -o patch-header patch-header.o scan.o obstack.o
patch-header.o: xsys-protos.h
stmp-fixproto: patch-header scan-decls xsys-protos.h
CPP="$(GCC_FOR_TARGET) -E"; export CPP; \
${srcdir}/fixproto include include $(SYSTEM_HEADER_DIR)
touch stmp-fixproto
# Remake the info files. # Remake the info files.
...@@ -1463,6 +1496,9 @@ mostlyclean: ...@@ -1463,6 +1496,9 @@ mostlyclean:
# Delete some files made during installation. # Delete some files made during installation.
-rm -f specs gfloat.h float.h-* enquire SYSCALLS.c.X SYSCALLS.c -rm -f specs gfloat.h float.h-* enquire SYSCALLS.c.X SYSCALLS.c
-rm -f collect collect2 ld mips-tfile mips-tdump alloca.s -rm -f collect collect2 ld mips-tfile mips-tdump alloca.s
# Delete files generated for fixproto
rm -rf patch-header scan-decls xsys-protos.h deduced.h tmp-deduced.h \
tmp.i tmp.c
# 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
# Delete sorted indices we don't actually use. # Delete sorted indices we don't actually use.
...@@ -1691,7 +1727,7 @@ install-include-dir: install-dir ...@@ -1691,7 +1727,7 @@ install-include-dir: install-dir
-chmod a+rx $(libsubdir)/include -chmod a+rx $(libsubdir)/include
# Install the include directory using tar. # Install the include directory using tar.
install-headers-tar: stmp-headers install-include-dir install-headers-tar: stmp-headers $(STMP_FIXPROTO) install-include-dir
cd include; \ cd include; \
(tar cf - .; exit 0) | (cd $(libsubdir)/include; tar $(TAROUTOPTS) - ) (tar cf - .; exit 0) | (cd $(libsubdir)/include; tar $(TAROUTOPTS) - )
# /bin/sh on some systems returns the status of the first tar, # /bin/sh on some systems returns the status of the first tar,
...@@ -1699,7 +1735,7 @@ install-headers-tar: stmp-headers install-include-dir ...@@ -1699,7 +1735,7 @@ install-headers-tar: stmp-headers install-include-dir
# So use `exit 0' to ignore its exit status. # So use `exit 0' to ignore its exit status.
# Install the include directory using cpio. # Install the include directory using cpio.
install-headers-cpio: stmp-headers install-include-dir install-headers-cpio: stmp-headers $(STMP_FIXPROTO) install-include-dir
cd include; find . -print | cpio -pdum $(libsubdir)/include cd include; find . -print | cpio -pdum $(libsubdir)/include
# Put assert.h where it won't override GNU libc's assert.h. # Put assert.h where it won't override GNU libc's assert.h.
......
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