tgmath.h without complex.h

Richard Sandiford rsandifo@nildram.co.uk
Wed Sep 26 00:03:00 GMT 2007


Jakub Jelinek <jakub@redhat.com> writes:
> On Tue, Sep 25, 2007 at 10:10:40PM +0100, Richard Sandiford wrote:
>> --- gcc/Makefile.in	2007-09-25 09:32:44.000000000 +0100
>> +++ gcc/Makefile.in	2007-09-25 09:58:09.000000000 +0100
>> @@ -305,6 +305,9 @@ USER_H = $(srcdir)/ginclude/float.h \
>>  	 $(srcdir)/ginclude/stdfix.h \
>>  	 $(EXTRA_HEADERS)
>>  
>> +# Whether <tgmath.h> should be installed, if included in EXTRA_HEADERS.
>> +INSTALL_TGMATH_H = [ -f $(SYSTEM_HEADER_DIR)/complex.h ]
>> +
>>  UNWIND_H = $(srcdir)/unwind-generic.h
>>  
>>  # The GCC to use for compiling crt*.o.
>> @@ -3379,10 +3382,12 @@ stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) 
>>  	for file in .. $(USER_H); do \
>>  	  if [ X$$file != X.. ]; then \
>>  	    realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
>> -	    $(STAMP) include/$$realfile; \
>> -	    rm -f include/$$realfile; \
>> -	    cp $$file include; \
>> -	    chmod a+r include/$$realfile; \
>> +	    if test $$realfile != tgmath.h || $(INSTALL_TGMATH_H); then \
>> +	      $(STAMP) include/$$realfile; \
>> +	      rm -f include/$$realfile; \
>> +	      cp $$file include; \
>> +	      chmod a+r include/$$realfile; \
>> +	    fi; \
>>  	  fi; \
>>  	done
>>  	rm -f include/unwind.h
>
> Why don't you do the check in gcc/config.gcc or gcc/configure{.ac,} instead?
> We already have use_gcc_tgmath var there, set to no on Linux and on the Hurd.
> So IMHO you should just add there a check for complex.h presence and
> set use_gcc_tgmath=no if it is missing.

The problem is that SYSTEM_HEADER_DIR can be overridden by the target
makefile fragments, so we don't necessarily know the right value at
configure time.  I also think it would be a bad idea to test for
limits.h in the Makefile and complex.h in configure.

Richard



More information about the Gcc-patches mailing list