Build SheepShaver for Windows?

About SheepShaver, a PPC Mac emulator for Windows, MacOS X, and Linux that can run System 7.5.3 to MacOS 9.0.4.

Moderators: Cat_7, Ronald P. Regensburg, ClockWise

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

Build SheepShaver for Windows?

Post by emendelson »

Has anyone managed to build current SheepShaver code under Windows?

I was able to build a version back in 2017 using this method:

https://www.emaculation.com/forum/viewt ... 225#p58418

But I haven't been able to build current code. Does anyone know the secret (if there is one)?
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Build SheepShaver for Windows?

Post by emendelson »

The code and instructions linked below seem to build correctly, but on launch I get:

Invalid struct my_stat -- edit posix_emu.h

https://github.com/rakslice/macemu/tree ... ingw32_wip
rakslice
Student Driver
Posts: 22
Joined: Sun Jun 27, 2004 12:50 am

Re: Build SheepShaver for Windows?

Post by rakslice »

That sheepshaver_mingw32_wip branch is based on the master branch in kanjitalk755's repo. I've basically been accumulating changes in that branch in the course of getting things building on my Windows machine.

I don't know the details of kanjitalk755's windows build environment other than what's in the README.md in that branch, that's it's some kind of MSYS mingw32 and that some build steps are noted. I've actually been building in MSYS2 mingw32 (https://www.msys2.org/), but I wonder in hindsight if my using MSYS2 is actually a mistake and not what was intended. Background on MSYS vs MSYS2: https://stackoverflow.com/a/25023611

In general the "Invalid struct my_stat -- edit posix_emu.h" error happens when, at build time, the stat struct the compiler got from the system headers was a different size than the one in posix_emu.h. stat() is the posix-style function to get file information such as size and modification time, and Windows has a function that's approximately the same. https://docs.microsoft.com/en-us/cpp/c- ... ew=vs-2019

I ran into this error message initially when using my local build of kanjitalk755's code. Without investigating too hard, I guessed that the system stat header was newer than whatever the code was expecting, and I just padded posix_emu's my_stat version out to the right length to get past the error.

What are you building on? I guess this change must have broken compatibility with that. Maybe I can figure out how to make the padding conditional to avoid this issue.
rakslice
Student Driver
Posts: 22
Joined: Sun Jun 27, 2004 12:50 am

Re: Build SheepShaver for Windows?

Post by rakslice »

I should mention what I'm doing to build that branch in MSYS2:
1. Use the MSYS2 32-bit installer (msys2-i686-*) from msys2.org
2. Run an "MSYS2 MinGW 32-bit" shell from the start menu icon
3. Install MSYS2's packaged GTK 2 and SDL 2:

Code: Select all

pacman -S mingw-w64-i686-gtk2 mingw-w64-i686-SDL2
The rest is as noted in kanjitalk755's README.md.

For the MSYS2 packaged libraries that are dynamically linked (e.g. gtk), the dll files are in msys32\mingw32\bin\*.dll
rakslice
Student Driver
Posts: 22
Joined: Sun Jun 27, 2004 12:50 am

Re: Build SheepShaver for Windows?

Post by rakslice »

But if you want to try getting rid of the posix_emu.h change in my branch to see if it fixes the problem on whatever you're building on, just edit posix_emu.h and remove the lines int spare1 and so on from struct my_stat.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Build SheepShaver for Windows?

Post by emendelson »

This is very helpful. Thank you!

I've been using the same MinGW/Msys 1.0 system that I describe here:

https://www.emaculation.com/forum/viewt ... =6&t=10019

I simply copied it over from my old Windows 7 system to my current Windows 10 system.

In your source code, I removed the three int spare 1 lines that you mentioned in your post, and the resulting build launched correctly.

Later on, I'll try using MSYS2 as you describe, but the older system seems to work perfectly for now.

Thank you again!
rakslice
Student Driver
Posts: 22
Joined: Sun Jun 27, 2004 12:50 am

Re: Build SheepShaver for Windows?

Post by rakslice »

I realized since that there are other packages you need on a fresh install of MSYS2 from the installer; GTK2 and SDL2 are just the packages I had to install on the MSYS2 in Appveyor's build image which has a bunch of things preinstalled. Unfortunately I don't have a detailed list as there are other projects I use MSYS2 for, but it would include a bunch of things you can find in the toolchain group and autotools for a start:

Code: Select all

pacman -S mingw-w64-i686-toolchain automake-wrapper autoconf
Post Reply