1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
|
--- configure.~1~ 2004-09-09 19:22:25.000000000 +1000
+++ qt-2.3.9/configure 2004-09-13 18:35:41.000000000 +1000
@@ -406,6 +406,9 @@
-kde)
KDE=yes
;;
+ -devfs)
+ DEVFS=yes
+ ;;
-no-g++-exceptions)
GPLUSPLUS_EXCEPTIONS=no
;;
@@ -1290,6 +1293,8 @@
set to point to a KDE 2 installation.
See http://www.kde.org
+ -devfs ............. Use devfs /dev paths.
+
-no-g++-exceptions . Disable exceptions on platforms using the GNU C++
compiler by using the -fno-exceptions flag.
@@ -1353,6 +1358,10 @@
[ "x$SM" = "xno" ] && QT_CXX="${QT_CXX} -DQT_NO_SM_SUPPORT"
[ "x$XFT" = "xyes" ] && QT_CXX="${QT_CXX} -DQT_XFT"
[ "x$XFT" = "xno" ] && QT_CXX="${QT_CXX} -DQT_NO_XKB"
+if [ "x$DEVFS" = "xyes" ]
+then
+ QT_CXX="${QT_CXX} -DQT_QWS_DEVFS"
+fi
if [ "x$THREAD" = "xyes" ]
then
cat >src-mt.mk <<EOF
--- qgfxlinuxfb_qws.cpp.~1~ 2004-09-13 09:17:07.000000000 +1000
+++ qt-2.3.9/src/kernel/qgfxlinuxfb_qws.cpp 2004-09-13 18:43:41.000000000 +1000
@@ -101,12 +101,19 @@
bool QLinuxFbScreen::connect( const QString &displaySpec )
{
// Check for explicitly specified device
+#ifdef QT_QWS_DEVFS
+ QRegExp r( "/dev/fb/[0-9]+" );
+#else
QRegExp r( "/dev/fb[0-9]+" );
+#endif
int len;
int m = r.match( displaySpec, 0, &len );
+#ifdef QT_QWS_DEVFS
+ QString dev = (m>=0) ? displaySpec.mid( m, len ) : QString("/dev/fb/0");
+#else
QString dev = (m>=0) ? displaySpec.mid( m, len ) : QString("/dev/fb0");
-
+#endif
fd=open( dev.latin1(), O_RDWR );
if (fd<0) {
qWarning("Can't open framebuffer device %s",dev.latin1());
@@ -121,14 +128,22 @@
/* Get fixed screen information */
if (ioctl(fd, FBIOGET_FSCREENINFO, &finfo)) {
+#ifdef QT_QWS_DEVFS
+ perror("reading /dev/fb/0");
+#else
perror("reading /dev/fb0");
+#endif
qWarning("Error reading fixed information");
return FALSE;
}
/* Get variable screen information */
if (ioctl(fd, FBIOGET_VSCREENINFO, &vinfo)) {
+#ifdef QT_QWS_DEVFS
+ perror("reading /dev/fb/0");
+#else
perror("reading /dev/fb0");
+#endif
qWarning("Error reading variable information");
return FALSE;
}
@@ -165,7 +180,11 @@
data += dataoffset;
if ((int)data == -1) {
+#ifdef QT_QWS_DEVFS
+ perror("reading /dev/fb/0");
+#else
perror("mapping /dev/fb0");
+#endif
qWarning("Error: failed to map framebuffer device to memory.");
return FALSE;
}
@@ -229,7 +248,11 @@
static void writeTerm(const char* termctl, int sizeof_termctl)
{
+#ifdef QT_QWS_DEVFS
+ const char* tt[]={"/dev/vc/1","/dev/console","/dev/tty",0};
+#else
const char* tt[]={"/dev/console","/dev/tty","/dev/tty0",0};
+#endif
const char** dev=tt;
while (*dev) {
int tty=::open(*dev,O_WRONLY);
@@ -792,7 +815,11 @@
fb_var_screeninfo vinfo;
if (ioctl(fd, FBIOGET_FSCREENINFO, &finfo)) {
+#ifdef QT_QWS_DEVFS
+ perror("reading /dev/fb/0");
+#else
perror("reading /dev/fb0");
+#endif
qFatal("Error reading fixed information");
}
--- qkeyboard_qws.cpp.~1~ 2004-09-13 09:17:07.000000000 +1000
+++ qt-2.3.9/src/kernel/qkeyboard_qws.cpp 2004-09-13 18:46:27.000000000 +1000
@@ -1179,8 +1179,11 @@
QWSTtyKeyboardHandler::QWSTtyKeyboardHandler(const QString& device)
{
+#ifdef QT_QWS_DEVFS
+ kbdFD=open(device.isEmpty() ? "/dev/vc/1" : device.latin1(), O_RDWR | O_NDELAY, 0);
+#else
kbdFD=open(device.isEmpty() ? "/dev/tty0" : device.latin1(), O_RDWR | O_NDELAY, 0);
-
+#endif
if ( kbdFD >= 0 ) {
QSocketNotifier *notifier;
notifier = new QSocketNotifier( kbdFD, QSocketNotifier::Read, this );
--- qwindowsystem_qws.cpp.~1~ 2004-09-13 09:17:07.000000000 +1000
+++ qt-2.3.9/src/kernel/qwindowsystem_qws.cpp 2004-09-13 18:49:16.000000000 +1000
@@ -820,7 +820,11 @@
void openDevice()
{
if ( !sn ) {
+#ifdef QT_QWS_DEVFS
+ int fd = ::open("/dev/sound/dsp",O_RDWR);
+#else
int fd = ::open("/dev/dsp",O_RDWR);
+#endif
if ( fd < 0 ) {
// For debugging purposes - defined QT_NO_SOUND if you
// don't have sound hardware!
--- qsoundqss_qws.cpp.~1~ 2004-09-13 09:17:07.000000000 +1000
+++ qt-2.3.9/src/kernel/qsoundqss_qws.cpp 2004-09-13 18:52:37.000000000 +1000
@@ -986,7 +986,11 @@
// Don't block open right away.
//
bool openOkay = false;
+#ifdef QT_QWS_DEVFS
+ if ((fd = ::open("/dev/sound/dsp", O_WRONLY|O_NONBLOCK)) != -1)
+#else
if ((fd = ::open("/dev/dsp", O_WRONLY|O_NONBLOCK)) != -1) {
+#endif
int flags = fcntl(fd, F_GETFL);
flags &= ~O_NONBLOCK;
openOkay = (fcntl(fd, F_SETFL, flags) == 0);
|