[FFmpeg-cvslog] r19404 - in trunk: common.mak configure

Stefano Sabatini stefano.sabatini-lala
Sun Jul 12 19:32:31 CEST 2009


On date Sunday 2009-07-12 15:29:32 +0200, mru wrote:
> Author: mru
> Date: Sun Jul 12 15:29:32 2009
> New Revision: 19404
> 
> Log:
> Separate C preprocessor flags into CPPFLAGS variable
> 
> Modified:
>    trunk/common.mak
>    trunk/configure
> 
> Modified: trunk/common.mak
> ==============================================================================
> --- trunk/common.mak	Sun Jul 12 15:22:01 2009	(r19403)
> +++ trunk/common.mak	Sun Jul 12 15:29:32 2009	(r19404)
> @@ -18,16 +18,17 @@ endif
>  
>  ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
>  
> -CFLAGS := -DHAVE_AV_CONFIG_H -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(OPTFLAGS)
> +CPPFLAGS += -DHAVE_AV_CONFIG_H -I$(BUILD_ROOT_REL) -I$(SRC_PATH)
> +CFLAGS := $(OPTFLAGS)
>  
>  %.o: %.c
> -	$(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
> +	$(CC) $(CPPFLAGS) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
>  
>  %.o: %.S
> -	$(AS) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
> +	$(AS) $(CPPFLAGS) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
>  
>  %.ho: %.h
> -	$(CC) $(CFLAGS) $(LIBOBJFLAGS) -Wno-unused -c -o $@ -x c $<
> +	$(CC) $(CPPFLAGS) $(CFLAGS) $(LIBOBJFLAGS) -Wno-unused -c -o $@ -x c $<
>  
>  %.d: %.c
>  	$(DEPEND_CMD) > $@
> 
> Modified: trunk/configure
> ==============================================================================
[...]
> @@ -2472,6 +2484,7 @@ enabled stripping &&
>      echo "STRIP=$strip" >> config.mak ||
>      echo "STRIP=echo ignoring strip" >> config.mak
>  
> +echo "CPPFLAGS?=$CPPFLAGS" >> config.mak
>  echo "OPTFLAGS=$CFLAGS" >> config.mak
>  echo "LDFLAGS=$LDFLAGS" >> config.mak
>  echo "FFSERVERLDFLAGS=$FFSERVERLDFLAGS" >> config.mak

That's causing me trouble, what's the point of the '?'?

In the case it is already defined in the environment, CPPFLAGS is not
defined, so all the -D_ISOC99_SOURCE etc. flags are not set and the
compilation fails whenever they are required.

So I tried to change that to:
echo "CPPFLAGS=$CPPFLAGS" >> config.mak

then CPPFLAGS is correctly set, but I have problems with the DEPEND_CMD
var. Looks like that in the second case, DEPEND_CMD is set just when
reading the config.mak, that is with the non-modified value of
CPPFLAGS, that is without the -DHAVE_AV_CONFIG_H -I$(BUILD_ROOT_REL)
flags set in common.mak:

CPPFLAGS := -DHAVE_AV_CONFIG_H -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(CPPFLAGS)

Anyway the workaround is to avoid to set CPPFLAGS in the env, in that
case make works the supposed way.

Regards.



More information about the ffmpeg-cvslog mailing list