Build kanjitalk755's BasiliskII code in Windows

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
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Build kanjitalk755's BasiliskII code in Windows

Post by emendelson »

Here's a quick guide to building kanjitalk755's BasiliskII code in Windows. Tested in Windows 10.

1. Install MinGW

Go to this page:
https://osdn.net/projects/mingw/releases/

Download and run mingw-get-setup.exe

In the opening menu, accept all the default options and click Install.

Click Continue after Step 2 completes.

In the MinGW Installation Manager window, right-click and choose "Mark for installation" for these packages:
  • mingw-developer-toolkit-bin
    msys-base-bin
    mingw32-gcc-g++-bin
    mingw32-base-bin (automatically marked when you select the first package on this list)
On the top-line Installation menu, click Apply Changes, then the Apply button.

When all the packages have been downloaded and installed, click Close.

Exit the MinGW Installation Manager.

In Explorer, navigate to:
C:\MinGW\msys\1.0\msys.bat

(I recommend creating a desktop shortcut to that batch file.)

Run that batch file.

At the MINGW32 prompt enter these lines:

Code: Select all

mkdir src
start src
An Explorer window will open to the empty src folder. Keep that window open.

2. Download and install SDL2 and macemu-master

Go to this page:
https://www.libsdl.org/download-2.0.php

Under Source Code, download and open the zip file

Copy the directory inside the zip file (currently SDL2-2.0.9) into the src folder.

Leave the Explorer window open.

Close the zip file.

Go to this page:

https://github.com/kanjitalk755/macemu

Click Clone or Download and download the zip file.

Open the zip file and copy the macemu-master into the src folder window.

Close the zip file.

Close the Explorer window.

3. Build and install SDL2

At the MinGW prompt, enter

Code: Select all

cd src/SDL2-2.0.9 (or whatever version you downloaded)
./autogen.sh
./configure --disable-shared
make
make install
4. Build BasiliskII

Still at the MinGW prompt, enter:

Code: Select all

cd ~/src/macemu-master/BasiliskII/src/Windows
NO_CONFIGURE=1 ../Unix/autogen.sh
./configure
make
start .   [that's start, then a space, then a dot]
exit
The MinGW prompt will close, and an Explorer window will open, containing BasiliskII.exe and other files.

Copy into this folder a ROM file, a disk image, and a prefs file with the correct contents.

Run BasiliskII.exe.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Build kanjitalk755's BasiliskII code in Windows

Post by emendelson »

Request: Can anyone give up-to-date instructions for building BasiliskIIGUI.exe in MinGW?
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Build kanjitalk755's BasiliskII code in Windows

Post by Cat_7 »

The GUI hasn't seen any love for a long time. Most of the current instructions, however, still work. You need to install the gtk devel package in Windows, find a file called pixman-1.pc.in. Rename it to pixman-1.pc, edit it so at version there is not a variable string but some number (Version: 0.12.0)

The current content of pixman-1.pc file is below, so you can use that too:
prefix=/target
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
target=win32

Name: Pixman
Description: The pixman library (version 1)
Version: 0.12.0
Cflags: -I${includedir}/pixman-1 @DEP_CFLAGS@
Libs: -L${libdir} -lpixman-1 @DEP_LIBS@


My system variables are:
GTK_BASEPATH=C:\GTK

INCLUDE=C:\GTK\INCLUDE;C:\GTK\INCLUDE\GTK-2.0;C:\GTK\INCLUDE\GLIB-2.0;C:\GTK\INCLUDE\PANGO-1.0;C:\GTK\INCLUDE\CAIRO;C:\GTK\INCLUDE\ATK-1.0;C:\GTK\INCLUDE\GTKGLEXT-1.0;C:\GTK\LIB\GTK-2.0\INCLUDE;C:\GTK\LIB\GLIB-2.0\INCLUDE;C:\GTK\LIB\GTKGLEXT-1.0\INCLUDE;C:\GTK\INCLUDE\LIBGLADE-2.0;C:\GTK\INCLUDE\LIBXML2;C:\GTK\INCLUDE;C:\GTK\INCLUDE\GTK-2.0;C:\GTK\INCLUDE\GLIB-2.0;C:\GTK\INCLUDE\PANGO-1.0;C:\GTK\INCLUDE\CAIRO;C:\GTK\INCLUDE\ATK-1.0;C:\GTK\INCLUDE\GTKGLEXT-1.0;C:\GTK\LIB\GTK-2.0\INCLUDE;C:\GTK\LIB\GLIB-2.0\INCLUDE;C:\GTK\LIB\GTKGLEXT-1.0\INCLUDE;C:\GTK\INCLUDE\LIBGLADE-2.0;C:\GTK\INCLUDE\LIBXML2;

PKG_CONFIG_PATH=C:\GTK\Lib\pkgconfig\

Edit the src/Windows/Makefile:
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

(You can find the required GTK flags by issuing thefollowing commands in your mingw32 window:
pkg-config --cflags gtk+-win32-2.0
pkg-config --libs gtk+-win32-2.0

Remove all references to -mno-cygwin in the Makefile (2)

Finally configure and build the code and fail on some (I guess) C variant unicode issues:

prefs_editor_gtk.cpp:678:20: error: cannot convert 'char*' to 'LPCWSTR' {aka 'const wchar_t*'}
if (GetDriveType(rootdir) == DRIVE_CDROM)
^~~~~~~
In file included from d:\mingw\include\windows.h:44,
from sysdeps.h:50,
from prefs_editor_gtk.cpp:21:
d:\mingw\include\winbase.h:1708:39: note: initializing argument 1 of 'UINT GetDriveTypeW(LPCWSTR)'
WINBASEAPI UINT WINAPI GetDriveTypeW (LPCWSTR);
^~~~~~~
prefs_editor_gtk.cpp: In function 'void create_volumes_pane(GtkWidget*)':
prefs_editor_gtk.cpp:768:9: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
str = "";
^~

---many more of these errors---

Best,
Cat_7
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Build kanjitalk755's BasiliskII code in Windows

Post by emendelson »

Well, that doesn't sound all that encouraging! Until there's a way to avoid fatal errors, I'll get along with my patched version of the old GUI program...
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Build kanjitalk755's BasiliskII code in Windows

Post by emendelson »

Unfortunately, there doesn't seem to be a fix for this issue yet:

viewtopic.php?f=6&t=10023
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Build kanjitalk755's BasiliskII code in Windows

Post by emendelson »

emendelson wrote:Unfortunately, there doesn't seem to be a fix for this issue yet:

https://www.emaculation.com/forum/viewt ... =6&t=10023
As the other thread shows, kanjitalk755 fixed the Alt-F4 problem in the Windows build. The instructions above should produce a usable build with current kanjitalk755 code.
Post Reply