On Mon, Jul 23, 2012 at 12:16:41AM +0100, Mans Rullgard wrote:
> This allows using non-standard flags for running the C preprocessor.
> The -o flag must be included in this setting due to strange syntax
> required by some compilers.
> 
> --- a/configure
> +++ b/configure
> @@ -621,6 +621,10 @@ cc_o(){
>      eval printf '%s\\n' $CC_O
>  }
>  
> +cc_e(){
> +    eval printf '%s\\n' $CC_E
> +}

One could argue code duplication here, but more importantly..

> @@ -632,7 +636,7 @@ check_cpp(){
>      log_file $TMPC
> -    check_cmd $cc $CPPFLAGS $CFLAGS "$@" -E -o $TMPO $TMPC
> +    check_cmd $cc $CPPFLAGS $CFLAGS "$@" $(cc_e $TMPO) $TMPC
>  }
>  
> @@ -1724,6 +1728,7 @@ cflags_filter=echo
>  
>  AS_O='-o $@'
> +CC_E='-E -o $@'
>  CC_O='-o $@'
>  LD_O='-o $@'
>  HOSTCC_O='-o $@'
> @@ -2042,7 +2047,8 @@ probe_cc(){
>  
> -    unset _type _ident _cc_o _flags _cflags _ldflags _depflags _DEPCMD 
> _DEPFLAGS
> +    unset _type _ident _cc_e _cc_o _flags _cflags _ldflags
> +    unset _depflags _DEPCMD _DEPFLAGS
>      _flags_filter=echo
>  
> @@ -2105,6 +2111,7 @@ probe_cc(){
>          _flags='--gcc --abi=eabi -me'
>          _cflags='-D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__='
> +        _cc_e='-ppl -fe=$@'
>          _cc_o='-fe=$@'

Why not set "CC_E" (or whatever) to "-E", "-ppl" and combine it with
the cc_o function we already have? Something like this:

for gcc (default):
CC_E='-E'
for that strange beast:
CC_E='-ppl'

-    check_cmd $cc $CPPFLAGS $CFLAGS "$@" -E -o $TMPO $TMPC
+    check_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_E $(cc_o $TMPO) $TMPC

Maybe one would still have to set _cc_e in probe_cc(), but you get
the general idea...

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to