[Scheme-reports] Features Michael Montague (03 Nov 2013 22:22 UTC)
Re: [Scheme-reports] Features John Cowan (04 Nov 2013 06:48 UTC)
Re: [Scheme-reports] Features Michael Montague (04 Nov 2013 08:44 UTC)
Re: [Scheme-reports] Features Michael Montague (05 Nov 2013 03:12 UTC)
Re: [Scheme-reports] Features John Cowan (05 Nov 2013 05:08 UTC)
Re: [Scheme-reports] Features Alex Shinn (05 Nov 2013 16:11 UTC)

Re: [Scheme-reports] Features Michael Montague 05 Nov 2013 01:00 UTC

Look at the table in http://en.wikipedia.org/wiki/Uname

"OS or kernel name (-s)" is utsname.sysname and "Machine (-m)" is
utsname.machine.

 From looking at the source code to uname:
http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/uname.c the "OS
name (-o)" is a define -- it is used at the bottom of uname.c. I think
that it is defined by autoconf.

Based on this information, I am doing the following. I add
utsname.sysname and utsname.machine to features after fixing them up.
Fixing them up consists of lowercasing them and converting '/' and '_'
to '-'.

If someone has a better solution, I am happy to use it.

Michael.

On 11/3/2013 9:48 PM, Michael Montague wrote:
> On 11/3/2013 8:41 PM, John Cowan wrote:
>> Michael Montague scripsit:
>>
>>> R7RS lists i386, x86-64, and gnu-linux as possible
>>> features. Presumably, i386 should be a feature for the 32 bit version,
>>> and x86-64 for the 64 bit version.
>> That's exactly the Right Thing.
>
> So I need to map i686 to i386 for the Debian 32 bit on VirtualBox
> case. Does Debian 32 bit ever return i586 or i486? Hopefully, all of
> the different Linux distributions are the same -- I have not bothered
> to dive into the source for uname to try to figure out the
> possibilities. What happens on FreeBSD? Solaris? Darwin? ...
>
>>
>>> I can make Linux lowercase and easily check for Linux and change it to
>>> gnu-linux, but I am leery of doing that.
>> Why are you leary?  That's the intention.
>
> Does every unix variant need to be special cased?
>
>>> In order for features to be useful across implementations, the symbols
>>> must be exactly the same.
>> Which is exactly why you should do it.
>>
>
> Agreed. But based on Debian, there does not seem to be a
> straightforward way of doing it: using uname, an implementation needs
> to change Linux to gnu-linux, change i686 to i386, and change x86_64
> to x86-64. What are the special cases for the rest of the common unix
> variants?
>
> How does Chibi handle this? It supports a bunch of different systems.
>

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports