diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 85a540076c..b5e7bd0b2c 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,54 @@ 2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2009-04-20 08:19 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * utils/hbmk2/hbmk2.prg + + Added experimental support for header directory autodetection. + This means that you can pass a list of possible dirs to use + when a .c header cannot be found in explicitly passed locations. + ! Fixed to always disable -shared with -hbdyn. + ! Added hbmaindllp in -hbdyn mode on win|wce. + ! Fix in -nohbp parameter handling. + + Added support for macros in -L, -*flag=, -workdir= + + Added -stop command line parameter which stops execution. + Can be used in conjunction with arch/comp filters to stop + execution on certain platforms/compilers. + ! Fixed to not create workdir in some unlikely combination of options. + ! Fixed typo causing newer headers not being detected in resource files. + + Now 'unix' can also be used in filters to check for any *nix platform. + % Excluding some well-known headers from parsing (windows.h, ole2, os2.h + currently) + ; Above changes makes it possible to use hbmk2 to build our contribs. + The only missing feature is 'install', what is a simple copy. + --- + -ohbpgsql + + # just for the sake of an example, not needed for real hbpgsql. + -stop{dos} + + -inctrypath=${HB_INC_PGSQL} + -inctrypath={unix}/usr/include + -inctrypath={unix}/usr/local/pgsql/include + -inctrypath={unix}/usr/local/pgsql/include/libpq + -inctrypath={unix}/usr/include/pgsql + -inctrypath={unix}/usr/include/postgresql + -inctrypath={unix}/postgres/include + -inctrypath={unix}/opt/local/include/postgresql83 + + postgres.c + + pgrdd.prg + tpostgre.prg + --- + + * contrib/hbole/oleinit.c + * contrib/hbole/hbwinole.h + * Cleanups in header usage and content. This should fix + missing hb_oleInit() symbol on some compilers. + + * contrib/examples/pp/hbpptbl.c + - Removed HB_EXTENSION protected two lines. + 2009-04-19 18:14 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/gtqtc/gtqtc.h * harbour/contrib/gtqtc/gtqtc.cpp @@ -73,7 +121,7 @@ + harbour/contrib/hbqt/TQTextDocumentWriter.prg + harbour/contrib/hbqt/TQTextFormat.prg + harbour/contrib/hbqt/TQTextStream.prg - + + Added several new classes, hbqtgen.prg adjusted for new definitions, implemented more info in the sources but deferred for next commit. @@ -94,54 +142,54 @@ * harbour/contrib/gtqtc/gtqtc.h * harbour/contrib/gtqtc/gtqtc.cpp * harbour/contrib/gtqtc/moc_gtqtc.cpp - + IMPLEMENTED : - Fired Events : HB_GTE_SETFOCUS | HB_GTE_KILLFOCUS | HB_GTE_RESIZE + + IMPLEMENTED : + Fired Events : HB_GTE_SETFOCUS | HB_GTE_KILLFOCUS | HB_GTE_RESIZE Cursor : SC_NONE | SC_NORMAL | SC_SPECIAL1 | SC_SPECIAL2 ! IMPROVED : Many artifacts. - + * harbour/contrib/gtqtc/tests/demoqtc.prg ! Modified to demonstarte above changes. NOTE: GTQTC is complete on base level. Only few gliches remain for - cursor management under certain circumstances. The lib is - tested on Winsow XP and QT 4.5 (2009.01). I am sure there - may be few issues coming up more you test on different + cursor management under certain circumstances. The lib is + tested on Winsow XP and QT 4.5 (2009.01). I am sure there + may be few issues coming up more you test on different platforms. So I am looking for feedback especially from *nix users. (::) At this point I will request Przemek to review gtqtc.c.h and point me to optimization it may require. - + 2009-04-17 11:47 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/hbqt/generator/hbqtgen.prg - ! oMenuBar:show() => oWnd:setMenuBar( QT_PTROF( oMenuBar ) ) + ! oMenuBar:show() => oWnd:setMenuBar( QT_PTROF( oMenuBar ) ) Thanks Bisz Istvin for provising the clue. 2009-04-17 08:36 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/gtqtc/gtqtc.h * harbour/contrib/gtqtc/gtqtc.cpp * harbour/contrib/gtqtc/moc_gtqtc.cpp - ! Fixed more Windows specific contents. It should compile + ! Fixed more Windows specific contents. It should compile on *nixes now [ Qt::WindowCloseButtonHint could be the exception ] + Implemented timer event. + Implemented PALETTE functionality of GTWVT. - + Implemented drawing console output to an image first and then + + Implemented drawing console output to an image first and then rendered onto the screen. This requirement is initiated because - nowhere I found a way to mimic blinking CARET. - The proof of concept is implemened through part of image - rendering in a timer event. It may introduce some overhead - but please be noted that we have to live with it until we + nowhere I found a way to mimic blinking CARET. + The proof of concept is implemened through part of image + rendering in a timer event. It may introduce some overhead + but please be noted that we have to live with it until we reach a proper solution. - + Rendered to image and then flushed to screen is a powerful feature of QT and we may take use of it in many ways in future. - Probably QTWVG will exploit it to maximum if we do not + Probably QTWVG will exploit it to maximum if we do not plan some extenstions in GTQTC. * harbour/contrib/gtqtc/tests/demoqtc.prg ! Demonstrated implemented facts as above. - Note the BLINKING block on the console, may be, + Note the BLINKING block on the console, may be, implemented as a replacement to windows caret. 2009-04-17 08:07 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) diff --git a/harbour/contrib/examples/pp/hbpptbl.c b/harbour/contrib/examples/pp/hbpptbl.c index 7518ea894b..51b6be94ac 100644 --- a/harbour/contrib/examples/pp/hbpptbl.c +++ b/harbour/contrib/examples/pp/hbpptbl.c @@ -403,17 +403,10 @@ void hb_pp_Table( void ) static COMMANDS sC___228 = {0,"CLEAR",5,"","CLEAR SCREEN ; CLEAR GETS",&sC___227 }; static COMMANDS sC___229 = {0,"CLEAR",5,"ALL", "CLOSE DATABASES ; CLOSE FORMAT ; CLEAR MEMORY ; CLEAR GETS ; SET ALTERNATE OFF ; SET ALTERNATE TO",&sC___228 }; -#ifdef HB_EXTENSION - static COMMANDS sC___230 = {0,"INDEX",5,"ON \1A00 \2TAG \1B40 \3 TO \1C40 \2FOR \1D00\3 \2\1E20ALL>\3 \2WHILE \1F00\3 \2NEXT \1G00\3 \2RECORD \1H00\3 \2\1I20REST>\3 \2EVAL \1J00\3 \2EVERY \1K00\3 \2\1L20 UNIQUE>\3 \2\1M20 ASCENDING>\3 \2\1N20 DESCENDING>\3 \2\1O20 USECURRENT>\3 \2\1P20 ADDITIVE>\3 \2\1R20 CUSTOM>\3 \2\1S20 NOOPTIMIZE>\3 \2\1T20 MEMORY>\3", - "ordCondSet( \1D20, \1D40, \2\1E50\3, \1F40, \1J40, \1K00, RECNO(), \1G00, \1H00, \2\1I50\3, \2\1N50\3,, \2\1P50\3, \2\1O50\3, \2\1R50\3, \2\1S50\3, \1F20, \2\1T50\3 ) ; ordCreate(\1C30, \1B30, \1A20, \1A40, \2\1L50\3 )",&sC___229 }; - static COMMANDS sC___231 = {0,"INDEX",5,"ON \1A00 TAG \1B40 \2TO \1C40\3 \2FOR \1D00\3 \2\1E20ALL>\3 \2WHILE \1F00\3 \2NEXT \1G00\3 \2RECORD \1H00\3 \2\1I20REST>\3 \2EVAL \1J00\3 \2EVERY \1K00\3 \2\1L20 UNIQUE>\3 \2\1M20 ASCENDING>\3 \2\1N20 DESCENDING>\3 \2\1O20 USECURRENT>\3 \2\1P20 ADDITIVE>\3 \2\1R20 CUSTOM>\3 \2\1S20 NOOPTIMIZE>\3 \2\1T20 MEMORY>\3", - "ordCondSet( \1D20, \1D40, \2\1E50\3, \1F40, \1J40, \1K00, RECNO(), \1G00, \1H00, \2\1I50\3, \2\1N50\3,, \2\1P50\3, \2\1O50\3, \2\1R50\3, \2\1S50\3, \1F20, \2\1T50\3 ) ; ordCreate(\1C30, \1B30, \1A20, \1A40, \2\1L50\3 )",&sC___230 }; -#else static COMMANDS sC___230 = {0,"INDEX",5,"ON \1A00 \2TAG \1B40 \3 TO \1C40 \2FOR \1D00\3 \2\1E20ALL>\3 \2WHILE \1F00\3 \2NEXT \1G00\3 \2RECORD \1H00\3 \2\1I20REST>\3 \2EVAL \1J00\3 \2EVERY \1K00\3 \2\1L20 UNIQUE>\3 \2\1M20 ASCENDING>\3 \2\1N20 DESCENDING>\3 \2\1O20 USECURRENT>\3 \2\1P20 ADDITIVE>\3 \2\1R20 CUSTOM>\3 \2\1S20 NOOPTIMIZE>\3", "ordCondSet( \1D20, \1D40, \2\1E50\3, \1F40, \1J40, \1K00, RECNO(), \1G00, \1H00, \2\1I50\3, \2\1N50\3,, \2\1P50\3, \2\1O50\3, \2\1R50\3, \2\1S50\3, \1F20 ) ; ordCreate(\1C30, \1B30, \1A20, \1A40, \2\1L50\3 )",&sC___229 }; static COMMANDS sC___231 = {0,"INDEX",5,"ON \1A00 TAG \1B40 \2TO \1C40\3 \2FOR \1D00\3 \2\1E20ALL>\3 \2WHILE \1F00\3 \2NEXT \1G00\3 \2RECORD \1H00\3 \2\1I20REST>\3 \2EVAL \1J00\3 \2EVERY \1K00\3 \2\1L20 UNIQUE>\3 \2\1M20 ASCENDING>\3 \2\1N20 DESCENDING>\3 \2\1O20 USECURRENT>\3 \2\1P20 ADDITIVE>\3 \2\1R20 CUSTOM>\3 \2\1S20 NOOPTIMIZE>\3", "ordCondSet( \1D20, \1D40, \2\1E50\3, \1F40, \1J40, \1K00, RECNO(), \1G00, \1H00, \2\1I50\3, \2\1N50\3,, \2\1P50\3, \2\1O50\3, \2\1R50\3, \2\1S50\3, \1F20 ) ; ordCreate(\1C30, \1B30, \1A20, \1A40, \2\1L50\3 )",&sC___230 }; -#endif static COMMANDS sC___232 = {0,"INDEX",5,"ON \1A00 TO \1B40 \2\1C20 UNIQUE>\3", "dbCreateIndex( \1B30, \1A20, \1A40, if( \1C50, .T., NIL ) )",&sC___231 }; static COMMANDS sC___233 = {0,"DELETE",6,"TAG \1A40 \2 IN \1B40 \3 \2, \1C40 \2 IN \1D40 \3 \3", diff --git a/harbour/contrib/hbole/hbwinole.h b/harbour/contrib/hbole/hbwinole.h index 1047421d9f..1773900be1 100644 --- a/harbour/contrib/hbole/hbwinole.h +++ b/harbour/contrib/hbole/hbwinole.h @@ -59,8 +59,6 @@ #include "hbdate.h" #include "hbinit.h" -HB_EXTERN_BEGIN - /* This option can resolve compilation problems in C++ mode for some * compilers like OpenWatcom but not for all, f.e. it will not help * BCC when used with -P (C++ mode) switch. @@ -78,6 +76,8 @@ HB_EXTERN_BEGIN #define NONAMELESSUNION #endif +#include + /* macros used to hide type of interface: C or C++ */ #if defined( __cplusplus ) && !defined( CINTERFACE ) && \ @@ -90,7 +90,7 @@ HB_EXTERN_BEGIN # define HB_ID_REF( id ) ( &id ) #endif -#include +HB_EXTERN_BEGIN HB_EXPORT void hb_oleVariantToItem( PHB_ITEM pItem, VARIANT* pVariant ); HB_EXPORT void hb_oleInit( void ); diff --git a/harbour/contrib/hbole/oleinit.c b/harbour/contrib/hbole/oleinit.c index 177c96818c..4c7b3ac17a 100644 --- a/harbour/contrib/hbole/oleinit.c +++ b/harbour/contrib/hbole/oleinit.c @@ -50,18 +50,16 @@ * */ - -#include "hbvm.h" -#include "windows.h" +#include "hbwinole.h" /* - * Duplicated OleUninitialize() call causes GPF. So, if a few OLE libraries + * Duplicated OleUninitialize() call causes GPF. So, if a few OLE libraries * is used inside Harbour code, you can expect GPF on application exit. - * This code does not implement any OLE interface except initialization. It is + * This code does not implement any OLE interface except initialization. It is * have to be used from all other OLE libraries. [Mindaugas] */ -static int s_iOleInit = 0; +static int s_iOleInit = 0; static void hb_ole_exit( void* cargo ) { @@ -74,8 +72,7 @@ static void hb_ole_exit( void* cargo ) } } - -HB_EXPORT void hb_oleInit() +void hb_oleInit() { if( ! s_iOleInit ) { diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index ff0cd19aee..2e1a49eeab 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -123,10 +123,14 @@ STATIC s_cCOMP STATIC s_aLIBCOREGT STATIC s_cGTDEFAULT +STATIC s_aOPTPRG +STATIC s_aOPTC STATIC s_lGUI := .F. STATIC s_lMT := .F. STATIC s_lDEBUG := .F. STATIC s_nHEAD := _HEAD_PARTIAL +STATIC s_aINCTRYPATH +STATIC s_lREBUILD := .F. STATIC s_lDEBUGINC := .F. STATIC s_lDEBUGSTUB := .F. @@ -262,8 +266,6 @@ FUNCTION hbmk( aArgs ) LOCAL s_aLIBDYNHAS LOCAL s_aLIBSYSCORE := {} LOCAL s_aLIBSYSMISC := {} - LOCAL s_aOPTPRG - LOCAL s_aOPTC LOCAL s_aOPTRES LOCAL s_aOPTL LOCAL s_aOPTA @@ -295,7 +297,6 @@ FUNCTION hbmk( aArgs ) LOCAL s_lBLDFLGL := .F. LOCAL s_lRUN := .F. LOCAL s_lINC := .F. - LOCAL s_lREBUILD := .F. LOCAL s_lCLEAN := .F. LOCAL s_nJOBS := 1 @@ -788,6 +789,7 @@ FUNCTION hbmk( aArgs ) s_aOPTRUN := {} s_aRESSRC := {} s_aRESCMP := {} + s_aINCTRYPATH := {} s_aLIBUSER := {} s_aLIBUSERGT := {} s_aLIBDYNHAS := {} @@ -837,6 +839,7 @@ FUNCTION hbmk( aArgs ) @s_aLIBUSERGT,; @s_aLIBPATH,; @s_aLIBDYNHAS,; + @s_aINCTRYPATH,; @s_aOPTPRG,; @s_aOPTC,; @s_aOPTRES,; @@ -883,6 +886,7 @@ FUNCTION hbmk( aArgs ) cParamL == "-hblnk" .OR. ; cParamL == "-hblib" .OR. ; cParamL == "-hbdyn" .OR. ; + cParamL == "-nohbp" .OR. ; cParamL == "-clipper" .OR. ; cParamL == "-rtlink" .OR. ; cParamL == "-blinker" .OR. ; @@ -1041,14 +1045,29 @@ FUNCTION hbmk( aArgs ) CASE Left( cParam, 2 ) == "-L" .AND. ; Len( cParam ) > 2 - cParam := ArchCompFilter( SubStr( cParam, 3 ) ) + cParam := MacroProc( ArchCompFilter( SubStr( cParam, 3 ) ) ) IF ! Empty( cParam ) AAdd( s_aLIBPATH, PathSepToTarget( cParam ) ) ENDIF + CASE Left( cParamL, Len( "-inctrypath=" ) ) == "-inctrypath=" .AND. ; + Len( cParamL ) > Len( "-inctrypath=" ) + + cParam := MacroProc( tmp := ArchCompFilter( SubStr( cParam, Len( "-inctrypath=" ) + 1 ) ) ) + IF ! Empty( cParam ) + AAdd( s_aINCTRYPATH, PathSepToTarget( cParam ) ) + ENDIF + + CASE Left( cParamL, Len( "-stop" ) ) == "-stop" + + cParam := ArchCompFilter( cParam ) + IF ! Empty( cParam ) + lStopAfterInit := .T. + ENDIF + CASE Left( cParamL, Len( "-prgflag=" ) ) == "-prgflag=" - cParam := ArchCompFilter( SubStr( cParam, Len( "-prgflag=" ) + 1 ) ) + cParam := MacroProc( ArchCompFilter( SubStr( cParam, Len( "-prgflag=" ) + 1 ) ) ) IF Left( cParam, 1 ) $ cOptPrefix IF SubStr( cParamL, 2 ) == "gh" lStopAfterHarbour := .T. @@ -1060,49 +1079,49 @@ FUNCTION hbmk( aArgs ) CASE Left( cParamL, Len( "-cflag=" ) ) == "-cflag=" - cParam := ArchCompFilter( SubStr( cParam, Len( "-cflag=" ) + 1 ) ) + cParam := MacroProc( ArchCompFilter( SubStr( cParam, Len( "-cflag=" ) + 1 ) ) ) IF Left( cParam, 1 ) $ cOptPrefix AAdd( s_aOPTC , PathSepToTarget( cParam, 2 ) ) ENDIF CASE Left( cParamL, Len( "-resflag=" ) ) == "-resflag=" - cParam := ArchCompFilter( SubStr( cParam, Len( "-resflag=" ) + 1 ) ) + cParam := MacroProc( ArchCompFilter( SubStr( cParam, Len( "-resflag=" ) + 1 ) ) ) IF Left( cParam, 1 ) $ cOptPrefix AAdd( s_aOPTRES , PathSepToTarget( cParam, 2 ) ) ENDIF CASE Left( cParamL, Len( "-ldflag=" ) ) == "-ldflag=" - cParam := ArchCompFilter( SubStr( cParam, Len( "-ldflag=" ) + 1 ) ) + cParam := MacroProc( ArchCompFilter( SubStr( cParam, Len( "-ldflag=" ) + 1 ) ) ) IF Left( cParam, 1 ) $ cOptPrefix AAdd( s_aOPTL , PathSepToTarget( cParam, 2 ) ) ENDIF CASE Left( cParamL, Len( "-dflag=" ) ) == "-dflag=" - cParam := ArchCompFilter( SubStr( cParam, Len( "-dflag=" ) + 1 ) ) + cParam := MacroProc( ArchCompFilter( SubStr( cParam, Len( "-dflag=" ) + 1 ) ) ) IF Left( cParam, 1 ) $ cOptPrefix AAdd( s_aOPTD , PathSepToTarget( cParam, 2 ) ) ENDIF CASE Left( cParamL, Len( "-aflag=" ) ) == "-aflag=" - cParam := ArchCompFilter( SubStr( cParam, Len( "-aflag=" ) + 1 ) ) + cParam := MacroProc( ArchCompFilter( SubStr( cParam, Len( "-aflag=" ) + 1 ) ) ) IF Left( cParam, 1 ) $ cOptPrefix AAdd( s_aOPTA , PathSepToTarget( cParam, 2 ) ) ENDIF CASE Left( cParamL, Len( "-runflag=" ) ) == "-runflag=" - cParam := ArchCompFilter( SubStr( cParam, Len( "-runflag=" ) + 1 ) ) + cParam := MacroProc( ArchCompFilter( SubStr( cParam, Len( "-runflag=" ) + 1 ) ) ) IF Left( cParam, 1 ) $ cOptPrefix AAdd( s_aOPTRUN , PathSepToTarget( cParam, 2 ) ) ENDIF CASE Left( cParamL, Len( "-workdir=" ) ) == "-workdir=" - cWorkDir := PathSepToTarget( ArchCompFilter( SubStr( cParam, Len( "-workdir=" ) + 1 ) ) ) + cWorkDir := PathSepToTarget( MacroProc( ArchCompFilter( SubStr( cParam, Len( "-workdir=" ) + 1 ) ) ) ) CASE Left( cParam, 2 ) == "-l" .AND. ; Len( cParam ) > 2 .AND. ; @@ -1161,6 +1180,7 @@ FUNCTION hbmk( aArgs ) @s_aLIBUSERGT,; @s_aLIBPATH,; @s_aLIBDYNHAS,; + @s_aINCTRYPATH,; @s_aOPTPRG,; @s_aOPTC,; @s_aOPTRES,; @@ -1244,23 +1264,29 @@ FUNCTION hbmk( aArgs ) ENDCASE NEXT + IF lCreateDyn .AND. s_lSHARED + s_lSHARED := .F. + ENDIF + /* Start doing the make process. */ IF ! lStopAfterInit .AND. ( Len( s_aPRG ) + Len( s_aC ) + Len( s_aOBJUSER ) + Len( s_aOBJA ) ) == 0 OutErr( "hbmk: Error: No source files were specified." + hb_osNewLine() ) RETURN 4 ENDIF - IF s_lINC - IF cWorkDir == NIL - cWorkDir := s_cARCH + hb_osPathSeparator() + s_cCOMP + IF ! lStopAfterInit + IF s_lINC + IF cWorkDir == NIL + cWorkDir := s_cARCH + hb_osPathSeparator() + s_cCOMP + ENDIF + AAdd( s_aOPTPRG, "-o" + cWorkDir + hb_osPathSeparator() ) /* NOTE: Ending path sep is important. */ + IF ! DirBuild( cWorkDir ) + OutErr( "hbmk: Error: Working directory cannot be created: " + cWorkDir + hb_osNewLine() ) + RETURN 9 + ENDIF + ELSE + cWorkDir := "" ENDIF - AAdd( s_aOPTPRG, "-o" + cWorkDir + hb_osPathSeparator() ) /* NOTE: Ending path sep is important. */ - IF ! DirBuild( cWorkDir ) - OutErr( "hbmk: Error: Working directory cannot be created: " + cWorkDir + hb_osNewLine() ) - RETURN 9 - ENDIF - ELSE - cWorkDir := "" ENDIF IF ! lStopAfterInit .AND. ! lStopAfterHarbour @@ -1287,7 +1313,7 @@ FUNCTION hbmk( aArgs ) IF ! hb_FGetDateTime( FN_DirExtSet( tmp, cWorkDir, ".c" ), @tmp2 ) .OR. ; ! hb_FGetDateTime( FN_ExtSet( tmp, ".prg" ), @tmp1 ) .OR. ; tmp1 > tmp2 .OR. ; - ( s_nHEAD != _HEAD_OFF .AND. FindNewerHeaders( FN_ExtSet( tmp, ".prg" ), tmp2, OPTPRG_to_INCPATH( s_aOPTPRG, s_cHB_INC_INSTALL ), @headstate ) ) + ( s_nHEAD != _HEAD_OFF .AND. FindNewerHeaders( FN_ExtSet( tmp, ".prg" ), tmp2, .F., OPTPRG_to_INCPATH( s_aOPTPRG, s_cHB_INC_INSTALL ), @headstate ) ) AAdd( s_aPRG_TODO, tmp ) ENDIF NEXT @@ -2264,6 +2290,7 @@ FUNCTION hbmk( aArgs ) IF lCreateDyn .AND. s_cARCH $ "win|wce" AAdd( s_aOPTC, "-DHB_DYNLIB" ) + AAdd( aLIB_BASE1, "hbmaindllp" ) ENDIF /* Do entry function detection on platform required and supported */ @@ -2407,8 +2434,8 @@ FUNCTION hbmk( aArgs ) ENDIF IF ! hb_FGetDateTime( FN_DirExtSet( tmp, cWorkDir, cResExt ), @tmp2 ) .OR. ; ! hb_FGetDateTime( tmp, @tmp1 ) .OR. ; - tmp1 > tmp2 - ( s_nHEAD != _HEAD_OFF .AND. FindNewerHeaders( tmp, tmp2, OPTC_to_INCPATH( s_aOPTRES, s_cHB_INC_INSTALL ), @headstate ) ) + tmp1 > tmp2 .OR. ; + ( s_nHEAD != _HEAD_OFF .AND. FindNewerHeaders( tmp, tmp2, .F., OPTC_to_INCPATH( s_aOPTRES, s_cHB_INC_INSTALL ), @headstate ) ) AAdd( s_aRESSRC_TODO, tmp ) ENDIF NEXT @@ -2494,6 +2521,9 @@ FUNCTION hbmk( aArgs ) ENDIF IF nErrorLevel == 0 + + headstate := NIL + IF s_lINC .AND. ! s_lREBUILD s_aC_TODO := {} s_aC_DONE := {} @@ -2504,7 +2534,7 @@ FUNCTION hbmk( aArgs ) IF ! hb_FGetDateTime( FN_DirExtSet( tmp, cWorkDir, cObjExt ), @tmp2 ) .OR. ; ! hb_FGetDateTime( tmp, @tmp1 ) .OR. ; tmp1 > tmp2 .OR. ; - ( s_nHEAD != _HEAD_OFF .AND. FindNewerHeaders( tmp, tmp2, OPTC_to_INCPATH( s_aOPTC, s_cHB_INC_INSTALL ), @headstate ) ) + ( s_nHEAD != _HEAD_OFF .AND. FindNewerHeaders( tmp, tmp2, ! Empty( s_aINCTRYPATH ), OPTC_to_INCPATH( s_aOPTC, s_cHB_INC_INSTALL ), @headstate ) ) AAdd( s_aC_TODO, tmp ) ELSE AAdd( s_aC_DONE, tmp ) @@ -2515,6 +2545,13 @@ FUNCTION hbmk( aArgs ) s_aC_DONE := {} ENDIF + /* Header dir detection if needed and if FindNewerHeaders() wasn't called yet. */ + IF ! Empty( s_aINCTRYPATH ) .AND. ! Empty( s_aC_TODO ) .AND. headstate == NIL + FOR EACH tmp IN s_aC + FindNewerHeaders( tmp, NIL, .T., OPTC_to_INCPATH( s_aOPTC, s_cHB_INC_INSTALL ), @headstate ) + NEXT + ENDIF + IF s_lINC .AND. ! s_lREBUILD s_aPRG_TODO := {} s_aPRG_DONE := {} @@ -2978,24 +3015,29 @@ STATIC FUNCTION SetupForGT( cGT, /* @ */ s_cGT, /* @ */ s_lGUI ) If this isn't enough for your needs, feel free to update the code. [vszakats] */ -STATIC FUNCTION FindNewerHeaders( cFileName, tTimeParent, aINCPATH, /* @ */ hFiles, nEmbedLevel ) +#define _HEADSTATE_hFiles 1 +#define _HEADSTATE_lAnyNewer 2 +#define _HEADSTATE_MAX_ 2 + +STATIC FUNCTION FindNewerHeaders( cFileName, tTimeParent, lIncTry, aINCPATH, /* @ */ headstate, nEmbedLevel ) LOCAL cFile LOCAL fhnd LOCAL nPos LOCAL tTimeSelf LOCAL tmp + LOCAL cNameExtL - IF ! hb_isTimeStamp( tTimeParent ) - RETURN .F. - ENDIF + STATIC s_aExcl := { "windows.h", "ole2.h", "os2.h" } DEFAULT nEmbedLevel TO 1 IF nEmbedLevel == 1 - hFiles := hb_Hash() + headstate := Array( _HEADSTATE_MAX_ ) + headstate[ _HEADSTATE_hFiles ] := hb_Hash() + headstate[ _HEADSTATE_lAnyNewer ] := .F. ENDIF - IF s_nHEAD == _HEAD_OFF + IF ! lIncTry .AND. s_nHEAD == _HEAD_OFF RETURN .F. ENDIF @@ -3009,15 +3051,21 @@ STATIC FUNCTION FindNewerHeaders( cFileName, tTimeParent, aINCPATH, /* @ */ hFil RETURN .F. ENDIF - cFileName := FindHeader( cFileName, aINCPATH ) + /* Don't spend time on some known headers */ + cNameExtL := Lower( FN_NameExtGet( cFileName ) ) + IF AScan( s_aExcl, { |tmp| Lower( tmp ) == cNameExtL } ) > 0 + RETURN .F. + ENDIF + + cFileName := FindHeader( cFileName, aINCPATH, iif( lIncTry, s_aINCTRYPATH, NIL ) ) IF Empty( cFileName ) RETURN .F. ENDIF - IF hb_HPos( hFiles, cFileName ) > 0 + IF hb_HPos( headstate[ _HEADSTATE_hFiles ], cFileName ) > 0 RETURN .F. ENDIF - hb_HSet( hFiles, cFileName, .T. ) + hb_HSet( headstate[ _HEADSTATE_hFiles ], cFileName, .T. ) IF s_lDEBUGINC OutStd( "hbmk: debuginc: HEADER", cFileName, hb_osNewLine() ) @@ -3027,8 +3075,12 @@ STATIC FUNCTION FindNewerHeaders( cFileName, tTimeParent, aINCPATH, /* @ */ hFil RETURN .F. ENDIF - IF tTimeSelf > tTimeParent - RETURN .T. + IF tTimeParent != NIL .AND. tTimeSelf > tTimeParent + headstate[ _HEADSTATE_lAnyNewer ] := .T. + /* Let it continue if we want to scan for header locations */ + IF ! lIncTry + RETURN .T. + ENDIF ENDIF /* NOTE: Beef up this section if you need a more intelligent source @@ -3036,7 +3088,7 @@ STATIC FUNCTION FindNewerHeaders( cFileName, tTimeParent, aINCPATH, /* @ */ hFil .prg, .c and .res sources. Please try to keep it simple, as speed and maintainability is also important. [vszakats] */ - IF s_nHEAD == _HEAD_FULL + IF lIncTry .OR. s_nHEAD == _HEAD_FULL cFile := MemoRead( cFileName ) ELSE IF ( fhnd := FOpen( cFileName, FO_READ + FO_SHARED ) ) == F_ERROR @@ -3051,14 +3103,17 @@ STATIC FUNCTION FindNewerHeaders( cFileName, tTimeParent, aINCPATH, /* @ */ hFil DO WHILE ( tmp := hb_At( '#include "', cFile, nPos ) ) > 0 nPos := tmp + Len( '#include "' ) IF ( tmp := hb_At( '"', cFile, nPos ) ) > 0 - IF FindNewerHeaders( SubStr( cFile, nPos, tmp - nPos ), tTimeParent, aINCPATH, @hFiles, nEmbedLevel + 1 ) - hFiles := NIL - RETURN .T. + IF FindNewerHeaders( SubStr( cFile, nPos, tmp - nPos ), tTimeParent, lIncTry, aINCPATH, @headstate, nEmbedLevel + 1 ) + headstate[ _HEADSTATE_lAnyNewer ] := .T. + /* Let it continue if we want to scan for header locations */ + IF ! lIncTry + RETURN .T. + ENDIF ENDIF ENDIF ENDDO - RETURN .F. + RETURN headstate[ _HEADSTATE_lAnyNewer ] STATIC FUNCTION OPTPRG_to_INCPATH( aOPT, cHB_INC_INSTALL ) LOCAL aINCPATH := {} @@ -3098,7 +3153,7 @@ STATIC FUNCTION OPTC_to_INCPATH( aOPT, cHB_INC_INSTALL ) RETURN aINCPATH -STATIC FUNCTION FindHeader( cFileName, aINCPATH ) +STATIC FUNCTION FindHeader( cFileName, aINCPATH, aINCTRYPATH ) LOCAL cDir /* Check in current dir */ @@ -3113,6 +3168,23 @@ STATIC FUNCTION FindHeader( cFileName, aINCPATH ) ENDIF NEXT + /* Check in potential include path list */ + FOR EACH cDir IN aINCTRYPATH + IF hb_FileExists( DirAddPathSep( PathSepToSelf( cDir ) ) + cFileName ) + /* Add these dir to include paths */ + IF AScan( aINCPATH, { |tmp| tmp == cDir } ) == 0 + AAdd( aINCPATH, cDir ) + ENDIF + IF AScan( s_aOPTC, { |tmp| tmp == "-I" + cDir } ) == 0 + IF s_lDEBUGINC + OutStd( "hbmk: debuginc: Autodetected header dir for " + cFileName + ": " + cDir, hb_osNewLine() ) + ENDIF + AAdd( s_aOPTC, "-I" + cDir ) + ENDIF + RETURN DirAddPathSep( PathSepToSelf( cDir ) ) + cFileName + ENDIF + NEXT + RETURN NIL /* Replicating logic used by compilers. */ @@ -3645,6 +3717,7 @@ STATIC PROCEDURE HBP_ProcessAll( lConfigOnly,; /* @ */ aLIBUSERGT,; /* @ */ aLIBPATH,; /* @ */ aLIBDYNHAS,; + /* @ */ aINCTRYPATH,; /* @ */ aOPTPRG,; /* @ */ aOPTC,; /* @ */ aOPTRES,; @@ -3689,6 +3762,7 @@ STATIC PROCEDURE HBP_ProcessAll( lConfigOnly,; @aLIBUSERGT,; @aLIBPATH,; @aLIBDYNHAS,; + @aINCTRYPATH,; @aOPTPRG,; @aOPTC,; @aOPTRES,; @@ -3723,6 +3797,7 @@ STATIC PROCEDURE HBP_ProcessAll( lConfigOnly,; @aLIBUSERGT,; @aLIBPATH,; @aLIBDYNHAS,; + @aINCTRYPATH,; @aOPTPRG,; @aOPTC,; @aOPTRES,; @@ -3754,6 +3829,7 @@ STATIC PROCEDURE HBP_ProcessOne( cFileName,; /* @ */ aLIBUSERGT,; /* @ */ aLIBPATH,; /* @ */ aLIBDYNHAS,; + /* @ */ aINCTRYPATH,; /* @ */ aOPTPRG,; /* @ */ aOPTC,; /* @ */ aOPTRES,; @@ -3788,7 +3864,7 @@ STATIC PROCEDURE HBP_ProcessOne( cFileName,; cLine := AllTrim( ArchCompFilter( AllTrim( cLine ) ) ) DO CASE - CASE Lower( Left( cLine, Len( "libs=" ) ) ) == "libs=" ; cLine := SubStr( cLine, Len( "libs=" ) + 1 ) + CASE Lower( Left( cLine, Len( "libs=" ) ) ) == "libs=" ; cLine := SubStr( cLine, Len( "libs=" ) + 1 ) FOR EACH cItem IN hb_ATokens( cLine,, .T. ) cItem := PathSepToTarget( StrStripQuote( cItem ) ) IF AScan( aLIBUSER, {|tmp| tmp == cItem } ) == 0 @@ -3796,7 +3872,7 @@ STATIC PROCEDURE HBP_ProcessOne( cFileName,; ENDIF NEXT - CASE Lower( Left( cLine, Len( "libpaths=" ) ) ) == "libpaths=" ; cLine := SubStr( cLine, Len( "libpaths=" ) + 1 ) + CASE Lower( Left( cLine, Len( "libpaths=" ) ) ) == "libpaths=" ; cLine := SubStr( cLine, Len( "libpaths=" ) + 1 ) FOR EACH cItem IN hb_ATokens( cLine,, .T. ) cItem := PathSepToTarget( MacroProc( StrStripQuote( cItem ), FN_DirGet( cFileName ) ) ) IF AScan( aLIBPATH, {|tmp| tmp == cItem } ) == 0 @@ -3804,11 +3880,19 @@ STATIC PROCEDURE HBP_ProcessOne( cFileName,; ENDIF NEXT + CASE Lower( Left( cLine, Len( "inctrypaths=" ) ) ) == "inctrypaths=" ; cLine := SubStr( cLine, Len( "inctrypaths=" ) + 1 ) + FOR EACH cItem IN hb_ATokens( cLine,, .T. ) + cItem := PathSepToTarget( MacroProc( StrStripQuote( cItem ), FN_DirGet( cFileName ) ) ) + IF AScan( aINCTRYPATH, {|tmp| tmp == cItem } ) == 0 + AAddNotEmpty( aINCTRYPATH, cItem ) + ENDIF + NEXT + /* NOTE: This keyword is used in hbmk.cfg and signals whether a given optional module (gtsln, gtcrs, gtxwc) is part of the Harbour shared library, so that we can automatically add the required libs here. [vszakats] */ - CASE Lower( Left( cLine, Len( "libdynhas=" ) ) ) == "libdynhas=" ; cLine := SubStr( cLine, Len( "libdynhas=" ) + 1 ) + CASE Lower( Left( cLine, Len( "libdynhas=" ) ) ) == "libdynhas=" ; cLine := SubStr( cLine, Len( "libdynhas=" ) + 1 ) FOR EACH cItem IN hb_ATokens( cLine,, .T. ) cItem := PathSepToTarget( StrStripQuote( cItem ) ) IF ! Empty( cItem ) @@ -3822,13 +3906,13 @@ STATIC PROCEDURE HBP_ProcessOne( cFileName,; ENDIF NEXT - CASE Lower( Left( cLine, Len( "echo=" ) ) ) == "echo=" ; cLine := SubStr( cLine, Len( "echo=" ) + 1 ) + CASE Lower( Left( cLine, Len( "echo=" ) ) ) == "echo=" ; cLine := SubStr( cLine, Len( "echo=" ) + 1 ) cLine := MacroProc( cLine, FN_DirGet( cFileName ) ) IF ! Empty( cLine ) OutStd( cLine + hb_osNewLine() ) ENDIF - CASE Lower( Left( cLine, Len( "prgflags=" ) ) ) == "prgflags=" ; cLine := SubStr( cLine, Len( "prgflags=" ) + 1 ) + CASE Lower( Left( cLine, Len( "prgflags=" ) ) ) == "prgflags=" ; cLine := SubStr( cLine, Len( "prgflags=" ) + 1 ) FOR EACH cItem IN hb_ATokens( cLine,, .T. ) cItem := PathSepToTarget( MacroProc( StrStripQuote( cItem ), FN_DirGet( cFileName ) ) ) IF AScan( aOPTPRG, {|tmp| tmp == cItem } ) == 0 @@ -3836,7 +3920,7 @@ STATIC PROCEDURE HBP_ProcessOne( cFileName,; ENDIF NEXT - CASE Lower( Left( cLine, Len( "cflags=" ) ) ) == "cflags=" ; cLine := SubStr( cLine, Len( "cflags=" ) + 1 ) + CASE Lower( Left( cLine, Len( "cflags=" ) ) ) == "cflags=" ; cLine := SubStr( cLine, Len( "cflags=" ) + 1 ) FOR EACH cItem IN hb_ATokens( cLine,, .T. ) cItem := MacroProc( StrStripQuote( cItem ), FN_DirGet( cFileName ) ) IF AScan( aOPTC, {|tmp| tmp == cItem } ) == 0 @@ -3844,7 +3928,7 @@ STATIC PROCEDURE HBP_ProcessOne( cFileName,; ENDIF NEXT - CASE Lower( Left( cLine, Len( "resflags=" ) ) ) == "resflags=" ; cLine := SubStr( cLine, Len( "resflags=" ) + 1 ) + CASE Lower( Left( cLine, Len( "resflags=" ) ) ) == "resflags=" ; cLine := SubStr( cLine, Len( "resflags=" ) + 1 ) FOR EACH cItem IN hb_ATokens( cLine,, .T. ) cItem := MacroProc( StrStripQuote( cItem ), FN_DirGet( cFileName ) ) IF AScan( aOPTRES, {|tmp| tmp == cItem } ) == 0 @@ -3852,7 +3936,7 @@ STATIC PROCEDURE HBP_ProcessOne( cFileName,; ENDIF NEXT - CASE Lower( Left( cLine, Len( "ldflags=" ) ) ) == "ldflags=" ; cLine := SubStr( cLine, Len( "ldflags=" ) + 1 ) + CASE Lower( Left( cLine, Len( "ldflags=" ) ) ) == "ldflags=" ; cLine := SubStr( cLine, Len( "ldflags=" ) + 1 ) FOR EACH cItem IN hb_ATokens( cLine,, .T. ) cItem := MacroProc( StrStripQuote( cItem ), FN_DirGet( cFileName ) ) IF AScan( aOPTL, {|tmp| tmp == cItem } ) == 0 @@ -3860,69 +3944,69 @@ STATIC PROCEDURE HBP_ProcessOne( cFileName,; ENDIF NEXT - CASE Lower( Left( cLine, Len( "gui=" ) ) ) == "gui=" ; cLine := SubStr( cLine, Len( "gui=" ) + 1 ) + CASE Lower( Left( cLine, Len( "gui=" ) ) ) == "gui=" ; cLine := SubStr( cLine, Len( "gui=" ) + 1 ) DO CASE CASE ValueIsT( cLine ) ; lGUI := .T. CASE ValueIsF( cLine ) ; lGUI := .F. ENDCASE - CASE Lower( Left( cLine, Len( "mt=" ) ) ) == "mt=" ; cLine := SubStr( cLine, Len( "mt=" ) + 1 ) + CASE Lower( Left( cLine, Len( "mt=" ) ) ) == "mt=" ; cLine := SubStr( cLine, Len( "mt=" ) + 1 ) DO CASE CASE Lower( cLine ) == "mt" ; lMT := .T. /* Compatibility */ CASE ValueIsT( cLine ) ; lMT := .T. CASE ValueIsF( cLine ) ; lMT := .F. ENDCASE - CASE Lower( Left( cLine, Len( "shareddef=" ) ) ) == "shareddef=" ; cLine := SubStr( cLine, Len( "shareddef=" ) + 1 ) + CASE Lower( Left( cLine, Len( "shareddef=" ) ) ) == "shareddef=" ; cLine := SubStr( cLine, Len( "shareddef=" ) + 1 ) IF lSHARED == NIL DO CASE CASE ValueIsT( cLine ) ; lSHARED := .T. ; lSTATICFULL := .F. CASE ValueIsF( cLine ) ; lSHARED := .F. ; lSTATICFULL := .F. ENDCASE ENDIF - CASE Lower( Left( cLine, Len( "shared=" ) ) ) == "shared=" ; cLine := SubStr( cLine, Len( "shared=" ) + 1 ) + CASE Lower( Left( cLine, Len( "shared=" ) ) ) == "shared=" ; cLine := SubStr( cLine, Len( "shared=" ) + 1 ) DO CASE CASE ValueIsT( cLine ) ; lSHARED := .T. ; lSTATICFULL := .F. CASE ValueIsF( cLine ) ; lSHARED := .F. ; lSTATICFULL := .F. ENDCASE - CASE Lower( Left( cLine, Len( "fullstatic=" ) ) ) == "fullstatic=" ; cLine := SubStr( cLine, Len( "fullstatic=" ) + 1 ) + CASE Lower( Left( cLine, Len( "fullstatic=" ) ) ) == "fullstatic=" ; cLine := SubStr( cLine, Len( "fullstatic=" ) + 1 ) DO CASE CASE ValueIsT( cLine ) ; lSHARED := .F. ; lSTATICFULL := .T. CASE ValueIsF( cLine ) ; lSHARED := .F. ; lSTATICFULL := .F. ENDCASE - CASE Lower( Left( cLine, Len( "debug=" ) ) ) == "debug=" ; cLine := SubStr( cLine, Len( "debug=" ) + 1 ) + CASE Lower( Left( cLine, Len( "debug=" ) ) ) == "debug=" ; cLine := SubStr( cLine, Len( "debug=" ) + 1 ) DO CASE CASE ValueIsT( cLine ) ; lDEBUG := .T. CASE ValueIsF( cLine ) ; lDEBUG := .F. ENDCASE - CASE Lower( Left( cLine, Len( "opt=" ) ) ) == "opt=" ; cLine := SubStr( cLine, Len( "opt=" ) + 1 ) + CASE Lower( Left( cLine, Len( "opt=" ) ) ) == "opt=" ; cLine := SubStr( cLine, Len( "opt=" ) + 1 ) DO CASE CASE ValueIsT( cLine ) ; lOPT := .T. CASE ValueIsF( cLine ) ; lOPT := .F. ENDCASE - CASE Lower( Left( cLine, Len( "nulrdd=" ) ) ) == "nulrdd=" ; cLine := SubStr( cLine, Len( "nulrdd=" ) + 1 ) + CASE Lower( Left( cLine, Len( "nulrdd=" ) ) ) == "nulrdd=" ; cLine := SubStr( cLine, Len( "nulrdd=" ) + 1 ) DO CASE CASE ValueIsT( cLine ) ; lNULRDD := .T. CASE ValueIsF( cLine ) ; lNULRDD := .F. ENDCASE - CASE Lower( Left( cLine, Len( "map=" ) ) ) == "map=" ; cLine := SubStr( cLine, Len( "map=" ) + 1 ) + CASE Lower( Left( cLine, Len( "map=" ) ) ) == "map=" ; cLine := SubStr( cLine, Len( "map=" ) + 1 ) DO CASE CASE ValueIsT( cLine ) ; lMAP := .T. CASE ValueIsF( cLine ) ; lMAP := .F. ENDCASE - CASE Lower( Left( cLine, Len( "strip=" ) ) ) == "strip=" ; cLine := SubStr( cLine, Len( "strip=" ) + 1 ) + CASE Lower( Left( cLine, Len( "strip=" ) ) ) == "strip=" ; cLine := SubStr( cLine, Len( "strip=" ) + 1 ) DO CASE CASE ValueIsT( cLine ) ; lSTRIP := .T. CASE ValueIsF( cLine ) ; lSTRIP := .F. ENDCASE - CASE Lower( Left( cLine, Len( "compr=" ) ) ) == "compr=" ; cLine := SubStr( cLine, Len( "compr=" ) + 1 ) + CASE Lower( Left( cLine, Len( "compr=" ) ) ) == "compr=" ; cLine := SubStr( cLine, Len( "compr=" ) + 1 ) DO CASE CASE ValueIsT( cLine ) ; nCOMPR := _COMPR_DEF CASE ValueIsF( cLine ) ; nCOMPR := _COMPR_OFF @@ -3931,20 +4015,20 @@ STATIC PROCEDURE HBP_ProcessOne( cFileName,; CASE Lower( cLine ) == "max" ; nCOMPR := _COMPR_MAX ENDCASE - CASE Lower( Left( cLine, Len( "head=" ) ) ) == "head=" ; cLine := SubStr( cLine, Len( "head=" ) + 1 ) + CASE Lower( Left( cLine, Len( "head=" ) ) ) == "head=" ; cLine := SubStr( cLine, Len( "head=" ) + 1 ) DO CASE CASE Lower( cLine ) == "off" ; nHEAD := _HEAD_OFF CASE Lower( cLine ) == "full" ; nHEAD := _HEAD_FULL CASE Lower( cLine ) == "partial" ; nHEAD := _HEAD_PARTIAL ENDCASE - CASE Lower( Left( cLine, Len( "run=" ) ) ) == "run=" ; cLine := SubStr( cLine, Len( "run=" ) + 1 ) + CASE Lower( Left( cLine, Len( "run=" ) ) ) == "run=" ; cLine := SubStr( cLine, Len( "run=" ) + 1 ) DO CASE CASE ValueIsT( cLine ) ; lRUN := .T. CASE ValueIsF( cLine ) ; lRUN := .F. ENDCASE - CASE Lower( Left( cLine, Len( "inc=" ) ) ) == "inc=" ; cLine := SubStr( cLine, Len( "inc=" ) + 1 ) + CASE Lower( Left( cLine, Len( "inc=" ) ) ) == "inc=" ; cLine := SubStr( cLine, Len( "inc=" ) + 1 ) DO CASE CASE ValueIsT( cLine ) ; lINC := .T. CASE ValueIsF( cLine ) ; lINC := .F. @@ -3954,7 +4038,7 @@ STATIC PROCEDURE HBP_ProcessOne( cFileName,; building Harbour. It only needs to be filled if this default GT is different from the Harbour default one, IOW when it was overridden by user at Harbour build time. [vszakats] */ - CASE Lower( Left( cLine, Len( "gtdef=" ) ) ) == "gtdef=" ; cLine := SubStr( cLine, Len( "gtdef=" ) + 1 ) + CASE Lower( Left( cLine, Len( "gtdef=" ) ) ) == "gtdef=" ; cLine := SubStr( cLine, Len( "gtdef=" ) + 1 ) IF ! Empty( cLine ) IF ! SetupForGT( cLine, @s_cGTDEFAULT, @lGUI ) cLine := NIL @@ -3967,7 +4051,7 @@ STATIC PROCEDURE HBP_ProcessOne( cFileName,; ENDIF ENDIF - CASE Lower( Left( cLine, Len( "gt=" ) ) ) == "gt=" ; cLine := SubStr( cLine, Len( "gt=" ) + 1 ) + CASE Lower( Left( cLine, Len( "gt=" ) ) ) == "gt=" ; cLine := SubStr( cLine, Len( "gt=" ) + 1 ) IF ! Empty( cLine ) IF cGT == NIL IF ! SetupForGT( cLine, @cGT, @lGUI ) @@ -4093,37 +4177,40 @@ STATIC FUNCTION ArchCompFilter( cItem ) cFilterSrc := SubStr( cItem, nStart + 1, nEnd - nStart - 1 ) cItem := Left( cItem, nStart - 1 ) + SubStr( cItem, nEnd + 1 ) - /* Parse filter and convert it to Harbour expression */ - cFilterHarb := "" - cValue := "" - FOR nPos := 1 TO Len( cFilterSrc ) - IF IsDigit( SubStr( cFilterSrc, nPos, 1 ) ) .OR. ; - IsAlpha( SubStr( cFilterSrc, nPos, 1 ) ) - cValue += SubStr( cFilterSrc, nPos, 1 ) - ELSE - IF ! Empty( cValue ) - cFilterHarb += StrTran( cExpr, "%1", cValue ) + SubStr( cFilterSrc, nPos, 1 ) - cValue := "" + IF ! Empty( cFilterSrc ) + + /* Parse filter and convert it to Harbour expression */ + cFilterHarb := "" + cValue := "" + FOR nPos := 1 TO Len( cFilterSrc ) + IF IsDigit( SubStr( cFilterSrc, nPos, 1 ) ) .OR. ; + IsAlpha( SubStr( cFilterSrc, nPos, 1 ) ) + cValue += SubStr( cFilterSrc, nPos, 1 ) ELSE - cFilterHarb += SubStr( cFilterSrc, nPos, 1 ) + IF ! Empty( cValue ) + cFilterHarb += StrTran( cExpr, "%1", cValue ) + SubStr( cFilterSrc, nPos, 1 ) + cValue := "" + ELSE + cFilterHarb += SubStr( cFilterSrc, nPos, 1 ) + ENDIF + ENDIF + NEXT + IF ! Empty( cValue ) + cFilterHarb += StrTran( cExpr, "%1", cValue ) + SubStr( cFilterSrc, nPos, 1 ) + ENDIF + + cFilterHarb := StrTran( cFilterHarb, "&", ".AND." ) + cFilterHarb := StrTran( cFilterHarb, "|", ".OR." ) + + /* Evaluate filter */ + bFilter := hb_macroBlock( cFilterHarb ) + IF bFilter != NIL + IF ISLOGICAL( xResult := Eval( bFilter ) ) .AND. xResult + RETURN cItem ENDIF ENDIF - NEXT - IF ! Empty( cValue ) - cFilterHarb += StrTran( cExpr, "%1", cValue ) + SubStr( cFilterSrc, nPos, 1 ) + RETURN "" ENDIF - - cFilterHarb := StrTran( cFilterHarb, "&", ".AND." ) - cFilterHarb := StrTran( cFilterHarb, "|", ".OR." ) - - /* Evaluate filter */ - bFilter := hb_macroBlock( cFilterHarb ) - IF bFilter != NIL - IF ISLOGICAL( xResult := Eval( bFilter ) ) .AND. xResult - RETURN cItem - ENDIF - ENDIF - RETURN "" ENDIF RETURN cItem @@ -4535,7 +4622,8 @@ FUNCTION hbmk_COMP() FUNCTION hbmk_KEYW( cKeyword ) RETURN cKeyword == iif( s_lMT , "mt" , "st" ) .OR. ; cKeyword == iif( s_lGUI , "gui" , "std" ) .OR. ; - cKeyword == iif( s_lDEBUG, "debug", "nodebug" ) + cKeyword == iif( s_lDEBUG, "debug", "nodebug" ) .OR. ; + cKeyword == iif( s_cARCH $ "bsd|hpux|sunos|linux" .OR. s_cARCH == "darwin", "unix", "" ) STATIC PROCEDURE ShowHeader() @@ -4579,9 +4667,11 @@ STATIC PROCEDURE ShowHelp( lLong ) " can be: min, max, def" ,; " -[no]run run/don't run output executable" ,; " -nohbp do not process .hbp files in current directory" ,; + " -stop stop without doing anything" ,; "" ,; " -bldf[-] inherit all/no (default) flags from Harbour build" ,; " -bldf=[p][c][l] inherit .prg/.c/linker flags (or none) from Harbour build" ,; + " -inctrypath=

