- 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@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 + 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) + if test -z "$DEBUGFORMAT" + then + for ac_flag in $CFLAGS; do + case $ac_flag in + -gdwarf*) DEBUGFORMAT=$ac_flag ;; + -g) DEBUGFORMAT=-gdwarf ;; + esac + done + fi + case $DEBUGFORMAT in + *dwarf-3) WINE_TRY_CFLAGS([-gdwarf-3]) + WINE_TRY_CFLAGS([-gstrict-dwarf]) ;; + *dwarf-4) WINE_TRY_CFLAGS([-gdwarf-4]) + WINE_TRY_CFLAGS([-gstrict-dwarf]) ;; + *dwarf|*dwarf-2) WINE_TRY_CFLAGS([-gdwarf-2]) + WINE_TRY_CFLAGS([-gstrict-dwarf]) ;; + esac
dnl Disable gcc builtins except for Mingw AC_SUBST(MSVCRTFLAGS,"")