Em Seg, 2009-03-02 às 17:04 +1100, Timothy S. Nelson escreveu: > Hi. I note that we have $?OS, $?VM, and $?DISTRO (and their $* > counterparts). I'd like to recommend that we eliminate $?OS, and replace it > with $?KERNEL (ie. Linux) and maybe $?ARCH (ie. i386). Thoughts?
The usual way to handle this is by something called "arch triplet", as you can find out if you call gcc -dumpmachine This triplet is formed by the "Instruction Set" (usually called CPU), the "Platform" ("pc" for most people) and the "Operating System" ("linux-gnu" in my case, while the "-gnu" specifies that you're using the gnu libc). (gcc omits the "pc" part, usually). So, I think the proper name to the variables would be $?ARCH and $*ARCH Where they would stringify to the arch triplet, while providing convenience methods for .cpu, .platform and .os. But thinking about it, I wonder if we shouldn't have actually two compile-time variables, which are HOST_ARCH and TARGET_ARCH so cross compiling is possible, or at least make $?ARCH to mean TARGET_ARCH while still providing $?HOST_ARCH, and since we're talking about compiling Perl code, we should probably have $?HOST_PERL and $?TARGET_PERL as well.. daniel