Compiling custom Mini vMac builds on Cygwin
Moderators: Cat_7, Ronald P. Regensburg
Compiling custom Mini vMac builds on Cygwin
So I was fell into a rabbit hole, that is, compiling custom Mini vMac builds. I know that there's the variation service, but I prefer compiling the source.
I got lucky by compiling Linux builds but I got no luck on compiling Windows or MacOS (Intel only) builds inside Termux.
I tried on my PC to use Cygwin and compile the Windows builds, at least. Then I have a problem of compiling it using normal gcc and make, it spewed an error about _MAX_PATH. Any fix or help?
I got lucky by compiling Linux builds but I got no luck on compiling Windows or MacOS (Intel only) builds inside Termux.
I tried on my PC to use Cygwin and compile the Windows builds, at least. Then I have a problem of compiling it using normal gcc and make, it spewed an error about _MAX_PATH. Any fix or help?
- adespoton
- Forum All-Star
- Posts: 4286
- Joined: Fri Nov 27, 2009 5:11 am
- Location: Emaculation.com
- Contact:
Re: Compiling custom Mini vMac builds on Cygwin
I can't be much help as I compile my variations using xCode on macOS. However, on there, GCC actually maps to LLVM. Is it possible it's actually expecting this? Or could it be that your path depth is too deep and you need to store the files closer to root?
I'm pretty sure Paul's variations service actually runs on Linux, so it should be possible to do, once a few environment related issues have been sorted.
I'm pretty sure Paul's variations service actually runs on Linux, so it should be possible to do, once a few environment related issues have been sorted.
Re: Compiling custom Mini vMac builds on Cygwin
So i have mingw-w64-gcc, cygwin-gcc, clang and gccadespoton wrote: ↑Fri May 13, 2022 2:59 pm I can't be much help as I compile my variations using xCode on macOS. However, on there, GCC actually maps to LLVM. Is it possible it's actually expecting this? Or could it be that your path depth is too deep and you need to store the files closer to root?
I'm pretty sure Paul's variations service actually runs on Linux, so it should be possible to do, once a few environment related issues have been sorted.
Which one should I use?
Re: Compiling custom Mini vMac builds on Cygwin
Hi,
if you want to use Cygwin to build a version which can run on Windows, i strongly recommend you to use WSL with MinGW as the cross compiler, as it allows you to build standalone executables with no additional dependencies on the Cygwin Runtime/Translation layer.
Short description on how to build with WSL - i have taken the relevant steps from my own documentation on how to build it:
1. Install WSL
2. Install MinGW:
3. Install SDL prebuilt for MinGW:
4. In vMac Mini's source directory:
Hope that helps! If any questions pop up, just ask!
if you want to use Cygwin to build a version which can run on Windows, i strongly recommend you to use WSL with MinGW as the cross compiler, as it allows you to build standalone executables with no additional dependencies on the Cygwin Runtime/Translation layer.
Short description on how to build with WSL - i have taken the relevant steps from my own documentation on how to build it:
1. Install WSL
2. Install MinGW:
Code: Select all
apt-get install mingw-w64
Code: Select all
wget https://www.libsdl.org/release/SDL2-devel-2.0.22-mingw.tar.gz
gzip -dc SDL2-devel-2.0.22-mingw.tar.gz | tar -xvf -
cd SDL2-2.0.22
sudo make install-package arch=x86_64-w64-mingw32 prefix=/usr/x86_64-w64-mingw32
Code: Select all
gcc setup/tool.c -o setup_t
# needed to overcoming some limitations
# in the build system
ln -s /usr/bin/x86_64-w64-mingw32-gcc gcc.exe
ln -s /usr/bin/x86_64-w64-mingw32-windres windres.exe
ln -s /usr/bin/x86_64-w64-mingw32-strip strip.exe
ln -s src SRC
export PATH=.:$PATH
# for Macintosh SE
./setup_t -n "minivmac-3.7-test" -e mgw -t wx64 -m SEFDHD -hres 512 -vres 384 -depth 0 -fullscreen 0 -magnify 1 -sound 1 -sony-sum 1 -
sony-tag 1 -speed 1 -ta 2 -em-cpu 2 -mem 4M -chr 0 > setup.sh
# patch the setup file for Windows SDL2 issue with WinMain undefined reference
sed -i '/.*SDL\.h/i printf \"%s\\n\" \"#define SDL_MAIN_HANDLED\" \>\> \"\$\{DestFile\}\"' setup.sh
. setup.sh
export PATH=.:$PATH
make clean
make -j $(nproc)
Re: Compiling custom Mini vMac builds on Cygwin
Hello, but I used Windows 10 Pro 1809, so I think WSL wouldn't work for me... Can you please tell me if WSL is compatible with older Windows 10 builds (or 1809 to be exact)?egrath wrote: ↑Sat May 14, 2022 7:20 pm Hi,
if you want to use Cygwin to build a version which can run on Windows, i strongly recommend you to use WSL with MinGW as the cross compiler, as it allows you to build standalone executables with no additional dependencies on the Cygwin Runtime/Translation layer.
Short description on how to build with WSL - i have taken the relevant steps from my own documentation on how to build it:
1. Install WSL
2. Install MinGW:3. Install SDL prebuilt for MinGW:Code: Select all
apt-get install mingw-w64
4. In vMac Mini's source directory:Code: Select all
wget https://www.libsdl.org/release/SDL2-devel-2.0.22-mingw.tar.gz gzip -dc SDL2-devel-2.0.22-mingw.tar.gz | tar -xvf - cd SDL2-2.0.22 sudo make install-package arch=x86_64-w64-mingw32 prefix=/usr/x86_64-w64-mingw32
Hope that helps! If any questions pop up, just ask!Code: Select all
gcc setup/tool.c -o setup_t # needed to overcoming some limitations # in the build system ln -s /usr/bin/x86_64-w64-mingw32-gcc gcc.exe ln -s /usr/bin/x86_64-w64-mingw32-windres windres.exe ln -s /usr/bin/x86_64-w64-mingw32-strip strip.exe ln -s src SRC export PATH=.:$PATH # for Macintosh SE ./setup_t -n "minivmac-3.7-test" -e mgw -t wx64 -m SEFDHD -hres 512 -vres 384 -depth 0 -fullscreen 0 -magnify 1 -sound 1 -sony-sum 1 - sony-tag 1 -speed 1 -ta 2 -em-cpu 2 -mem 4M -chr 0 > setup.sh # patch the setup file for Windows SDL2 issue with WinMain undefined reference sed -i '/.*SDL\.h/i printf \"%s\\n\" \"#define SDL_MAIN_HANDLED\" \>\> \"\$\{DestFile\}\"' setup.sh . setup.sh export PATH=.:$PATH make clean make -j $(nproc)
Re: Compiling custom Mini vMac builds on Cygwin
Hi, as far as i know, WSL 1 works on 1809. There are plenty of tutorials out there on how to install it. Just do a short Google Research (TM), its as easy as running a few commands.
Re: Compiling custom Mini vMac builds on Cygwin
I have automated scripts for minivmac already that can make the makefiles and stuff, can i use them?
I used this:
Code: Select all
./setup_t -t wx64 -m 128K > 128k.sh && chmod +x 128k.sh
./setup_t -t wx64 -m 512Ke > 512Ke.sh && chmod +x 512Ke.sh
./setup_t -t wx64 -m Plus > Plus.sh && chmod +x Plus.sh
./setup_t -t wx64 -m SE > SE.sh && chmod +x SE.sh
./setup_t -t wx64 -m Classic > Classic.sh && chmod +x Classic.sh
./setup_t -t wx64 -m SEFDHD > SEFDHD.sh && chmod +x SEFDHD.sh
./setup_t -t wx64 -m II > MacII.sh && chmod +x MacII.sh
./setup_t -t wx64 -m Twiggy > Twiggy.sh && chmod +x Twiggy.sh
./setup_t -t wx64 -m Twig43 > Twiggy43.sh && chmod +x Twiggy43.sh
./setup_t -t wx64 -m PB100 > PowerBook100.sh && chmod +x PowerBook100.sh
./setup_t -t wx64 -m II -hres 960 -vres 540 -depth 5 -n "mini-vmac-36.04-maciicustom" > MacIICustom.sh && chmod +x MacIICustom.sh
./setup_t -t wx64 -m Plus -hres 960 -vres 540 -n "mini-vmac-36.04-pluscustom" > PlusCustom.sh && chmod +x PlusCustom.sh
./setup_t -t wx64 -m 128K -hres 960 -vres 540 -n "mini-vmac-36.04-128kcustom" > 128kCustom.sh && chmod +x 128kCustom.sh
ls -lu
cp *.sh Windows
rm -rf *.sh
Re: Compiling custom Mini vMac builds on Cygwin
I tried but should I worry about this:egrath wrote: ↑Sat May 14, 2022 7:20 pm Hi,
if you want to use Cygwin to build a version which can run on Windows, i strongly recommend you to use WSL with MinGW as the cross compiler, as it allows you to build standalone executables with no additional dependencies on the Cygwin Runtime/Translation layer.
Short description on how to build with WSL - i have taken the relevant steps from my own documentation on how to build it:
1. Install WSL
2. Install MinGW:3. Install SDL prebuilt for MinGW:Code: Select all
apt-get install mingw-w64
4. In vMac Mini's source directory:Code: Select all
wget https://www.libsdl.org/release/SDL2-devel-2.0.22-mingw.tar.gz gzip -dc SDL2-devel-2.0.22-mingw.tar.gz | tar -xvf - cd SDL2-2.0.22 sudo make install-package arch=x86_64-w64-mingw32 prefix=/usr/x86_64-w64-mingw32
Hope that helps! If any questions pop up, just ask!Code: Select all
gcc setup/tool.c -o setup_t # needed to overcoming some limitations # in the build system ln -s /usr/bin/x86_64-w64-mingw32-gcc gcc.exe ln -s /usr/bin/x86_64-w64-mingw32-windres windres.exe ln -s /usr/bin/x86_64-w64-mingw32-strip strip.exe ln -s src SRC export PATH=.:$PATH # for Macintosh SE ./setup_t -n "minivmac-3.7-test" -e mgw -t wx64 -m SEFDHD -hres 512 -vres 384 -depth 0 -fullscreen 0 -magnify 1 -sound 1 -sony-sum 1 - sony-tag 1 -speed 1 -ta 2 -em-cpu 2 -mem 4M -chr 0 > setup.sh # patch the setup file for Windows SDL2 issue with WinMain undefined reference sed -i '/.*SDL\.h/i printf \"%s\\n\" \"#define SDL_MAIN_HANDLED\" \>\> \"\$\{DestFile\}\"' setup.sh . setup.sh export PATH=.:$PATH make clean make -j $(nproc)
Code: Select all
src/ENDIANAC.h:101:22: warning: ‘do_put_mem_word’ defined but not used [-Wunused-function]
101 | LOCALINLINEFUNC void do_put_mem_word(ui3p a, ui4r v)
| ^~~~~~~~~~~~~~~
src/ENDIANAC.h:57:22: warning: ‘do_get_mem_long’ defined but not used [-Wunused-function]
57 | LOCALINLINEFUNC ui5r do_get_mem_long(ui3p a)
| ^~~~~~~~~~~~~~~
Re: Compiling custom Mini vMac builds on Cygwin
These are just warnings from the compiler, just ignore these actual ones.
Re: Compiling custom Mini vMac builds on Cygwin
How'd you compile MacOS builds inside Linux then?
and also kind of off topic but how do I use the Twiggy 4.3T ROM that's available on the MacGUI vault? I don't know how to make it work on Mini vMac...
and also kind of off topic but how do I use the Twiggy 4.3T ROM that's available on the MacGUI vault? I don't know how to make it work on Mini vMac...
Re: Compiling custom Mini vMac builds on Cygwin
Haven't built a Macintosh version on Linux. The description above is just for building a Windows version in Linux.
Compilerwarnings in general are non-fatal opposed to errors. They occur often when using different compilers and/or versions as they all behave a little bit different. Some of them indicate deeper problems which should be managed, some of them not. In your specific case the compiler just complains about a function which is defined, but not used anywhere.
Compilerwarnings in general are non-fatal opposed to errors. They occur often when using different compilers and/or versions as they all behave a little bit different. Some of them indicate deeper problems which should be managed, some of them not. In your specific case the compiler just complains about a function which is defined, but not used anywhere.
- adespoton
- Forum All-Star
- Posts: 4286
- Joined: Fri Nov 27, 2009 5:11 am
- Location: Emaculation.com
- Contact:
Re: Compiling custom Mini vMac builds on Cygwin
I'd say ask Paul, but he's been MIA for over a year now. If anyone DOES get in touch with him or someone from his family, please update the "Has anyone seen..." thread.
As for the Twiggy ROM, you need to use a custom Twiggy build of Mini vMac; the default 128k one won't work.
What I do instead is just use the 128k ROM and a modified version of the Twiggy disk image that runs with the 128k ROM; it's simpler, and works with an official 128k build of Mini vMac.
Info on bits of the story available here:
viewtopic.php?t=8809
http://toastytech.com/guis/twiggy.html
And of course, Paul's instructions on setting up the build environment on whatever host platform you've got, for whatever target platform you want, emulating whatever hardware platform you desire, is here: https://www.gryphel.com/c/minivmac/develop.html -- and that includes the Twiggy hardware as an option. I use the https://www.gryphel.com/c/minivmac/change/v37.html source, so that I can target an M1 Mac.
Re: Compiling custom Mini vMac builds on Cygwin
Ah, ok. I also built the version of the emulator that do support the earlier version of the Twiggy ROM as well as the version that supports the modified 128k ROM and the later 4.4T revision.adespoton wrote: ↑Mon May 16, 2022 6:57 pmI'd say ask Paul, but he's been MIA for over a year now. If anyone DOES get in touch with him or someone from his family, please update the "Has anyone seen..." thread.
As for the Twiggy ROM, you need to use a custom Twiggy build of Mini vMac; the default 128k one won't work.
What I do instead is just use the 128k ROM and a modified version of the Twiggy disk image that runs with the 128k ROM; it's simpler, and works with an official 128k build of Mini vMac.
Info on bits of the story available here:
viewtopic.php?t=8809
http://toastytech.com/guis/twiggy.html
And of course, Paul's instructions on setting up the build environment on whatever host platform you've got, for whatever target platform you want, emulating whatever hardware platform you desire, is here: https://www.gryphel.com/c/minivmac/develop.html -- and that includes the Twiggy hardware as an option. I use the https://www.gryphel.com/c/minivmac/change/v37.html source, so that I can target an M1 Mac.