[Rd] PKG_CFLAGS/CFLAGS and PKG_CXXFLAGS/CXXFLAGS

Ernest Turro ernest.turro at ic.ac.uk
Tue Mar 20 19:58:51 CET 2007


Why is it that R places CFLAGS after PKG_CFLAGS and not before when  
compiling a package (e.g. through R CMD build pkg)? This can be  
problematic if, for instance, you want to use -O3, but -O2 is in  
R_HOME/etc/Makeconf. If -O2 (in CFLAGS) appears after -O3 (in  
PKG_CFLAGS), you are left with what you didn't want: -O2.

In R-exts, it says that "Flags which are set in file etc/Makeconf can  
be overridden by the environment variable MAKEFLAGS (at least for  
systems using GNU make), as in (Bourne shell syntax)" but this  
doesn't work if I set either MAKEFLAGS or CFLAGS/CXXFLAGS in my  
configure.ac script or package Makevars.

Does anyone have any ideas on how to reliably override the default  
CFLAGS/CXXFLAGS given in Makeconf?

Many thanks,

Ernest



More information about the R-devel mailing list