tiff.c: In function ‘is_tiff’: tiff.c:45: error: ‘TIFFHeader’ undeclared (first use in this function) tiff.c:45: error: (Each undeclared identifier is reported only once tiff.c:45: error: for each function it appears in.) tiff.c:45: error: expected ‘;’ before ‘th’ tiff.c:52: error: ‘th’ undeclared (first use in this function) make: *** [tiff.o] Error 1 make: *** Waiting for unfinished jobs.... * ERROR: media-gfx/xloadimage-4.1-r10 failed: * emake failed * * Call stack: * ebuild.sh, line 48: Called src_compile * environment, line 2371: Called _eapi2_src_compile * ebuild.sh, line 640: Called die * The specific snippet of code: * emake || die "emake failed" * * If you need support, post the output of 'emerge --info =media-gfx/xloadimage-4.1-r10', * the complete build log and the output of 'emerge -pqv =media-gfx/xloadimage-4.1-r10'. * The complete build log is located at '/var/tmp/portage/media-gfx/xloadimage-4.1-r10/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/media-gfx/xloadimage-4.1-r10/temp/environment'. * S: '/var/tmp/portage/media-gfx/xloadimage-4.1-r10/work/xloadimage.4.1' >>> Failed to emerge media-gfx/xloadimage-4.1-r10, Log file: >>> '/var/tmp/portage/media-gfx/xloadimage-4.1-r10/temp/build.log' * * The following package has failed to build or install: * * ('ebuild', '/', 'media-gfx/xloadimage-4.1-r10', 'merge'), Log file: * '/var/tmp/portage/media-gfx/xloadimage-4.1-r10/temp/build.log' Reproducible: Always
*** Bug 319441 has been marked as a duplicate of this bug. ***
This happens also if "-tiff" is used. Probably passing the tiff USE flag along to the configuration part is broken.
Created attachment 231403 [details, diff] Patch for new tiff-4 Builds fine here with this patch using media-libs/tiff-4.0.0_beta5
The proposed patch works for me, on amd64
Has anyone tested the patch with tiff-3.9.2? It "needs" to be backwards compatible.
(In reply to comment #3) > Created an attachment (id=231403) [details] > Patch for new tiff-4 > > Builds fine here with this patch using media-libs/tiff-4.0.0_beta5 > this patch works, please put it in the package.
(In reply to comment #6) > (In reply to comment #3) > > Created an attachment (id=231403) [details] [details] > > Patch for new tiff-4 > > > > Builds fine here with this patch using media-libs/tiff-4.0.0_beta5 > > > > this patch works, please put it in the package. > nope, it breaks the building with tiff-3.9.2 tiff.c: In function ‘is_tiff’: tiff.c:45:3: error: ‘TIFFHeaderCommon’ undeclared (first use in this function) tiff.c:45:3: note: each undeclared identifier is reported only once for each function it appears in tiff.c:45:20: error: expected ‘;’ before ‘th’ tiff.c:52:27: error: ‘th’ undeclared (first use in this function)
Patch work for xloadimage-4.1-r10 +tiff
(In reply to comment #5) > Has anyone tested the patch with tiff-3.9.2? It "needs" to be backwards > compatible. > Not tested, just compared with the old tiff library sources. It is not backwards compatible. I've hoped some #ifdef-ing might help, but I've found that the situation is much worse. The good news: The old tiff library defines TIFF_VERSION, the new one TIFF_VERSION_CLASSIC. Testing #ifdef TIFF_VERSION_CLASSIC should do the work. The bad news: The patch cannot actually work. If it works, or seems to work, its shear luck, or rather just an illusion. For one, it does not patch all the appearances of TIFFHeader in the code, try `grep -r TIFFHeader /var/tmp/portage/media-gfx/xloadimage-4.1-r10/work/xloadimage.4.1/` after unpacking the ebuild. What's worse, it does not deal with TIFFDirEntry at all -- and try grepping for that. Having unpacked the media-libs/tiff-4.0.0_beta5 ebuild, look at /var/tmp/portage/media-libs/tiff-4.0.0_beta5/work/tiff-4.0.0beta5/html/v4.0.0.html It says: <quote> Although it's rare, some application code does use structures like TIFFHeader or TIFFDirEntry that used to be an exact binary representation of TIFF structures. These need to change. The old TIFFHeader structure is replaced by the new TIFFHeaderClassic, TIFFHeaderBig, and TIFFHeaderCommon structures that are an exact binary representation of the ClassicTIFF and BigTIFF header, and of the part that is common to both. There is no new equivalent for the old TIFFDirEntry structure (or more precisely, there is still a TIFFDirEntry structure, but it is changed, moved to library-private definition, and no longer an exact binary representation of the tag structure of either TIFF version). </quote> Looks like adapting the xloadimage code to the new tiff library version will require cleaning of its use of boath TIFFHeader and TIFFDirEntry. It likely should have never used them at the first place. Parts of code will have to be identified, understood, and rewritten completely to use the (new) tiff library interface properly. Since xloadimage seems to be completely dead upstream, no longer has a homepage available, hence no upstream whatsoever likely, it is probably going to be phased out unless somebody takes over it and becomes its new upstream. Any volunteers?
(In reply to comment #9) I do not know, how crucial it is, but I successfully merge xloadimage with the next patch: --- tiff.c.orig 2010-05-10 19:24:57.000000000 +0200 +++ tiff.c 2010-05-10 19:26:49.000000000 +0200 @@ -18,7 +18,9 @@ * lib. But we want to use the system's shared libraries */ /*#include "tiff/tiffio.h"*/ #include <tiffio.h> - +#ifndef TIFFHeader + #define TIFFHeader TIFFHeaderClassic +#endif /* this structure contains all the information we care about WRT a TIFF * image. */ And, so far I did not observe any problems with tiff images...
Also xloadimage-4.1-r11 fails to compile: ... x86_64-pc-linux-gnu-gcc -march=nocona -O2 -pipe -fomit-frame-pointer -c -DHAVE_CONFIG_H -DSYSPATHFILE=\"/etc/X11/Xloadimage\" undither.c tiff.c: In function 'is_tiff': tiff.c:45: error: 'TIFFHeader' undeclared (first use in this function) tiff.c:45: error: (Each undeclared identifier is reported only once tiff.c:45: error: for each function it appears in.) tiff.c:45: error: expected ';' before 'th' tiff.c:52: error: 'th' undeclared (first use in this function) x86_64-pc-linux-gnu-gcc -march=nocona -O2 -pipe -fomit-frame-pointer -c -DHAVE_CONFIG_H -DSYSPATHFILE=\"/etc/X11/Xloadimage\" value.c make: *** [tiff.o] Error 1 make: *** Waiting for unfinished jobs.... * ERROR: media-gfx/xloadimage-4.1-r11 failed: * emake failed
(In reply to comment #11) > Also xloadimage-4.1-r11 fails to compile: > ... > x86_64-pc-linux-gnu-gcc -march=nocona -O2 -pipe -fomit-frame-pointer -c > -DHAVE_CONFIG_H -DSYSPATHFILE=\"/etc/X11/Xloadimage\" undither.c > tiff.c: In function 'is_tiff': > tiff.c:45: error: 'TIFFHeader' undeclared (first use in this function) Same here with tiff-4.0.0_beta5. Applying my patch (see my attachment) solves this. Helmut.
~x86: ... 686-pc-linux-gnu-gcc -march=native -O2 -pipe -msse3 -fomit-frame-pointer -c -DHAVE_CONFIG_H -DSYSPATHFILE=\"/etc/X11/Xloadimage\" smooth.c i686-pc-linux-gnu-gcc -march=native -O2 -pipe -msse3 -fomit-frame-pointer -c -DHAVE_CONFIG_H -DSYSPATHFILE=\"/etc/X11/Xloadimage\" sunraster.c i686-pc-linux-gnu-gcc -march=native -O2 -pipe -msse3 -fomit-frame-pointer -c -DHAVE_CONFIG_H -DSYSPATHFILE=\"/etc/X11/Xloadimage\" tiff.c tiff.c: In function ‘is_tiff’: tiff.c:45: σφάλμα: ‘TIFFHeader’ undeclared (first use in this function) tiff.c:45: σφάλμα: (Each undeclared identifier is reported only once tiff.c:45: σφάλμα: for each function it appears in.) tiff.c:45: σφάλμα: expected ‘;’ before ‘th’ tiff.c:52: σφάλμα: ‘th’ undeclared (first use in this function) make: *** [tiff.o] Error 1 make: *** Waiting for unfinished jobs.... * ERROR: media-gfx/xloadimage-4.1-r11 failed: * emake failed * * Call stack: * ebuild.sh, line 54: Called src_compile * environment, line 2849: Called _eapi2_src_compile * ebuild.sh, line 646: Called die * The specific snippet of code: * emake || die "emake failed"
Patch xloadimage-4.1-tiff.patch from Helmut works for me. I tested on xloadimage-4.1-r11, tiff-4.0.0_beta5 and some tiff images. However, xloadimage is unable to open several tiff files with the following: "Can't handle TIFF RGB images with 4 samples per pixel, sorry" Though, it seems to be unrelated issue.
In my case, with tiff-4.0.0_beta6, and the same version of xloadimage, I need the TIFFHeaderCommon construct rather than the proposed TIFFHeader.
Problem still exists in xloadimage-4.1-r11 (+tiff). Building with USE="-tiff" works around the problem though. My build log (using +tiff): http://pastebin.com/vQBy6jxc.
(In reply to comment #16) > Problem still exists in xloadimage-4.1-r11 (+tiff). Building with USE="-tiff" > works around the problem though. Have you tried proposed patch? It works for me with xloadimage-4.1-r11 (+tiff) and tiff-4.0.0._beta6.
I had the same problem with xloadimage 4.1-r11 and tiff 4.0.0_beta6, and the above Helmut Jarausch patch resolved it. Thank's Helmut.
I used a bit different method, but essentially it's the same as the attached patch... + 22 Jan 2012; Samuli Suominen <ssuominen@gentoo.org> + xloadimage-4.1-r11.ebuild: + Fix building with media-libs/tiff >= 4.0.0_pre wrt #319383 by Helmut Jarausch