I'm trying to get a good cross-compile environment set up to write 68K Mac apps from my modern Mac (OS: Big Sur). I've tried 3 IDEs so far, with mixed, but distinct results. Curious about others using Retro68, and their experiences. Hopefully this will be helpful to me, and also anyone coming along with the same questions.
Retro68: https://github.com/autc04/Retro68
CodeLite
I hadn't used CodeLite before. It's a cross-platform IDE with C/C++ support. It's fairly zippy, not Java, but doesn't use native OS X controls, so some things like cut/paste need right-clicks.
References:
Experience:
Eclipse
I have more experience with Eclipse, mostly from doing Amiga cross-compiles. Eclipse is java based, has a few UI quirks, but obviously tons of extensions and configuration. Eclipse doesn't use cmake, as I understand it, but it can apparently read an existing cmake project and create something in it's own way. I haven't tried that yet (see ref).
Experience:
[*]2nd Annoyance: once you have used cmake script to compile it once, and hit then hit compile again, eclipse gets confused because it's finding main() twice, etc. When I have 5 mins I'll tweak the script to erase the cmake stuff on compile, I'm sure that will take care of it. Only listing it because I suppose there's a possibility it can't be fixed, and the real thing is to I guess convert the project from the cmake project to an Eclipse style one.
References:
Visual Studio Code
This is a native Mac app, and pretty zippy (even with the x86 version running under Rosetta2). I have never used this before today.
Experience:
References:
Retro68: https://github.com/autc04/Retro68
CodeLite
I hadn't used CodeLite before. It's a cross-platform IDE with C/C++ support. It's fairly zippy, not Java, but doesn't use native OS X controls, so some things like cut/paste need right-clicks.
References:
- http://www.toughdev.com/content/2018/12/developing-68k-mac-apps-with-codelite-ide-retro68-and-pce-macplus-emulator/
- http://www.toughdev.com/content/2017/03/exploring-retro68-gcc-based-sdk-for-68k-macintoshes/
Experience:
- Thanks to ToughDev's pages above, it wasn't super hard to get this compiling. I configured LaunchAPPL to use Mini vMac, and that's just fantastic.
- hello world and "dialog" (sample program from Retro68) compile no problem.
- BUT... A good chunk of the 68K headers, if I use them, will fail to load, and I won't be able to compile.
For example, "Quickdraw.h". I'm using the universal headers, from MPW, I think version 3.4 of the headers. For example, <Controls.h> will say it's not found. But the file is there, so that's just a wonky error message. If I open Controls.h in CodeLite, I can see a more specific error, where the include for <MacTypes.h> is: "In included file: 'stdbool.h' file not found. /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/stdbool.h:28:15
stdbool.h is not directly linked there, but something is pulling it in.
- the particular version of that file above has an #include_next. Not sure if that's where its failing, or how to fix it.
Eclipse
I have more experience with Eclipse, mostly from doing Amiga cross-compiles. Eclipse is java based, has a few UI quirks, but obviously tons of extensions and configuration. Eclipse doesn't use cmake, as I understand it, but it can apparently read an existing cmake project and create something in it's own way. I haven't tried that yet (see ref).
Experience:
- I have it compiling by calling cmake via script. (again, not the way it wants to do it, but haven't had time to explore yet). Of the 3, this is the one working "best", but I'm essentially using it as a glorified text editor at this point, and could probably achieve similar results with BBEdit. (plus have better search)
- Annoyance: it is spewing up THOUSANDS of warnings from gcc about the 68k Mac includes. They are all the same warning category:
/Retro68-build/toolchain/universal/CIncludes/CodeFragments.h:322:1: warning: 'GetSharedLibrary' initialized and declared 'extern'
- I googled a bit and tried a couple things to suppress that particular warning, but haven't had any luck to date. It's not the end of the world, but it fills the output when compiling, so hard to find warnings/errors you actually do need to care about.
[*]2nd Annoyance: once you have used cmake script to compile it once, and hit then hit compile again, eclipse gets confused because it's finding main() twice, etc. When I have 5 mins I'll tweak the script to erase the cmake stuff on compile, I'm sure that will take care of it. Only listing it because I suppose there's a possibility it can't be fixed, and the real thing is to I guess convert the project from the cmake project to an Eclipse style one.
References:
- Retro68 setup: None, but I could put together a write up of how I got it (kind of) working if anyone is interested.
- https://jvgomez.github.io/pages/how-to-configure-a-cc-project-with-eclipse-and-cmake.html
- gcc warning:
https://stackoverflow.com/questions/4268589/warning-in-extern-declaration
- https://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Warning-Options.html
- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=45977
Visual Studio Code
This is a native Mac app, and pretty zippy (even with the x86 version running under Rosetta2). I have never used this before today.
Experience:
- Frustrating. I've been messing around with the config files, can't can't quite get it to do the right thing. Anybody have this working for Retro68?
- It is inserting -arch=x86_64 into the gcc command line, and that causes the gcc version in retro68 to barf. I can't find out where it is doing this, and how to turn it off.
is not able to compile a simple test program.
[cmake]
[cmake] It fails with the following output:
[cmake]
[cmake] Change Dir: /Users/micahbly/dev/vsc-workspace-mac68k/HelloWorld/build/CMakeFiles/CMakeTmp
[cmake]
[cmake] Run Build Command(s):/usr/bin/make cmTC_b2a23/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_b2a23.dir/build.make CMakeFiles/cmTC_b2a23.dir/build
[cmake] Building C object CMakeFiles/cmTC_b2a23.dir/testCCompiler.c.o
[cmake] /Users/micahbly/dev/GitHub/Retro68-build/toolchain/bin/m68k-apple-macos-gcc -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk -o CMakeFiles/cmTC_b2a23.dir/testCCompiler.c.o -c /Users/micahbly/dev/vsc-workspace-mac68k/HelloWorld/build/CMakeFiles/CMakeTmp/testCCompiler.c
[cmake] m68k-apple-macos-gcc: error: x86_64: No such file or directory
[cmake] m68k-apple-macos-gcc: error: unrecognized command line option '-arch'; did you mean '-march='?
References: