bochs 源码编译GUI选项无法编译通过的解决办法。

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 顺利完成。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值