<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>5046</bug_id>
          
          <creation_ts>2013-08-23 17:43:29 +0000</creation_ts>
          <short_desc>Document that CPPFLAGS override behavior and possible workaround</short_desc>
          <delta_ts>2016-03-05 19:40:15 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>9</classification_id>
          <classification>Documentation</classification>
          <product>Reference</product>
          <component>handbook</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>2.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Laszlo Papp">lpapp</reporter>
          <assigned_to name="Paul Eggleton">bluelightning</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>poky.doc.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>ross.burton</cc>
    
    <cc>srifenbark</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>35893</commentid>
    <comment_count>0</comment_count>
    <who name="Laszlo Papp">lpapp</who>
    <bug_when>2013-08-23 17:43:29 +0000</bug_when>
    <thetext>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 &quot;CPPFLAGS = -I./&quot;, 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. &apos;env&apos;). When &apos;-e&apos; is used, that CPPFLAGS in the software&apos;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 = &quot;Foo&quot;
SECTION = &quot;base&quot;
LICENSE = &quot;Proprietary&quot;
LIC_FILES_CHKSUM = &quot;file://${WORKDIR}/COPYRIGHT;md5=3c56ae9da467f3061406b9a5af9b277b&quot;

SRC_URI = &quot;file://foo.tar.xz \
               file://COPYRIGHT&quot;

do_compile() {
        oe_runmake -C foo
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35894</commentid>
    <comment_count>1</comment_count>
    <who name="Laszlo Papp">lpapp</who>
    <bug_when>2013-08-23 17:52:46 +0000</bug_when>
    <thetext>Hmm, no, EXTRA_OEMAKE = &quot;&apos;CFLAGS=${CFLAGS}&apos; &apos;CPPFLAGS=${CPPFLAGS}&apos;&quot; did not help, unfortunately.

How to get this buildsystem accept and respect the upstream software&apos;s build settings? I think there should be a documented way of doing so.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35900</commentid>
    <comment_count>2</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2013-08-26 06:23:07 +0000</bug_when>
    <thetext>Adding some people to the CC list so I can get more information.

Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35945</commentid>
    <comment_count>3</comment_count>
    <who name="Laszlo Papp">lpapp</who>
    <bug_when>2013-08-27 09:49:06 +0000</bug_when>
    <thetext>Scott, this seems to work below. Should it go to meta-skeleton rather than the documentation?

============== testcase_0.1.bb ==================

DESCRIPTION = &quot;Test case for a simple GNU Makefile&quot;
SECTION = &quot;base&quot;
LICENSE = &quot;GPLv2&quot;
LIC_FILES_CHKSUM = &quot;file://${WORKDIR}/COPYRIGHT;md5=349c872e0066155e1818b786938876a4&quot;

S = &quot;${WORKDIR}&quot;

SRC_URI = &quot;file://main.cpp \
           file://Makefile \
           file://COPYRIGHT \
          &quot;

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 *~</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35995</commentid>
    <comment_count>4</comment_count>
    <who name="Laszlo Papp">lpapp</who>
    <bug_when>2013-08-28 14:28:40 +0000</bug_when>
    <thetext>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 &quot;Undefined reference ...&quot; scenario for those symbols.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36045</commentid>
    <comment_count>5</comment_count>
    <who name="Jessica">jessica.zhang</who>
    <bug_when>2013-08-29 14:45:25 +0000</bug_when>
    <thetext>Scott,

This may be included in the content that Paul will help with you for creating receipes for 1.6

Thanks,
Jessica</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36507</commentid>
    <comment_count>6</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2013-09-10 22:29:57 +0000</bug_when>
    <thetext>Hi,

Okay - I am changing the status to &quot;ACCEPTED&quot; 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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38391</commentid>
    <comment_count>7</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2013-10-31 18:34:39 +0000</bug_when>
    <thetext>I am changing this to NEEDINFO.  Waiting for information from Paul via email.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42081</commentid>
    <comment_count>8</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2014-04-01 22:54:34 +0000</bug_when>
    <thetext>Enhancement - moving to 1.7</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42502</commentid>
    <comment_count>9</comment_count>
    <who name="Laszlo Papp">lpapp</who>
    <bug_when>2014-04-10 09:31:45 +0000</bug_when>
    <thetext>Paul, feedback?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43725</commentid>
    <comment_count>10</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2014-06-03 09:17:48 +0000</bug_when>
    <thetext>Setting to M3 as the 1.7 target.  I will try to get Paul to help.

Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43774</commentid>
    <comment_count>11</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2014-06-04 15:54:29 +0000</bug_when>
    <thetext>Hi, 

Need some information from Paul on this.  Assigning to Paul.

Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43972</commentid>
    <comment_count>12</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2014-06-16 09:17:57 +0000</bug_when>
    <thetext>Apparently I did not assign this correctly.  Now it is assigned to Paul.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44377</commentid>
    <comment_count>13</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2014-07-08 12:51:17 +0000</bug_when>
    <thetext>Not sure why the M3 milestone is not showing up.  I am setting it (again).  Still need to consult with Paul.

Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45010</commentid>
    <comment_count>14</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2014-08-07 15:05:01 +0000</bug_when>
    <thetext>So, I&apos;m marking this as ACCEPTED rather than NEEDINFO since it is now assigned to me rather than Scott.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59711</commentid>
    <comment_count>15</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2016-03-04 02:41:01 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59739</commentid>
    <comment_count>16</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2016-03-05 19:40:15 +0000</bug_when>
    <thetext>Setting the Doc flag to &quot;No&quot;.

Soctt</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>