[Rd] How to customize the list of exported functions in a shared library (update)

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Feb 5 16:28:35 CET 2007

On Mon, 5 Feb 2007, Vladimir Eremeev wrote:

> Vladimir Eremeev wrote:

Something important is missing here!

>> It calls gcc:
>> gcc  "-I../sources" "-I."  -IC:/PROGRA~1/R/include  -gdwarf-2 -Wall -O2
>> -std=gnu99   -c rsnns.c -o rsnns.o
>> gcc  -shared   -o Rsnns.dll Rsnns.def [ lots of *.o ]  -LC:/PROGRA~1/R/bin
>> "-Lc:/mingw/lib" -lfl -liberty   -lR
>> The file Rsnns.def is generated automatically and is deleted on success.
>> On error, it remains, and contains export of all symbols.
>> Probably GCC generates it, I haven't tracked its generation in the R's
>> scripts.

Actually, you *still* haven't tracked its generation in the R's scripts.

> This file is generated in R scripts.
> MkRules contains
> %.dll:
> 	@$(ECHO) EXPORTS > $*.def
> 	@$(NM) $^ | $(SED) -n 's/^........ [BCDRT] _/ /p' >> $*.def
> 	$(DLL) -shared $(DLLFLAGS) $($*-DLLFLAGS) -o $@ $*.def $^ $($*-DLLLIBS)
> 	@$(RM) $*.def

Yes, but that is not necessarily the rule used.  See MakeDll which 
contains the rules for generating DLLs to be linked into R, and CHANGES 
for the documentation.

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

More information about the R-devel mailing list