在CentOS5.6编译DAHDI的时候会遇到如下报错:
include/linux/device.h:407: error: expected identifier or '(' before 'const'
make[3]: *** [/usr/src/rpm/BUILD/dahdi-linux-kmod-2.4.0/_kmod_build_/drivers/dahdi/xpp/card_bri.o] Error 1
make[2]: *** [/usr/src/rpm/BUILD/dahdi-linux-kmod-2.4.0/_kmod_build_/drivers/dahdi/xpp] Error 2
make[1]: *** [_module_/usr/src/rpm/BUILD/dahdi-linux-kmod-2.4.0/_kmod_build_/drivers/dahdi] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.18-238.5.1.el5-i686'
将下面的补丁打上就可以了编译通过了:
patch:
--------------------------------------------------------------
--- include/dahdi/kernel.h 2010-08-19 20:03:25.000000000 +0200
+++ include/dahdi/kernel.h 2011-03-18 11:32:32.000000000 +0100
@@ -86,7 +86,9 @@
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
-#define dev_name(dev) (dev)->bus_id
+#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5,6)
+#define dev_name(dev) (dev)->bus_id
+#endif
#define dev_set_name(dev, format, ...) \
snprintf((dev)->bus_id, BUS_ID_SIZE, format, ## __VA_ARGS__);
#endif
----------------------------------------------------
Cheers!
MSN:yangjiazhi@live.com
Website:www.voipevents.com