diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 546a9430a9..3bb47f9690 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,23 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-01-23 12:17 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * utils/hbmk2/hbmk2.prg + + Added -env: option, command line only, it serves to alter local + environment, which is used by fix itself and which is passed to + external commands. This means it's now possible to call hbmk2 + in a way that it configures the whole build environment for itself: + hbmk2 hello.hbp -env:PATH#C:\mingw\bin; -env:HB_WITH_QT=C:\qt\4.5.3 + Read more in --help. + ; Please experiment with it. + + * contrib/hbide/ideprojmanager.prg + + Added simple way (HBIDE_DIR_HBMK2 envvar) to configure location + of hbmk2. + + * contrib/hbqt/generator/hbqtgen.prg + ! Minor formatting fix to generated code. + 2010-01-22 19:24 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbide/ideprojmanager.prg ! Fix in "Launch" option with respect to :WrkDirectory just before diff --git a/harbour/contrib/hbide/ideprojmanager.prg b/harbour/contrib/hbide/ideprojmanager.prg index 50cbdcb2d3..22994f9c94 100644 --- a/harbour/contrib/hbide/ideprojmanager.prg +++ b/harbour/contrib/hbide/ideprojmanager.prg @@ -104,6 +104,7 @@ CLASS IdeProject DATA metaData INIT {} DATA dotHbp INIT "" DATA compilers INIT "" + DATA hbmk2dir INIT hb_getenv( "HBIDE_DIR_HBMK2" ) METHOD new( aProps ) METHOD applyMeta( s ) @@ -1054,11 +1055,11 @@ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt ) // ::qProcess:setWorkingDirectory( ::oProject:wrkDirectory ) // - ::qProcess:start( "hbmk2", qStringList ) + ::qProcess:start( ::oProject:hbmk2dir + "hbmk2", qStringList ) #endif ELSE cOutput := "" ; cErrors := "" - nResult := hb_processRun( ( "hbmk2 " + iif( ::lPPO, "-hbraw ", "" ) + cHbpPath ), , @cOutput, @cErrors ) + nResult := hb_processRun( ( ::oProject:hbmk2dir + "hbmk2 " + iif( ::lPPO, "-hbraw ", "" ) + cHbpPath ), , @cOutput, @cErrors ) cTmp := cOutput + CRLF cTmp += IIF( empty( cErrors ), "", cErrors ) + CRLF @@ -1225,4 +1226,3 @@ STATIC FUNCTION hbide_outputLine( cLine, nOccur ) RETURN replicate( cLine, nOccur ) /*----------------------------------------------------------------------*/ - diff --git a/harbour/contrib/hbqt/generator/hbqtgen.prg b/harbour/contrib/hbqt/generator/hbqtgen.prg index e4843650b1..f55daea82d 100644 --- a/harbour/contrib/hbqt/generator/hbqtgen.prg +++ b/harbour/contrib/hbqt/generator/hbqtgen.prg @@ -534,11 +534,11 @@ STATIC FUNCTION GenSource( cProFile, cPathIn, cPathOut, cPathDoc ) aadd( cpp_, "typedef struct" ) aadd( cpp_, "{" ) - aadd( cpp_, " void * ph;" ) - aadd( cpp_, " bool bNew;" ) - aadd( cpp_, " QT_G_FUNC_PTR func;" ) + aadd( cpp_, " void * ph;" ) + aadd( cpp_, " bool bNew;" ) + aadd( cpp_, " QT_G_FUNC_PTR func;" ) IF lObject - aadd( cpp_, " QPointer< "+ cWidget +" > pq;" ) + aadd( cpp_, " QPointer< "+ cWidget +" > pq;" ) ENDIF aadd( cpp_, "} QGC_POINTER_" + cWidget + ";" ) aadd( cpp_, " " ) diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 5c450c73a8..49761194db 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -220,6 +220,10 @@ REQUEST hbmk_KEYW #define _HBMK_NEST_MAX 10 #define _HBMK_HEAD_NEST_MAX 10 +#define _VAR_MODE_SET 1 +#define _VAR_MODE_APPEND 2 +#define _VAR_MODE_INSERT 3 + #define _COMPEMBED_BASE_ ( "comp" + hb_osPathSeparator() ) #define _WORKDIR_BASE_ ".hbmk" @@ -296,40 +300,41 @@ REQUEST hbmk_KEYW #define _HBMK_lIGNOREERROR 54 #define _HBMK_lIMPLIB 55 #define _HBMK_lHBCPPMM 56 +#define _HBMK_aVAR 57 -#define _HBMK_lCreateLib 57 -#define _HBMK_lCreateDyn 58 +#define _HBMK_lCreateLib 58 +#define _HBMK_lCreateDyn 59 -#define _HBMK_lBLDFLGP 59 -#define _HBMK_lBLDFLGC 60 -#define _HBMK_lBLDFLGL 61 +#define _HBMK_lBLDFLGP 60 +#define _HBMK_lBLDFLGC 61 +#define _HBMK_lBLDFLGL 62 -#define _HBMK_cFIRST 62 -#define _HBMK_aPRG 63 -#define _HBMK_aC 64 -#define _HBMK_aCPP 65 -#define _HBMK_aRESSRC 66 -#define _HBMK_aRESCMP 67 -#define _HBMK_aOBJUSER 68 -#define _HBMK_aICON 69 -#define _HBMK_hDEPTS 70 +#define _HBMK_cFIRST 63 +#define _HBMK_aPRG 64 +#define _HBMK_aC 65 +#define _HBMK_aCPP 66 +#define _HBMK_aRESSRC 67 +#define _HBMK_aRESCMP 68 +#define _HBMK_aOBJUSER 69 +#define _HBMK_aICON 70 +#define _HBMK_hDEPTS 71 -#define _HBMK_aPO 71 -#define _HBMK_cHBL 72 -#define _HBMK_cHBLDir 73 -#define _HBMK_aLNG 74 -#define _HBMK_cPO 75 +#define _HBMK_aPO 72 +#define _HBMK_cHBL 73 +#define _HBMK_cHBLDir 74 +#define _HBMK_aLNG 75 +#define _HBMK_cPO 76 -#define _HBMK_lDEBUGTIME 76 -#define _HBMK_lDEBUGINC 77 -#define _HBMK_lDEBUGSTUB 78 -#define _HBMK_lDEBUGI18N 79 +#define _HBMK_lDEBUGTIME 77 +#define _HBMK_lDEBUGINC 78 +#define _HBMK_lDEBUGSTUB 79 +#define _HBMK_lDEBUGI18N 80 -#define _HBMK_cCCPATH 80 -#define _HBMK_cCCPREFIX 81 -#define _HBMK_cCCPOSTFIX 82 +#define _HBMK_cCCPATH 81 +#define _HBMK_cCCPREFIX 82 +#define _HBMK_cCCPOSTFIX 83 -#define _HBMK_MAX_ 82 +#define _HBMK_MAX_ 83 #ifndef _HBMK_EMBEDDED_ @@ -735,6 +740,7 @@ FUNCTION hbmk( aArgs, /* @ */ lPause ) hbmk[ _HBMK_lIGNOREERROR ] := .F. hbmk[ _HBMK_lIMPLIB ] := .F. hbmk[ _HBMK_lHBCPPMM ] := .F. + hbmk[ _HBMK_aVAR ] := {} hbmk[ _HBMK_lBLDFLGP ] := .F. hbmk[ _HBMK_lBLDFLGC ] := .F. @@ -836,6 +842,23 @@ FUNCTION hbmk( aArgs, /* @ */ lPause ) CASE cParamL == "-xhb" ; hbmk[ _HBMK_nHBMODE ] := _HBMODE_XHB CASE cParamL == "-hb10" ; hbmk[ _HBMK_nHBMODE ] := _HBMODE_HB10 CASE cParamL == "-hbc" ; hbmk[ _HBMK_nHBMODE ] := _HBMODE_RAW_C ; lAcceptCFlag := .T. + CASE Left( cParamL, 5 ) == "-env:" + + tmp := SubStr( cParam, 6 ) + IF ! Empty( tmp ) + IF ( tmp1 := At( "=", tmp ) ) > 1 + tmp2 := _VAR_MODE_SET + ELSEIF ( tmp1 := At( "+", tmp ) ) > 1 + tmp2 := _VAR_MODE_APPEND + ELSEIF ( tmp1 := At( "#", tmp ) ) > 1 + tmp2 := _VAR_MODE_INSERT + ELSE + tmp2 := _VAR_MODE_SET + tmp1 := Len( tmp ) + 1 + ENDIF + AAdd( hbmk[ _HBMK_aVAR ], { tmp2, Left( tmp, tmp1 - 1 ), SubStr( tmp, tmp1 + 1 ) } ) + ENDIF + CASE cParamL == "-help" .OR. ; cParamL == "--help" @@ -872,6 +895,14 @@ FUNCTION hbmk( aArgs, /* @ */ lPause ) ENDIF ENDIF + FOR EACH tmp IN hbmk[ _HBMK_aVAR ] + SWITCH tmp[ 1 ] + CASE _VAR_MODE_SET ; hb_SetEnv( tmp[ 2 ], tmp[ 3 ] ) ; EXIT + CASE _VAR_MODE_INSERT ; hb_SetEnv( tmp[ 2 ], tmp[ 3 ] + hb_GetEnv( tmp[ 2 ] ) ) ; EXIT + CASE _VAR_MODE_APPEND ; hb_SetEnv( tmp[ 2 ], hb_GetEnv( tmp[ 2 ] ) + tmp[ 3 ] ) ; EXIT + ENDSWITCH + NEXT + /* Initialize Harbour libs */ IF ! ( hbmk[ _HBMK_nHBMODE ] == _HBMODE_XHB ) @@ -1509,6 +1540,7 @@ FUNCTION hbmk( aArgs, /* @ */ lPause ) Left( cParamL, 6 ) == "-plat=" .OR. ; Left( cParamL, 10 ) == "-platform=" .OR. ; Left( cParamL, 6 ) == "-arch=" .OR. ; /* Compatibility */ + Left( cParamL, 5 ) == "-env:" .OR. ; cParamL == "-hbrun" .OR. ; cParamL == "-hbraw" .OR. ; cParamL == "-hbcmp" .OR. ; @@ -8136,6 +8168,8 @@ STATIC PROCEDURE ShowHelp( lLong ) { "-target" , I_( "marks beginning of options belonging to a new build target" ) },; { "-alltarget" , I_( "marks beginning of common options belonging to all targets" ) },; NIL,; + { "-env:[[]]", I_( "alter local environment. is the name of the environment variable to alter. can be '=' to set/override, '+' to append to the end of existing value, '#' to insert to the beginning of existing value. is the value to set/append/insert. If multiple options are passed, they are processed from left to right." ) },; + NIL,; { "-hbrun" , I_( "run target" ) },; { "-hbraw" , I_( "stop after running Harbour compiler" ) },; { "-hbcmp|-clipper" , I_( "stop after creating the object files\ncreate link/copy hbmk2 to hbcmp/clipper for the same effect" ) },;