On 2007-03-31 03:34:50 -0500, Ryan Schmidt wrote:
With CFLAGS, LDFLAGS and friends, we have to be careful not to overwrite but merely to append, in case some things are already defined in those variables. For example, CFLAGS by default includes -O2; if we overwrite CFLAGS we've just dropped optimization back to -O0, which may not have been intended.
Another problem is that flags can be appended in an incorrect order. When using CPATH and LIBRARY_PATH at the MacPorts level, one makes sure that particular port settings have the precedence over the system (here MacPorts) settings.
Do we have the same problem with CPATH and LIBRARY_PATH, or can I assume that they are empty to begin with and just set them to what I want?
The port command *must* override the values of these variables. As they are environment variables, they may contain values set up by the user for his own use when port is executed. And these values can conflict with MacPorts. BTW, there can be problems with software that uses pkg-config when there are conflicting paths. You'll have to check xrender installation in particular (and fix its Portfile if need be), since I had problems in the past: http://trac.macosforge.org/projects/macports/ticket/5165 If I understand correctly, for this particular software, one needs to give -I/opt/local/include explicitly *before* -I/usr/X11R6/include. But anyway pkg-config seems to handle CPATH and C_INCLUDE_PATH differently: $ CPATH="" C_INCLUDE_PATH="" pkg-config --cflags render -I/opt/local/include $ CPATH=/opt/local/include C_INCLUDE_PATH="" pkg-config --cflags render -I/opt/local/include $ CPATH="" C_INCLUDE_PATH=/opt/local/include pkg-config --cflags render $ -- Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/> 100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/> Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)