diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b9c6d287f9..c8352e389d 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,13 @@ past entries belonging to these authors: Viktor Szakats. */ +2009-05-02 22:09 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * utils/hbmk2/hbmk2.prg + * Cleanup: Added few internal constants. + * Cleanup: Some debug strings marked as non-translatable. + + Help screen forming changed to be friendly to translators. + Please update .pot files. + 2009-05-02 12:10 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * utils/hbmk2/hbmk2.prg * Minor cleanups. (func/proc scopes) diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 8bdc9991eb..8503998d60 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -115,6 +115,16 @@ #define _HEAD_PARTIAL 1 #define _HEAD_FULL 2 +#define _COMPDET_bBlock 1 +#define _COMPDET_cCOMP 2 + +#define _COMPDETE_bBlock 1 +#define _COMPDETE_cARCH 2 +#define _COMPDETE_cCOMP 3 +#define _COMPDETE_cCCPREFIX 4 + +#define _WORKDIR_DEF_ ".hbmk" + ANNOUNCE HB_GTSYS REQUEST HB_GT_CGI_DEFAULT @@ -436,8 +446,7 @@ FUNCTION hbmk( aArgs ) tmp := "${hb_root}hbmk2.${lng}.hbl" tmp := StrTran( tmp, "${hb_root}", PathSepToSelf( DirAddPathSep( hb_DirBase() ) ) ) tmp := StrTran( tmp, "${lng}", s_cUILNG ) - tmp := hb_MemoRead( tmp ) - IF hb_i18n_check( tmp ) + IF hb_i18n_check( tmp := hb_MemoRead( tmp ) ) hb_i18n_set( hb_i18n_restoretable( tmp ) ) ENDIF ENDIF @@ -712,16 +721,16 @@ FUNCTION hbmk( aArgs ) IF Empty( s_cCOMP ) .AND. ! Empty( aCOMPDET ) /* Look for this compiler first */ FOR tmp := 1 TO Len( aCOMPDET ) - IF aCOMPDET[ tmp ][ 2 ] == cSelfCOMP .AND. Eval( aCOMPDET[ tmp ][ 1 ] ) - s_cCOMP := aCOMPDET[ tmp ][ 2 ] + IF aCOMPDET[ tmp ][ _COMPDET_cCOMP ] == cSelfCOMP .AND. Eval( aCOMPDET[ tmp ][ _COMPDET_bBlock ] ) + s_cCOMP := aCOMPDET[ tmp ][ _COMPDET_cCOMP ] EXIT ENDIF NEXT IF Empty( s_cCOMP ) /* Check the rest of compilers */ FOR tmp := 1 TO Len( aCOMPDET ) - IF !( aCOMPDET[ tmp ][ 2 ] == cSelfCOMP ) .AND. Eval( aCOMPDET[ tmp ][ 1 ] ) - s_cCOMP := aCOMPDET[ tmp ][ 2 ] + IF !( aCOMPDET[ tmp ][ _COMPDET_cCOMP ] == cSelfCOMP ) .AND. Eval( aCOMPDET[ tmp ][ _COMPDET_bBlock ] ) + s_cCOMP := aCOMPDET[ tmp ][ _COMPDET_cCOMP ] EXIT ENDIF NEXT @@ -730,10 +739,10 @@ FUNCTION hbmk( aArgs ) IF Empty( s_cCOMP ) .AND. s_cARCH $ "win|wce" /* Autodetect embedded MinGW installation */ FOR tmp := 1 TO Len( aCOMPDET_LOCAL ) - IF s_cARCH == aCOMPDET_LOCAL[ tmp ][ 2 ] .AND. ; - ! Empty( tmp1 := Eval( aCOMPDET_LOCAL[ tmp ][ 1 ], aCOMPDET_LOCAL[ tmp ][ 4 ] ) ) - s_cCOMP := aCOMPDET_LOCAL[ tmp ][ 3 ] - s_cCCPREFIX := aCOMPDET_LOCAL[ tmp ][ 4 ] + IF s_cARCH == aCOMPDET_LOCAL[ tmp ][ _COMPDETE_cARCH ] .AND. ; + ! Empty( tmp1 := Eval( aCOMPDET_LOCAL[ tmp ][ _COMPDETE_bBlock ], aCOMPDET_LOCAL[ tmp ][ _COMPDETE_cCCPREFIX ] ) ) + s_cCOMP := aCOMPDET_LOCAL[ tmp ][ _COMPDETE_cCOMP ] + s_cCCPREFIX := aCOMPDET_LOCAL[ tmp ][ _COMPDETE_cCCPREFIX ] s_cCCPATH := tmp1 EXIT ENDIF @@ -765,12 +774,12 @@ FUNCTION hbmk( aArgs ) IF s_cARCH $ "win|wce" /* Detect cross platform CCPREFIX and CCPATH if embedded MinGW installation is detected */ FOR tmp := 1 TO Len( aCOMPDET_LOCAL ) - IF aCOMPDET_LOCAL[ tmp ][ 2 ] == s_cARCH .AND. ; - aCOMPDET_LOCAL[ tmp ][ 3 ] == s_cCOMP - IF ! Empty( tmp1 := Eval( aCOMPDET_LOCAL[ tmp ][ 1 ], aCOMPDET_LOCAL[ tmp ][ 4 ] ) ) + IF aCOMPDET_LOCAL[ tmp ][ _COMPDETE_cARCH ] == s_cARCH .AND. ; + aCOMPDET_LOCAL[ tmp ][ _COMPDETE_cCOMP ] == s_cCOMP + IF ! Empty( tmp1 := Eval( aCOMPDET_LOCAL[ tmp ][ _COMPDETE_bBlock ], aCOMPDET_LOCAL[ tmp ][ _COMPDETE_cCCPREFIX ] ) ) s_cCCPATH := tmp1 ENDIF - s_cCCPREFIX := aCOMPDET_LOCAL[ tmp ][ 4 ] + s_cCCPREFIX := aCOMPDET_LOCAL[ tmp ][ _COMPDETE_cCCPREFIX ] EXIT ENDIF NEXT @@ -1391,7 +1400,7 @@ FUNCTION hbmk( aArgs ) IF ! lStopAfterInit IF s_lINC IF cWorkDir == NIL - cWorkDir := ".hbmk" + hb_osPathSeparator() + s_cARCH + hb_osPathSeparator() + s_cCOMP + cWorkDir := _WORKDIR_DEF_ + hb_osPathSeparator() + s_cARCH + hb_osPathSeparator() + s_cCOMP ENDIF AAdd( s_aOPTPRG, "-o" + cWorkDir + hb_osPathSeparator() ) /* NOTE: Ending path sep is important. */ IF ! DirBuild( cWorkDir ) @@ -2377,7 +2386,7 @@ FUNCTION hbmk( aArgs ) tmp := "/* Automatically generated by hbmk. Do not edit. */" + Chr( 10 ) +; "#define _HBMK_VCS_TYPE_ " + Chr( 34 ) + tmp2 + Chr( 34 ) + Chr( 10 ) +; "#define _HBMK_VCS_ID_ " + Chr( 34 ) + tmp1 + Chr( 34 ) + Chr( 10 ) - /* Update only if necessary to trigger rebuild only if really needed */ + /* Update only if something changed to trigger rebuild only if really needed */ IF !( hb_MemoRead( s_cVCSHEAD ) == tmp ) IF s_lInfo OutStd( hb_StrFormat( I_( "hbmk: Generating VCS header: %1$s" ), s_cVCSHEAD ), hb_osNewLine() ) @@ -2408,7 +2417,7 @@ FUNCTION hbmk( aArgs ) s_aC_DONE := {} FOR EACH tmp IN s_aC IF s_lDEBUGINC - OutStd( hb_StrFormat( I_( "hbmk: debuginc: C %1$s %2$s" ), tmp, FN_DirExtSet( tmp, cWorkDir, cObjExt ) ), hb_osNewLine() ) + OutStd( hb_StrFormat( "hbmk: debuginc: C %1$s %2$s", tmp, FN_DirExtSet( tmp, cWorkDir, cObjExt ) ), hb_osNewLine() ) ENDIF IF ! hb_FGetDateTime( FN_DirExtSet( tmp, cWorkDir, cObjExt ), @tmp2 ) .OR. ; ! hb_FGetDateTime( tmp, @tmp1 ) .OR. ; @@ -2442,7 +2451,7 @@ FUNCTION hbmk( aArgs ) s_aPRG_TODO := {} FOR EACH tmp IN s_aPRG IF s_lDEBUGINC - OutStd( hb_StrFormat( I_( "hbmk: debuginc: PRG %1$s %2$s" ),; + OutStd( hb_StrFormat( "hbmk: debuginc: PRG %1$s %2$s",; FN_ExtSet( tmp, ".prg" ),; FN_DirExtSet( tmp, cWorkDir, ".c" ) ), hb_osNewLine() ) ENDIF @@ -2682,7 +2691,7 @@ FUNCTION hbmk( aArgs ) s_aRESSRC_TODO := {} FOR EACH tmp IN s_aRESSRC IF s_lDEBUGINC - OutStd( hb_StrFormat( I_( "hbmk: debuginc: RESSRC %1$s %2$s" ), tmp, FN_DirExtSet( tmp, cWorkDir, cResExt ) ), hb_osNewLine() ) + OutStd( hb_StrFormat( "hbmk: debuginc: RESSRC %1$s %2$s", tmp, FN_DirExtSet( tmp, cWorkDir, cResExt ) ), hb_osNewLine() ) ENDIF IF ! hb_FGetDateTime( FN_DirExtSet( tmp, cWorkDir, cResExt ), @tmp2 ) .OR. ; ! hb_FGetDateTime( tmp, @tmp1 ) .OR. ; @@ -2787,7 +2796,7 @@ FUNCTION hbmk( aArgs ) s_aPRG_DONE := {} FOR EACH tmp IN s_aPRG IF s_lDEBUGINC - OutStd( hb_StrFormat( I_( "hbmk: debuginc: CPRG %1$s %2$s" ),; + OutStd( hb_StrFormat( "hbmk: debuginc: CPRG %1$s %2$s",; FN_DirExtSet( tmp, cWorkDir, ".c" ),; FN_DirExtSet( tmp, cWorkDir, cObjExt ) ), hb_osNewLine() ) ENDIF @@ -2936,7 +2945,7 @@ FUNCTION hbmk( aArgs ) IF s_lINC .AND. ! s_lREBUILD IF s_lDEBUGINC - OutStd( hb_StrFormat( I_( "hbmk: debuginc: target %1$s" ), s_cPROGNAME ), hb_osNewLine() ) + OutStd( hb_StrFormat( "hbmk: debuginc: target %1$s", s_cPROGNAME ), hb_osNewLine() ) ENDIF IF hb_FGetDateTime( s_cPROGNAME, @tTarget ) @@ -2945,7 +2954,7 @@ FUNCTION hbmk( aArgs ) IF lTargetUpToDate FOR EACH tmp IN ArrayAJoin( { s_aOBJ, s_aOBJUSER, s_aOBJA, s_aRESSRC, s_aRESCMP } ) IF s_lDEBUGINC - OutStd( hb_StrFormat( I_( "hbmk: debuginc: EXEDEP %1$s" ), tmp ), hb_osNewLine() ) + OutStd( hb_StrFormat( "hbmk: debuginc: EXEDEP %1$s", tmp ), hb_osNewLine() ) ENDIF IF ! hb_FGetDateTime( tmp, @tmp1 ) .OR. tmp1 > tTarget lTargetUpToDate := .F. @@ -2958,7 +2967,7 @@ FUNCTION hbmk( aArgs ) FOR EACH tmp IN s_aLIBRAW IF ! Empty( tmp2 := FindLib( tmp, s_aLIBPATH, cLibExt ) ) IF s_lDEBUGINC - OutStd( hb_StrFormat( I_( "hbmk: debuginc: EXEDEPLIB %1$s" ), tmp2 ), hb_osNewLine() ) + OutStd( hb_StrFormat( "hbmk: debuginc: EXEDEPLIB %1$s", tmp2 ), hb_osNewLine() ) ENDIF IF ! hb_FGetDateTime( tmp2, @tmp1 ) .OR. tmp1 > tTarget lTargetUpToDate := .F. @@ -3384,7 +3393,7 @@ STATIC FUNCTION FindNewerHeaders( cFileName, cParentDir, tTimeParent, lIncTry, l hb_HSet( headstate[ _HEADSTATE_hFiles ], cFileName, .T. ) IF s_lDEBUGINC - OutStd( hb_StrFormat( I_( "hbmk: debuginc: HEADER %1$s" ), cFileName ), hb_osNewLine() ) + OutStd( hb_StrFormat( "hbmk: debuginc: HEADER %1$s", cFileName ), hb_osNewLine() ) ENDIF IF ! hb_FGetDateTime( cFileName, @tTimeSelf ) @@ -3469,8 +3478,8 @@ STATIC FUNCTION FindHeader( cFileName, cParentDir, aINCTRYPATH ) /* Add these dir to include paths */ IF AScan( s_aINCPATH, { |tmp| tmp == cDir } ) == 0 AAdd( s_aINCPATH, cDir ) - IF s_lDEBUGINC - OutStd( hb_StrFormat( I_( "hbmk: debuginc: Autodetected header dir for %1$s: %2$s" ), cFileName, cDir ), hb_osNewLine() ) + IF s_lINFO + OutStd( hb_StrFormat( I_( "hbmk: Autodetected header dir for %1$s: %2$s" ), cFileName, cDir ), hb_osNewLine() ) ENDIF ENDIF RETURN DirAddPathSep( PathSepToSelf( cDir ) ) + cFileName @@ -3891,7 +3900,7 @@ STATIC FUNCTION DirBuild( cDir ) IF hb_DirCreate( cDirTemp ) != 0 RETURN .F. ENDIF - IF Lower( cDirItem ) == ".hbmk" + IF Lower( cDirItem ) == _WORKDIR_DEF_ hb_FSetAttr( cDirTemp, FC_HIDDEN ) ENDIF ENDIF @@ -5188,133 +5197,156 @@ STATIC PROCEDURE ShowHelp( lLong ) I_( " " ),; I_( " hbmk [options] [] " ),; I_( " " ),; - I_( "Options:" ),; - I_( " -o output file name" ),; - I_( " -l link with library" ),; - I_( " -L additional path to search for libraries" ),; - I_( " -i

