summaryrefslogtreecommitdiffstats
path: root/src/3rdparty
diff options
context:
space:
mode:
authorRobert Griebl <rgriebl@trolltech.com>2008-07-30 21:14:24 (GMT)
committerRobert Griebl <rgriebl@trolltech.com>2009-07-29 08:50:20 (GMT)
commitd7b688870aead912690188b324d370b920a7a600 (patch)
treeaac6c19d222ca3bad65cfbb850483a647013c67a /src/3rdparty
parente5262a0c29c743f2afd4ba249e8adff984c1ca83 (diff)
downloadQt-d7b688870aead912690188b324d370b920a7a600.zip
Qt-d7b688870aead912690188b324d370b920a7a600.tar.gz
Qt-d7b688870aead912690188b324d370b920a7a600.tar.bz2
Port of Qt to VxWorks
This makes Qt work on VxWorks 6.6+ in native (kernel) mode. * compiles with the WindRiver GNU toolchain (Linux only) * works with QWS (tested with the VNC driver only) * tested on PPC hardware and the x86 VxWorks simulator * no q3support, no phonon, no webkit * no QSharedMemory, no QSystemSemaphore, no QProcess * only one QApplication instance (flat address space) * filesystem support depends heavily on the quality of the native driver * QLibrary is just a dummy to make plugins work at all * qmake transparently creates VxWorks munching rules for static ctors * made auto-test cope with missing OS features A special note regarding the Q_FOREACH patch for dcc: when calling foreach(a,c) with c being a function returning a container, the compiler would generate 5 references to some labels (.LXXXX), which are not there (so the linker complains in the end). Seems like dcc doesn't really like the 'true ? 0 : <function call to get type>' statement Reviewed-By: Harald Fernengel
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/freetype/builds/unix/ftsystem.c9
-rw-r--r--src/3rdparty/libjpeg/jmorecfg.h5
-rw-r--r--src/3rdparty/libpng/pngconf.h2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_config.h2
-rw-r--r--src/3rdparty/patches/freetype-2.3.6-vxworks.patch35
-rw-r--r--src/3rdparty/patches/libjpeg-6b-vxworks.patch23
-rw-r--r--src/3rdparty/patches/libpng-1.2.20-vxworks.patch13
-rw-r--r--src/3rdparty/patches/libtiff-3.8.2-vxworks.patch11
-rw-r--r--src/3rdparty/patches/sqlite-3.5.6-vxworks.patch68
-rw-r--r--src/3rdparty/sqlite/sqlite3.c25
10 files changed, 186 insertions, 7 deletions
diff --git a/src/3rdparty/freetype/builds/unix/ftsystem.c b/src/3rdparty/freetype/builds/unix/ftsystem.c
index 3a740fd..40fa8d0 100644
--- a/src/3rdparty/freetype/builds/unix/ftsystem.c
+++ b/src/3rdparty/freetype/builds/unix/ftsystem.c
@@ -69,6 +69,9 @@
#include <string.h>
#include <errno.h>
+#ifdef VXWORKS
+#include <ioLib.h>
+#endif
/*************************************************************************/
/* */
@@ -238,7 +241,7 @@
return FT_Err_Invalid_Stream_Handle;
/* open the file */
- file = open( filepathname, O_RDONLY );
+ file = open( filepathname, O_RDONLY, 0);
if ( file < 0 )
{
FT_ERROR(( "FT_Stream_Open:" ));
@@ -317,7 +320,11 @@
read_count = read( file,
+#ifndef VXWORKS
stream->base + total_read_count,
+#else
+ (char *) stream->base + total_read_count,
+#endif
stream->size - total_read_count );
if ( read_count <= 0 )
diff --git a/src/3rdparty/libjpeg/jmorecfg.h b/src/3rdparty/libjpeg/jmorecfg.h
index 54a7d1c..b0b5870 100644
--- a/src/3rdparty/libjpeg/jmorecfg.h
+++ b/src/3rdparty/libjpeg/jmorecfg.h
@@ -157,7 +157,7 @@ typedef short INT16;
/* INT32 must hold at least signed 32-bit values. */
-#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */
+#if !defined(XMD_H) && !defined(VXWORKS) /* X11/xmd.h correctly defines INT32 */
typedef long INT32;
#endif
@@ -183,6 +183,9 @@ typedef unsigned int JDIMENSION;
/* a function called through method pointers: */
#define METHODDEF(type) static type
/* a function used only in its module: */
+#if defined(VXWORKS) && defined(LOCAL)
+# undef LOCAL
+#endif
#define LOCAL(type) static type
/* a function referenced thru EXTERNs: */
#define GLOBAL(type) type
diff --git a/src/3rdparty/libpng/pngconf.h b/src/3rdparty/libpng/pngconf.h
index 19e4732..8eb7d35 100644
--- a/src/3rdparty/libpng/pngconf.h
+++ b/src/3rdparty/libpng/pngconf.h
@@ -344,7 +344,7 @@
# endif /* __linux__ */
#endif /* PNG_SETJMP_SUPPORTED */
-#ifdef BSD
+#if defined(BSD) && !defined(VXWORKS)
# include <strings.h>
#else
# include <string.h>
diff --git a/src/3rdparty/libtiff/libtiff/tif_config.h b/src/3rdparty/libtiff/libtiff/tif_config.h
index e95f7a4..689421c 100644
--- a/src/3rdparty/libtiff/libtiff/tif_config.h
+++ b/src/3rdparty/libtiff/libtiff/tif_config.h
@@ -104,7 +104,7 @@
/* #undef HAVE_PTHREAD */
/* Define to 1 if you have the <search.h> header file. */
-#if !defined(Q_OS_WINCE)
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_VXWORKS)
#define HAVE_SEARCH_H 1
#endif
diff --git a/src/3rdparty/patches/freetype-2.3.6-vxworks.patch b/src/3rdparty/patches/freetype-2.3.6-vxworks.patch
new file mode 100644
index 0000000..21e884c
--- /dev/null
+++ b/src/3rdparty/patches/freetype-2.3.6-vxworks.patch
@@ -0,0 +1,35 @@
+diff --git builds/unix/ftsystem.c builds/unix/ftsystem.c
+index 3a740fd..40fa8d0 100644
+--- builds/unix/ftsystem.c
++++ builds/unix/ftsystem.c
+@@ -69,6 +69,9 @@
+ #include <string.h>
+ #include <errno.h>
+
++#ifdef VXWORKS
++#include <ioLib.h>
++#endif
+
+ /*************************************************************************/
+ /* */
+@@ -238,7 +241,7 @@
+ return FT_Err_Invalid_Stream_Handle;
+
+ /* open the file */
+- file = open( filepathname, O_RDONLY );
++ file = open( filepathname, O_RDONLY, 0);
+ if ( file < 0 )
+ {
+ FT_ERROR(( "FT_Stream_Open:" ));
+@@ -317,7 +320,11 @@
+
+
+ read_count = read( file,
++#ifndef VXWORKS
+ stream->base + total_read_count,
++#else
++ (char *) stream->base + total_read_count,
++#endif
+ stream->size - total_read_count );
+
+ if ( read_count <= 0 )
diff --git a/src/3rdparty/patches/libjpeg-6b-vxworks.patch b/src/3rdparty/patches/libjpeg-6b-vxworks.patch
new file mode 100644
index 0000000..263c8d0
--- /dev/null
+++ b/src/3rdparty/patches/libjpeg-6b-vxworks.patch
@@ -0,0 +1,23 @@
+diff --git jmorecfg.h jmorecfg.h
+index 54a7d1c..b0b5870 100644
+--- jmorecfg.h
++++ jmorecfg.h
+@@ -157,7 +157,7 @@ typedef short INT16;
+
+ /* INT32 must hold at least signed 32-bit values. */
+
+-#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */
++#if !defined(XMD_H) && !defined(VXWORKS) /* X11/xmd.h correctly defines INT32 */
+ typedef long INT32;
+ #endif
+
+@@ -183,6 +183,9 @@ typedef unsigned int JDIMENSION;
+ /* a function called through method pointers: */
+ #define METHODDEF(type) static type
+ /* a function used only in its module: */
++#if defined(VXWORKS) && defined(LOCAL)
++# undef LOCAL
++#endif
+ #define LOCAL(type) static type
+ /* a function referenced thru EXTERNs: */
+ #define GLOBAL(type) type
diff --git a/src/3rdparty/patches/libpng-1.2.20-vxworks.patch b/src/3rdparty/patches/libpng-1.2.20-vxworks.patch
new file mode 100644
index 0000000..4c49b3f
--- /dev/null
+++ b/src/3rdparty/patches/libpng-1.2.20-vxworks.patch
@@ -0,0 +1,13 @@
+diff --git pngconf.h pngconf.h
+index 19e4732..8eb7d35 100644
+--- pngconf.h
++++ pngconf.h
+@@ -344,7 +344,7 @@
+ # endif /* __linux__ */
+ #endif /* PNG_SETJMP_SUPPORTED */
+
+-#ifdef BSD
++#if defined(BSD) && !defined(VXWORKS)
+ # include <strings.h>
+ #else
+ # include <string.h>
diff --git a/src/3rdparty/patches/libtiff-3.8.2-vxworks.patch b/src/3rdparty/patches/libtiff-3.8.2-vxworks.patch
new file mode 100644
index 0000000..b1b725e
--- /dev/null
+++ b/src/3rdparty/patches/libtiff-3.8.2-vxworks.patch
@@ -0,0 +1,11 @@
+--- libtiff/tif_config.h.orig
++++ libtiff/tif_config.h
+@@ -104,7 +104,7 @@
+ /* #undef HAVE_PTHREAD */
+
+ /* Define to 1 if you have the <search.h> header file. */
+-#if !defined(Q_OS_WINCE)
++#if !defined(Q_OS_WINCE) && !defined(Q_OS_VXWORKS)
+ #define HAVE_SEARCH_H 1
+ #endif
+
diff --git a/src/3rdparty/patches/sqlite-3.5.6-vxworks.patch b/src/3rdparty/patches/sqlite-3.5.6-vxworks.patch
new file mode 100644
index 0000000..6ae65fd
--- /dev/null
+++ b/src/3rdparty/patches/sqlite-3.5.6-vxworks.patch
@@ -0,0 +1,68 @@
+--- sqlite3.c.orig
++++ sqlite3.c
+@@ -383,7 +383,7 @@ SQLITE_PRIVATE void sqlite3Coverage(int);
+ **
+ ** See also ticket #2741.
+ */
+-#if !defined(_XOPEN_SOURCE) && !defined(__DARWIN__) && !defined(__APPLE__) && SQLITE_THREADSAFE
++#if !defined(_XOPEN_SOURCE) && !defined(__DARWIN__) && !defined(__APPLE__) && SQLITE_THREADSAFE && !defined(VXWORKS)
+ # define _XOPEN_SOURCE 500 /* Needed to enable pthread recursive mutexes */
+ #endif
+
+@@ -440,6 +440,13 @@ SQLITE_PRIVATE void sqlite3Coverage(int);
+ */
+ #ifndef _SQLITE3_H_
+ #define _SQLITE3_H_
++
++#ifdef VXWORKS
++# define SQLITE_HOMEGROWN_RECURSIVE_MUTEX
++# define NO_GETTOD
++# include <ioLib.h>
++#endif
++
+ #include <stdarg.h> /* Needed for the definition of va_list */
+
+ /*
+@@ -18792,7 +18799,11 @@ SQLITE_PRIVATE sqlite3_vfs *sqlite3OsDefaultVfs(void){
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+-#include <sys/time.h>
++#ifdef VXWORKS
++# include <sys/times.h>
++#else
++# include <sys/time.h>
++#endif
+ #include <errno.h>
+ #ifdef SQLITE_ENABLE_LOCKING_STYLE
+ #include <sys/ioctl.h>
+@@ -19728,7 +19739,11 @@ static int seekAndWrite(unixFile *id, i64 offset, const void *pBuf, int cnt){
+ if( newOffset!=offset ){
+ return -1;
+ }
++# ifndef VXWORKS
+ got = write(id->h, pBuf, cnt);
++# else
++ got = write(id->h, (char *)pBuf, cnt);
++# endif
+ #endif
+ TIMER_END;
+ OSTRACE5("WRITE %-3d %5d %7lld %d\n", id->h, got, offset, TIMER_ELAPSED);
+@@ -21554,12 +21569,16 @@ static int unixRandomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf){
+ #if !defined(SQLITE_TEST)
+ {
+ int pid, fd;
+- fd = open("/dev/urandom", O_RDONLY);
++ fd = open("/dev/urandom", O_RDONLY, 0);
+ if( fd<0 ){
+ time_t t;
+ time(&t);
+ memcpy(zBuf, &t, sizeof(t));
++#ifndef VXWORKS
+ pid = getpid();
++#else
++ pid = (int)taskIdCurrent();
++#endif
+ memcpy(&zBuf[sizeof(t)], &pid, sizeof(pid));
+ }else{
+ read(fd, zBuf, nBuf);
diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c
index 91ce30f..7e604cb 100644
--- a/src/3rdparty/sqlite/sqlite3.c
+++ b/src/3rdparty/sqlite/sqlite3.c
@@ -383,7 +383,7 @@ SQLITE_PRIVATE void sqlite3Coverage(int);
**
** See also ticket #2741.
*/
-#if !defined(_XOPEN_SOURCE) && !defined(__DARWIN__) && !defined(__APPLE__) && SQLITE_THREADSAFE
+#if !defined(_XOPEN_SOURCE) && !defined(__DARWIN__) && !defined(__APPLE__) && SQLITE_THREADSAFE && !defined(VXWORKS)
# define _XOPEN_SOURCE 500 /* Needed to enable pthread recursive mutexes */
#endif
@@ -440,6 +440,13 @@ SQLITE_PRIVATE void sqlite3Coverage(int);
*/
#ifndef _SQLITE3_H_
#define _SQLITE3_H_
+
+#ifdef VXWORKS
+# define SQLITE_HOMEGROWN_RECURSIVE_MUTEX
+# define NO_GETTOD
+# include <ioLib.h>
+#endif
+
#include <stdarg.h> /* Needed for the definition of va_list */
/*
@@ -18792,7 +18799,11 @@ SQLITE_PRIVATE sqlite3_vfs *sqlite3OsDefaultVfs(void){
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
-#include <sys/time.h>
+#ifdef VXWORKS
+# include <sys/times.h>
+#else
+# include <sys/time.h>
+#endif
#include <errno.h>
#ifdef SQLITE_ENABLE_LOCKING_STYLE
#include <sys/ioctl.h>
@@ -19728,7 +19739,11 @@ static int seekAndWrite(unixFile *id, i64 offset, const void *pBuf, int cnt){
if( newOffset!=offset ){
return -1;
}
+# ifndef VXWORKS
got = write(id->h, pBuf, cnt);
+# else
+ got = write(id->h, (char *)pBuf, cnt);
+# endif
#endif
TIMER_END;
OSTRACE5("WRITE %-3d %5d %7lld %d\n", id->h, got, offset, TIMER_ELAPSED);
@@ -21554,12 +21569,16 @@ static int unixRandomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf){
#if !defined(SQLITE_TEST)
{
int pid, fd;
- fd = open("/dev/urandom", O_RDONLY);
+ fd = open("/dev/urandom", O_RDONLY, 0);
if( fd<0 ){
time_t t;
time(&t);
memcpy(zBuf, &t, sizeof(t));
+#ifndef VXWORKS
pid = getpid();
+#else
+ pid = (int)taskIdCurrent();
+#endif
memcpy(&zBuf[sizeof(t)], &pid, sizeof(pid));
}else{
read(fd, zBuf, nBuf);