configure: Allow specifying cross debug format.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2020-05-14 16:40:03 +02:00 committed by Alexandre Julliard
parent 942e298308
commit 8e051c5802
3 changed files with 65 additions and 13 deletions

View File

@ -69,6 +69,7 @@ CONVERT = @CONVERT@
ICOTOOL = @ICOTOOL@ ICOTOOL = @ICOTOOL@
MSGFMT = @MSGFMT@ MSGFMT = @MSGFMT@
CROSSTARGET = @CROSSTARGET@ CROSSTARGET = @CROSSTARGET@
CROSSDEBUG = @CROSSDEBUG@
SUBDIRS = @SUBDIRS@ SUBDIRS = @SUBDIRS@
RUNTESTFLAGS = -q -P wine RUNTESTFLAGS = -q -P wine
MAKEDEP = $(TOOLSDIR)/tools/makedep$(TOOLSEXT) MAKEDEP = $(TOOLSDIR)/tools/makedep$(TOOLSEXT)

53
configure vendored
View File

@ -705,6 +705,7 @@ X_PRE_LIBS
X_CFLAGS X_CFLAGS
XMKMF XMKMF
PTHREAD_LIBS PTHREAD_LIBS
CROSSDEBUG
DELAYLOADFLAG DELAYLOADFLAG
CROSSLDFLAGS CROSSLDFLAGS
EXTRACROSSCFLAGS EXTRACROSSCFLAGS
@ -10520,9 +10521,19 @@ if test "x$ac_cv_crosscflags__Wnonnull" = xyes; then :
fi ;; fi ;;
esac esac
for ac_flag in $CROSSCFLAGS; do
case $ac_flag in if test -z "$CROSSDEBUG"
-g) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -gdwarf-2" >&5 then
for ac_flag in $CROSSCFLAGS; do
case $ac_flag in
-gdwarf*) CROSSDEBUG=dwarf ;;
-gcodeview) CROSSDEBUG=pdb ;;
-g) CROSSDEBUG=${CROSSDEBUG:-dwarf} ;;
esac
done
fi
case $CROSSDEBUG in
*dwarf) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -gdwarf-2" >&5
$as_echo_n "checking whether the cross-compiler supports -gdwarf-2... " >&6; } $as_echo_n "checking whether the cross-compiler supports -gdwarf-2... " >&6; }
if ${ac_cv_crosscflags__gdwarf_2+:} false; then : if ${ac_cv_crosscflags__gdwarf_2+:} false; then :
$as_echo_n "(cached) " >&6 $as_echo_n "(cached) " >&6
@ -10553,7 +10564,7 @@ $as_echo "$ac_cv_crosscflags__gdwarf_2" >&6; }
if test "x$ac_cv_crosscflags__gdwarf_2" = xyes; then : if test "x$ac_cv_crosscflags__gdwarf_2" = xyes; then :
EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -gdwarf-2" EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -gdwarf-2"
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -gstrict-dwarf" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -gstrict-dwarf" >&5
$as_echo_n "checking whether the cross-compiler supports -gstrict-dwarf... " >&6; } $as_echo_n "checking whether the cross-compiler supports -gstrict-dwarf... " >&6; }
if ${ac_cv_crosscflags__gstrict_dwarf+:} false; then : if ${ac_cv_crosscflags__gstrict_dwarf+:} false; then :
$as_echo_n "(cached) " >&6 $as_echo_n "(cached) " >&6
@ -10584,8 +10595,38 @@ $as_echo "$ac_cv_crosscflags__gstrict_dwarf" >&6; }
if test "x$ac_cv_crosscflags__gstrict_dwarf" = xyes; then : if test "x$ac_cv_crosscflags__gstrict_dwarf" = xyes; then :
EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -gstrict-dwarf" EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -gstrict-dwarf"
fi ;; fi ;;
esac pdb) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -gcodeview" >&5
done $as_echo_n "checking whether the cross-compiler supports -gcodeview... " >&6; }
if ${ac_cv_crosscflags__gcodeview+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved_cc=$CC
ac_wine_try_cflags_saved_exeext=$ac_exeext
CFLAGS="$CFLAGS $EXTRACROSSCFLAGS -nostartfiles -nodefaultlibs -gcodeview"
CC="$CROSSCC"
ac_exeext=".exe"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int __cdecl mainCRTStartup(void) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_crosscflags__gcodeview=yes
else
ac_cv_crosscflags__gcodeview=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
CC=$ac_wine_try_cflags_saved_cc
ac_exeext=$ac_wine_try_cflags_saved_exeext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_crosscflags__gcodeview" >&5
$as_echo "$ac_cv_crosscflags__gcodeview" >&6; }
if test "x$ac_cv_crosscflags__gcodeview" = xyes; then :
EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -gcodeview"
fi ;;
esac
if test "x$enable_werror" = "xyes" if test "x$enable_werror" = "xyes"
then then

View File

@ -1100,13 +1100,23 @@ then
WINE_TRY_CROSSCFLAGS([-Wnonnull]) ;; WINE_TRY_CROSSCFLAGS([-Wnonnull]) ;;
esac esac
dnl Default to dwarf-2 debug info dnl Determine debug info format
for ac_flag in $CROSSCFLAGS; do AC_SUBST(CROSSDEBUG)
case $ac_flag in if test -z "$CROSSDEBUG"
-g) WINE_TRY_CROSSCFLAGS([-gdwarf-2]) then
WINE_TRY_CROSSCFLAGS([-gstrict-dwarf]) ;; for ac_flag in $CROSSCFLAGS; do
esac case $ac_flag in
done -gdwarf*) CROSSDEBUG=dwarf ;;
-gcodeview) CROSSDEBUG=pdb ;;
-g) CROSSDEBUG=${CROSSDEBUG:-dwarf} ;;
esac
done
fi
case $CROSSDEBUG in
*dwarf) WINE_TRY_CROSSCFLAGS([-gdwarf-2])
WINE_TRY_CROSSCFLAGS([-gstrict-dwarf]) ;;
pdb) WINE_TRY_CROSSCFLAGS([-gcodeview]) ;;
esac
if test "x$enable_werror" = "xyes" if test "x$enable_werror" = "xyes"
then then