I'm trying to get zaptel 1.0.2 compiled on FC2 or FC3 and I'm getting compile time errors. Systems include: FC2: Linux xxxxxxxxxxxx 2.6.9-1.3_FC2 #1 Mon Nov 15 14:46:43 EST 2004 i686 i686 i386 GNU/Linux FC3: Linux xxxxxxxxxxxx 2.6.9-1.681_FC3 #1 Thu Nov 18 15:13:22 EST 2004 x86_64 x86_64 x86_64 GNU/Linux /usr/home/bwright/zaptel-1.0.2> make linux26 ... make -C /usr/src/linux-2.6 SUBDIRS=/usr/home/bwright/zaptel-1.0.2 modules make[1]: Entering directory `/usr/src/linux-2.6.9' Makefile:461: .config: No such file or directory CC [M] /usr/home/bwright/zaptel-1.0.2/zaptel.o In file included from /usr/home/bwright/zaptel-1.0.2/zconfig.h:9, from /usr/home/bwright/zaptel-1.0.2/zaptel.c:40: include/linux/config.h:4:28: linux/autoconf.h: No such file or directory In file included from /usr/home/bwright/zaptel-1.0.2/zaptel.c:40: /usr/home/bwright/zaptel-1.0.2/zconfig.h:10:27: linux/version.h: No such file or directory /usr/home/bwright/zaptel-1.0.2/zconfig.h:66:41: missing binary operator before token "(" In file included from include/linux/kernel.h:11, from /usr/home/bwright/zaptel-1.0.2/zaptel.c:42: include/linux/linkage.h:5:25: asm/linkage.h: No such file or directory In file included from include/linux/types.h:13, from include/linux/kernel.h:13, from /usr/home/bwright/zaptel-1.0.2/zaptel.c:42: include/linux/posix_types.h:47:29: asm/posix_types.h: No such file or directory In file included from include/linux/kernel.h:13, from /usr/home/bwright/zaptel-1.0.2/zaptel.c:42: include/linux/types.h:14:23: asm/types.h: No such file or directory In file included from include/linux/kernel.h:13, from /usr/home/bwright/zaptel-1.0.2/zaptel.c:42: include/linux/types.h:18: error: syntax error before "__kernel_dev_t" include/linux/types.h:18: warning: type defaults to `int' in declaration of `__kernel_dev_t' include/linux/types.h:18: warning: data definition has no type or storage class include/linux/types.h:21: error: syntax error before "dev_t" include/linux/types.h:21: warning: type defaults to `int' in declaration of `dev_t' include/linux/types.h:21: warning: data definition has no type or storage class include/linux/types.h:22: error: syntax error before "ino_t" include/linux/types.h:22: warning: type defaults to `int' in declaration of `ino_t' include/linux/types.h:22: warning: data definition has no type or storage class [long errors blah blah blah snipped] What appears to be happening is that the #include statement is trying to include linux/*.h from both /usr/src/linux-2.6/include/linux and /usr/include/linux. Apparently, this conflicting include directory namespace doesn't work when compiling kernel drivers on Fedora Core. So, it appears to be ignoring /usr/include/linux entirely. The compile, thus, fails finding autoconf.h, version.h and possibly other header files located in /usr/include/linux which shouldn't be in /usr/src/linux-2.6/include/linux. The other thing I've noticed is the following: >more /usr/include/linux/autoconf.h #error Invalid kernel header included in userspace >more /usr/include/linux/config.h #ifndef _LINUX_CONFIG_H #define _LINUX_CONFIG_H #ifdef __KERNEL__ #error Incorrectly using glibc headers for a kernel module #endif #endif Clearly, if creating a kernel driver on FC2 or FC3, they don't really want you including these header files anyway and will error out anyway if you do manage to include them. So, I'd have to say that the zaptel drivers are going to need a bit of work to compile properly under FC2 or FC3 anyway. This might also explain why the compiler is ignoring /usr/include/linux. So, is there any way around this problem? I've already had my hand at editing the Makefile, but I can't seem to make it do anything different than this. If anyone has any ideas, please let me know. I'd like to get this driver compiled. Thanks. -- Brian Wright <bwright@boomerang.com> Manager of Network Operations Boomerang.com 650-798-1017
Nathan Bowyer
2004-Nov-29 18:37 UTC
[Asterisk-Users] Compiling zaptel 1.0.2 on Fedora Core
On Mon, 29 Nov 2004 17:08:23 -0800, Brian Wright <bwright@boomerang.com> wrote:> I'm trying to get zaptel 1.0.2 compiled on FC2 or FC3 and I'm getting > compile time errors. Systems include: > > FC2: Linux xxxxxxxxxxxx 2.6.9-1.3_FC2 #1 Mon Nov 15 14:46:43 EST 2004 > i686 i686 i386 GNU/Linux > FC3: Linux xxxxxxxxxxxx 2.6.9-1.681_FC3 #1 Thu Nov 18 15:13:22 EST 2004 > x86_64 x86_64 x86_64 GNU/Linux > > /usr/home/bwright/zaptel-1.0.2> make linux26 > ... > make -C /usr/src/linux-2.6 SUBDIRS=/usr/home/bwright/zaptel-1.0.2 modules > make[1]: Entering directory `/usr/src/linux-2.6.9' > Makefile:461: .config: No such file or directory > CC [M] /usr/home/bwright/zaptel-1.0.2/zaptel.o > In file included from /usr/home/bwright/zaptel-1.0.2/zconfig.h:9, > from /usr/home/bwright/zaptel-1.0.2/zaptel.c:40: > include/linux/config.h:4:28: linux/autoconf.h: No such file or directory > In file included from /usr/home/bwright/zaptel-1.0.2/zaptel.c:40: > /usr/home/bwright/zaptel-1.0.2/zconfig.h:10:27: linux/version.h: No such > file or directory[snip]> > What appears to be happening is that the #include statement is trying to > include linux/*.h from both /usr/src/linux-2.6/include/linux and > /usr/include/linux. Apparently, this conflicting include directory > namespace doesn't work when compiling kernel drivers on Fedora Core. > So, it appears to be ignoring /usr/include/linux entirely. The compile, > thus, fails finding autoconf.h, version.h and possibly other header > files located in /usr/include/linux which shouldn't be in > /usr/src/linux-2.6/include/linux. > > The other thing I've noticed is the following: > > >more /usr/include/linux/autoconf.h > #error Invalid kernel header included in userspace > > >more /usr/include/linux/config.h > #ifndef _LINUX_CONFIG_H > #define _LINUX_CONFIG_H > > #ifdef __KERNEL__ > #error Incorrectly using glibc headers for a kernel module > #endif > > #endif > > Clearly, if creating a kernel driver on FC2 or FC3, they don't really > want you including these header files anyway and will error out anyway > if you do manage to include them. So, I'd have to say that the zaptel > drivers are going to need a bit of work to compile properly under FC2 or > FC3 anyway. This might also explain why the compiler is ignoring > /usr/include/linux. > > So, is there any way around this problem? I've already had my hand at > editing the Makefile, but I can't seem to make it do anything different > than this. If anyone has any ideas, please let me know. I'd like to > get this driver compiled. >Did you make the symlink from /usr/src/linux-2.6 to /lib/modules/`uname -r`/build/? As stated in README.Linux26, it says that creating a kernel module no longer requires the full kernel source to compile against. Do that and it should work. Its worked for me on both FC2 and FC3. Nathan
Nicolás Gudiño
2004-Nov-30 10:18 UTC
[Asterisk-Users] Compiling zaptel 1.0.2 on Fedora Core
Hello,> I'm trying to get zaptel 1.0.2 compiled on FC2 or FC3 and I'm getting > compile time errors. Systems include:[snip]> In file included from /usr/home/bwright/zaptel-1.0.2/zaptel.c:40: > /usr/home/bwright/zaptel-1.0.2/zconfig.h:10:27: linux/version.h: No such > file or directory[snip] Copied straight from the wiki (search for fedora): cd /usr/src (or make sure you are in your source directory) cp configs/config-for-my-kernel .config make oldconfig make include/asm make include/linux/version.h make SUBDIRS=scripts It worked for me last night. Regards, -- Nicol?s Gudi?o Buenos Aires - Argentina