Login  •  Register


The time is now: Tue Aug 11, 2020 6:30 pm

Emaculation wiki  •  Delete all board cookies



Post new topic  Reply to topic Page 1 of 1 [ 7 posts ]
Print view Previous topic  |  Next topic
Author Message
PostPosted: Thu Feb 20, 2020 1:15 pm 
Offline
Forum All-Star

Joined: Tue Oct 14, 2008 12:12 am
Posts: 1210
Has anyone managed to build current SheepShaver code under Windows?

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

viewtopic.php?f=20&t=5325&start=225#p58418

But I haven't been able to build current code. Does anyone know the secret (if there is one)?


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Thu Feb 20, 2020 1:51 pm 
Offline
Forum All-Star

Joined: Tue Oct 14, 2008 12:12 am
Posts: 1210
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


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun Feb 23, 2020 10:05 am 
Offline
Student Driver

Joined: Sun Jun 27, 2004 12:50 am
Posts: 17
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.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun Feb 23, 2020 10:28 am 
Offline
Student Driver

Joined: Sun Jun 27, 2004 12:50 am
Posts: 17
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:
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


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun Feb 23, 2020 10:45 am 
Offline
Student Driver

Joined: Sun Jun 27, 2004 12:50 am
Posts: 17
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.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun Feb 23, 2020 2:23 pm 
Offline
Forum All-Star

Joined: Tue Oct 14, 2008 12:12 am
Posts: 1210
This is very helpful. Thank you!

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

viewtopic.php?f=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!


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun Mar 01, 2020 10:16 am 
Offline
Student Driver

Joined: Sun Jun 27, 2004 12:50 am
Posts: 17
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:
pacman -S mingw-w64-i686-toolchain automake-wrapper autoconf


Top
 Profile  
Reply with quote Post a reply  
Display posts from previous:  Sort by  
Post new topic  Reply to topic Page 1 of 1 [ 7 posts ]


Who is online

Users browsing this forum: Google [Bot] and 23 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
 

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group