|-incpath=

additional path to search for headers" ),; - I_( " -static|-shared link with static/shared libs" ),; - I_( " -mt|-st link with multi/single-thread VM" ),; - I_( " -gt link with GT GT driver, can be repeated to link" ),; - I_( " with more GTs. First one will be the default at runtime" ) } + I_( "Options:" ) } - LOCAL aText_Help := {; - I_( " -help|--help long help" ) } + LOCAL aText_Notes := {; + I_( " " ),; + I_( "Notes:" ) } - LOCAL aText_Long := {; + LOCAL aText_Supp := {; I_( " " ),; - I_( " -gui|-std create GUI/console executable" ),; - I_( " -main= override the name of starting function/procedure" ),; - I_( " -fullstatic link with all static libs" ),; - I_( " -nulrdd[-] link with nulrdd" ),; - I_( " -[no]debug add/exclude C compiler debug info" ),; - I_( " -[no]opt toggle C compiler optimizations (default: on)" ),; - I_( " -[no]map create (or not) a map file" ),; - I_( " -[no]strip strip (no strip) binaries" ),; - I_( " -[no]trace show commands executed" ),; - I_( " -traceonly show commands to be executed, but don't execute them" ),; - I_( " -[no]compr[=lev] compress executable/dynamic lib (needs UPX)" ),; - I_( " can be: min, max, def" ),; - I_( " -[no]run run/don't run output executable" ),; - I_( " -vcshead= generate .ch header file with local repository information" ),; - I_( " SVN, Git and Mercurial are currently supported. Generated" ),; - I_( " header will define macro _HBMK_VCS_TYPE_ with the name of" ),; - I_( " detected VCS and _HBMK_VCS_ID_ with the unique ID of local" ),; - I_( " repository" ),; - I_( " -nohbp do not process .hbp files in current directory" ),; - I_( " -stop stop without doing anything" ),; - I_( " " ),; - I_( " -bldf[-] inherit all/no (default) flags from Harbour build" ),; - I_( " -bldf=[p][c][l] inherit .prg/.c/linker flags (or none) from Harbour build" ),; - I_( " -inctrypath=

