[Rd] how to include a windows dll in a package

Gabor Csardi csardi at rmki.kfki.hu
Tue Aug 15 15:45:58 CEST 2006


On Tue, Aug 15, 2006 at 03:34:05PM +0200, Uwe Ligges wrote:
> 
> 
> Gabor Csardi wrote:
> >Thank you for the answer.
> >
> >On Tue, Aug 15, 2006 at 02:09:59PM +0100, Prof Brian Ripley wrote:
> >>On Tue, 15 Aug 2006, Gabor Csardi wrote:
> >[...]
> >>>what is the correct way to include a dll in a source package, that
> >>>is expected to be installed in the libs directory?
> >>You could put it in inst/libs.   But we discourage that.
> >>(And if you do do this, watch out for licence conditions.)
> >
> >Why is this discouraged? Not that i like putting binary files into 
> >packages,
> >i understand that this is against good taste. But is there a more serious
> >reason?
> 
> 
> 1. It's not really nice, since GPL tells something about distributing 
> the *sources*. Anyway, XML's binary version also ships the dll ...

No problem, libxml2 sources are available, that is fine with the GPL.
They need not be included in the _same_ package as the binaries.

> 2. For example, non-Windows installations won't require that dll.

That is true, so the best would be to include the dll only in windows, 
configure.win is good for that.

[...]
> You can copy from the XML package:
> 
> configure.win should contain at least:
> 
> #!/bin/sh
> mkdir $DPKG/libs
> cp $LIB_XML/lib/libxml2.dll $DPKG/libs
> 
> and Makevars.win can make use of
> ${LIB_XML}/include
> ${LIB_XML}/lib
> 
> The name of the environment variable to the XML stuff, LIB_XML, is fixed 
> due to my setup on the machine that build the Windows binaries.

Yes, but you need to install libxml2 and set LIB_XML by hand, don't you? 

All in all, i would prefer the following solution if it is not against the R
policy.

1. Include the libxml headers and windows DLL's in the source package. 
2. The headers are used only for compiling the package on windows.
3. The DLL's are put into the windows binary package, but not used otherwise.

This way no special action is needed by the user for 
1. building the binary package on windows
2. installing the binary package on windows
3. building & installing the source package on unix-likes

Is this good enough? 

Gabor

> Uwe Ligges
> 

-- 
Csardi Gabor <csardi at rmki.kfki.hu>    MTA RMKI, ELTE TTK



More information about the R-devel mailing list