additional path to autodetect .c header locations" ,; " -prgflag= pass flag to Harbour" ,; " -cflag= pass flag to C compiler" ,; " -resflag= pass flag to resource compiler (Windows only)" ,; @@ -4634,16 +4724,18 @@ STATIC PROCEDURE ShowHelp( lLong ) " - .hbp options (they should come in separate lines):" ,; " libs=[], gt=[gtname], prgflags=[Harbour flags]" ,; " cflags=[C compiler flags], resflags=[resource compiler flags]" ,; - " ldflags=[Linker flags], libpaths=[lib paths]" ,; + " ldflags=[Linker flags], libpaths=[lib paths], inctrypaths=[paths]" ,; " gui|mt|shared|nulrdd|debug|opt|map|strip|run|inc=[yes|no]" ,; " compr=[yes|no|def|min|max], head=[off|partial|full], echo=" ,; " Lines starting with '#' char are ignored" ,; - " - Platform filters are accepted in each .hbp line and with -l options." ,; + " - Platform filters are accepted in each .hbp line and with several options." ,; " Filter format: {[!][]}. Filters can be combined " ,; " using '&', '|' operators and grouped by parantheses." ,; - " Ex.: {win}, {gcc}, {linux|darwin}, {win&!pocc}, {(win|linux)&!owatcom}" ,; - " - Certain .hbp lines (prgflags=, cflags=, ldflags=, libpaths=, echo=) will" ,; - " accept macros: ${hb_root}, ${hb_self}, ${hb_arch}, ${hb_comp}, ${}" ,; + " Ex.: {win}, {gcc}, {linux|darwin}, {win&!pocc}, {(win|linux)&!owatcom}," ,; + " {unix&mt&gui}, -cflag={win}-DMYDEF, -stop{dos}" ,; + " - Certain .hbp lines (prgflags=, cflags=, ldflags=, libpaths=, inctrypaths=," ,; + " echo=) and corresponding command line parameters will accept macros:" ,; + " ${hb_root}, ${hb_self}, ${hb_arch}, ${hb_comp}, ${}" ,; " - Defaults and feature support vary by architecture/compiler." ,; " - Supported values for each supported value:" ,; " linux : gcc, owatcom, icc" ,;