在Mac OS X Snow Leopard上编译Bochs [英] Compiling Bochs on Mac os x Snow Leopard

查看:192
本文介绍了在Mac OS X Snow Leopard上编译Bochs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人能够在Snow Leopard下编译Bochs模拟器.豹对我来说工作得很好,但是在Snow Leopard下,我遇到了很多与Carbon库有关的问题...

Was someone able to compile the Bochs simulator under Snow Leopard. Leopard worked fine for me but under Snow Leopard I get alot of problems related to the Carbon library...

好的,还要求提供更多信息.

Ok, some more information was request.

  • 我在shell上使用make进行编译; bochs来源附带的标准构建过程
  • 我成功地针对10.5 SDK进行了编译. Unfortunatley,它没有在Snow Leopard下运行...总是崩溃
  • 然后,我从SnowLeopard CD中安装了最新的XCode并针对10.6 SDK进行了编译;如果没有更改,而isysroot标志指向10.6而不是10.5,则编译器现在很难找到一些Carbon标头...(-frame Carbon作为g ++的参数包含在内)

这是错误...在为boch编译碳基gui时失败:

Here the error... it fails when it comes to compiling the carbon-based gui for bochs:

g++ -c  -I.. -I./.. -I../iodev -I./../iodev -I../instrument/stubs -I./../instrument/stubs -pipe -O3 -isysroot /Developer/SDKs/MacOSX10.6.sdk -framework Carbon -fomit-frame-pointer -finline-functions -falign-loops=16 -falign-jumps=16 -falign-functions=16 -falign-labels=16 -falign-loops-max-skip=15 -falign-jumps-max-skip=15 -fprefetch-loop-arrays  -fpascal-strings -fno-common -Wno-four-char-constants -Wno-unknown-pragmas -Dmacintosh -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES    carbon.cc -o carbon.o
carbon.cc:154: warning: non-local variable ‘<anonymous enum> last_screen_state’ uses anonymous type
carbon.cc:154: warning: non-local variable ‘<anonymous enum> screen_state’ uses anonymous type
carbon.cc:163: error: ‘CIconHandle’ does not name a type
carbon.cc: In function ‘OSStatus CEvtHandleWindowBackdropUpdate(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*)’:
carbon.cc:278: error: ‘GetWindowPortBounds’ was not declared in this scope
carbon.cc:279: error: ‘BackColor’ was not declared in this scope
carbon.cc:280: error: ‘EraseRect’ was not declared in this scope

...更多未声明的xxx错误

... many more undeclared xxx errors

先谢谢了 Mac

推荐答案

我终于可以自己完成此任务,但是比我期望的要花更多的工作.即使在Linux上,Bochs的安装也可能有点气质.

I was finally able to accomplish this myself, but it took a little more work than I expected. Bochs can be a little temperamental to install, even on Linux.

忘了尝试使用Carbon进行编译. Apple已弃用它,您将无法使用它编译64位应用程序(Mac OS X的默认设置). http://appleinsider.com/articles/12/02/18/mountain_lion_focuses_on_cocoa_carbons_pres_x11>

Forget about attempting to compile with Carbon. Apple is deprecating it and you won't be able to compile applications in 64-bit with it (the default for Mac OS X). http://appleinsider.com/articles/12/02/18/mountain_lion_focuses_on_cocoa_drops_x11_and_deprecates_carbon

顺便说一句,Bochs团队未使用Mac OS X,可能不会解决此问题.这可能是您帮助开源项目的机会: http://sourceforge.net/p/bochs/bugs/1204/

BTW, the Bochs team doesn't use Mac OS X and probably won't be fixing this issue. This could be your chance to help an open source project: http://sourceforge.net/p/bochs/bugs/1204/

也就是说,您只需稍作调整就可以使用SDL支持进行编译.

That said, you should be able to compile with SDL support with a little tweaking.

我永远无法从 http://www.libsdl.org 中获得SDL库,因此它无法正常工作,所以我使用Homebrew- http://brew.sh 进行安装:

I could never get the SDL library from http://www.libsdl.org to work correctly, so I used Homebrew -- http://brew.sh -- to install it:

brew install sdl

配置Bochs

我喜欢用调试器配置Bochs(用于OS开发),并且喜欢将其安装到主目录中(以防我想删除它).这是我使用的配置命令:

Configure Bochs

I like to configure Bochs with the debugger (for OS development) and I like to install it into my home directory (in case I want to delete it). Here is the configure command I use:

./configure --enable-ne2000 \
            --enable-all-optimizations \
            --enable-cpu-level=6 \
            --enable-x86-64 \
            --enable-vmx=2 \
            --enable-pci \
            --enable-usb \
            --enable-usb-ohci \
            --enable-e1000 \
            --enable-debugger \
            --enable-disasm \
            --disable-debugger-gui \
            --with-sdl \
            --prefix=$HOME/opt/bochs

请注意,我添加了-disable-debugger-gui ,因为如果您选择启用调试器,则默认情况下将其启用.但是,由于调试器GUI依赖于GTK +,并且在Mac OS X上默认未安装,因此您要禁用它(GTK +是您不想处理的另一种蠕虫病毒).

Please note that I added --disable-debugger-gui because it is enabled by default if you choose to enable the debugger. However, since the debugger GUI relies on GTK+, and that isn't installed by default on Mac OS X, you want to disable it (GTK+ is another can of worms you don't want to deal with).

下一步,构建并安装

make
make install

最后,只需设置BXSHARE环境变量并更新路径:

Finally, just set your BXSHARE environment variable and update your path:

export BXSHARE="$HOME/opt/bochs/share/bochs"
export PATH="$PATH:$HOME/opt/bochs/bin"

这篇关于在Mac OS X Snow Leopard上编译Bochs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