the template Makefile unconditionally sets the "-fast" optimiziation flag on Darwin.
unfortunately, on PowerPC this produces code that will only run on G5 processors, and not on G4.
this results in unloadable externals (Pd bails out with "no matching architecture in universal wrapper")
Pd-extended ppc builds override the OPT_CFLAGS (adding "-mcpu=7450" to also support G4), thus the problem does not occur there.
i think the template/Makefile should work on as much platforms as possible (eventually at the cost of less performance), so i suggest throwing away the "-fast" flag.
Anonymous
In full agreement that it should build on all supported platforms, we just need to determine what those are. I am tempted to try to use $(CPU) to set -mcpu=7450, then that would leave out G3 on older G4 processors. Honestly, I'd prefer to cap Mac OS X support at 10.4 with a G4 7450, then put the work into supporting old GNU/Linux distros. Old hardware runs so much better on GNU/Linux than Mac OS X anyway.
Then there are also the FAT_CFLAGS, which prevent building on < 10.4. But those flags make building for deployment much easier since without -mmacosx-version-min=10.4, the builds will target the current version, so if someone builds on 10.6/x86_64, it'll only work on that platform, not 10.5, 10.4, powerpc, etc.
well, my compilation machine and target machine is both a G4 powerbook (which i never boot into linux as this is my primary OSX build machine)
i expect the produced binaries to run on that machine (which they don't)
the fix is as simple as removing the "-fast" flag from the optimization (which will produce a fat binary running on (any?) powerpc, i686 and x86_64)
if someone really needs it for a certain build, they can always stick it into the OPT_CFLAGS
yes, to fix your specific problem, just removing the -fast would do it, but it would not fix the problems I outlined before about people building on 10.6 and creating things that will run on 10.5 or 10.4, etc. So I say if we are already going to do CPU and OS detection, we might as well add in the -fast flag. It enables SIMD stuff too, which can have a big impact. Plus I think its required for the auto-vectorization support.
So the question remains: who wants to support Mac OS X < 10.4 or Mac OS X on CPUs < G4-7450? I don't.
ad FAT_CFLAGS: indeed defaulting fat to ppc+i386+x86_64 is a bit huge; chances are hight that it will only work for externals that have zero dependencies (ok ok, which is the target of the template/Makefile)
ad optimization: i firmly believe that even with G5-altivec code enabled and auto-vectorization turned on, about 80% of the externals will NOT see a dramatic speedup. simply because there are only so many externals dealing with signal-processing and other parallelizable algorithms. as knuth says "premature optimization is the root of all evil" and i add automatic premature optimization is worse.
anyhow, i wanted to also say that i (personally) don't see any need to support Mac OS X < 10.4 nor Mac OS X
on CPUs < G4-7450?
however, i do think that both OSX-10.4 and G4-7450 should be supported (the latter being my platform, though i have 10.5)
and if we can acchieve this by using "less compiler flags" or "more compiler flags", i am a strong advocat of using less flags.