Emaculation.com
 

Compiling BasiliskII and SheepShaver for various host environments

IMPORTANT NOTICE: The source code for BasiliskII and SheepShaver has been relocated to a github repository. The source code can now be downloaded from: https://github.com/cebix/macemu

++++ WORK IN PROGRESS, HELP IF YOU CAN ++++

Preparing your build environment

Common assumptions:

  • You have a folder called “src” inside which you are going to place all downloads mentioned below. The folder structure we are assuming looks like this:
  • src
  • src\SDL-1.2.15
  • src\BasiliskII (this folder will be created automatically if you follow the directions below)
  • src\SheepShaver (this folder will be created automatically if you follow the directions below)
Windows

You need an installation of Cygwin 1.5 or 1.7 or MinGW which includes the GCC and G++ compilers, the cvs package, X-headers, libgnome development etc.
Inside that installation, download SDL-1.2.15 and build and install SDL. NOTE: TO BE COMPLETED, PERHAPS WITH SCREEN SHOTS

Make the “src” folder in your Cygwin or MinGW home folder.

Step by step installation of SDL-1.2.15

  • Download the source code from: http://www.libsdl.org/release/SDL-1.2.15.zip
  • unpack the code in the folder “src”
  • start Cygwin or MinGW.
  • (only in case you're using Cygwin 1.7 execute: “chmod 755 /usr/bin/set-gcc-default-3.sh” and ”/usr/bin/set-gcc-default-3.sh” effectively setting Cygwin 1.7 to use the gcc version 3 compiler in stead of the standard gcc version 4 compiler). You can reverse this by executing: “chmod 755 /usr/bin/set-gcc-default-4.sh” and ”/usr/bin/set-gcc-default-4.sh”
  • cd to the folder containing the SDL source and
./autogen.sh
./configure --disable-shared
make
make install

You can install multiple versions of SDL, but you will then need to cd into the SDL folder every time you start cygwin and set and export the path to sdl-config to build SheepShaver, so SDL libs and sdl-config file can be found.

./autogen.sh
./configure --disable-shared --prefix=`pwd`
make
make install
PATH=`pwd`/bin:$PATH
export PATH
Windows GUIs

The Windows GUIs are built by using the gtk+ Win32 development packages. We assume you install them in C:\GTK

(disregard a possible error message)

export PKG_CONFIG_PATH='C:\GTK\lib\pkgconfig\'
OSX Snow Leopard

You have two options to build SheepShaver with OSX. You can use the command line method described below, or the XCode project method. In any case you need Xcode installed.

Using the command line
Make the “src” folder inside your home folder.

./autogen.sh
./configure --disable-shared --prefix=`pwd`
make
make install
PATH=`pwd`/bin:$PATH
export PATH

* You need to cd into the SDL folder every time you start a new terminal window and export the path (the last two command lines above) to sdl-config to build SheepShaver, so SDL libs and sdl-config file can be found.

Using Xcode (3.x, with 10.4 SDK installed)

Linux

You need GCC and G++ installed, plus several other development packages, like SDL-1.2.15 development, the X-headers, the libgnome-development package, cvs access

  • Your SDL installation and other packages should be found automatically when you start building SheepShaver or BasiliskII

Actions for all environments

Download the sources:

  • cd into the “src” folder
  • Go to https://github.com/cebix/macemu and download the zip file under “ZIP”
  • Open the zip file and place the folders BasiliskII and SheepShaver in the “src” folder

The SheepShaver code is not needed if you only want to compile BasiliskII.

Building BasiliskII in Windows

cd to the BasiliskII folder and:

cd src/Windows
NO_CONFIGURE=1 ../Unix/autogen.sh
./configure
make
strip BasiliskII.exe

If you also want to build the GUI, use

cd src/Windows
NO_CONFIGURE=1 ../Unix/autogen.sh
./configure

Edit the file “make” in the Windows folder.

Change "WANT_GTK = no" to "WANT_GTK = yes"

Open a command window in Windows and enter:

pkg-config --cflags gtk+-win32-2.0
pkg-config --libs gtk+-win32-2.0

copy the outputs of the respective commands behind the lines GTK_CFLAGS = and GTK_LIBS =

It would look something like:

WANT_GTK = yes
GTK_CFLAGS = -mms-bitfields -IC:/GTK/include/gtk-2.0 -IC:/GTK/lib/gtk-2.0/include -IC:/GTK/include/atk-1.0 -IC:/GTK/include/cairo -IC:/GTK/include/pango-1.0 -IC:/GTK/include/glib-2.0 -IC:/GTK/lib/glib-2.0/include -IC:/GTK/include/freetype2 -IC:/GTK/include\\
GTK_LIBS = -Wl,-luuid -LC:/GTK/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -limm32 -lshell32 -lole32 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpangoft2-1.0 -lpangowin32-1.0 -lgdi32 -lfreetype -lz -lfontconfig -lpango-1.0 -lm -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl\\
make
strip BasiliskII.exe
strip BasiliskIIGUI.exe

Building BasiliskII in OSX Snow Leopard

cd to the BasiliskII folder and:

cd src/Unix
export CC=/usr/bin/gcc-4.0
export CXX=/usr/bin/g++-4.0
NO_CONFIGURE=1 ./autogen.sh
./configure --enable-sdl-video --enable-sdl-audio --disable-vosf --enable-jit-compiler
make
make BasiliskII_app

For an “in depth” overview of build possibilies, also check http://mrob.com/pub/comp/basilisk-ii.html

Building BasiliskII in Linux flavours

Ubuntu:

cd BasiliskII
cd src/Unix
NO_CONFIGURE=1 ./autogen.sh
./configure --enable-sdl-video --enable-sdl-audio --disable-vosf --enable-jit-compiler
make
strip BasiliskII

Fedora:

cd BasiliskII
cd src/Unix
NO_CONFIGURE=1 ./autogen.sh
./configure --enable-sdl-video --enable-sdl-audio --disable-vosf --enable-jit-compiler
make
strip BasiliskII

Suse:

cd BasiliskII
cd src/Unix
NO_CONFIGURE=1 ./autogen.sh
./configure --enable-sdl-video --enable-sdl-audio --disable-vosf --enable-jit-compiler
make
strip BasiliskII

CentOS-64:

  • First edit the file \src\BasiliskII\src\Unix\configure.ac and comment out the lines 113 to 125, like this
dnl Check if we should really be assuming x86_64 even if we detected HAVE_I386 above. 
dnl if [[ "x$HAVE_I386" = "xyes" ]]; then
dnl  AC_TRY_RUN([
dnl    int main(void) {
dnl        #if defined(__x86_64__)
dnl                return 0;
dnl        #else
dnl                return 1;
dnl        #endif
dnl    }
dnl  ], [
dnl    HAVE_I386=no
dnl    HAVE_X86_64=yes
dnl  ])
dnl fi
cd BasiliskII
cd src/Unix
NO_CONFIGURE=1 ./autogen.sh
./configure --enable-sdl-video --enable-sdl-audio --disable-vosf --enable-jit-compiler
make
strip BasiliskII

Building SheepShaver in Windows

cd to the SheepShaver folder and:

make links
cd src/Windows
NO_CONFIGURE=1 ../Unix/autogen.sh

Go into the SheepShaver/src/Windows folder and open the file “configure” with a text editor. Remove the lines 3991 to 3998 and save the file. Then continue with:

CC='gcc-3 -mwin32' CXX='g++-3 -mwin32' ./configure --with-gtk=no
make
strip SheepShaver.exe

If you also want to build the GUI, use

cd src/Windows
NO_CONFIGURE=1 ../Unix/autogen.sh
CC='gcc-3 -mwin32' CXX='g++-3 -mwin32' ./configure

Edit the file “make” in the Windows folder.

Change "WANT_GTK = no" to "WANT_GTK = yes"

Open a command window in Windows and enter:

pkg-config --cflags gtk+-win32-2.0
pkg-config --libs gtk+-win32-2.0

copy the outputs of the respective commands behind the lines GTK_CFLAGS = and GTK_LIBS =

It would look something like:

WANT_GTK = yes
GTK_CFLAGS = -mms-bitfields -IC:/GTK/include/gtk-2.0 -IC:/GTK/lib/gtk-2.0/include -IC:/GTK/include/atk-1.0 -IC:/GTK/include/cairo -IC:/GTK/include/pango-1.0 -IC:/GTK/include/glib-2.0 -IC:/GTK/lib/glib-2.0/include -IC:/GTK/include/freetype2 -IC:/GTK/include\\
GTK_LIBS = -Wl,-luuid -LC:/GTK/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -limm32 -lshell32 -lole32 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpangoft2-1.0 -lpangowin32-1.0 -lgdi32 -lfreetype -lz -lfontconfig -lpango-1.0 -lm -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl\\
make
strip SheepShaver.exe
strip SheepShaverGUI.exe

Building SheepShaver in OSX Snow Leopard

You have two option to build Sheepshaver in OSX, using the command line or using the XCode project file. Stick to the method you used to prepare your build environment as described above.

Using the command line
cd to the SheepShaver folder and do:

make links
cd src/Unix
NO_CONFIGURE=1 ./autogen.sh
./configure --enable-sdl-audio --enable-sdl-video --disable-vosf
make
make SheepShaver_app

Using the Xcode project file
Open a terminal and cd to the SheepShaver folder and do:

make links 

Close the terminal

  • open the src/SheepShaver/src/MacOSX/SheepShaver.xcodeproj file. Xcode opens.
  • in the “Debug | SheepShaver | …” drop-down menu choose “Release”
  • build the project by selecting Build in the Build menu
  • SheepShaver is then found in the src/SheepShaver/src/MacOSX/build/release/ folder

Building SheepShaver in Linux flavours

  • SheepShaver currently suffers from issues regarding running in a window/full screen. For full screen support, follow the directions below. However, if you want a stable build for windowed use, delete ”–enable-sdl-video” and ”–enable-sdl-audio” from the ./configure step.

Ubuntu:

cd to the SheepShaver folder and:

make links
cd src/Unix
NO_CONFIGURE=1 ./autogen.sh
./configure --enable-sdl-video --enable-sdl-audio --disable-vosf
make
strip SheepShaver

Fedora:

cd to the SheepShaver folder and:

make links
cd src/Unix
NO_CONFIGURE=1 ./autogen.sh
./configure --enable-sdl-video --enable-sdl-audio --disable-vosf
make
strip SheepShaver

Suse:

cd to the SheepShaver folder and:

make links
cd src/Unix
NO_CONFIGURE=1 ./autogen.sh
./configure --enable-sdl-video --enable-sdl-audio --disable-vosf
make
strip SheepShaver

CentOS-64:

  • The JIT_compiler doesn't compile on CentOS-64 (see error below), so it needs to be disabled in the configure step
  • glibc detected ./dyngen: free(): invalid pointer: 0x000000007a8826c0 when compiling /dyngen -o ppc-dyngen-ops.hpp obj/ppc-dyngen-ops.o
  • Even then, SheepShaver throws an error “Xlib: unexpected async reply (sequence 0x414)!
  • giving SheepShaver more memory, and checking “ignore illegal memory access” might help a bit.

cd to the SheepShaver folder and:

make links
cd src/Unix
NO_CONFIGURE=1 ./autogen.sh
./configure --enable-sdl-video --enable-sdl-audio --disable-vosf --enable-jit=no
make
strip SheepShaver

Cross-compiling in Linux for Windows

These instructions apply to Ubuntu 12.10 32Bits

Start with preparing your build environment: Make sure you have installed build-essentials, automake, autoconf and mingw32

You can install these prerequisites from the command line with:

sudo apt-get install build-essential automake autoconf mingw32

The rest of these instructions assume you use \home\yourusername\src as folder for the source code for SDL and BasiliskII:

Download the SDL source code from the command line and build SDL:

wget http://www.libsdl.org/release/SDL-1.2.15.tar.gz
tar -xzf SDL-1.2.15.tar.gz
cd SDL-1.2.15
./configure --host=i586-mingw32msvc --disable-shared --prefix=`pwd`
make
make install
export PATH=`pwd`/bin:$PATH

Next, go the the /src/BasiliskII folder and enter:

NO_CONFIGURE=1 ../Unix/autogen.sh
echo ac_cv_have_win32_exceptions=yes > extra.cache
./configure --host=i586-mingw32msvc --cache-file=extra.cache
make

If you also want to build the Basilisk GUI:

wget http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/gtk+-bundle_2.24.10-20120208_win32.zip

Extract the archive in your /src folder. Next, create a file /src/basilisk/bin/pkg-config containing:

#!/bin/sh
PKG_CONFIG_LIBDIR=/opt/basilisk/lib/pkgconfig \
PKG_CONFIG_PATH=/opt/basilisk/lib/pkgconfig /usr/bin/pkg-config $*

and chmod +x it to make it executable

Next, patch up the libraries:

cd /src/basilisk
sed -i 's|^prefix=.*$|prefix=/src/basilisk|g' lib/pkgconfig/*.pc
cd ./lib
for f in *.lib; do mv $f lib${f%%lib}a; done

Use this configure command for Basilisk II:

./configure --host=i586-mingw32msvc --cache-file=extra.cache --with-gtk --disable-gtktest

You have to edit the makefile in the BasiliskII/src/Windows folder: change a reference to b2ether/Packet32.cpp to b2ether/packet32.cpp before finally entering:

make

Tidbits

  • Source code for Visual C for basiliskII and SheepShaver:

There are some unfinished attempts (jan. 2011) to update the source code for Basilisk and SheepShaver for Windows that build in Visual C. The code also builds in MinGW. It originates from here: https://github.com/tycho/basiliskii and https://github.com/tycho/sheepshaver

The code is mirrored here:
BasiliskII_source
SheepShaver_source

  • A version of Basilisk for Haiku is available:

http://sys6502.blogspot.com

The application is mirrored here:
Basilisk for Haiku
You need to set the correct rights on the application, so set it to execute for the current user.

compiling_sheepshaver_basilisk.txt · Last modified: 2013/05/05 23:18 by cat_7
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki