Re: PATCH: Amaya 1.3b build FAILS on i586-pc-linux-gnu (Red Hat 5.1).

On Mon, 7 Dec 1998 Irene.Vatton@inrialpes.fr wrote:

> I've integrated them into the next Amaya release except the option *-x c*
> You suggested:
>  .c.o :
> -	$(CC) -DCPP="$(CPP)" $(CFLAGS) $(INCLUDES) -c $< -o $@
> +	$(CC) '-DCPP="'"$(CPP)"' -x c"' $(CFLAGS) $(INCLUDES) -c $< -o $@
> 
> I've done
>  .c.o :
> -	$(CC) -DCPP="$(CPP)" $(CFLAGS) $(INCLUDES) -c $< -o $@
> +	$(CC) '-DCPP="'"$(CPP)"'"' $(CFLAGS) $(INCLUDES) -c $< -o $@
> 
>   Irene.

Well, here's the problem.  The problem is that during the build, CPP is
called to preprocess several files whose filenames end with ".P" (and
other extensions).  The configure.in macro sets CPP to "gcc -E", which
does invoke the C preprocessor, but only if the filename ends with ".c".

There's a note to that effect in autoconf's documentation:

==
Macro: AC_PROG_CPP

Set output variable CPP to a command that runs the C preprocessor. If `$CC
-E' doesn't work, it uses `/lib/cpp'. It is only portable to run CPP on
files with a `.c' extension.

==

One possible solution is to add the following code to configure.in right
after 'AC_PROG_CPP':

if test "$GCC" = "yes"
then
	CPP="$CPP -x c"
fi

This should add '-x c' to CPP flags on gcc-based preprocessors only.

Received on Monday, 4 January 1999 04:01:01 UTC