From ripley at stats.ox.ac.uk  Wed Nov 28 15:47:10 2012
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Wed, 28 Nov 2012 14:47:10 +0000
Subject: [Rd] Makevars that distinguish between OSX and *NIX
In-Reply-To: <22879e9d08d5fc52be14f6f76816de70@cs.utah.edu>
References: <3cb3bdb5b91966573be20763f50c4f71.squirrel@webmail.xs4all.nl>
	<CAAmySGNQPL-vq5fFpS1YHc7YF2xar_18XhThO_8DQPxPxcS6Aw@mail.gmail.com>
	<50B3FC84.3080400@sapo.pt>
	<CAAmySGO8Wx05spC+95QAAPjndphmHnAOusKirQ8DQweDKf+9UA@mail.gmail.com>
	<50B61FDC.2060006@stats.ox.ac.uk>
	<22879e9d08d5fc52be14f6f76816de70@cs.utah.edu>
Message-ID: <50B623EE.3060407@stats.ox.ac.uk>

On 28/11/2012 14:36, sgerber wrote:
> Hi
>
> Is there a similar way to create a specific Makevars for OSX versus *NIX
> systems as for Windows, e.g. a Makervars.osx ?
> If not what is there another lean solution to create system specific
> Makevars? I need to link differently depending on whether I am on *NIX
> or OSX (specifically link to OpenGL).
>

Well, OS X (sic) is a certified UNIX!

This is what a 'configure' script is used for (e.g. by package rgl). 
But you can write conditional code in commands in the Makevars, e.g. by

if test `uname` = "Darwin" ; then
else
fi

Please do not use GNU make misfeatures to do this if you want it to be 
portable (see 'Writing R Extensions').

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] Makevars that distinguish between OSX and *NIX
Prof Brian Ripley