Two configure script changes for the USB debugger.

- Only use GTK 2.0 if needed by wxWidgets, otherwise use GTK 3.0.
- Set minimum GTK version for the USB debug dialog to 3.0.
This commit is contained in:
Volker Ruppert 2024-07-14 21:12:32 +02:00
parent 858a9a5147
commit 9415313a49
3 changed files with 18 additions and 36 deletions

25
bochs/configure vendored
View File

@ -26366,26 +26366,19 @@ if test "$needs_gtk2" = 1; then
# pkg-config is required to set TOOLKIT_CXXFLAGS and LIBS
if test "x$PKG_CONFIG" != x; then
# if wxGTK is based on GTK 3.0, use it for gui debugger to avoid conflicts
if test "$with_wx" = yes -a "$wx_needs_gdk_version" = 3; then
$PKG_CONFIG --exists gtk+-3.0
if test x$? = x0; then
TOOLKIT_CXXFLAGS="`$PKG_CONFIG --cflags gtk+-3.0`"
LIBS="$LIBS `$PKG_CONFIG --libs gtk+-3.0`"
bx_have_gtk_version=3
fi
else
if test "$with_wx" = yes -a "$wx_needs_gdk_version" = 2; then
$PKG_CONFIG --exists gtk+-2.0
if test x$? = x0; then
TOOLKIT_CXXFLAGS="`$PKG_CONFIG --cflags gtk+-2.0`"
LIBS="$LIBS `$PKG_CONFIG --libs gtk+-2.0`"
bx_have_gtk_version=2
else
$PKG_CONFIG --exists gtk+-3.0
if test x$? = x0; then
TOOLKIT_CXXFLAGS="`$PKG_CONFIG --cflags gtk+-3.0`"
LIBS="$LIBS `$PKG_CONFIG --libs gtk+-3.0`"
bx_have_gtk_version=3
fi
fi
else
$PKG_CONFIG --exists gtk+-3.0
if test x$? = x0; then
TOOLKIT_CXXFLAGS="`$PKG_CONFIG --cflags gtk+-3.0`"
LIBS="$LIBS `$PKG_CONFIG --libs gtk+-3.0`"
bx_have_gtk_version=3
fi
fi
else
@ -26665,7 +26658,7 @@ fi
USB_DBG_OBJS=""
if test "$usb_debugger" = 1; then
if test "$bx_have_gtk_version" -ge 2; then
if test "$bx_have_gtk_version" -ge 3; then
USB_DBG_OBJS="usb_debug.o gtk_usb_debug.o"
printf "%s\n" "#define BX_USB_DEBUGGER 1" >>confdefs.h

View File

@ -2805,26 +2805,19 @@ if test "$needs_gtk2" = 1; then
# pkg-config is required to set TOOLKIT_CXXFLAGS and LIBS
if test "x$PKG_CONFIG" != x; then
# if wxGTK is based on GTK 3.0, use it for gui debugger to avoid conflicts
if test "$with_wx" = yes -a "$wx_needs_gdk_version" = 3; then
$PKG_CONFIG --exists gtk+-3.0
if test x$? = x0; then
TOOLKIT_CXXFLAGS="`$PKG_CONFIG --cflags gtk+-3.0`"
LIBS="$LIBS `$PKG_CONFIG --libs gtk+-3.0`"
bx_have_gtk_version=3
fi
else
if test "$with_wx" = yes -a "$wx_needs_gdk_version" = 2; then
$PKG_CONFIG --exists gtk+-2.0
if test x$? = x0; then
TOOLKIT_CXXFLAGS="`$PKG_CONFIG --cflags gtk+-2.0`"
LIBS="$LIBS `$PKG_CONFIG --libs gtk+-2.0`"
bx_have_gtk_version=2
else
$PKG_CONFIG --exists gtk+-3.0
if test x$? = x0; then
TOOLKIT_CXXFLAGS="`$PKG_CONFIG --cflags gtk+-3.0`"
LIBS="$LIBS `$PKG_CONFIG --libs gtk+-3.0`"
bx_have_gtk_version=3
fi
fi
else
$PKG_CONFIG --exists gtk+-3.0
if test x$? = x0; then
TOOLKIT_CXXFLAGS="`$PKG_CONFIG --cflags gtk+-3.0`"
LIBS="$LIBS `$PKG_CONFIG --libs gtk+-3.0`"
bx_have_gtk_version=3
fi
fi
else
@ -3025,7 +3018,7 @@ AC_SUBST(ENH_DBG_OBJS)
USB_DBG_OBJS=""
if test "$usb_debugger" = 1; then
if test "$bx_have_gtk_version" -ge 2; then
if test "$bx_have_gtk_version" -ge 3; then
USB_DBG_OBJS="usb_debug.o gtk_usb_debug.o"
AC_DEFINE(BX_USB_DEBUGGER, 1)
elif test "$DEFAULT_GUI" = win32 -o "$with_win32" = yes; then

View File

@ -25,10 +25,6 @@
#if BX_USB_DEBUGGER
#if BX_HAVE_GTK_VERSION == 2
#define GTK_DISABLE_DEPRECATED
#endif
#include "usb_debug.h"
#include <gtk/gtk.h>