diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 106e8660f3..8f14be8cc8 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,28 @@ The license applies to all entries newer than 2009-04-28. */ +2010-06-29 21:02 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * utils/hbmk2/hbmk2.prg + + Addeded support for specifying dependencies in .hbc files. + + * contrib/hbide/hbide.hbp + * contrib/hbqt/hbqt.hbc + * Moved qt dependency specification from local make file to + central hbqt.hbc. + + * INSTALL + * contrib/hbqt/hbmk2_plugin_qt.prg + ! Minor correction to compile to hbmk2 plugin .hrb if compiled + with harbour. + + Added support for HB_QTPATH, HB_QTPOSTFIX envvars. This is + now the recommended way to override QT tools autodetection. + Kept HB_QT_MOC_BIN for compatibility. Deprecated. + (just added support for HB_QT_UIC_BIN, HB_QT_RCC_BIN removed) + - Deleted hardcoded hack to look for '-qt4' postfix when looking + for QT tools. Now it's QT version agnostic. Use HB_QTPOSTFIX instead. + ! Fixed deleting temp .uic file in stdalone mode. + + Added -w3 pragma. + 2010-06-29 11:21 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbide/ideactions.prg - Removed: "Insert Randome Name" option in . @@ -23,7 +45,7 @@ * contrib/hbide/idesources.prg % Fixed: "Save all sources" option of menu. A fatal one. - Thanks to Reinaldo for reporting. + Thanks to Reinaldo for reporting. 2010-06-29 09:31 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbide/hbide.qrc @@ -40,14 +62,14 @@ * contrib/hbide/idedocks.prg * contrib/hbide/ideeditor.prg + Prepared: to honor multiple panels to host views of ideDBU - sessions plus arranged to host a tree-view at the left + sessions plus arranged to host a tree-view at the left if there will be a need in the future. + Added: toolbar to ideDBU interface with ounly one button to add a table to the view. Now table open dialog is not presented at the time of invocation. - + Improved: ideDBU view to take care of available + + Improved: ideDBU view to take care of available space more intelligently. 2010-06-29 14:56 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) @@ -142,7 +164,7 @@ 2010-06-29 09:52 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * INSTALL + Added HB_QT_RCC_BIN - ; TODO: Change these envvars to HB_QTPOSTFIX and HB_QTPATH. + ; TODO: Change these envvars to HB_QTPOSTFIX and HB_QTPATH. [DONE] * contrib/hbqt/hbqt.hbc - contrib/hbqt/hbmk2_plugin_ui.prg @@ -539,6 +561,9 @@ current directory. This concept was causing more trouble than good, as it turned out. Also removed -nohbc option, which has now lost its meaning. + INCOMPATIBILITY. To restore old effect, either add .hbc + to your .hbp file, or create a hbmk.hbm file with a reference + to the .hbc file. ; TODO: Rename hbmk.cfg to hbmk.hbc to have a standard extension. ; TODO: To solve the search path issue on *nix dir structures. @@ -3254,7 +3279,7 @@ * config/global.mk * HB_ROOT -> HB_SRC_ROOTPATH Renamed to not have such obvious and short name and not - to collide with build-in hbmk2 macro with the same name. + to collide with built-in hbmk2 macro with the same name. 2010-06-15 18:43 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * INSTALL @@ -3484,7 +3509,7 @@ 2010-06-14 23:31 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * config/dos/djgpp.mk - ! Fixed ten year old issue where error returned by LD was suppressed. + ! Fixed ten years old issue where error returned by LD was suppressed. Thanks to Tamas Tevesz for finding it. 2010-06-14 20:46 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) diff --git a/harbour/INSTALL b/harbour/INSTALL index e3a4de4e20..24b5c9ecb9 100644 --- a/harbour/INSTALL +++ b/harbour/INSTALL @@ -337,10 +337,10 @@ HARBOUR with 3rd party components: HB_QT_STATIC=yes (only meaningful on Windows platform) - You can override automatic detection of QT 'moc', 'rcc' and 'uic' tools, f.e.: - HB_QT_MOC_BIN=/opt/qt46/bin/moc - HB_QT_RCC_BIN=/opt/qt46/bin/rcc - HB_QT_UIC_BIN=/opt/qt46/bin/uic + You can override automatic detection of QT 'moc', 'rcc' and 'uic' tools + by using HB_QTPATH and optionally HB_QTPOSTFIX envvars, f.e.: + HB_QTPATH=/opt/qt46/bin/ + HB_QTPOSTFIX=-qt4 NOTES: - You need to use native path format to your shell/OS. - Spaces in directory names aren't currently supported. diff --git a/harbour/contrib/hbide/hbide.hbp b/harbour/contrib/hbide/hbide.hbp index d652e75e63..19040fd26e 100644 --- a/harbour/contrib/hbide/hbide.hbp +++ b/harbour/contrib/hbide/hbide.hbp @@ -75,14 +75,3 @@ idebrowse.prg -pi=updown.ui -pi=hbide.qrc - -# Required for compilation of the .cpp files converted from .qrc -# TOFIX: Move this to hbqt.hbc -# TODO: Create .cpp to .prg converter for resources to fully get around int --depkeyhead=qt:QtCore/qglobal.h --depcontrol=qt:${HB_WITH_QT} -{!darwin}-depincpath=qt:/usr/include/qt4 -{!darwin}-depincpath=qt:/usr/lib/qt4/include -{!darwin}-depincpath=qt:/usr/include -{darwin}-depincpath=qt:/Developer/qt/include -{darwin}-depincpath=qt:/Library/Frameworks diff --git a/harbour/contrib/hbqt/hbmk2_plugin_qt.prg b/harbour/contrib/hbqt/hbmk2_plugin_qt.prg index e9dc44c841..a7d087760f 100644 --- a/harbour/contrib/hbqt/hbmk2_plugin_qt.prg +++ b/harbour/contrib/hbqt/hbmk2_plugin_qt.prg @@ -10,9 +10,11 @@ * See COPYING for licensing terms. */ +#pragma warninglevel=3 + #define I_( x ) hb_i18n_gettext( x ) -#if defined( __HBSCRIPT__HBMK ) +#if ! defined( __HBSCRIPT__HBRUN ) FUNCTION hbmk2_plugin_qt( hbmk2 ) LOCAL cRetVal := "" @@ -88,7 +90,7 @@ FUNCTION hbmk2_plugin_qt( hbmk2 ) /* Detect 'uic' tool location */ - cUIC_BIN := qt_tool_detect( hbmk2, "UIC_BIN", "HB_QT_UIC_BIN", "uic" ) + cUIC_BIN := qt_tool_detect( hbmk2, "uic", "UIC_BIN" ) IF ! Empty( cUIC_BIN ) @@ -154,7 +156,7 @@ FUNCTION hbmk2_plugin_qt( hbmk2 ) /* Detect 'moc' tool location */ - cMOC_BIN := qt_tool_detect( hbmk2, "MOC_BIN", "HB_QT_MOC_BIN", "moc" ) + cMOC_BIN := qt_tool_detect( hbmk2, "moc", "MOC_BIN", "HB_QT_MOC_BIN" ) IF ! Empty( cMOC_BIN ) @@ -202,7 +204,7 @@ FUNCTION hbmk2_plugin_qt( hbmk2 ) /* Detect 'rcc' tool location */ - cRCC_BIN := qt_tool_detect( hbmk2, "RCC_BIN", "HB_QT_RCC_BIN", "rcc" ) + cRCC_BIN := qt_tool_detect( hbmk2, "rcc", "RCC_BIN" ) IF ! Empty( cRCC_BIN ) @@ -262,28 +264,30 @@ FUNCTION hbmk2_plugin_qt( hbmk2 ) RETURN cRetVal -STATIC FUNCTION qt_tool_detect( hbmk2, cEnvQT, cEnvHB, cName ) +STATIC FUNCTION qt_tool_detect( hbmk2, cName, cEnvQT, cEnvHB ) LOCAL cBIN cBIN := GetEnv( cEnvQT ) IF Empty( cBIN ) - IF Empty( GetEnv( cEnvHB ) ) - IF hbmk2[ "cPLAT" ] == "win" - IF GetEnv( "HB_WITH_QT" ) == "no" - RETURN NIL - ELSE - cBIN := GetEnv( "HB_WITH_QT" ) + "\..\bin\" + cName + ".exe" - IF ! hb_FileExists( cBIN ) - hbmk2_OutErr( hbmk2, hb_StrFormat( "HB_WITH_QT points to incomplete QT installation. '%1$s' executable not found.", cName ) ) + IF Empty( cEnvHB ) .OR. Empty( GetEnv( cEnvHB ) ) + cName += GetEnv( "HB_QTPOSTFIX" ) + IF Empty( GetEnv( "HB_QTPATH" ) ) .OR. ; + ! hb_FileExists( cBIN := GetEnv( "HB_QTPATH" ) + cName ) + + IF hbmk2[ "cPLAT" ] == "win" + IF GetEnv( "HB_WITH_QT" ) == "no" RETURN NIL + ELSE + cBIN := GetEnv( "HB_WITH_QT" ) + "\..\bin\" + cName + ".exe" + IF ! hb_FileExists( cBIN ) + hbmk2_OutErr( hbmk2, hb_StrFormat( "HB_WITH_QT points to incomplete QT installation. '%1$s' executable not found.", cName ) ) + RETURN NIL + ENDIF ENDIF - ENDIF - ELSE - cBIN := hbmk2_FindInPath( cName, GetEnv( "PATH" ) + hb_osPathListSeparator() + "/opt/qtsdk/qt/bin" ) - IF Empty( cBIN ) - cBIN := hbmk2_FindInPath( cName + "-qt4", GetEnv( "PATH" ) + hb_osPathListSeparator() + "/opt/qtsdk/qt/bin" ) + ELSE + cBIN := hbmk2_FindInPath( cName, GetEnv( "PATH" ) + hb_osPathListSeparator() + "/opt/qtsdk/qt/bin" ) IF Empty( cBIN ) - hbmk2_OutErr( hbmk2, hb_StrFormat( "%1$s not set, could not autodetect", cEnvHB ) ) + hbmk2_OutErr( hbmk2, hb_StrFormat( "HB_QTPATH, HB_QTPOSTFIX, %1$s not set, could not autodetect", cEnvHB ) ) RETURN NIL ENDIF ENDIF @@ -292,6 +296,7 @@ STATIC FUNCTION qt_tool_detect( hbmk2, cEnvQT, cEnvHB, cName ) hbmk2_OutStd( hbmk2, hb_StrFormat( "Using QT '%1$s' executable: %2$s (autodetected)", cName, cBIN ) ) ENDIF ELSE + /* kept for compatibility */ IF hb_FileExists( GetEnv( cEnvHB ) ) cBIN := GetEnv( cEnvHB ) IF hbmk2[ "lINFO" ] @@ -319,17 +324,20 @@ PROCEDURE Main( cSrc, cDst ) FClose( hb_FTempCreateEx( @cTmp ) ) IF ( nError := hb_processRun( "uic " + cSrc + " -o " + cTmp ) ) == 0 - IF uic_to_prg( NIL, cTmp, cDst, cSrc ) - RETURN + IF ! uic_to_prg( NIL, cTmp, cDst, cSrc ) + nError := 9 ENDIF ELSE OutErr( "Error: Calling 'uic' tool: " + hb_ntos( nError ) + hb_osNewLine() ) ENDIF + + FErase( cTmp ) ELSE OutErr( "Missing parameter. Call with: <.ui> <.prg>" + hb_osNewLine() ) + nError := 8 ENDIF - ErrorLevel( 1 ) + ErrorLevel( nError ) RETURN @@ -373,7 +381,7 @@ STATIC FUNCTION uic_to_prg( hbmk2, cFileNameSrc, cFileNameDst, cOriSrc ) RETURN .F. #define STRINGIFY( cStr ) '"' + cStr + '"' -#define PAD_30( cStr ) PadR( cStr, Max( Len( cStr ), 20 ) ) +#define PAD_30( cStr ) PadR( cStr, Max( Len( cStr ), 35 ) ) #define STRIP_SQ( cStr ) StrTran( StrTran( StrTran( StrTran( s, "[", " " ), "]", " " ), "\n", " " ), Chr( 10 ), " " ) STATIC FUNCTION hbq_create( cFile, cFuncName ) @@ -514,7 +522,7 @@ STATIC FUNCTION hbq_create( cFile, cFuncName ) AAdd( aLinesPRG, "FUNCTION " + cFuncName + "( qParent )" ) AAdd( aLinesPRG, " LOCAL oUI" ) AAdd( aLinesPRG, " LOCAL oWidget" ) - AAdd( aLinesPRG, " LOCAL qObj := {=>}" ) + AAdd( aLinesPRG, " LOCAL qObj := { => }" ) AAdd( aLinesPRG, "" ) AAdd( aLinesPRG, " hb_hCaseMatch( qObj, .F. )" ) AAdd( aLinesPRG, "" ) @@ -592,7 +600,7 @@ STATIC FUNCTION hbq_create( cFile, cFuncName ) NEXT AAdd( aLinesPRG, "" ) AAdd( aLinesPRG, " oUI := HbQtUI():new()" ) - AAdd( aLinesPRG, " oUI:qObj := qObj" ) + AAdd( aLinesPRG, " oUI:qObj := qObj" ) AAdd( aLinesPRG, " oUI:oWidget := oWidget" ) AAdd( aLinesPRG, "" ) AAdd( aLinesPRG, " RETURN oUI" ) @@ -700,14 +708,14 @@ STATIC PROCEDURE hbq_replaceConstants( /* @ */ cString ) aResult := hb_regexAll( regDefine, cString ) IF ! Empty( aResult ) - cOR := "hb_bitOr(" + cOR := "hb_bitOr( " FOR n := 1 TO Len( aResult ) cOR += aResult[ n ][ 1 ] IF n < Len( aResult ) cOR += "," ENDIF NEXT - cOR += ")" + cOR += " )" cCmdB := SubStr( cString, 1, At( aResult[ 1 ][ 1 ], cString ) - 1 ) cConst := aResult[ Len( aResult ) ][ 1 ] cCmdE := SubStr( cString, At( cConst, cString ) + Len( cConst ) ) diff --git a/harbour/contrib/hbqt/hbqt.hbc b/harbour/contrib/hbqt/hbqt.hbc index 695acafc5a..d7a8803a1c 100644 --- a/harbour/contrib/hbqt/hbqt.hbc +++ b/harbour/contrib/hbqt/hbqt.hbc @@ -22,5 +22,12 @@ libs=hbqtcore hbqtgui hbqtnetwork {win|os2}hbcppmm=yes +# Required for compilation of the .cpp files converted from .qrc +# TODO: Create .cpp to .prg converter for resources to fully get around int +depkeyhead=qt:QtCore/qglobal.h +depcontrol=qt:${HB_WITH_QT} +{!darwin}depincpath=qt:/usr/include/qt4 /usr/lib/qt4/include /usr/include +{darwin}depincpath=qt:/Developer/qt/include /Library/Frameworks + gui=yes gt=gtnul diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index e39f47e21b..b5645da41e 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -7783,6 +7783,54 @@ STATIC FUNCTION HBC_ProcessOne( hbmk, cFileName, nNestingLevel ) ENDIF ENDIF + CASE Lower( Left( cLine, Len( "deppkgname=" ) ) ) == "deppkgname=" ; cLine := SubStr( cLine, Len( "deppkgname=" ) + 1 ) + + IF dep_split_arg( hbmk, cLine, @cLine, @tmp ) + tmp := MacroProc( hbmk, tmp, cFileName ) + AAddNewNotEmpty( hbmk[ _HBMK_hDEP ][ cLine ][ _HBMKDEP_aPKG ], StrStripQuote( AllTrim( tmp ) ) ) + ENDIF + + CASE Lower( Left( cLine, Len( "depkeyhead=" ) ) ) == "depkeyhead=" ; cLine := SubStr( cLine, Len( "depkeyhead=" ) + 1 ) + + IF dep_split_arg( hbmk, cLine, @cLine, @tmp ) + FOR EACH cItem IN hb_ATokens( tmp,, .T. ) + AAddNewNotEmpty( hbmk[ _HBMK_hDEP ][ cLine ][ _HBMKDEP_aKeyHeader ], AllTrim( StrTran( MacroProc( hbmk, cItem, cFileName ), "\", "/" ) ) ) + NEXT + ENDIF + + CASE Lower( Left( cLine, Len( "depoptional=" ) ) ) == "depoptional=" ; cLine := SubStr( cLine, Len( "depoptional=" ) + 1 ) + + IF dep_split_arg( hbmk, cLine, @cLine, @tmp ) + tmp := MacroProc( hbmk, tmp, cFileName ) + DO CASE + CASE Lower( tmp ) == "yes" ; hbmk[ _HBMK_hDEP ][ cLine ][ _HBMKDEP_lOptional ] := .T. + CASE Lower( tmp ) == "no" ; hbmk[ _HBMK_hDEP ][ cLine ][ _HBMKDEP_lOptional ] := .F. + ENDCASE + ENDIF + + CASE Lower( Left( cLine, Len( "depcontrol=" ) ) ) == "depcontrol=" ; cLine := SubStr( cLine, Len( "depcontrol=" ) + 1 ) + + IF dep_split_arg( hbmk, cLine, @cLine, @tmp ) + hbmk[ _HBMK_hDEP ][ cLine ][ _HBMKDEP_cControl ] := AllTrim( MacroProc( hbmk, tmp, cFileName ) ) + AAddNew( hbmk[ _HBMK_hDEP ][ cLine ][ _HBMKDEP_aINCPATH ], _HBMK_DEP_CTRL_MARKER ) + ENDIF + + CASE Lower( Left( cLine, Len( "depincpath=" ) ) ) == "depincpath=" ; cLine := SubStr( cLine, Len( "depincpath=" ) + 1 ) + + IF dep_split_arg( hbmk, cLine, @cLine, @tmp ) + FOR EACH cItem IN hb_ATokens( tmp,, .T. ) + AAddNewNotEmpty( hbmk[ _HBMK_hDEP ][ cLine ][ _HBMKDEP_aINCPATH ], PathNormalize( PathProc( PathSepToSelf( MacroProc( hbmk, cItem, cFileName ) ), FN_DirGet( cFileName ) ) ) ) + NEXT + ENDIF + + CASE Lower( Left( cLine, Len( "depincpathlocal=" ) ) ) == "depincpathlocal=" ; cLine := SubStr( cLine, Len( "depincpathlocal=" ) + 1 ) + + IF dep_split_arg( hbmk, cLine, @cLine, @tmp ) + FOR EACH cItem IN hb_ATokens( tmp,, .T. ) + AAddNewNotEmpty( hbmk[ _HBMK_hDEP ][ cLine ][ _HBMKDEP_aINCPATHLOCAL ], PathNormalize( PathProc( PathSepToSelf( MacroProc( hbmk, cItem, cFileName ) ), FN_DirGet( cFileName ) ) ) ) + NEXT + ENDIF + /* .hbc identification strings. Similar to pkgconfig ones. */ CASE Lower( Left( cLine, Len( "name=" ) ) ) == "name=" ; cLine := SubStr( cLine, Len( "name=" ) + 1 )