On 2007-03-15 14:37:08 +0100, Vincent Lefevre wrote:
If I unset C_INCLUDE_PATH, then the build doesn't fail. So, this means that readline.h is taken from /opt/local/include/readline/readline.h (with my C_INCLUDE_PATH), even though -I"/usr/include" is used. Any explanation?
This is confirmed with: prunille:~> cat test.c #include <readline/readline.h> prunille:~> gcc -E -I/usr/include test.c | grep readline/readline.h # 1 "/opt/local/include/readline/readline.h" 1 3 [...] Similar problem under Linux. BTW, this bug seems to occur only with /usr/include (perhaps because it is a system directory). The gcc man page says: -isystem dir Search dir for header files, after all directories specified by -I but before the standard system directories. Mark it as a system directory, so that it gets the same special treatment as is applied to the standard system directories. so that one should have a path like: /usr/include /opt/local/include /usr/include the first /usr/include being specified by -I and the last one being in the standard system directories list. As MacPorts needs /usr/include, it should probably unset CPATH, C_INCLUDE_PATH and LIBRARY_PATH. -- 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)