[PATCH 5/6] configure: allow picking up dwarf version for compilation from command line

Jacek Caban jacek at codeweavers.com
Fri Oct 1 13:14:07 CDT 2021


Hi Eric,

On 9/28/21 5:21 PM, Eric Pouech wrote:
> - specifying -gdwarf-X will configure dwarf version X for compilation
>    (recent compilers will support 2 up to 5, Wine doesn't support 5 yet)
> - <regular> compilation: either picked up in one of CFLAGS options
>    (when present), or gotten from DEBUGFORMAT as fallback
> - cross compilation: either picked up in one of CROSSCFLAGS options,
>    (when present), or gotten from CROSSDEBUGFORMAT as fallback
> - renamed CROSSDEBUG into CROSSDEBUGFORMAT in sake of clarity and
>    coherency with DEBUGFORMAT
>
> Default version for both compilations is still dwarf 2
>
> V2:  with Jacek's suggestions on making both compilations regular/cross as
> coherent as possiblex)
>
> Signed-off-by: Eric Pouech <eric.pouech at gmail.com>
>
> ---
>   configure.ac |   50 ++++++++++++++++++++++++++++++++++++--------------
>   1 file changed, 36 insertions(+), 14 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index c0a126293c4..7b97740788d 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1031,21 +1031,31 @@ then
>           esac
>   
>           dnl Determine debug info format
> +        AC_SUBST(CROSSDEBUGFORMAT)
>           AC_SUBST(CROSSDEBUG)
> -        if test -z "$CROSSDEBUG"
> +	if test -n "$CROSSDEBUG"
> +	then
> +	    AS_ECHO("CROSSDEBUG is deprecated. Please use CROSSDEBUGFORMAT instead.") >&AS_MESSAGE_FD
> +	fi


I'm not really convinced it's worth the change, but in any case it could 
be a separated patch. Also note that you used tabs here.


> +	CROSSDEBUGFORMAT=${CROSSDEBUGFORMAT:-$CROSSDEBUG}
> +        if test -z "$CROSSDEBUGFORMAT"
>           then
>             for ac_flag in $CROSSCFLAGS; do
>               case $ac_flag in
> -             -gdwarf*)    CROSSDEBUG=dwarf ;;
> -             -gcodeview)  CROSSDEBUG=pdb ;;
> -             -g)          CROSSDEBUG=${CROSSDEBUG:-dwarf} ;;
> +             -gdwarf*)    CROSSDEBUGFORMAT=$ac_flag ;;
> +             -gcodeview)  CROSSDEBUGFORMAT=pdb ;;
> +             -g)          CROSSDEBUGFORMAT=dwarf ;;
>               esac
>             done
>           fi
> -        case $CROSSDEBUG in
> -          *dwarf)  WINE_TRY_CROSSCFLAGS([-gdwarf-2])
> -                   WINE_TRY_CROSSCFLAGS([-gstrict-dwarf]) ;;
> -          pdb)     WINE_TRY_CROSSCFLAGS([-gcodeview]) ;;
> +        case $CROSSDEBUGFORMAT in
> +          *dwarf-3)        WINE_TRY_CROSSCFLAGS([-gdwarf-3])
> +                           WINE_TRY_CROSSCFLAGS([-gstrict-dwarf]) ;;
> +          *dwarf-4)        WINE_TRY_CROSSCFLAGS([-gdwarf-4])
> +                           WINE_TRY_CROSSCFLAGS([-gstrict-dwarf]) ;;
> +          *dwarf|*dwarf-2) WINE_TRY_CROSSCFLAGS([-gdwarf-2])
> +                           WINE_TRY_CROSSCFLAGS([-gstrict-dwarf]) ;;
> +          codeview|pdb)    WINE_TRY_CROSSCFLAGS([-gcodeview]) ;;
>           esac
>   
>           WINE_TRY_CROSSCFLAGS([-fexcess-precision=standard],[AC_SUBST(EXCESS_PRECISION_CFLAGS,"-fexcess-precision=standard")])
> @@ -2040,12 +2050,24 @@ char*f(const char *h,char n) {return strchr(h,n);}]])],[ac_cv_c_logicalop_noisy=
>     esac
>   
>     dnl Default to dwarf-2 debug info
> -  for ac_flag in $CFLAGS; do
> -    case $ac_flag in
> -      -g) WINE_TRY_CFLAGS([-gdwarf-2])
> -          WINE_TRY_CFLAGS([-gstrict-dwarf]) ;;
> -    esac
> -  done
> +  AC_SUBST(DEBUGFORMAT)


AC_SUBST is not needed here, you don't use it outside configure script


> +  if test -z "$DEBUGFORMAT"
> +  then
> +    for ac_flag in $CFLAGS; do
> +      case $ac_flag in
> +        -gdwarf*)    DEBUGFORMAT=$ac_flag ;;
> +        -g)          DEBUGFORMAT=-gdwarf ;;


Note that this will override previous selection for cases like 
CFLAGS="-gdwarf-4 -g".


Thanks,

Jacek




More information about the wine-devel mailing list