Closed maronz closed 6 months ago
This is what I see in the configure script:
# some display libraries and the enhanced debugger may depend on the GTK+ software package
bx_have_gtk_version=0
if test "$needs_gtk2" = 1; then
# pkg-config is required to set TOOLKIT_CXXFLAGS and LIBS
if test "$PKGCONFIG" != not_found; 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
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
fi
fi
else
echo "ERROR: pkg-config was not found, unable to access the gtk+-2.0 package."
echo "The gui debugger support is disabled now."
fi
fi
The code for GTK 3 is already there:
# 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
What did you done specifically ?
I have to admit that I could have expressed myself more clearly. My issue came up when I wanted to build the debugger GUI with GTK3, but without having the required libraries for GTK2 or WX.
It might help if I put a few remarks into the following expanded diff:
# some display libraries and the enhanced debugger may depend on the GTK+ software package
bx_have_gtk_version=0
if test "$needs_gtk2" = 1; then
# pkg-config is required to set TOOLKIT_CXXFLAGS and LIBS
if test "$PKGCONFIG" != not_found; 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 ### with WX, check for GTK3
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
pkg-config --exists gtk+-2.0 ### without WX, check for GTK2
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 ### without WX, check for GTK3
+ 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
fi
else
echo "ERROR: pkg-config was not found, unable to access the gtk+-2.0 package."
echo "The gui debugger support is disabled now."
fi
fi
It looks okay to me, so I have applied the changes. I cannot test it here, since wxWidgets still uses GTK2.
On a current Linux Mint system (which is based on Ubuntu 22.04) one can build Bochs simply by having the
g++
and thelibx11-dev
packages installed. I'm generally happy enough to use the simple 'X11' GUI, so that works so far.For some other project I might have added also the
libgtk-3-dev
package. Lets assume I want to now use the Bochs debugger GUI. I'd therefore perform a rebuild with:configure --enable-debugger
At this stage one would be forced to install additionally:
libgtk2.0-dev
(even though the GTK3 dev files are already available).I've done a small "tweak", which should amend 'configure' insofar as to also perform a check for GTK3, if the GTK2 dev files can't be found:
This seems to work for me, but I'm not really happy to repeat this block of code. Probably some refactoring could be done to achieve a better result. But since I'm not a user of any of the other interfaces, I did not want to break things.