Diffstat (limited to 'qt/qt-2.3.10.patch/devfs.patch') (more/less context) (ignore whitespace changes)
-rw-r--r-- | qt/qt-2.3.10.patch/devfs.patch | 163 |
1 files changed, 163 insertions, 0 deletions
diff --git a/qt/qt-2.3.10.patch/devfs.patch b/qt/qt-2.3.10.patch/devfs.patch new file mode 100644 index 0000000..27ea423 --- a/dev/null +++ b/qt/qt-2.3.10.patch/devfs.patch | |||
@@ -0,0 +1,163 @@ | |||
1 | |||
2 | # | ||
3 | # Patch managed by http://www.holgerschurig.de/patcher.html | ||
4 | # | ||
5 | |||
6 | --- qt-2.3.9-snapshot-20050114/configure~devfs | ||
7 | +++ qt-2.3.9-snapshot-20050114/configure | ||
8 | @@ -412,6 +412,9 @@ | ||
9 | -visibility-hidden) | ||
10 | VISIBILITY=YES | ||
11 | ;; | ||
12 | + -devfs) | ||
13 | + DEVFS=yes | ||
14 | +;; | ||
15 | -no-g++-exceptions) | ||
16 | GPLUSPLUS_EXCEPTIONS=no | ||
17 | ;; | ||
18 | @@ -1302,6 +1305,8 @@ | ||
19 | -visibility-hidden . Use -fvisibility=hidden as default. This requires GCC 4.0 | ||
20 | or a special patched GCC to support the visibility attribute | ||
21 | |||
22 | + -devfs ............. Use devfs /dev paths. | ||
23 | + | ||
24 | -no-g++-exceptions . Disable exceptions on platforms using the GNU C++ | ||
25 | compiler by using the -fno-exceptions flag. | ||
26 | |||
27 | @@ -1374,6 +1379,10 @@ | ||
28 | then | ||
29 | QT_CXX="${QT_CXX} -DGCC_SUPPORTS_VISIBILITY -fvisibility=hidden" | ||
30 | fi | ||
31 | +if [ "x$DEVFS" = "xyes" ] | ||
32 | +then | ||
33 | + QT_CXX="${QT_CXX} -DQT_QWS_DEVFS" | ||
34 | +fi | ||
35 | if [ "x$THREAD" = "xyes" ] | ||
36 | then | ||
37 | cat >src-mt.mk <<EOF | ||
38 | --- qt-2.3.9-snapshot-20050114/src/kernel/qgfxlinuxfb_qws.cpp~devfs | ||
39 | +++ qt-2.3.9-snapshot-20050114/src/kernel/qgfxlinuxfb_qws.cpp | ||
40 | @@ -101,11 +101,19 @@ | ||
41 | bool QLinuxFbScreen::connect( const QString &displaySpec ) | ||
42 | { | ||
43 | // Check for explicitly specified device | ||
44 | +#ifdef QT_QWS_DEVFS | ||
45 | + QRegExp r( "/dev/fb/[0-9]+" ); | ||
46 | +#else | ||
47 | QRegExp r( "/dev/fb[0-9]+" ); | ||
48 | +#endif | ||
49 | int len; | ||
50 | int m = r.match( displaySpec, 0, &len ); | ||
51 | |||
52 | +#ifdef QT_QWS_DEVFS | ||
53 | + QString dev = (m>=0) ? displaySpec.mid( m, len ) : QString("/dev/fb/0"); | ||
54 | +#else | ||
55 | QString dev = (m>=0) ? displaySpec.mid( m, len ) : QString("/dev/fb0"); | ||
56 | +#endif | ||
57 | |||
58 | fd=open( dev.latin1(), O_RDWR ); | ||
59 | if (fd<0) { | ||
60 | @@ -121,14 +129,22 @@ | ||
61 | |||
62 | /* Get fixed screen information */ | ||
63 | if (ioctl(fd, FBIOGET_FSCREENINFO, &finfo)) { | ||
64 | +#ifdef QT_QWS_DEVFS | ||
65 | +perror("reading /dev/fb/0"); | ||
66 | +#else | ||
67 | perror("reading /dev/fb0"); | ||
68 | +#endif | ||
69 | qWarning("Error reading fixed information"); | ||
70 | return FALSE; | ||
71 | } | ||
72 | |||
73 | /* Get variable screen information */ | ||
74 | if (ioctl(fd, FBIOGET_VSCREENINFO, &vinfo)) { | ||
75 | +#ifdef QT_QWS_DEVFS | ||
76 | +perror("reading /dev/fb/0"); | ||
77 | +#else | ||
78 | perror("reading /dev/fb0"); | ||
79 | +#endif | ||
80 | qWarning("Error reading variable information"); | ||
81 | return FALSE; | ||
82 | } | ||
83 | @@ -165,7 +181,11 @@ | ||
84 | data += dataoffset; | ||
85 | |||
86 | if ((int)data == -1) { | ||
87 | -perror("mapping /dev/fb0"); | ||
88 | +#ifdef QT_QWS_DEVFS | ||
89 | +perror("reading /dev/fb/0"); | ||
90 | +#else | ||
91 | +perror("reading /dev/fb0"); | ||
92 | +#endif | ||
93 | qWarning("Error: failed to map framebuffer device to memory."); | ||
94 | return FALSE; | ||
95 | } | ||
96 | @@ -229,7 +249,11 @@ | ||
97 | |||
98 | static void writeTerm(const char* termctl, int sizeof_termctl) | ||
99 | { | ||
100 | +#ifdef QT_QWS_DEVFS | ||
101 | + const char* tt[]={"/dev/vc/1","/dev/console","/dev/tty",0}; | ||
102 | +#else | ||
103 | const char* tt[]={"/dev/console","/dev/tty","/dev/tty0",0}; | ||
104 | +#endif | ||
105 | const char** dev=tt; | ||
106 | while (*dev) { | ||
107 | int tty=::open(*dev,O_WRONLY); | ||
108 | @@ -792,7 +816,11 @@ | ||
109 | fb_var_screeninfo vinfo; | ||
110 | |||
111 | if (ioctl(fd, FBIOGET_FSCREENINFO, &finfo)) { | ||
112 | +#ifdef QT_QWS_DEVFS | ||
113 | +perror("reading /dev/fb/0"); | ||
114 | +#else | ||
115 | perror("reading /dev/fb0"); | ||
116 | +#endif | ||
117 | qFatal("Error reading fixed information"); | ||
118 | } | ||
119 | |||
120 | --- qt-2.3.9-snapshot-20050114/src/kernel/qkeyboard_qws.cpp~devfs | ||
121 | +++ qt-2.3.9-snapshot-20050114/src/kernel/qkeyboard_qws.cpp | ||
122 | @@ -1192,7 +1192,11 @@ | ||
123 | |||
124 | QWSTtyKeyboardHandler::QWSTtyKeyboardHandler(const QString& device) | ||
125 | { | ||
126 | +#ifdef QT_QWS_DEVFS | ||
127 | + kbdFD=open(device.isEmpty() ? "/dev/vc/1" : device.latin1(), O_RDWR | O_NDELAY, 0); | ||
128 | +#else | ||
129 | kbdFD=open(device.isEmpty() ? "/dev/tty0" : device.latin1(), O_RDWR | O_NDELAY, 0); | ||
130 | +#endif | ||
131 | |||
132 | if ( kbdFD >= 0 ) { | ||
133 | QSocketNotifier *notifier; | ||
134 | --- qt-2.3.9-snapshot-20050114/src/kernel/qwindowsystem_qws.cpp~devfs | ||
135 | +++ qt-2.3.9-snapshot-20050114/src/kernel/qwindowsystem_qws.cpp | ||
136 | @@ -836,7 +836,11 @@ | ||
137 | void openDevice() | ||
138 | { | ||
139 | if ( !sn ) { | ||
140 | +#ifdef QT_QWS_DEVFS | ||
141 | + int fd = ::open("/dev/sound/dsp",O_RDWR); | ||
142 | +#else | ||
143 | int fd = ::open("/dev/dsp",O_RDWR); | ||
144 | +#endif | ||
145 | if ( fd < 0 ) { | ||
146 | // For debugging purposes - defined QT_NO_SOUND if you | ||
147 | // don't have sound hardware! | ||
148 | --- qt-2.3.9-snapshot-20050114/src/kernel/qsoundqss_qws.cpp~devfs | ||
149 | +++ qt-2.3.9-snapshot-20050114/src/kernel/qsoundqss_qws.cpp | ||
150 | @@ -1088,7 +1088,12 @@ | ||
151 | // Don't block open right away. | ||
152 | // | ||
153 | bool openOkay = false; | ||
154 | - if ((fd = ::open("/dev/dsp", O_WRONLY|O_NONBLOCK)) != -1) { | ||
155 | +#ifdef QT_QWS_DEVFS | ||
156 | + if ((fd = ::open("/dev/sound/dsp", O_WRONLY|O_NONBLOCK)) != -1) | ||
157 | +#else | ||
158 | + if ((fd = ::open("/dev/dsp", O_WRONLY|O_NONBLOCK)) != -1) | ||
159 | +#endif | ||
160 | + { | ||
161 | int flags = fcntl(fd, F_GETFL); | ||
162 | flags &= ~O_NONBLOCK; | ||
163 | openOkay = (fcntl(fd, F_SETFL, flags) == 0); | ||