[Rd] R CMD SHLIB uses foo.c instead of foo.cc if both are present (PR#2645)

Kurt Hornik hornik at ci.tuwien.ac.at
Mon Mar 17 21:32:55 MET 2003


>>>>> faheem  writes:

> On Sun, 16 Mar 2003, Duncan Temple Lang wrote:

>> The "fix" is relatively simple. One can change the order of the
>> suffixes listed in $R_HOME/etc/Makeconf (i.e. the Makeconf.in version)
>> to alter the precedence. If one changes the line
>> 
>> .SUFFIXES: .c .cc .cpp .C .d .f .lo .o
>> 
>> to place the '.c' after the '.cc', your example will work as you want it.

> Just to clarify. Is this something that you (ie. R developers) are
> planning to change, or are you just recommending that I change it? If
> so, it will break on every upgrade. Wonder if I can put this in
> Makevars as a local override, though...

> Hmm. Perhaps using makefiles would be easier, really.

It may be possible to work around this from your end using R CMD COMPILE
first and then calling R CMD SHLIB only for the linking part.

>> While the behavior is not desirable since you specified foo.cc on the
>> command line for R CMD SHLIB, I don't think it is a good idea to be
>> using files named x.c and x.cc in the same directory.  I would think
>> that this will lead to confusions with other tools and I can't think
>> of a context in which it is necessary.

> Mmm. Certainly not *necessary*. I still think it is a bug, though.

Actually, if you have foo.c and foo.cc in the same dir and compile these
for linking into a shared library they would both compile into foo.o ...

-k



More information about the R-devel mailing list