Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 40972 - DevIL-1.6.6 ebuild doesn't honour USE flags
Summary: DevIL-1.6.6 ebuild doesn't honour USE flags
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Graphics Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-09 07:20 UTC by Shaun Cloherty
Modified: 2004-03-18 18:21 UTC (History)
3 users (show)

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


Attachments
Patch to configure.in and a new configure (devil-1.6.6-autoconf.patch,351.71 KB, patch)
2004-02-09 07:31 UTC, Shaun Cloherty
Details | Diff
A modified ebuild to make use of the autoconf patch (devil-1.6.6-r1.ebuild,1.26 KB, text/plain)
2004-02-09 07:34 UTC, Shaun Cloherty
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shaun Cloherty 2004-02-09 07:20:51 UTC
emerging DevIL (media-libs/devil) version 1.6.6 fails to honour the supplied USE flags. For example;

USE="opengl" emerge devil

Fails to build support for OpenGL.

Further investigation reveals that --enable-opengl is indeed passed to configure, and the problem lies within the DevIL configure.in. 

configure.in contains (for opengl support);

AC_ARG_ENABLE(opengl,
[  --disable-opengl        Doesn't compile opengl support],
use_opengl="no", use_opengl="yes")

which results in use_opengl being set to "no" for both --disable-opengl (which is correct) _and_ --enable-opengl (which is clearly incorrect). This is true for all the suppled --disable-xyz macros.

As a work around, reverting back to;

src_compile() {
        local myconf
        use X && myconf="${myconf} --with-x"
        use gif || myconf="${myconf} --disable-gif"
        use png || myconf="${myconf} --disable-png"
        use sdl || myconf="${myconf} --disable-sdl"
        use jpeg || myconf="${myconf} --disable-jpeg"
        use tiff || myconf="${myconf} --disable-tiff"
        use opengl || myconf="${myconf} --disable-opengl"
 
        elibtoolize
        econf \
                ${myconf} \
                --disable-directx \
                --disable-win32 || die "./configure failed"
                                                                                
        make || die
}

as in previous ebuilds produces the expected result.


Reproducible: Always
Steps to Reproduce:
1.USE="opengl" emerge devil
2.
3.

Actual Results:  
No support for OpenGL.

Expected Results:  
OpenGL support should have been included.
Comment 1 Shaun Cloherty 2004-02-09 07:27:45 UTC
A better solution might be to patch configure.in and regenerate configure. And then propagate the fix to upstream maintainers.
Comment 2 Shaun Cloherty 2004-02-09 07:31:52 UTC
Created attachment 25258 [details, diff]
Patch to configure.in and a new configure

Here is one possible form that such a patch might take, not necessarily the
most elegant...
Comment 3 Shaun Cloherty 2004-02-09 07:34:34 UTC
Created attachment 25259 [details]
A modified ebuild to make use of the autoconf patch
Comment 4 Richard Lärkäng 2004-02-09 15:06:26 UTC
Because of this bug almost no apps using dev-games/ogre work, but theese patches fixes this.
Comment 5 Lorne Sturtevant 2004-02-18 19:10:43 UTC
This patch works for me as well.  I can now run my ogre apps again.
Comment 6 Gustavo Ribeiro Alves 2004-03-17 12:32:29 UTC
This patch works perfectly for me. Why wasn't it commited yet?
Comment 7 Clay Culver 2004-03-17 22:55:33 UTC
Ok, I used the above patch/ebuild, and the ogre demo programs RUN fine, but they refuse to compile.  On my machine, this is the problem:

Create a simple "hello world!" application named hello.c
$ gcc hello.c -o hello -lIL
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/../../../libIL.so: undefined reference to `_vsnprintf'
collect2: ld returned 1 exit status

This is the same thing that happened to me when I tried building DevIL from source.  Does anyone else have this problem, and if so has anyone found a fix for it?

My USE statement includes the following relevant flags:
USE="X gif png sdl jpeg tiff opengl"  (plus other stuffs)
Comment 8 Clay Culver 2004-03-18 07:54:21 UTC
Ok, I pinned down the bug.  These two lines are the culprit:
./src-IL/src/il_tiff.c:171:     _vsnprintf(buff, 1024, fmt, ap);
./src-IL/src/il_tiff.c:177:     _vsnprintf(buff, 1024, fmt, ap);

If anyone is familiar with the _vsnprintf statement, then patching these lines should fix it.

Steps to reproduce the bug:
1) $ USE="X gif png sdl jpeg tiff opengl" sudo emerge devil
[Make sure this is 1.6.6-r1.]
2) After a successful install, create a simple c application (hello world suffices).
3) $ gcc hello.c -o hello -lIL
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/../../../libIL.so: undefined reference to `_vsnprintf'
collect2: ld returned 1 exit status

There are a few workarounds.  If you simply disable the tiff USE flag this doesn't happen.  If someone knows what the _vsnprintf does, you could simply patch it.
Comment 9 SpanKY gentoo-dev 2004-03-18 18:21:04 UTC
fixed in cvs (including the vnsprint junk)

thanks for the patch :)