This is an old revision of the document!
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:
THIS GUIDE ONLY DESCRIBES BUILDING BASILISK OR SHEEPSHAVER FROM THE OFFICIAL SOURCE CODE.
There are other repositories with forked code, solving particular problems. You are on your own if you want to build the code in those repositories!
++++ WORK IN PROGRESS, HELP IF YOU CAN ++++
Preparing your build environment
Common assumptions:
- You have a folder called “src” inside your home folder in 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\macemu\BasiliskII (this folder will be created automatically if you follow the directions below)
- src\macemu\SheepShaver (this folder will be created automatically if you follow the directions below)
Windows
You need a Windows port of the GCC and G++ compilers, X-headers, libgnome development etc. You can use either Cygwin 1.5 or 1.7, or MinGW with MSYS:
- To set up Cygwin, follow these instructions.
- To set up MinGW with MSYS, follow these instructions.
When building on Windows, the term “home folder” means your Cygwin or MSYS home folder, e.g. home/yourusername or msys/1.0/home/yourusername .
Build SDL 1.2.15
- Download the source code from: http://www.libsdl.org/release/SDL-1.2.15.zip
- Extract the zip file to the SDL-1.2.15 folder in your “src” folder.
- start Cygwin or MSYS shell.
- (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 run the following commands:
./autogen.sh ./configure --disable-shared make make install
If you want to install multiple versions of SDL, use these commands:
./autogen.sh ./configure --disable-shared --prefix=`pwd` make make install PATH=`pwd`/bin:$PATH export PATH
* You will then need to cd into the corresponding SDL folder every time you start Cygwin or MSYS and set and export the path to sdl-config to build SheepShaver, so SDL libs and sdl-config file can be found.
To build the Windows GUIs
The Windows GUIs are built by using the gtk+ Win32 development packages. This section assume you installed them in C:\GTK
- Find a file called pixman-1.pc on the Internet and place it in: C:\GTK\lib\pkgconfig\
- Start the Cygwin or MSYS shell
- Export the path to PKG_CONFIG
(disregard a possible error message)
export PKG_CONFIG_PATH='C:\GTK\lib\pkgconfig\'
OSX Snow Leopard
Please note that the current code only builds in Snow Leopard with XCode 3.x (latest 3.2.6)! Newer versions of OSX and XCode are not supported.
To build BasiliskII there is only the command line method. To build SheepShaver with OSX you have two options. You can use the command line method, or the XCode project method. Both are described below. In any case you need Xcode installed. The Xcode method requires that the 10.4 SDK be installed. If you did not install it when you installed Xcode, run the Xcode installer again. In the Installation Type dialog, select the option to install the 10.4 SDK (it is unchecked by default).
Using the command line
Cd to your “src” folder.
- Download the source code from: http://www.libsdl.org/release/SDL-1.2.15.zip
- unpack the code in the folder “src/SDL-1.2.15” folder
- start a terminal window
- cd to the folder containing the SDL source and run the following:
./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)
- download the SDL-framework from http://www.libsdl.org/release/SDL-1.2.15-OSX10.4.dmg
- find the SDL.framework folder and copy it to your /Library/Frameworks/ folder.
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 source code:
If you have Git installed
Use the following command to download the source code:
git clone https://github.com/cebix/macemu.
Find the “macemu” folder in your git repository folder and copy it into your “src” folder. This will create the folders BasiliskII and SheepShaver in the “src/macemu” folder.
If you don't have Git installed
- Go to https://github.com/cebix/macemu and download the source code with “Download ZIP”
- Extract the zip file in your “src” folder. This will create the folders BasiliskII and SheepShaver in the “src/macemu” folder.
The SheepShaver code is not needed if you only want to compile BasiliskII.
Building BasiliskII in Windows
If your version of gcc is 4.7.0 or more recent, you need to remove all occurrences of
-mno-cygwin
from the build files, as this option has been deprecated and will give an error while building. See this discussion for more details.
Now cd to the BasiliskII folder and:
cd src/Windows NO_CONFIGURE=1 ../Unix/autogen.sh ./configure
Optional: prepare for building the GUI
Edit the file “make” in the Basilisk/src/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
and copy-paste 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\\
Finally run:
make strip BasiliskII.exe
And if you also built the GUI, run:
strip BasiliskIIGUI.exe
Building BasiliskII in OSX Snow Leopard
If you started a new terminal window, then don't forget to export the path to SDL (see above at “Preparing your build environment”):
cd src/SDL-1.2.15/ PATH=`pwd`/bin:$PATH export PATH
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 possibilities, also check http://mrob.com/pub/comp/basilisk-ii.html
Building BasiliskII in Linux flavours
Ubuntu, Fedora, 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
If you started a new terminal window, then don't forget to export the path to SDL (see above at “Preparing your build environment”):
cd src/SDL-1.2.15/ PATH=`pwd`/bin:$PATH export PATH
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, Fedora, 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
Cross-compiling in Linux for Windows
These instructions apply to Ubuntu 12.10 32Bits, Debian 7.1 64bits
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
For BasiliskII, go to the /src/BasiliskII/src/Windows 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 --enable-sdl-video --enable-sdl-audio --enable-jit-compiler make
For SheepShaver, go to the SheepShaver folder and enter:
make links cd /src/Windows NO_CONFIGURE=1 ../Unix/autogen.sh echo ac_cv_have_win32_exceptions=yes > extra.cache ./configure --host=i586-mingw32msvc --cache-file=extra.cache --enable-sdl-video --enable-sdl-audio 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 --enable-sdl-video --enable-sdl-audio --enable-jit-compiler
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:
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.
- SDL 1.2.15 doesn't build with XCode 5.0.1 on Mavericks: this patch fixes SDL_QuartzVideo.h:
source: http://ftp.cc.uoc.gr/mirrors/macports/release/ports/devel/libsdl/files/no-CGDirectPaletteRef.patch
@@ -91,7 +91,9 @@ typedef struct SDL_PrivateVideoData { CGDirectDisplayID display; /* 0 == main display (only support single display) */ const void *mode; /* current mode of the display */ const void *save_mode; /* original mode of the display */ +#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1070) CGDirectPaletteRef palette; /* palette of an 8-bit display */ +#endif NSOpenGLContext *gl_context; /* OpenGL rendering context */ NSGraphicsContext *nsgfx_context; /* Cocoa graphics context */ Uint32 width, height, bpp; /* frequently used data about the display */