Discussion:
Tiny patch for mga_vid to compile against 2.6.19 kernel
Jan Kozanek
2007-01-07 22:42:23 UTC
Permalink
Hi list,

the 2.6.19 vanilla tree has really omitted the deprecated
include/linux/config.h, thus mga_vid won't compile with the error
mentioned previously in here:
http://lists.mplayerhq.hu/pipermail/mplayer-matrox/2006-November/000319.html

Below is a tiny patch for mga_vid.c to compile against a 2.6.19 kernel.

--<CUT>---
--- mga_vid-2.6.18/mga_vid.c 2006-09-27 18:32:13.000000000 +0200
+++ mga_vid-2.6.19/mga_vid.c 2007-01-07 23:24:17.000000000 +0100
@@ -42,7 +42,7 @@
//use the 'major' parameter to override the default major number (83)
/* mknod /dev/mga_vid c 83 0 */

-#include <linux/config.h>
+#include <linux/autoconf.h>
#include <linux/version.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
--<CUT>---
--
S pozdravem/Best Regards,
Jan Kozanek
Tamas, Gergely
2007-01-08 18:37:36 UTC
Permalink
Hi,
Post by Jan Kozanek
Below is a tiny patch for mga_vid.c to compile against a 2.6.19 kernel.
--<CUT>---
--- mga_vid-2.6.18/mga_vid.c 2006-09-27 18:32:13.000000000 +0200
+++ mga_vid-2.6.19/mga_vid.c 2007-01-07 23:24:17.000000000 +0100
@@ -42,7 +42,7 @@
//use the 'major' parameter to override the default major number (83)
/* mknod /dev/mga_vid c 83 0 */
-#include <linux/config.h>
+#include <linux/autoconf.h>
#include <linux/version.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
--<CUT>---
Why do you need 'linux/autoconf.h' ?

[***@neptune ~]$ cat /usr/include/linux/autoconf.h
#include <linux/err_kernel_only.h>

Simply comment out the 'linux/config.h' line.

What about something like :

--- <<< --- <<< --- <<< ---
Index: mga_vid.c
===================================================================
--- mga_vid.c (revision 250)
+++ mga_vid.c (working copy)
@@ -42,8 +42,12 @@
//use the 'major' parameter to override the default major number (83)
/* mknod /dev/mga_vid c 83 0 */

+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
#include <linux/config.h>
-#include <linux/version.h>
+#endif
+
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kobject.h>
--- <<< --- <<< --- <<< ---

Gergely
Attila Kinali
2007-01-08 23:57:15 UTC
Permalink
On Mon, 8 Jan 2007 19:37:36 +0100
Post by Tamas, Gergely
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
#include <linux/config.h>
-#include <linux/version.h>
+#endif
+
I don't want this ifdef hell we had in the "old"
mga_vid again. If removing config.h is enough,
then just remove it. I don't care much about
backward compatibility as we have for these
cases the snapshots on the webpage.

If it works for you, feel free to commit.

Attila Kinali
--
Lotus Notes ist eine verteilte Datenbankapplikation,
als Sample ist eine miese Groupware dabei ;)
-- Lukas Beeler
Jan Kozanek
2007-01-09 00:01:43 UTC
Permalink
Post by Tamas, Gergely
Hi,
Post by Jan Kozanek
Below is a tiny patch for mga_vid.c to compile against a 2.6.19 kernel.
--<CUT>---
--- mga_vid-2.6.18/mga_vid.c 2006-09-27 18:32:13.000000000 +0200
+++ mga_vid-2.6.19/mga_vid.c 2007-01-07 23:24:17.000000000 +0100
@@ -42,7 +42,7 @@
//use the 'major' parameter to override the default major number (83)
/* mknod /dev/mga_vid c 83 0 */
-#include <linux/config.h>
+#include <linux/autoconf.h>
#include <linux/version.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
--<CUT>---
Why do you need 'linux/autoconf.h' ?
#include <linux/err_kernel_only.h>
Simply comment out the 'linux/config.h' line.
It would probably be better, definitely with the version check. I tried
to emulate the 2.6.18 linux/config.h behavior on 2.6.19 by the tiny
patch. Maybe it's already fully obsolete and can be omitted fully.
Post by Tamas, Gergely
cat linux-2.6.18.2/include/linux/config.h
#ifndef _LINUX_CONFIG_H
#define _LINUX_CONFIG_H
/* This file is no longer in use and kept only for backward compatibility.
* autoconf.h is now included via -imacros on the commandline
*/
#include <linux/autoconf.h>
#endif
--
S pozdravem/Best Regards,
Jan Kozánek
Loading...