jagged icon indicating copy to clipboard operation
jagged copied to clipboard

`arch.mk` should support more platforms

Open ethomson opened this issue 11 years ago • 2 comments

arch.mk is sort of lobotomized and only supports Linux and Mac OS at the moment. As of #18, this uses uname -m to determine the processor type. Long-term, a better solution would be to switch based on the OS type, since different systems provide different results.

Here's some data that I have handy:

Solaris (Sparc): uname -m is more correct, but I was sort of sloppily assuming that nobody would use sun4m anymore. That's probably true, but sun4u would probably be superior.

blade2000:~% uname -p
sparc
blade2000:~% uname -m
sun4u

Solaris (amd64): uname -p is superior. What's this i86pc business?!

ethomson@tfsxp-solaris10-x64:~% uname -p
i386
ethomson@tfsxp-solaris10-x64:~% uname -m
i86pc

AIX: uname -p is more correct. I suspect that uname -m is more precise, but in a fit of IBM has to do everything their own way-type madness, they've made it useless. Is that the model number of my processor? The serial number? Who knows.

rs6000:~% uname -p
powerpc
rs6000:~% uname -m
000A9B7C4C00

Mac PPC: uname -p is easier to parse.

macppc:~% uname -p
powerpc
macppc:~% uname -m
Power Macintosh

Linux PPC: uname -m is the only useful output.

ubuntu-606-ppc% uname -p
unknown
ubuntu-606-ppc% uname -m
ppc64

HP/UX: uname -m is the only option.

zx6000% uname -p
uname: illegal option -- p
usage: uname [-amnrsvil] [-S nodename]
zx6000% uname -m
ia64

Anyway. Just wanted to capture these for the future.

ethomson avatar Mar 01 '14 17:03 ethomson

Man, what a mess. I did only check MacOS and Linux for #18. Does arch help at all?

carlosmn avatar Mar 01 '14 17:03 carlosmn

Sadly, not really. It doesn't exist at all on AIX or HP/UX, and on Solaris, it unhelpfully reports sun4 instead of sun4c/sun4m/sun4u.

ethomson avatar Mar 01 '14 17:03 ethomson