From murdoch at stats.uwo.ca  Thu Nov 12 00:36:56 2009
From: murdoch at stats.uwo.ca (Duncan Murdoch)
Date: Wed, 11 Nov 2009 18:36:56 -0500
Subject: [Rd] Building package under windows which links against a
 cygwin library
In-Reply-To: <28152c800911111341j782f1a58q79d2dea081fafcaa@mail.gmail.com>
References: <28152c800911111341j782f1a58q79d2dea081fafcaa@mail.gmail.com>
Message-ID: <4AFB4A98.70905@stats.uwo.ca>

On 11/11/2009 4:41 PM, Cameron Bracken wrote:
> I am developing a package
> (http://r-forge.r-project.org/projects/swfdevice/) which links against
> the ming C library. The package builds fine under Mac OS X and Linux.
> I am really out of my element on windows, but I know there is a cygwin
> package for libming.
> 
> My question is, does anyone have advice/examples on linking R packages
> against cygwin libraries?  Is this even possible?  How would I go
> about writing a configure.win script to do this?

I suspect it's not going to work.  Linking to any Cygwin library will 
pull in the rest, and I would guess that will conflict with something 
else in R, which does not use Cygwin.

What you could do is include a copy of the source to the ming library, 
and get the regular R compilers to compile it.  I just tried, and it 
compiled without errors (though there were a few warnings).  Then you 
can write your R interface to it, and everything may just work.

The tricky bit might be getting the Makevars or Makefile right, but 
theirs is really simple, so that shouldn't be so bad.

Duncan Murdoch



[Rd] Building package under windows which links against a cygwin library
Duncan Murdoch