[Liverpool] Runtime OS architecture detection

Sebastian shop at open-t.co.uk
Thu Dec 9 21:13:55 UTC 2010


Burn him at stake! Clearly a devil's worshipper/Russian spy/warlock/pop 
music fan (delete as appropriate)!

Sebastian

On 12/09/2010 03:30 PM, Liam Devine wrote:
> Hello,
> I have not posted to this list much at all since registering at
> University and have never attended a LUG meeting. Yes I do hear the
> cries of 'burn him at the stake' :)
>
> At little bit of background info.
> Premake[1] is an Open Source cross platform 'configure' type library
> written in Lua which generates project files, solutions and make files.
> Currently I am trying to figure out the best and most universal method
> of detecting the host architecture for Linux distros at runtime for a
> couple of reasons:
> To let users call out to external executables depending on the arch [2]
> To set the correct location to look for libraries [3]
>
> My current thinking is the best method is to parse the output of 'uname
> -m' and this method has been confirmed to me that at least on one distro
> gives the value of a 32 bit id when a 32 bit distro is installed on a 64
> bit system, which is what I am looking for. The other alternatives as I
> see it are:
> parsing /proc/cpuinfo Although I am not sure if this would give a 64 bit
> value in the above case
> uname -p Does not always give a valid value, sometimes returning 'unknown'
>
>
> The current values that I have can be seen in [4]. Are there any others
> that are known to yourselves and is this the best method of obtaining
> the information? Any help would be gratefully received and any calls to
> burn me will be ignored :)
>
> Thanks
>
> Liam
>
> [1] http://industriousone.com/premake
> [2]
> http://sourceforge.net/tracker/index.php?func=detail&aid=1582602&group_id=71616&atid=531881
> <http://sourceforge.net/tracker/index.php?func=detail&aid=1582602&group_id=71616&atid=531881>
> [3]
> http://sourceforge.net/tracker/?func=detail&aid=3121217&group_id=71616&atid=531878
> <http://sourceforge.net/tracker/?func=detail&aid=3121217&group_id=71616&atid=531878>
> [4] http://industriousone.com/topic/native-arch
>
> PS Hmm does it show that I do not post to this mailing list much when I
> sent the first mail to liverpool-request :)
>
>
>
> _______________________________________________
> Liverpool mailing list
> Liverpool at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/liverpool



More information about the Liverpool mailing list