CentOS 8.3
按照《操作系统真象还原》一书的介绍,要下载bochs的源码,并且编译安装。
configure 选项:
./configure --enable-debugger --enable-disasm --enable-x86-debugger --enable-iodebug --with-x --with-x11
运行结果中有下面这段:
checking for default gui on this platform... x11
checking whether user wants XPM support... yes
checking X11/xpm.h usability... no
checking X11/xpm.h presence... no
checking for X11/xpm.h... no
checking X11/extensions/Xrandr.h usability... no
checking X11/extensions/Xrandr.h presence... no
checking for X11/extensions/Xrandr.h... no
Package x11 was not found in the pkg-config search path.
Perhaps you should add the directory containing `x11.pc'
to the PKG_CONFIG_PATH environment variable
Package 'x11', required by 'virtual:world', not found
Package x11 was not found in the pkg-config search path.
Perhaps you should add the directory containing `x11.pc'
to the PKG_CONFIG_PATH environment variable
Package 'x11', required by 'virtual:world', not found
checking for display libraries... X11
checking for wget... wget
configure: WARNING: The Bochs debugger gui cannot be compiled here, disabling it
make的时候果然出错。于是根据上面的提示安装
sudo dnf install libXpm-devel libXrandr-devel
之后再次执行configure,好了一点点,但是看最后的warning,gui支持仍然不满足:
checking for default gui on this platform... x11
checking whether user wants XPM support... yes
checking X11/xpm.h usability... yes
checking X11/xpm.h presence... yes
checking for X11/xpm.h... yes
checking X11/extensions/Xrandr.h usability... yes
checking X11/extensions/Xrandr.h presence... yes
checking for X11/extensions/Xrandr.h... yes
checking for display libraries... X11
checking for wget... wget
configure: WARNING: The Bochs debugger gui cannot be compiled here, disabling it
直接打开configure文件,找到下面这一段:
ENH_DBG_OBJS=""
if test "$gui_debugger" = 1; then
if test "$bx_have_gtk_version" -ge 2; then #注意这里
ENH_DBG_OBJS="enh_dbg.o gtk_enh_dbg_osdep.o"
$as_echo "#define BX_DEBUGGER_GUI 1" >>confdefs.h
elif test "$DEFAULT_GUI" = win32 -o "$with_win32" = yes; then
ENH_DBG_OBJS="enh_dbg.o win32_enh_dbg_osdep.o"
$as_echo "#define BX_DEBUGGER_GUI 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The Bochs debugger gui cannot be compiled here, disabling it" >&5
$as_echo "$as_me: WARNING: The Bochs debugger gui cannot be compiled here, disabling it" >&2;}
fi
fi
执行configure输出的warning就是else分支里打印的,那么看起来应该在第一个if判断中如果满足要求应该就可以了。
"$bx_have_gtk_version" -ge 2 猜测是要求安装gtk2/gtk3的库。
查询了一下gtk2/gtk3都已经安装,但是对应devel包没有安装,编译源码,应该是要devel包的。
于是再执行
sudo dnf install gtk2-devel gtk3-devel
再之后执行./configure 就不会有gui cannot be compiled的提示了。
make&sudo make install 顺利完成。