This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
PATCH to simplify Makefile.in's float.h stuff (was: Re: PATCH: Break fixproto-enquire dependency (was: Re: Irix make loop (stmp-multilib) ) )
- To: law at cygnus dot com, ghazi at caip dot rutgers dot edu
- Subject: PATCH to simplify Makefile.in's float.h stuff (was: Re: PATCH: Break fixproto-enquire dependency (was: Re: Irix make loop (stmp-multilib) ) )
- From: Manfred Hollstein <manfred at s-direktnet dot de>
- Date: Fri, 22 May 1998 14:39:35 +0200 (MEST)
- Cc: egcs-bugs at cygnus dot com, wilson at cygnus dot com, mmitchell at usa dot net
- References: <13654.46921.636606.926317@slsvhmt><23408.895639711@hurl.cygnus.com>
- Reply-To: manfred at s-direktnet dot de, Manfred dot Hollstein at ks dot sel dot alcatel dot de
On Tue, 19 May 1998, 22:48:31, law@hurl.cygnus.com wrote:
>
> In message <13654.46921.636606.926317@slsvhmt>you write:
> > On Thu, 7 May 1998, 16:39:44, manfred@s-direktnet.de wrote:
> >
> > > To fix my current problem on m68k-motorola-sysv, I've appended a
> > > modified patch, which simply uses "stmp-int-hdrs" instead of
> > > "stmp-headers" and adds the latter where necessary.
> > >
> > > If we'd decide to take one consistent approach for both gfloat.h-nat
> > > and gfloat.h-cross, I'll come up with a patch for it.
> > >
> > > Is it OK to check in the patch below?
> > >
> >
> > %^&*&^% It's still not correct :-( Need to swap order of $(LIBGCC) and
> > $(STMP_FIXPROTO) (this - final (?) - patch replaces all earlier ones):
> >
> > Mon May 11 10:29:10 1998 Manfred Hollstein <manfred@s-direktnet.de>
> >
> > * Makefile.in (all.cross): Surround $(LIBGCC) and $(STMP_FIXPROTO)
> > with stmp-int-hdrs and stmp-headers dependencies to break dependency
> > upon gfloat.h and enquire; swap order of $(LIBGCC) and $(STMP_FIXPROTO).
> > (rest.encap): Likewise.
> > (install-headers-tar): Likewise.
> > (install-headers-cpio): Likewise.
> > (stmp-fixproto): Add comment; change to depend upon stmp-int-hdrs
> > instead of stmp-headers.
> A note, according to Jim, breaking this circular dependency should
> be easier now. :-)
>
> Basically we never try to build float.h, instead we pick up whatever
> version configure tells us to from the config subdir.
>
>
> If someone wants a little cleanup project, removing all the Make rules
> for building float.h would probably simplify the Makefile a little :-)
>
> jeff
OK, you asked for it, here is it. I've isolated all enquire related
macros and rules and moved them down to Makefile.in's end. I retained
them, because I think, they're still useful, e.g. to be run as a check
or when someone needs to produce a new float-i_dont_know_what.h file.
In addition, I've added my previous stmp-fixproto/enquire patch, which
I've changed as Kaveh suggested to properly support parallel builds.
1998-05-22 Manfred Hollstein <manfred@s-direktnet.de>
* Makefile.in (ENQUIRE_CFLAGS, ENQUIRE_LDFLAGS): Move down to the end
of the Makefile.
(FLOAT_H_TEST): Likewise.
(ENQUIRE): Likewise.
(float.h-nat): Likewise.
(float.h-cross): Likewise.
(enquire): Likewise.
(enquire.o): Likewise.
(stmp-int-hdrs): Fix comment about enquire; depend upon gfloat.h.
(stmp-headers): Move actions to stmp-int-hdrs, retaining only a
no-op.
(FLOAT_H): Remove old float.h-nat version; move current definition
to CROSS_FLOAT_H location.
(all.cross): Remove comments about enquire stuff.
* Makefile.in (all.cross): Swap $(LIBGCC) and $(STMP_FIXPROTO).
(rest.encap): Likewise.
(libgcc2.ready): Depend upon $(STMP_FIXPROTO)
diff -rup -x CVS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19980521.orig/gcc/Makefile.in egcs-19980521/gcc/Makefile.in
--- egcs-19980521.orig/gcc/Makefile.in Thu May 21 15:40:28 1998
+++ egcs-19980521/gcc/Makefile.in Fri May 22 12:08:27 1998
@@ -161,11 +161,6 @@ GCC_FOR_TARGET = ./xgcc -B./
# It also specifies -I./include to find, e.g., stddef.h.
GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) -I./include $(TCFLAGS)
-# Special flags for compiling enquire.
-# We disable optimization to make floating point more reliable.
-ENQUIRE_CFLAGS = -DNO_MEM -DNO_LONG_DOUBLE_IO -O0
-ENQUIRE_LDFLAGS = $(LDFLAGS)
-
# Sed command to transform gcc to installed name. Overwritten by configure.
program_transform_name = @program_transform_name@
program_transform_cross_name = s,^,$(target_alias)-,
@@ -226,14 +221,6 @@ SYSTEM_HEADER_DIR = /usr/include
# Control whether to run fixproto.
STMP_FIXPROTO = stmp-fixproto
-# Test to see whether <float.h> exists in the system header files,
-# and is not derived from GCC.
-FLOAT_H_TEST = \
- [ -f $(SYSTEM_HEADER_DIR)/float.h ] && \
- if grep 'ifndef _FLOAT_H___' $(SYSTEM_HEADER_DIR)/float.h >/dev/null; \
- then false; \
- else :; fi
-
# Test to see whether <limits.h> exists in the system header files.
LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
@@ -353,10 +340,6 @@ TARGET_LIBGCC2_CFLAGS =
# Some targets override this to stmp-int-hdrs
LIBGCC2_DEPS =
-# Enquire target (This is a variable so that a target can choose not to
-# build it.)
-ENQUIRE = enquire
-
# libgcc1-test target (must also be overridable for a target)
LIBGCC1_TEST = libgcc1-test
@@ -403,6 +386,10 @@ LIB2FUNCS_EXTRA =
# This is overridden by configure.
CROSS_FLOAT_H=$(srcdir)/config/float-@float_format@.h
+# We do not try to build float.h anymore. Let configure select the
+# appropriate pre-built float.h file for the target.
+FLOAT_H=$(srcdir)/config/float-@float_format@.h
+
# Program to convert libraries.
LIBCONVERT =
@@ -475,12 +462,6 @@ ALL=all.internal
# Choose the real install target.
INSTALL_TARGET=install-normal
-# Source for float.h. Overridden by cross-make.
-FLOAT_H=float.h-nat
-# We do not try to build float.h anymore. Let configure select the
-# appropriate pre-built float.h file for the target.
-FLOAT_H=$(srcdir)/config/float-@float_format@.h
-
# Setup the testing framework, if you have one
EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \
echo $${rootme}/../expect/expect ; \
@@ -804,16 +785,14 @@ config.status: configure version.c
all.internal: start.encap rest.encap
# This is what to compile if making a cross-compiler.
-# Note that we can compile enquire using the cross-compiler just built,
-# although we can't run it on this machine.
-all.cross: native gcc-cross specs stmp-headers $(LIBGCC) $(STMP_FIXPROTO) \
+all.cross: native gcc-cross specs stmp-headers $(STMP_FIXPROTO) $(LIBGCC) \
$(LIBGCC1_TEST) $(EXTRA_PARTS) lang.all.cross
# This is what to compile if making gcc with a cross-compiler.
all.build: native xgcc$(exeext) $(EXTRA_PARTS) lang.all.build
# This is what must be made before installing GCC and converting libraries.
start.encap: native xgcc$(exeext) specs $(LIBGCC1) xlimits.h lang.start.encap
# These can't be made until after GCC can run.
-rest.encap: stmp-headers $(LIBGCC) $(STMP_FIXPROTO) $(EXTRA_PARTS) lang.rest.encap
+rest.encap: stmp-headers $(STMP_FIXPROTO) $(LIBGCC) $(EXTRA_PARTS) lang.rest.encap
# This is what is made with the host's compiler
# whether making a cross compiler or not.
native: config.status auto-host.h cpp$(exeext) $(LANGUAGES) \
@@ -875,37 +854,6 @@ gfloat.h: $(FLOAT_H)
-rm -f gfloat.h
cp $(FLOAT_H) gfloat.h
-# Create float.h source for the native machine.
-# Make it empty if we can use the system float.h without changes.
-float.h-nat: enquire
- -./enquire -f > tmp-float.h
- grep '#define [^_]' tmp-float.h >/dev/null || true > tmp-float.h
- mv tmp-float.h float.h-nat
-
-# Create a dummy float.h source for a cross-compiler.
-# ??? This isn't used anymore. Should we create config/float-unkn.h
-# and make that the default float_format in configure?
-float.h-cross:
- echo "#ifndef __GCC_FLOAT_NOT_NEEDED" > t-float.h-cross
- echo "#error float.h values not known for cross-compiler" >> t-float.h-cross
- echo "#endif" >> t-float.h-cross
- mv t-float.h-cross float.h-cross
-
-# Used to compile enquire with standard cc, but have forgotten why.
-# Let's try with GCC.
-enquire: enquire.o $(GCC_PARTS)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ENQUIRE_LDFLAGS) enquire.o -o $@
-enquire.o: $(srcdir)/enquire.c $(GCC_PASSES) stmp-int-hdrs
- rm -f include/float.h
- if $(FLOAT_H_TEST); then \
- SYS_FLOAT_H_WRAP=1; \
- else :; \
- SYS_FLOAT_H_WRAP=0; \
- fi; \
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(ENQUIRE_CFLAGS) \
- -DSYS_FLOAT_H_WRAP=$$SYS_FLOAT_H_WRAP \
- -I. -c $(srcdir)/enquire.c
-
# Build the version of limits.h that we will install.
xlimits.h: glimits.h limitx.h limity.h
if $(LIMITS_H_TEST) ; then \
@@ -1040,7 +988,7 @@ libgcc1.S: libgcc1.c $(CONFIG_H) config.
# Compiling libgcc2.a requires making sure that cc1, etc. have been compiled.
# But recompiling cc1 should not force recompilation of libgcc2.a.
# If you want to force recompilation, delete libgcc2.a.
-libgcc2.ready: $(GCC_PASSES) $(LIBGCC2_DEPS) stmp-int-hdrs
+libgcc2.ready: $(GCC_PASSES) $(LIBGCC2_DEPS) stmp-int-hdrs $(STMP_FIXPROTO)
-if [ -f libgcc2.ready ] ; then \
true; \
else \
@@ -1960,9 +1908,9 @@ gcov$(exeext): gcov.o $(LIBDEPS)
# s-* so that mostlyclean does not force the include directory to
# be rebuilt.
-# Build the include directory except for float.h (which depends upon
+# Build the include directory including float.h (which no longer depends upon
# enquire).
-stmp-int-hdrs: stmp-fixinc $(USER_H) xlimits.h
+stmp-int-hdrs: stmp-fixinc $(USER_H) xlimits.h gfloat.h
# Copy in the headers provided with gcc.
# The sed command gets just the last file name component;
# this is necessary because VPATH could add a dirname.
@@ -1980,20 +1928,20 @@ stmp-int-hdrs: stmp-fixinc $(USER_H) xli
rm -f include/limits.h
cp xlimits.h include/limits.h
chmod a+r include/limits.h
-# Install the README
- rm -f include/README
- cp $(srcdir)/README-fixinc include/README
- chmod a+r include/README
- touch stmp-int-hdrs
-
-# Build the complete include directory, including float.h.
-stmp-headers: stmp-int-hdrs gfloat.h
rm -f include/float.h
if [ -s gfloat.h ]; then \
cp gfloat.h include/float.h && \
chmod a+r include/float.h; \
else :; fi
- touch stmp-headers
+# Install the README
+ rm -f include/README
+ cp $(srcdir)/README-fixinc include/README
+ chmod a+r include/README
+ touch $@
+
+# Now that gfloat.h no longer depends upon enquire, this is actually a no-op.
+stmp-headers:
+ touch $@
fixinc.sh :
cd ../contrib/fixinc ; CC=$(CC) MAKE=$(MAKE) CFLAGS=$(CFLAGS) \
@@ -2889,3 +2837,57 @@ risky-stage4: stage4
.PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
force:
+
+# ---
+# The enquire rules are still useful for building new float-anything.h.
+# Special flags for compiling enquire.
+# We disable optimization to make floating point more reliable.
+ENQUIRE_CFLAGS = -DNO_MEM -DNO_LONG_DOUBLE_IO -O0
+ENQUIRE_LDFLAGS = $(LDFLAGS)
+
+# Enquire target (This is a variable so that a target can choose not to
+# build it.)
+ENQUIRE = enquire
+
+# Test to see whether <float.h> exists in the system header files,
+# and is not derived from GCC.
+FLOAT_H_TEST = \
+ [ -f $(SYSTEM_HEADER_DIR)/float.h ] && \
+ if grep 'ifndef _FLOAT_H___' $(SYSTEM_HEADER_DIR)/float.h >/dev/null; \
+ then false; \
+ else :; fi
+# We pretend to not having a usable <float.h>, hence disable the FLOAT_H_TEST
+# to ensure, we're emitting a full blown <float.h> ourselves.
+FLOAT_H_TEST = false
+
+# Used to compile enquire with standard cc, but have forgotten why.
+# Let's try with GCC.
+enquire: enquire.o $(GCC_PARTS)
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ENQUIRE_LDFLAGS) enquire.o -o $@
+enquire.o: $(srcdir)/enquire.c $(GCC_PASSES) stmp-int-hdrs
+ if $(FLOAT_H_TEST); then \
+ rm -f include/float.h; \
+ SYS_FLOAT_H_WRAP=1; \
+ else :; \
+ SYS_FLOAT_H_WRAP=0; \
+ fi; \
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(ENQUIRE_CFLAGS) \
+ -DSYS_FLOAT_H_WRAP=$$SYS_FLOAT_H_WRAP \
+ -I. -c $(srcdir)/enquire.c
+
+# Create float.h source for the native machine.
+# Make it empty if we can use the system float.h without changes.
+float.h-nat: enquire
+ -./enquire -f > tmp-float.h
+ grep '#define [^_]' tmp-float.h >/dev/null || true > tmp-float.h
+ mv tmp-float.h float.h-nat
+
+# Create a dummy float.h source for a cross-compiler.
+# ??? This isn't used anymore. Should we create config/float-unkn.h
+# and make that the default float_format in configure?
+float.h-cross:
+ echo "#ifndef __GCC_FLOAT_NOT_NEEDED" > t-float.h-cross
+ echo "#error float.h values not known for cross-compiler" >> t-float.h-cross
+ echo "#endif" >> t-float.h-cross
+ mv t-float.h-cross float.h-cross
+