additional path to autodetect .c header locations" ),; - I_( " -prgflag= pass flag to Harbour" ),; - I_( " -cflag= pass flag to C compiler" ),; - I_( " -resflag= pass flag to resource compiler (Windows only)" ),; - I_( " -ldflag= pass flag to linker (executable)" ),; - I_( " -aflag= pass flag to linker (static library)" ),; - I_( " -dflag= pass flag to linker (dynamic library)" ),; - I_( " -runflag= pass flag to output executable when -run option is used" ),; - I_( " -jobs= start n compilation threads (MT platforms/builds only)" ),; - I_( " -inc enable incremental build mode" ),; - I_( " -[no]head[=] control source header parsing (in incremental build mode)" ),; - I_( " can be: full, partial (default), off" ),; - I_( " -rebuild rebuild all (in incremental build mode)" ),; - I_( " -clean clean (in incremental build mode)" ),; - I_( " -workdir=

working directory for incremental build mode" ),; - I_( " (default: arch/comp)" ),; - I_( " " ),; - I_( " -hbl[=] output .hbl filename. ${lng} macro is accepted in filename" ),; - I_( " -lng= list of languages to be replaced in ${lng} macros in .pot" ),; - I_( " filenames and output .hbl filenames. Comma separared list:" ),; - I_( " -lng=en-EN,hu-HU,de" ),; - I_( " " ),; - I_( " -hbcmp|-clipper stop after creating the object files" ),; - I_( " create link/copy hbmk to hbcmp/clipper for the same effect" ),; - I_( " -hbcc stop after creating the object files and accept raw C flags" ),; - I_( " create link/copy hbmk to hbcc for the same effect" ),; - I_( " -hblnk accept raw linker flags" ),; - I_( " -hblib create static library" ),; - I_( " -hbdyn create dynamic library" ),; - I_( " -rtlink " ),; - I_( " -blinker " ),; - I_( " -exospace emulate Clipper compatible linker behavior" ),; - I_( " create link/copy hbmk to rtlink/blinker/exospace for the" ),; - I_( " same effect" ),; - I_( " --hbdirbin output Harbour binary directory" ),; - I_( " --hbdirdyn output Harbour dynamic library directory" ),; - I_( " --hbdirlib output Harbour static library directory" ),; - I_( " --hbdirinc output Harbour header directory" ),; - I_( " " ),; - I_( " -arch= assume specific architecure. Same as HB_ARCHITECTURE envvar" ),; - I_( " -comp= use specific compiler. Same as HB_COMPILER envvar" ),; - I_( " Special value:" ),; - I_( " - bld: use original build settings (default on *nix)" ),; - I_( " --version display version header only" ),; - I_( " -info turn on informational messages" ),; - I_( " -quiet suppress all screen messages" ),; - I_( " " ),; - I_( "Notes:" ),; - I_( " -