diff --git a/harbour/ChangeLog b/harbour/ChangeLog index fdcb7cb682..ce3a635958 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,35 @@ The license applies to all entries newer than 2009-04-28. */ +2010-06-14 15:29 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * src/vm/dynlibhb.c + * include/hbthread.h + + Added QNX support. + + * src/rtl/hbzlib.c + ! Added hack to fix missing zlibVersion() and zError() + functions from the zlib lib shipped with QNX 6.2.1. + + + config/qnx/libs.mk + + Added QNX specific lib configuration. + + * utils/hbmk2/hbmk2.prg + + Added (untested) list of system libs for qnx/gcc. + + * INSTALL + + Added QNX reference to one more place. + + ; NOTE on QNX: + All binaries build cleanly, hbtest works. + ; TOFIX/TODO: + - hbrun seems to misdetect the width of the terminal + - Clean some hack in QNX port + - platform autodetection + - retest whole port from vanilla SVN source, test MT + linkage. + + ; So now Harbour can run in cars, planes and spaceships. + 2010-06-14 14:26 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * external/zlib/Makefile * config/dos/djgpp.mk diff --git a/harbour/INSTALL b/harbour/INSTALL index 70a6a7aa34..7f68e552a8 100644 --- a/harbour/INSTALL +++ b/harbour/INSTALL @@ -133,8 +133,8 @@ HARBOUR $ ./hello You should see 'Hello world!' on screen. - on BSD/HP-UX/Solaris/BeOS/Haiku/*nix hosts - ------------------------------------------ + on BSD/HP-UX/Solaris/BeOS/Haiku/QNX/*nix hosts + ---------------------------------------------- (possible cross-build targets: Windows, Windows CE, MS-DOS) $ gmake install [HB_PLATFORM=<...>] diff --git a/harbour/config/qnx/libs.mk b/harbour/config/qnx/libs.mk new file mode 100644 index 0000000000..73d65b691a --- /dev/null +++ b/harbour/config/qnx/libs.mk @@ -0,0 +1,28 @@ +# +# $Id$ +# + +SYSLIBPATHS := + +ifneq ($(HB_LINKING_RTL),) + ifeq ($(HB_LIBNAME_CURSES),) + HB_LIBNAME_CURSES := ncurses + endif + ifneq ($(HB_HAS_CURSES),) + SYSLIBS += $(HB_LIBNAME_CURSES) + endif + ifneq ($(HB_HAS_SLANG),) + SYSLIBS += slang + endif + ifneq ($(HB_HAS_PCRE),) + ifeq ($(HB_HAS_PCRE_LOCAL),) + SYSLIBS += pcre + endif + endif + ifeq ($(HB_HAS_ZLIB_LOCAL),) + SYSLIBS += z + endif + SYSLIBS += socket +endif + +SYSLIBS += m diff --git a/harbour/include/hbthread.h b/harbour/include/hbthread.h index ac53cb6212..245f06f4b6 100644 --- a/harbour/include/hbthread.h +++ b/harbour/include/hbthread.h @@ -63,7 +63,8 @@ # define HB_TASK_THREAD #elif defined( HB_OS_LINUX ) || defined( HB_OS_DARWIN ) || \ defined( HB_OS_SUNOS ) || defined( HB_OS_HPUX ) || \ - defined( HB_OS_BSD ) || defined( HB_OS_BEOS ) + defined( HB_OS_BSD ) || defined( HB_OS_BEOS ) || \ + defined( HB_OS_QNX ) # include # define HB_PTHREAD_API #elif defined( HB_OS_WIN ) diff --git a/harbour/src/rtl/hbzlib.c b/harbour/src/rtl/hbzlib.c index 393b4bf6aa..ad0edddd89 100644 --- a/harbour/src/rtl/hbzlib.c +++ b/harbour/src/rtl/hbzlib.c @@ -110,7 +110,12 @@ HB_FUNC( HB_ZLIBVERSION ) if( hb_parni( 1 ) == 1 ) hb_retc_const( ZLIB_VERSION ); else +#if defined( HB_OS_QNX ) + /* NOTE: Hack to avoid "undefined reference to 'zlibVersion' when linking hbrun. */ + hb_retc_null(); +#else hb_retc( zlibVersion() ); +#endif } /* @@ -294,5 +299,10 @@ HB_FUNC( HB_ZUNCOMPRESS ) */ HB_FUNC( HB_ZERROR ) { +#if defined( HB_OS_QNX ) + /* NOTE: Hack to avoid "undefined reference to 'zlibVersion' when linking hbrun. */ + hb_retc_null(); +#else hb_retc( zError( hb_parni( 1 ) ) ); +#endif } diff --git a/harbour/src/vm/dynlibhb.c b/harbour/src/vm/dynlibhb.c index a63a75441f..ef505c6749 100644 --- a/harbour/src/vm/dynlibhb.c +++ b/harbour/src/vm/dynlibhb.c @@ -80,6 +80,7 @@ ( ( defined( HB_OS_LINUX ) && !defined( __WATCOMC__ ) ) || \ defined( HB_OS_SUNOS ) || defined( HB_OS_DARWIN ) || \ defined( HB_OS_BSD ) || defined( HB_OS_BEOS ) || \ + defined( HB_OS_QNX ) || \ ( defined( __DJGPP__ ) && \ ( __DJGPP__ > 2 || ( __DJGPP__ == 2 && __DJGPP_MINOR__ >= 4 ) ) ) ) # define HB_HAS_DLFCN diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 5f60943bfe..726b64a170 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -2751,7 +2751,9 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) IF !( hbmk[ _HBMK_cPLAT ] == "beos" ) AAdd( l_aLIBSYS, "m" ) IF hbmk[ _HBMK_lMT ] - AAdd( l_aLIBSYS, "pthread" ) + IF !( hbmk[ _HBMK_cPLAT ] == "qnx" ) + AAdd( l_aLIBSYS, "pthread" ) + ENDIF ENDIF ENDIF DO CASE @@ -2769,6 +2771,8 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) AAdd( hbmk[ _HBMK_aLIBPATH ], "/system/lib" ) AAdd( l_aLIBSYS, "root" ) AAdd( l_aLIBSYS, "network" ) + CASE hbmk[ _HBMK_cPLAT ] == "qnx" + AAdd( l_aLIBSYS, "socket" ) ENDCASE IF ! Empty( cLIB_BASE_PCRE ) .AND. ! hb_FileExists( _HBLIB_FULLPATH( cLIB_BASE_PCRE ) )