Detect OSX on Intel and pre-Intel systems?
-
How can one detect if the Ruby version running OSX is on an Intel system or pre-Intel system?
-
Snow Leopard Ruby code (1.8.7); > puts RUBY_PLATFORM universal-darwin10.0 Sketchup Ruby (1.8.5); > RUBY_PLATFORM i686-darwin8.10.1 Terminal code; > file /usr/bin/ruby /usr/bin/ruby; Mach-O universal binary with 3 architectures /usr/bin/ruby (for architecture x86_64); Mach-O 64-bit executable x86_64 /usr/bin/ruby (for architecture i386); Mach-O executable i386 /usr/bin/ruby (for architecture ppc7400); Mach-O executable ppc -
Thanks!

hmmm... universal binaries....
Can one compile a Ruby C Extension that runs on both PowerPC and Intel macs? -
if you look at the Makefile generated via extconf.rb you have
CFLAGS = -fno-common -arch i386 -arch x86_64 -g -Os ...so you can add/modify for PPC to suit your needs. didn't tried it, so I dont know if it works ok. btw, are there a lot of PPC users to worth the effort ?
-
I have no idea. Just a thought in case it was easy.
Atm - the only mac I have is a PPC... it's mad how expensive second hand macs are. Even really old PPC variants. Nuts! -
I just checked on an older PPC mac. So to sum up this thread:
` # Sketchup Ruby OSX 10.4 PPC
* RUBY_PLATFORM: fat-darwin8.8.0
* RUBY_VERSION: 1.8.5
Sketchup Ruby OSX 10.5 Intel
* RUBY_PLATFORM: i686-darwin8.10.1
* RUBY_VERSION: 1.8.5`
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement