Basilisk II, GCC 4.0 and XCode 4.2 on Snow Leopard

About BasiliskII, a 68k Mac emulator for Windows, MacOSX, and Linux that can run System 7.x through MacOS 8.1.

Moderators: Cat_7, Ronald P. Regensburg

Post Reply
User avatar
sentient06
Mac Mechanic
Posts: 188
Joined: Tue Mar 29, 2011 8:57 pm
Location: London, UK

Basilisk II, GCC 4.0 and XCode 4.2 on Snow Leopard

Post by sentient06 »

Hello folks, just for the record, I managed to set an XCode 4.2 environment on Snow Leopard compatible with Basilisk II's GCC 4.0 requirements.

For those who didn't try it: the problem with XCode 4.2 is that it uses GCC 4.2 and we have a few issues while compiling the emulators. The advantage of having a complete structure on Snow Leopard is that we can still try having universal builds that run in Leopard and Tiger, 32-bit builds, 64-bit builds (didn't manage to make it yet) and Lion and Mountain Lion compatible software. So, if you want to try it yourselves, I will post the steps I did and my key reference.

I will post in parts to make it tidy.
Last edited by sentient06 on Fri May 03, 2013 9:05 am, edited 1 time in total.
User avatar
sentient06
Mac Mechanic
Posts: 188
Joined: Tue Mar 29, 2011 8:57 pm
Location: London, UK

Re: Basilisk II, GCC 4.0 and XCode 4.2 on Snow Leopard

Post by sentient06 »

First, download XCode 3.2.6. It is available from Apple's developer centre website:
https://developer.apple.com/devcenter/d ... dk_4.3.dmg

Second, find XCode 4.2 for Snow Leopard. It is not available on Apple's, as far as I remember. Google it, there are torrents.
If you have XCode 4.x already installed, uninstall it. The preferences will remain untouched.

Open terminal.

Code: Select all

sudo /Developer/Library/uninstall-devtools --mode=all
Install XCode 3:
  • - Do not install "System Tools" nor "Unix Development" packages
    - "Mac OS X 10.4 SDK" and/or "Documentation" are optional
    - Change the path to "/Xcode3"
Install XCode 4.2:
  • - Select everything
    - Choose the normal target folder "/Developer"
Restore 10.4/10.5 SDK support.
Open terminal:

Code: Select all

cd /Developer/SDKs
sudo ln -s /Xcode3/SDKs/MacOSX10.4u.sdk .
sudo ln -s /Xcode3/SDKs/MacOSX10.5.sdk .
Restore GCC 4.0 support:
Terminal:

Code: Select all

cd /Developer/usr/bin
sudo ln -s /Xcode3/usr/bin/*4.0* .
cd /Developer/usr/libexec/
sudo ln -s /Xcode3/usr/libexec/gcc gcc
cd /Developer/Library/Xcode/PrivatePlugIns
cd Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins
sudo ln -s "/Xcode3/Library/Xcode/Plug-ins/GCC 4.0.xcplugin" .
Restore PPC support for GCC 4.2:

Code: Select all

cd /Developer/usr/libexec
sudo mv as as.bak
sudo ln -s /Xcode3/usr/bin/as .

Reference (I had to change a few commands):
http://stackoverflow.com/questions/5333 ... to-xcode-4
User avatar
sentient06
Mac Mechanic
Posts: 188
Joined: Tue Mar 29, 2011 8:57 pm
Location: London, UK

Re: Basilisk II, GCC 4.0 and XCode 4.2 on Snow Leopard

Post by sentient06 »

Now, to compile Basilisk II, we must define GCC and g++ accordingly.

Example:

Code: Select all

$ cd ~/Development/macemu/BasiliskII/src/Unix/
$ export CC=/Developer/usr/bin/gcc-4.0
$ export CXX=/Developer/usr/bin/g++-4.0
$ export CFLAGS="-g -O2 -arch i386"
$ export CXXFLAGS="-g -O2 -arch i386"
$ export LDFLAGS="-arch i386"
$ NO_CONFIGURE=1 ./autogen.sh
 + Running aclocal: done.
 + Running autoheader: done.
 + Running autoconf: done.
$ ./configure --enable-sdl-video --enable-sdl-audio --disable-vosf --enable-jit-compiler
(...)
Mac OS X GUI ........................... : no
SDL support ............................ : video audio
BINCUE support ......................... : no
LIBVHD support ......................... : no
XFree86 DGA support .................... : no
XFree86 VidMode support ................ : no
fbdev DGA support ...................... : no
Enable video on SEGV signals ........... : yes
ESD sound support ...................... : no
GTK user interface ..................... : no
mon debugger support ................... : no
Running m68k code natively ............. : no
Use JIT compiler ....................... : yes
JIT debug mode ......................... : no
Floating-Point emulation core .......... : IEEE fpu core
Assembly optimizations ................. : i386
Addressing mode ........................ : direct
Bad memory access recovery type ........ : mach

Configuration done. Now type "make" (or "gmake").
... and.. Bob's your uncle.
Hope it's useful for some.
Post Reply