| Summary: | Document that CPPFLAGS override behavior and possible workaround | ||
|---|---|---|---|
| Product: | [Documentation] Reference | Reporter: | Laszlo Papp <lpapp> |
| Component: | handbook | Assignee: | Paul Eggleton <bluelightning> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | Low | CC: | bluelightning, jessica.zhang, poky.doc.watcher, poky.watcher, richard.purdie, ross.burton, srifenbark |
| Version: | unspecified | ||
| Target Milestone: | 2.1 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |
Hmm, no, EXTRA_OEMAKE = "'CFLAGS=${CFLAGS}' 'CPPFLAGS=${CPPFLAGS}'" did not help, unfortunately.
How to get this buildsystem accept and respect the upstream software's build settings? I think there should be a documented way of doing so.
Adding some people to the CC list so I can get more information. Scott Scott, this seems to work below. Should it go to meta-skeleton rather than the documentation?
============== testcase_0.1.bb ==================
DESCRIPTION = "Test case for a simple GNU Makefile"
SECTION = "base"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYRIGHT;md5=349c872e0066155e1818b786938876a4"
S = "${WORKDIR}"
SRC_URI = "file://main.cpp \
file://Makefile \
file://COPYRIGHT \
"
do_compile() {
unset CPPFLAGS
oe_runmake
}
============== main.cpp ==================
int main() { return 0; }
============== Makefile ==================
CC=gcc
CPPFLAGS=-I.
main: main.cpp
$(CC) -o main main.cpp $(CPPFLAGS)
.PHONY: clean
clean:
rm -f main *.o *~
Quick update: ... unset CPPFLAGS LDFLAGS ... LDFLAGS is the same topic because if the software tries to build against symbols found in another libraries, like pthread_join in libpthread, -lpthread must be respected by the openembedded buildsystem. Otherwise, the software build ends up in "Undefined reference ..." scenario for those symbols. Scott, This may be included in the content that Paul will help with you for creating receipes for 1.6 Thanks, Jessica Hi, Okay - I am changing the status to "ACCEPTED" and will get to this post 1.5. I will work with Paul to create a good section on creating recipes that will include helpful information such as this. Thanks, Scott I am changing this to NEEDINFO. Waiting for information from Paul via email. Enhancement - moving to 1.7 Paul, feedback? Setting to M3 as the 1.7 target. I will try to get Paul to help. Scott Hi, Need some information from Paul on this. Assigning to Paul. Scott Apparently I did not assign this correctly. Now it is assigned to Paul. Not sure why the M3 milestone is not showing up. I am setting it (again). Still need to consult with Paul. Scott So, I'm marking this as ACCEPTED rather than NEEDINFO since it is now assigned to me rather than Scott. So as of the following commit, we no longer pass -e on the make command line, so this should no longer be a problem: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=f8520142c8a33fa9414314511fb01fbe79a2bf01 Marking as resolved accordingly. Setting the Doc flag to "No". Soctt |
I am having a simple recipe that can be seen below. The software underneath is using Makefiles for the buildsystem. The problem is that the buildsystem is trying to use a statement like "CPPFLAGS = -I./", but this seems to be dropped. The problem is that the software will not build without having this include path in there. It is seems to be set inside the bitbake.conf file (i.e. 'env'). When '-e' is used, that CPPFLAGS in the software's Makefile will be ignored. First of all, I think this should be documented. Secondly, perhaps even a workaround, or rather: the solution should be suggested how to respect such things intentionally. Perhaps EXTRA_OEMAKE is the right way with CPPFLAGS=${CPPFLAGS}, but it is just a gut feeling as a complete newcomer anyhow. ;-) DESCRIPTION = "Foo" SECTION = "base" LICENSE = "Proprietary" LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYRIGHT;md5=3c56ae9da467f3061406b9a5af9b277b" SRC_URI = "file://foo.tar.xz \ file://COPYRIGHT" do_compile() { oe_runmake -C foo }