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