From ernest.turro at ic.ac.uk  Tue Mar 20 19:58:51 2007
From: ernest.turro at ic.ac.uk (Ernest Turro)
Date: Tue, 20 Mar 2007 18:58:51 +0000
Subject: [Rd] PKG_CFLAGS/CFLAGS and PKG_CXXFLAGS/CXXFLAGS
Message-ID: <438FA5BB-AA84-4E61-8D3F-FDCA637CDD53@ic.ac.uk>

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



[Rd] PKG_CFLAGS/CFLAGS and PKG_CXXFLAGS/CXXFLAGS
Ernest Turro