tgmath.h without complex.h

Jakub Jelinek jakub@redhat.com
Tue Sep 25 23:50:00 GMT 2007


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.

	Jakub



More information about the Gcc-patches mailing list