Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 518150 - media-libs/jbigkit-2.1: fatal error: jbig.h: No such file or directory (CPPFLAGS += from Makefile ignored despite of +=)
Summary: media-libs/jbigkit-2.1: fatal error: jbig.h: No such file or directory (CPPFL...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Graphics Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-26 10:32 UTC by Artem Leshchev
Modified: 2015-12-15 20:31 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (file_518150.txt,4.99 KB, text/plain)
2014-07-26 10:32 UTC, Artem Leshchev
Details
emerge --info '=media-libs/jbigkit-2.1::gentoo' (file_518150.txt,5.24 KB, text/plain)
2014-07-26 10:41 UTC, Artem Leshchev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Artem Leshchev 2014-07-26 10:32:40 UTC
Created attachment 381590 [details]
build.log

Emerging fails with following errors:

pbmtojbg.c:11:18: fatal error: jbig.h: No such file or directory
 #include "jbig.h"
                  ^
compilation terminated.
make[1]: *** [pbmtojbg.o] Error 1
make[1]: *** Waiting for unfinished jobs....
jbgtopbm.c:11:18: fatal error: jbig.h: No such file or directory
 #include "jbig.h"
                  ^
compilation terminated.
make[1]: *** [jbgtopbm.o] Error 1
pbmtojbg85.c:11:20: fatal error: jbig85.h: No such file or directory
 #include "jbig85.h"
                    ^
compilation terminated.
make[1]: *** [pbmtojbg85.o] Error 1
make[1]: Leaving directory `/var/tmp/portage/media-libs/jbigkit-2.1/work/jbigkit-2.1-abi_x86_64.amd64/pbmtools'
make: *** [pbm] Error 2
Comment 1 Artem Leshchev 2014-07-26 10:41:34 UTC
Created attachment 381592 [details]
emerge --info '=media-libs/jbigkit-2.1::gentoo'
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2014-07-26 10:42:52 UTC
Your build.log is showing:

x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -W -march=native -O2 -pipe  -c -o pbmtojbg85.o pbmtojbg85.c
pbmtojbg.c:11:18: fatal error: jbig.h: No such file or directory

But mine is showing:

x86_64-pc-linux-gnu-gcc -O2 -pipe -march=native -frecord-gcc-switches -Wimplicit-function-declaration -W -I../libjbig   -c -o jbgtopbm85.o jbgtopbm85.c

So your build is missing CPPFLAGS that come from Makefile:

ssuominen@null /usr/portage/media-libs/jbigkit $ grep CPPFLAGS files/jbigkit-2.1-build.patch 
-CPPFLAGS = -I../libjbig 
+CPPFLAGS += -I../libjbig 

Now to figure out why...
Comment 3 Artem Leshchev 2014-07-26 10:44:53 UTC
(In reply to Samuli Suominen from comment #2)
> Your build.log is showing:
> 
> x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -W -march=native -O2 -pipe 
> -c -o pbmtojbg85.o pbmtojbg85.c
> pbmtojbg.c:11:18: fatal error: jbig.h: No such file or directory
> 
> But mine is showing:
> 
> x86_64-pc-linux-gnu-gcc -O2 -pipe -march=native -frecord-gcc-switches
> -Wimplicit-function-declaration -W -I../libjbig   -c -o jbgtopbm85.o
> jbgtopbm85.c
> 
> So your build is missing CPPFLAGS that come from Makefile:
> 
> ssuominen@null /usr/portage/media-libs/jbigkit $ grep CPPFLAGS
> files/jbigkit-2.1-build.patch 
> -CPPFLAGS = -I../libjbig 
> +CPPFLAGS += -I../libjbig 
> 
> Now to figure out why...

Looks like it dislike using CPPFLAGS in make.conf and want to redefine it.
Comment 4 Samuli Suominen (RETIRED) gentoo-dev 2014-07-26 10:47:42 UTC
This shouldn't be breaking it, but you have invalid flags in your `emerge --info` output in CPPFLAGS

None of these are CPPFLAGS:

CPPFLAGS="-march=native -O2 -pipe"

CPPFLAGS are preprocessor flags like -DKENNY_WAS_HERE
Comment 5 Artem Leshchev 2014-07-26 10:53:02 UTC
(In reply to Samuli Suominen from comment #4)
> This shouldn't be breaking it, but you have invalid flags in your `emerge
> --info` output in CPPFLAGS
> 
> None of these are CPPFLAGS:
> 
> CPPFLAGS="-march=native -O2 -pipe"
> 
> CPPFLAGS are preprocessor flags like -DKENNY_WAS_HERE

It builds with commented CPPFLAGS.

I have set it because `emerge --info` have shown that it is unset and make.conf.example and man page don't state what it means. I think it should be explained.
Comment 6 Artem Leshchev 2014-07-26 11:06:25 UTC
I will file a bug against Portage to explain that CPPFLAGS shouldn't be set.
Comment 7 Samuli Suominen (RETIRED) gentoo-dev 2014-07-26 11:25:54 UTC
Sorry, you must have misunderstood me, it's OK if you set flags like CPPFLAGS="-DARTEM_RULES_THE_WORLD" in make.conf, and it shouldn't be breaking this build

There is something wrong with the multilib conversion of this ebuild, because I see others ignored as well, like "tc-export AR RANLIB" in the ebuild, and then `ar` and `ranlib` directly used instead of full name

CCing multilib@g.o since I'm not spotting any obvious error in the ebuild
Comment 8 Samuli Suominen (RETIRED) gentoo-dev 2014-07-26 12:30:57 UTC
Figured one part of the bug,

+  26 Jul 2014; Samuli Suominen <ssuominen@gentoo.org> jbigkit-2.1.ebuild:
+  Move tc-export from multilib_src_compile() to src_prepare() so it gets passed
+  from phase to phase wrt #518150

But the CPPFLAGS += is still unsolved... 

Howto reproduce:

# CPPFLAGS="-DTESTTESTTESTTEST" emerge jbigkit

The Makefile's CPPFLAGS += -I../libjbig disappears and doesn't show in the build
Comment 9 Martin Väth 2015-01-21 07:25:23 UTC
ping: The bug still exists.

Only most people do no run into it:
If you do not build with CPPFLAGS, there is no problem.

Moreover, once you emerged successfully without CPPFLAGS, you also do not run into this bug directly, since the corresponding *.h files are then in /usr/include and thus need no CPPFLAGS.

However, the latter is a timebomb since it is of course false to use the installed *.h files instead of the provided "fresh" ones.

I no better solution exists, perhaps unset the CPPFLAGS in the ebuild.
Comment 10 Patrick Kirchner 2015-12-15 03:40:57 UTC
I've tried "CPPFLAGS="-DBLAHBLAHBLAH" emerge jbigkit" and the build still fails.  Is there any way to install this package?
Comment 11 SpanKY gentoo-dev 2015-12-15 20:31:54 UTC
the issue is that the build uses `make -e`.  that means env vars are injected as if they were set on the command line.  further, the += operator does not append values set on the command line (you might find this surprising, but it's been this way forever).  it's why the "override" keyword exists:
https://www.gnu.org/software/make/manual/make.html#Override-Directive

two ways to fix:
(1) don't use the -e flag (it's probably used because they want to pass vars set in the top level Makefile)
(2) use override

the issue with (2) is that it's not portable afaik (can't find it in POSIX), but then again neither is ?= or += which we use.  so blamo:
http://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5aed3a461b936573cff5cfc5cbab1cf28d5ef98e