<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>11092</bug_id>
          
          <creation_ts>2002-11-22 12:27 0000</creation_ts>
          <short_desc>svgalib-1.9.16 ebuild fails with multiple (related) issues</short_desc>
          <delta_ts>2005-05-05 06:14:20 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Ebuilds</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>11141</blocked>
    
    <blocked>12788</blocked>
          
          <everconfirmed>1</everconfirmed>
          <reporter>pee@erkkila.org</reporter>
          <assigned_to>azarah@gentoo.org</assigned_to>
          <cc>diegoliz@gmail.com</cc>
    
    <cc>djn@daimi.au.dk</cc>
    
    <cc>henti@geekware.co.za</cc>
    
    <cc>lostlogic@gentoo.org</cc>
    
    <cc>patrik@yes.nu</cc>
    
    <cc>qubex@punkass.com</cc>
    
    <cc>vapier@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>pee@erkkila.org</who>
            <bug_when>2002-11-22 12:27:10 0000</bug_when>
            <thetext>1. The ebuild will (silently) fail on the svgalib_helper line in the ebuild
   This is caught again later during the install process when make will bomb
   out trying to recompile to meet dependencies.

example: 

make[1]: Leaving directory `/var/tmp/portage/svgalib-1.9.16/work/svgalib-1.9.16/doc&apos;
(cd kernel/svgalib_helper ; make modules_install )
make[1]: Entering directory
`/var/tmp/portage/svgalib-1.9.16/work/svgalib-1.9.16/kernel/svgalib_helper&apos;
cc -D__KERNEL__ -DMODULE -Wall -O2  -I/usr/src/linux/include
-DSVGALIB_HELPER_MAJOR=209   -c -o main.o main.c
main.c:18:40: missing binary operator before &apos;(&apos;
In file included from main.c:27:
/usr/src/linux/include/asm/irq.h:16:25: irq_vectors.h: No such file or directory
main.c: In function `svgalib_helper_ioctl&apos;:
main.c:295: warning: implicit declaration of function `request_irq&apos;
main.c:312: warning: implicit declaration of function `free_irq&apos;
main.c:115: warning: `i&apos; might be used uninitialized in this function
main.c:400:41: missing binary operator before &apos;(&apos;
main.c: In function `svgalib_helper_mmap&apos;:
main.c:403: structure has no member named `vm_offset&apos;
main.c:412:41: missing binary operator before &apos;(&apos;
main.c:421:41: missing binary operator before &apos;(&apos;
main.c: In function `__initfn&apos;:
main.c:439: warning: implicit declaration of function `devfs_register_chrdev&apos;
main.c:519: warning: implicit declaration of function `devfs_unregister_chrdev&apos;
make[1]: *** [main.o] Error 1
make[1]: Leaving directory
`/var/tmp/portage/svgalib-1.9.16/work/svgalib-1.9.16/kernel/svgalib_helper&apos;
make: *** [installmodule] Error 2

!!! ERROR: media-libs/svgalib-1.9.16 failed.
!!! Function src_install, Line 48, Exitcode 2
!!! (no error message)

2. svga helper does not build at least with 2.5.4X kernels
===/usr/src/linux/include/asm/irq.h:
#include &lt;linux/config.h&gt;
#include &lt;linux/sched.h&gt;
/* include comes from machine specific directory */
#include &quot;irq_vectors.h&quot;
^^^--- in this case this is /usr/src/linux/arch/i386/mach-generic (on my machine)

This hack to src_compile() will fix it
(line 88 or so)
        make INCLUDEDIR=&quot;/usr/src/linux/include
-I/usr/src/linux/arch/i386/mach-generic&quot; \
                -C kernel/svgalib_helper || die


3. svga_helper will still fail ;) 

FIX:
need to add  #include &lt;linux/version.h&gt; to kernel/svga_helper/main.c

edit ebuild and add:

        cd ${S}; epatch ${FILESDIR}/${P}-m.diff

to src_unpack(), and then add this small patch to the files directory

root@nipplehead svgalib # more files/svgalib-1.9.16-m.diff 
--- svgalib-1.9.16/kernel/svgalib_helper/main.c 2002-07-26 13:58:31.000000000 +0000
+++ svgalib-1.9.16/kernel/svgalib_helper/main.c 2002-11-22 18:12:44.000000000 +0000
@@ -15,6 +15,7 @@
 #include &lt;linux/sched.h&gt;
 #include &lt;linux/wait.h&gt;
 
+#include &lt;linux/version.h&gt;
 #if LINUX_VERSION_CODE &lt; KERNEL_VERSION(2,5,0)
 #include &quot;kernel25compat.h&quot;
 #endif</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2002-11-22 12:51:20 0000</bug_when>
            <thetext>what kernel are you running 
 
also, please check your /usr/src/linux/ to make sure everything is setup </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>pee@erkkila.org</who>
            <bug_when>2002-11-22 13:05:10 0000</bug_when>
            <thetext>Kernel is either dev-sources 2.5.48, or fresh bitkeeper and yes
/usr/src/linux is setup.

This is a 2.5 issues, so im mostly just posting so people know what to expect.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>javier-ml-gentoo@marcet.info</who>
            <bug_when>2002-11-23 22:27:29 0000</bug_when>
            <thetext>I had first committed svgalib-1.9.16.ebuild to bugzilla with the kernel module&apos;s 
installation removed. 
This is a personal preference, i.e. I don&apos;t like kernel modules to be bundled within 
ebuilds, since I usually have more than one kernel to boot from, and/or update it 
regularly. This seems to be the case for you, pee, too. 
I just remembered this now and came to bugzilla to post the modified ebuild. 
Fortunately, Martin Schlemmer, who finally committed the ebuild to the official 
portage tree, added the kernel module back before doing so. 
 
Thanks Martin for noticing it and pee for the fix to compile the module on 
development kernels. 
 
Also, what do you think about the option to isolate the kernel modules from 
standard ebuilds? 
 
What I do now is having a folder in /usr/src where I keep a copy of all the kernel 
module&apos;s sources which come with different ebuilds, e.g. mplayer, svgalib, ... 
In addition I comment out the module installation in the corresponding ebuild. 
This way, I can emerge/unmerge those packages without deleting the module 
from the kernel tree and at the same time I can have various kernels with their 
own modules, which I have to build manually whenever I compile a new kernel. 
 
Probably, some other approach, to do it more elegantly might be interesting to 
add. 
 
Comments, ideas, flames? </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>djn@daimi.au.dk</who>
            <bug_when>2002-11-24 11:07:28 0000</bug_when>
            <thetext>Hi! 

the svgalib-1.9.16 fails for me too. I&apos;m running gentoo-sources 2.4.19-r9, an
1.4rc machine with all the latest packages (well, almost), and
ACCEPT_KEYWORDS=&quot;~x86&quot;

the build fails... And grepping through the output i get the following
interesting  points.

[output]

make[1]: Entering directory
`/var/tmp/portage/svgalib-1.9.16/work/svgalib-1.9.16/sharedlib&apos;
ln: `../src/svgalib_helper.h&apos;: File exists
make[1]: *** [.depend.src] Error 1
make[1]: Leaving directory
`/var/tmp/portage/svgalib-1.9.16/work/svgalib-1.9.16/sharedlib&apos;

[more output]

make: Entering directory
`/var/tmp/portage/svgalib-1.9.16/work/svgalib-1.9.16/kernel/svgalib_helper&apos;
cc -D__KERNEL__ -DMODULE -Wall -O2  -I/usr/src/linux/include
-DSVGALIB_HELPER_MAJOR=209 -M *.c &gt; .depend
In file included from /usr/src/linux/include/linux/sched.h:30,
                 from /usr/src/linux/include/linux/mm.h:4,
                 from /usr/src/linux/include/linux/slab.h:14,
                 from /usr/src/linux/include/asm/pci.h:32,
                 from /usr/src/linux/include/linux/pci.h:614,
                 from interrupt.c:1:
/usr/src/linux/include/linux/grsecurity.h:12:26: linux/grdefs.h: No such file or
directory
/usr/src/linux/include/linux/grsecurity.h:43:25: linux/grmsg.h: No such file or
directory
In file included from /usr/src/linux/include/linux/sched.h:30,
                 from /usr/src/linux/include/linux/mm.h:4,
                 from /usr/src/linux/include/linux/slab.h:14,
                 from main.c:4:
/usr/src/linux/include/linux/grsecurity.h:12:26: linux/grdefs.h: No such file or
directory
/usr/src/linux/include/linux/grsecurity.h:43:25: linux/grmsg.h: No such file or
directory
In file included from main.c:19:
kernel25compat.h:1:1: warning: &quot;minor&quot; redefined
In file included from /usr/src/linux/include/linux/fs.h:16,
                 from /usr/src/linux/include/linux/capability.h:17,
                 from /usr/src/linux/include/linux/binfmts.h:6,
                 from /usr/src/linux/include/linux/sched.h:10,
                 from /usr/src/linux/include/linux/mm.h:4,
                 from /usr/src/linux/include/linux/slab.h:14,
                 from main.c:4:
/usr/include/linux/kdev_t.h:81:1: warning: this is the location of the previous
definition
make: *** [.depend] Error 1
make: Leaving directory
`/var/tmp/portage/svgalib-1.9.16/work/svgalib-1.9.16/kernel/svgalib_helper&apos;

[more output]

cc -Wall -Wstrict-prototypes -march=athlon-tbird -O3 -pipe
-I/var/tmp/portage/svgalib-1.9.16/work/svgalib-1.9.16/inclu
de -I/var/tmp/portage/svgalib-1.9.16/work/svgalib-1.9.16/gl    -c -o mkcur.o mkcur.c
cc -o buildcsr   mkcur.o -lvgagl -lvga
mkcur.o(.text+0x244): In function `main&apos;:
: undefined reference to `vga_setcursorimage&apos;
mkcur.o(.text+0x250): In function `main&apos;:
: undefined reference to `vga_selectcursor&apos;
mkcur.o(.text+0x3fb): In function `main&apos;:
: undefined reference to `vga_setcursorposition&apos;
mkcur.o(.text+0x407): In function `main&apos;:
: undefined reference to `vga_showcursor&apos;
mkcur.o(.text+0x41e): In function `main&apos;:
: undefined reference to `vga_showcursor&apos;
mkcur.o(.text+0x49e): In function `main&apos;:
: undefined reference to `vga_showcursor&apos;
mkcur.o(.text+0x591): In function `main&apos;:
: undefined reference to `vga_setcursorimage&apos;
mkcur.o(.text+0x59d): In function `main&apos;:
: undefined reference to `vga_selectcursor&apos;
mkcur.o(.text+0x605): In function `main&apos;:
: undefined reference to `vga_initcursor&apos;
mkcur.o(.text+0x63f): In function `main&apos;:
: undefined reference to `vga_setcursorimage&apos;
mkcur.o(.text+0x64b): In function `main&apos;:
: undefined reference to `vga_selectcursor&apos;
mkcur.o(.text+0x6c6): In function `main&apos;:
: undefined reference to `vga_setcursorimage&apos;
mkcur.o(.text+0x836): In function `main&apos;:
: undefined reference to `vga_initcursor&apos;
mkcur.o(.text+0x8ec): In function `setcursor&apos;:
: undefined reference to `vga_setcursorimage&apos;
mkcur.o(.text+0x90b): In function `setcursor&apos;:
: undefined reference to `vga_setcursorimage&apos;
mkcur.o(.text+0x913): In function `setcursor&apos;:
: undefined reference to `vga_selectcursor&apos;
mkcur.o(.text+0x972): In function `setcursor&apos;:
: undefined reference to `vga_initcursor&apos;
collect2: ld returned 1 exit status
make[1]: *** [buildcsr] Error 1
make[1]: Leaving directory
`/var/tmp/portage/svgalib-1.9.16/work/svgalib-1.9.16/demos&apos;

[more output]

(cd kernel/svgalib_helper ; make modules_install )
make[1]: Entering directory
`/var/tmp/portage/svgalib-1.9.16/work/svgalib-1.9.16/kernel/svgalib_helper&apos;
cc -D__KERNEL__ -DMODULE -Wall -O2  -I/usr/src/linux/include
-DSVGALIB_HELPER_MAJOR=209   -c -o main.o main.c
In file included from /usr/src/linux/include/linux/sched.h:29,
                 from /usr/src/linux/include/linux/mm.h:4,
                 from /usr/src/linux/include/linux/slab.h:14,
                 from main.c:4:
/usr/include/linux/fs_struct.h: In function `set_fs_root&apos;:
/usr/include/linux/fs_struct.h:34: `current&apos; undeclared (first use in this function)
/usr/include/linux/fs_struct.h:34: (Each undeclared identifier is reported only once
/usr/include/linux/fs_struct.h:34: for each function it appears in.)
In file included from /usr/src/linux/include/linux/sched.h:29,
                 from /usr/src/linux/include/linux/mm.h:4,
                 from /usr/src/linux/include/linux/slab.h:14,
                 from main.c:4:
/usr/include/linux/fs_struct.h: In function `set_fs_pwd&apos;:
/usr/include/linux/fs_struct.h:57: `current&apos; undeclared (first use in this function)
In file included from /usr/src/linux/include/linux/sched.h:30,
                 from /usr/src/linux/include/linux/mm.h:4,
                 from /usr/src/linux/include/linux/slab.h:14,
                 from main.c:4:
/usr/src/linux/include/linux/grsecurity.h:12:26: linux/grdefs.h: No such file or
directory
/usr/src/linux/include/linux/grsecurity.h:43:25: linux/grmsg.h: No such file or
directory
In file included from /usr/src/linux/include/linux/mm.h:4,
                 from /usr/src/linux/include/linux/slab.h:14,
                 from main.c:4:
/usr/src/linux/include/linux/sched.h: At top level:
/usr/src/linux/include/linux/sched.h:171: warning: type mismatch with previous
implicit declaration
/usr/include/linux/fs_struct.h:62: warning: previous implicit declaration of
`preempt_schedule&apos;
/usr/src/linux/include/linux/sched.h:171: warning: `preempt_schedule&apos; was
previously implicitly declared to return `in
t&apos;
In file included from main.c:19:
kernel25compat.h:1:1: warning: &quot;minor&quot; redefined
In file included from /usr/src/linux/include/linux/fs.h:16,
                 from /usr/src/linux/include/linux/capability.h:17,
                 from /usr/src/linux/include/linux/binfmts.h:6,
                 from /usr/src/linux/include/linux/sched.h:10,
                 from /usr/src/linux/include/linux/mm.h:4,
                 from /usr/src/linux/include/linux/slab.h:14,
                 from main.c:4:
/usr/include/linux/kdev_t.h:81:1: warning: this is the location of the previous
definition
make[1]: *** [main.o] Error 1
make[1]: Leaving directory
`/var/tmp/portage/svgalib-1.9.16/work/svgalib-1.9.16/kernel/svgalib_helper&apos;
make: *** [installmodule] Error 2

!!! ERROR: media-libs/svgalib-1.9.16 failed.
!!! Function src_install, Line 48, Exitcode 2
!!! (no error message)


The funny thing is, that I have no grsecurity compiled in at all!
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>azarah@gentoo.org</who>
            <bug_when>2002-11-24 18:04:38 0000</bug_when>
            <thetext>Could be an option to disable the module support, as myself have had a few
issues to get it to
work with some boxes.  I however left it as is to check user responce (it is
after all marked
unstable).
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>azarah@gentoo.org</who>
            <bug_when>2002-12-03 11:59:25 0000</bug_when>
            <thetext>Javier, I dont have the time, so cant really test it, but is it possible for
1.9.16 to work without the kernel module ?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>azarah@gentoo.org</who>
            <bug_when>2002-12-27 15:29:19 0000</bug_when>
            <thetext>I see that they still did not have that included in svgalib-1.9.17, although
relevant bits have now moved to kernel/svgalib_helper/kernel25compat.h itself.

Is this still an issue for 1.9.17 ?
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>azarah@gentoo.org</who>
            <bug_when>2002-12-28 13:25:13 0000</bug_when>
            <thetext>*** Bug 12788 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>azarah@gentoo.org</who>
            <bug_when>2002-12-29 16:22:03 0000</bug_when>
            <thetext>Ok, svgalib-1.9.17-r1 should work fine with kernel 2.5.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>patrik@yes.nu</who>
            <bug_when>2002-12-30 11:23:24 0000</bug_when>
            <thetext>gunzipping manpages in man8
make[1]: Leaving directory
`/var/tmp/portage/svgalib-1.9.17-r1/work/svgalib-1.9.17/doc&apos;
(cd kernel/svgalib_helper ; make modules_install )
/bin/sh: line 1: [: /usr/src/linux/include: binary operator expected
grep: invalid option -- /
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help&apos; for more information.
make[1]: Entering directory
`/var/tmp/portage/svgalib-1.9.17-r1/work/svgalib-1.9.17/kernel/svgalib_helper&apos;
Makefile:6: *** commands commence before first target.  Stop.
make[1]: Leaving directory
`/var/tmp/portage/svgalib-1.9.17-r1/work/svgalib-1.9.17/kernel/svgalib_helper&apos;
make: *** [installmodule] Error 2

!!! ERROR: media-libs/svgalib-1.9.17-r1 failed.
!!! Function src_install, Line 96, Exitcode 2
!!! (no error message)
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>azarah@gentoo.org</who>
            <bug_when>2002-12-31 15:13:22 0000</bug_when>
            <thetext>Ok, I should not be so lazy, patched the Makefile and removed the hack.
Here is the ChangeLog entry:

-------------------------------
  31 Dec 2002; Martin Schlemmer &lt;azarah@gentoo.org&gt; svgalib-1.9.17-r1.ebuild :
  Ok, I should not be lazy, patch Makefile in svga_helper module, as my
  previous hack seems to fail for some people ... (bug #11092).
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>patrik@yes.nu</who>
            <bug_when>2003-01-02 04:53:18 0000</bug_when>
            <thetext>Solved for me.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>mikki@mikkifrisson.com</who>
            <bug_when>2003-01-06 20:18:38 0000</bug_when>
            <thetext>make: Entering directory
`/var/tmp/portage/svgalib-1.9.17-r1/work/svgalib-1.9.17/kernel/svgalib_helper&apos;
cc -O2 -DLINUX -Dlinux -D__KERNEL__ -DMODULE -Wall   -I/usr/src/linux/include
-DSVGALIB_HELPER_MAJOR=209 -M *.c &gt; .depend
In file included from /usr/src/linux/include/linux/fs.h:334,
                 from /usr/src/linux/include/linux/capability.h:17,
                 from /usr/src/linux/include/linux/binfmts.h:5,
                 from /usr/src/linux/include/linux/sched.h:9,
                 from /usr/src/linux/include/linux/mm.h:4,
                 from /usr/src/linux/include/linux/slab.h:14,
                 from /usr/src/linux/include/asm/pci.h:32,
                 from /usr/src/linux/include/linux/pci.h:610,
                 from interrupt.c:1:
/usr/src/linux/include/linux/xfs_fs_i.h:39: linux/vnode.h: No such file or directory
In file included from /usr/src/linux/include/linux/fs.h:385,
                 from /usr/src/linux/include/linux/capability.h:17,
                 from /usr/src/linux/include/linux/binfmts.h:5,
                 from /usr/src/linux/include/linux/sched.h:9,
                 from /usr/src/linux/include/linux/mm.h:4,
                 from /usr/src/linux/include/linux/slab.h:14,
                 from /usr/src/linux/include/asm/pci.h:32,
                 from /usr/src/linux/include/linux/pci.h:610,
                 from interrupt.c:1:
/usr/src/linux/include/linux/quota.h:138: linux/dqblk_v1.h: No such file or
directory
In file included from /usr/src/linux/include/linux/fs.h:334,
                 from /usr/src/linux/include/linux/capability.h:17,
                 from /usr/src/linux/include/linux/binfmts.h:5,
                 from /usr/src/linux/include/linux/sched.h:9,
                 from /usr/src/linux/include/linux/mm.h:4,
                 from /usr/src/linux/include/linux/slab.h:14,
                 from main.c:4:
/usr/src/linux/include/linux/xfs_fs_i.h:39: linux/vnode.h: No such file or directory
In file included from /usr/src/linux/include/linux/fs.h:385,
                 from /usr/src/linux/include/linux/capability.h:17,
                 from /usr/src/linux/include/linux/binfmts.h:5,
                 from /usr/src/linux/include/linux/sched.h:9,
                 from /usr/src/linux/include/linux/mm.h:4,
                 from /usr/src/linux/include/linux/slab.h:14,
                 from main.c:4:
/usr/src/linux/include/linux/quota.h:138: linux/dqblk_v1.h: No such file or
directory
make: *** [.depend] Error 1
make: Leaving directory
`/var/tmp/portage/svgalib-1.9.17-r1/work/svgalib-1.9.17/kernel/svgalib_helper&apos;

!!! ERROR: media-libs/svgalib-1.9.17-r1 failed.
!!! Function src_compile, Line 41, Exitcode 2
!!! Failed to build kernel module!
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>azarah@gentoo.org</who>
            <bug_when>2003-01-07 15:40:12 0000</bug_when>
            <thetext>Would help if we knew what kernel version ...
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>mikki@mikkifrisson.com</who>
            <bug_when>2003-01-08 21:07:32 0000</bug_when>
            <thetext>Stand by. It looks like I may have done an emerge -u on my kernel sources, and
/usr/src/linux is still pointing to the old (patched) version, which portage
decided to clean out. Doh!

Mikki</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>mikki@mikkifrisson.com</who>
            <bug_when>2003-01-09 00:32:57 0000</bug_when>
            <thetext>Yup, that was it. Works fine for me now...

Sorry about that.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>henti@geekware.co.za</who>
            <bug_when>2003-01-22 07:52:28 0000</bug_when>
            <thetext>Found the same problem with svgalib-1.9.17-r1.
Problem solved once /usr/src/linux is linked to latest kernel and 
run make menu/x/config and saved kernel

Henti </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>diegoliz@gmail.com</who>
            <bug_when>2003-03-02 10:23:26 0000</bug_when>
            <thetext>Again a kernel version issue.

---
Linux nuovo.casa.it 2.5.47-ac5 #3 Fri Nov 15 23:36:40 CET 2002 i686 Pentium II (Klamath) GenuineIntel GNU/Linux

!!! ERROR: media-libs/svgalib-1.9.17-r1 failed.
!!! Function check_kernel, Line 54, Exitcode 1
!!! Cannot find kernel includes!
---

check_kernel is looking for /usr/src/linux/include/asm/mach-{default|generic}
but in kenerl 2.5.47 there is none of them.

Probably they are just in newer kernels.

The point is that
I&apos;ve tried also with the stable 2.4.20 includes, but check_kernel checks
the major.minor version of the running kernel instead
of getting it from version.h

That is to compile svgalib I should reboot the computer with 2.4.20
otherwise I can&apos;t.

Should this be considered a bug?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>azarah@gentoo.org</who>
            <bug_when>2003-03-03 13:10:38 0000</bug_when>
            <thetext>Its changes to the api, not missing dirs.  If you look, you do have a
include/asm/mach-default with 2.5.58 and later i think.

----------------------------------------
nosferatu root # ls /usr/src/linux/include/asm/mach-default/ -ld
drwxrwxr-x    2 1046     101          4096 Feb 24 21:06 /usr/src/linux/include/asm/mach-default/
nosferatu root # uname -r
2.5.63bk2
nosferatu root # 
----------------------------------------

The actual error:

----------------------------------------
gcc -O2 -DLINUX -Dlinux -D__KERNEL__ -DMODULE -Wall   -I/usr/src/linux/include -I/usr/src/linux/include/asm/mach-default -DSVGALIB_HELPER_MAJOR=209   -c -o main.o main.c
main.c: In function `svgalib_helper_ioctl&apos;:
main.c:298: warning: implicit declaration of function `request_irq&apos;
main.c:315: warning: implicit declaration of function `free_irq&apos;
main.c:109: warning: `i&apos; might be used uninitialized in this function
main.c: In function `svgalib_helper_open&apos;:
main.c:338: warning: `_MOD_INC_USE_COUNT&apos; is deprecated (declared at /usr/src/linux/include/linux/module.h:462)
main.c: In function `svgalib_helper_release&apos;:
main.c:344: warning: `__MOD_DEC_USE_COUNT&apos; is deprecated (declared at /usr/src/linux/include/linux/module.h:437)
main.c: In function `init_module&apos;:
main.c:442: warning: implicit declaration of function `devfs_register_chrdev&apos;
main.c:457: warning: implicit declaration of function `devfs_register_series&apos;
main.c:461: warning: implicit declaration of function `devfs_auto_unregister&apos;
main.c:515: `EXPORT_NO_SYMBOLS&apos; undeclared (first use in this function)
main.c:515: (Each undeclared identifier is reported only once
main.c:515: for each function it appears in.)
main.c:522: warning: implicit declaration of function `devfs_unregister_chrdev&apos;
make: *** [main.o] Error 1
-----------------------------------------

Like I said, API changes ...</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>diegoliz@gmail.com</who>
            <bug_when>2003-03-03 15:31:17 0000</bug_when>
            <thetext>I know, and what about checking the installed kernel sources instead
of the running kernel? At least people running kernel 2.5 can compile it
installing a 2.4 without needing a 2.4 kernel running.

Here&apos;s the patch.

--- svgalib-1.9.17-r1.ebuild    2003-03-03 20:57:48.000000000 +0100
+++ new/svgalib-1.9.17-r1.ebuild        2003-03-03 21:23:54.000000000 +0100
@@ -35,8 +35,8 @@
                                                                                                                             
 check_kernel() {
                                                                                                                             
-       local KV_MAJOR=&quot;`uname -r | cut -d. -f1`&quot;
-       local KV_MINOR=&quot;`uname -r | cut -d. -f2`&quot;
+       local KV_MAJOR=&quot;`sed -n -e &apos;s/^VERSION = \([0-9]*\)$/\1/p&apos;  /usr/src/linux/Makefile`&quot;
+       local KV_MINOR=&quot;`sed -n -e &apos;s/^PATCHLEVEL = \([0-9]*\)$/\1/p&apos;  /usr/src/linux/Makefile`&quot;
        export INCLUDEDIR=&quot;/usr/src/linux/include&quot;
                                                                                                                             
        # Are we running kernel 2.5 ?

----
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>azarah@gentoo.org</who>
            <bug_when>2003-03-05 14:58:47 0000</bug_when>
            <thetext>Ok, so how is going to get it compiled, but not being able to load the module
anyhow going to help you ?
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>diegoliz@gmail.com</who>
            <bug_when>2003-03-05 18:31:07 0000</bug_when>
            <thetext>Good point.

Now there is just one check if the running kernel is a 2.4 or a 2.5
and if it&apos;s a 2.5, the INCLUDEDIR is set for kernels &gt;=2.5.58
(assuming that the include dir asm/mach-* is there with those versions).

But there is NO check if the /usr/src/linux/ is the one
of the running kernel.

So my patch didn&apos;t change things so much.
If you like more I can just add the check of the sublevel for 2.5.* like that:

----
--- svgalib-1.9.17-r1.ebuild    2003-03-03 20:57:48.000000000 +0100
+++ new2/svgalib-1.9.17-r1.ebuild       2003-03-06 00:13:36.000000000 +0100
@@ -37,10 +37,11 @@
         
        local KV_MAJOR=&quot;`uname -r | cut -d. -f1`&quot;
        local KV_MINOR=&quot;`uname -r | cut -d. -f2`&quot;
+       local KV_SUBLEVEL=&quot;`uname -r|sed -n -e &apos;s/[0-9]*\.[0-9]*\.\([0-9]*\).*/\1/p&apos;`&quot;
        export INCLUDEDIR=&quot;/usr/src/linux/include&quot;
  
-       # Are we running kernel 2.5 ?
-       if [ &quot;${KV_MAJOR}${KV_MINOR}&quot; -gt &quot;24&quot; ]
+       # Are we running kernel 2.5 &gt; 2.5.57 ?
+       if [ &quot;${KV_MAJOR}${KV_MINOR}&quot; -gt &quot;24&quot; -a $(KV_SUBLEVEL) -gt &quot;57&quot; ]
        then
                # Setup the proper mach include directory ...
                if [ -d ${INCLUDEDIR}/asm/mach-default ]
----

This way it works also for my 2.5.47, but there is still no check if the
module is built for the running kernel.

In my opinion it makes no sense to set the include path of the
installed kernel according to the one that is currently running
without knowing if they are the same.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>bedeox@emil.teleton.pl</who>
            <bug_when>2003-04-13 00:52:51 0000</bug_when>
            <thetext>Here is a dumb patch for svgalib_helper (seems to work...)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>bedeox@emil.teleton.pl</who>
            <bug_when>2003-04-13 00:58:48 0000</bug_when>
            <thetext>Created an attachment (id=10577)
svgalib_helper patch

This is a dumb patch, but seems to work.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>qubex@punkass.com</who>
            <bug_when>2003-04-17 15:14:14 0000</bug_when>
            <thetext>Bedeox, your patch work wonderfully for the devfs stuff, but it fails with what looks like an 
improper usage of grep: 
 
make: Entering directory `/var/tmp/portage/svgalib-1.9.17-r1/work/svgalib-1.9.17/threeDKit&apos; 
rm -f lib3dkit.a 
ar rcs lib3dkit.a 
make: Leaving directory `/var/tmp/portage/svgalib-1.9.17-r1/work/svgalib-1.9.17/threeDKit&apos; 
/bin/sh: line 1: [: /usr/src/linux/include: binary operator expected 
grep: invalid option -- / 
Usage: grep [OPTION]... PATTERN [FILE]... 
Try `grep --help&apos; for more information. 
make: Entering directory 
`/var/tmp/portage/svgalib-1.9.17-r1/work/svgalib-1.9.17/kernel/svgalib_helper&apos; 
Makefile:6: *** commands commence before first target.  Stop. 
make: Leaving directory 
`/var/tmp/portage/svgalib-1.9.17-r1/work/svgalib-1.9.17/kernel/svgalib_helper&apos; 
 
!!! ERROR: media-libs/svgalib-1.9.17-r1 failed. 
!!! Function src_compile, Line 77, Exitcode 2 
!!! Failed to build kernel module! 
 </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>chris@whyland.net</who>
            <bug_when>2003-04-22 10:44:51 0000</bug_when>
            <thetext>I&apos;m getting same error as well, using development-souces with latest kernel patch from linuxhq.com

Get same error:

!!! ERROR: media-libs/svgalib-1.9.17-r1 failed. 
!!! Function src_compile, Line 77, Exitcode 2 
!!! Failed to build kernel module! 
 </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>azarah@gentoo.org</who>
            <bug_when>2003-08-04 13:54:45 0000</bug_when>
            <thetext>svgalib-1.9.17-r2 should fix all these (note only for 2.6 kernel).
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>wshekrota@nc.rr.com</who>
            <bug_when>2005-05-05 05:58:30 0000</bug_when>
            <thetext>2.6.11-r6 kernel
2005.0 new install (emerge w/ no options used)
fails on emerge of lib3d kit
topmost error looks like ...

install -c-m 755 -o root -g bin so.lib3dkit.1.9.19 /var/tmp/portage/svgalib-1.9.19-r3/image//usr/lib/lib3dkit.so.1.9.19

install: invalid option -- -

==
this error seem to have been around a while?
How do I get past it within the realm of gentoo?
-Walt</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>wshekrota@nc.rr.com</who>
            <bug_when>2005-05-05 06:14:20 0000</bug_when>
            <thetext>2.6.11-r6 kernel
2005.0 new install (emerge w/ no options used)
fails on emerge of lib3d kit
topmost error looks like ...

install -c-m 755 -o root -g bin so.lib3dkit.1.9.19 /var/tmp/portage/svgalib-1.9.19-r3/image//usr/lib/lib3dkit.so.1.9.19

install: invalid option -- -

==
this error seem to have been around a while?
How do I get past it within the realm of gentoo?
-Walt</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>10577</attachid>
            <date>2003-04-13 00:58 0000</date>
            <desc>svgalib_helper patch</desc>
            <filename>svgalib_helper-kernel2.5.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIGtlcm5lbC9zdmdhbGliX2hlbHBlci9tYWluLmMub3JpZwkyMDAzLTA0LTEzIDA2OjQzOjQy
LjgwNTg3NjM2MCArMDIwMAorKysga2VybmVsL3N2Z2FsaWJfaGVscGVyL21haW4uYwkyMDAzLTA0
LTEzIDA2OjQyOjUyLjc3NjQ4MTk4NCArMDIwMApAQCAtNDU3LDcgKzQ1NywxMiBAQAogICAgIGRl
dmZzX3JlZ2lzdGVyX3NlcmllcyggZGV2ZnNfaGFuZGxlLAogICAgICAgICAgICAgICAgIiV1Iiwg
OCwgREVWRlNfRkxfREVGQVVMVCwgU1ZHQUxJQl9IRUxQRVJfTUFKT1IsIDAsCiAgICAgICAgICAg
ICAgICAgICAgICAgIFNfSUZDSFIgfCAgU19JUlVHTyB8IFNfSVJXWFUsICZzdmdhbGliX2hlbHBl
cl9mb3BzLCBOVUxMICkgOwotICAgIGRldmZzX21rX3N5bWxpbmsoIE5VTEwsICJzdmdhIiwgMCwg
InN2Z2FfaGVscGVyLzAiLCAmc2xhdmVfaGFuZGxlLCBOVUxMICk7CisgICAgCisgICAgI2lmIExJ
TlVYX1ZFUlNJT05fQ09ERSA8IEtFUk5FTF9WRVJTSU9OKDIsNSwwKQorICAgIAlkZXZmc19ta19z
eW1saW5rKCBOVUxMLCAic3ZnYSIsIDAsICJzdmdhX2hlbHBlci8wIiwgJnNsYXZlX2hhbmRsZSwg
TlVMTCApOworICAgICNlbHNlCisgICAgCWRldmZzX21rX3N5bWxpbmsoIE5VTEwsICJzdmdhIiAp
OworICAgICNlbmRpZgogICAgIGRldmZzX2F1dG9fdW5yZWdpc3RlciggZGV2ZnNfaGFuZGxlLCBz
bGF2ZV9oYW5kbGUgKTsKICNlbmRpZiAvKiBkZXZmc2Qgc3VwcG9ydCAqLwogCkBAIC01MTIsNyAr
NTE3LDkgQEAKIAogICAgIGluaXRfd2FpdHF1ZXVlX2hlYWQoJnZzeW5jX3dhaXQpOwogCisgICAg
I2lmIExJTlVYX1ZFUlNJT05fQ09ERSA8IEtFUk5FTF9WRVJTSU9OKDIsNSwwKQogICAgIEVYUE9S
VF9OT19TWU1CT0xTOworICAgICNlbmRpZgogCiAgICAgcmV0dXJuIDA7IC8qIHN1Y2NlZWQgKi8K
IAo=
</data>        

          </attachment>
    </bug>

</bugzilla>