This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/54696] New: Makefile doesn't propagate CPPFLAGS properly
- From: "noah.b.lavine at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 25 Sep 2012 02:34:23 +0000
- Subject: [Bug c/54696] New: Makefile doesn't propagate CPPFLAGS properly
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54696
Bug #: 54696
Summary: Makefile doesn't propagate CPPFLAGS properly
Classification: Unclassified
Product: gcc
Version: 4.7.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: noah.b.lavine@gmail.com
I tried to build GCC 4.7.2 from the source tarball, specifying a -I option in
CPPFLAGS because I keep header files in a nonstandard place
(~/.nix-profile/include).
Unfortunately, gcc failed to build. Instead it produced the error
gcc -I../.././libcpp -I. -I../.././libcpp/../include -I../.././libcpp/include
-g -fkeep-inline-functions -W -Wall -Wwrite-strings -Wmissing-format-attribute
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wc++-compat
-pedantic -Wno-long-long -I../.././libcpp -I. -I../.././libcpp/../include
-I../.././libcpp/include -c -o charset.o -MT charset.o -MMD -MP -MF
.deps/charset.Tpo ../.././libcpp/charset.c
In file included from ../.././libcpp/charset.c:22:0:
../.././libcpp/system.h:276:21: fatal error: libintl.h: No such file or
directory
compilation terminated.
But libintl.h exists in ~/.nix-profile/include. The problem is clear: the -I
statement from CPPFLAGS is not being used.
This particular statement is part of compiling libcpp, so I looked at the
makefile for libcpp, and found this line:
CPPFLAGS =
This is the problem. It seems clear that what is happening is that the CPPFLAGS
that I use when I configure the main GCC executable are not being passed on to
the configuration script for libcpp, which then doesn't know where to find
libintl. When I edit the makefile by hand to set CPPFLAGS correctly, the build
gets past that point.
One odd note is that I also pass LDFLAGS, and that *is* passed on to libcpp. So
it is not that all environment variables aren't propagated.