diff --git a/harbour/ChangeLog b/harbour/ChangeLog index fa9b246ed2..e3d84b14f5 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,22 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-07-06 01:20 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * utils/hbmk2/hbmk2.pt_BR.po + * utils/hbmk2/hbmk2.hu_HU.po + * utils/hbmk2/hbmk2.prg + + Added support for -icon= option to specifiy application icon. + If used multiple times, all icons will be added to the target + executable and the first one will be used as app icon. + Currently supported platforms: win, wce, darwin, os2. + (OS/2 is just guesswork) + + Added resource support for OS/2 + watcom targets. + (untested) + * Minor correction in one warning messages. + + * config/os2/watcom.cf + % Suppressing 'echo' commands from build log. + 2009-07-05 21:00 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * utils/hbmk2/hbmk2.pt_BR.po + Portuguese translation. Work of Vailton Renato. Thank you very much. diff --git a/harbour/config/os2/watcom.cf b/harbour/config/os2/watcom.cf index 841a7c21bd..7655dcda49 100644 --- a/harbour/config/os2/watcom.cf +++ b/harbour/config/os2/watcom.cf @@ -63,18 +63,18 @@ endif # Note: The empty line directly before 'endef' HAVE TO exist! # It causes that the 'echo' command is separated by LF define link_file -echo FILE $(file) >> __link__.tmp +@echo FILE $(file) >> __link__.tmp endef #Note: The empty line directly before 'endef' HAVE TO exist! define link_lib -echo LIB $(lib) >> __link__.tmp +@echo LIB $(lib) >> __link__.tmp endef define link_exe_file -echo $(LDFLAGS) NAME $@ > __link__.tmp +@echo $(LDFLAGS) NAME $@ > __link__.tmp $(foreach file, $(^F), $(link_file)) $(foreach lib, $(LINKLIBS), $(link_lib)) $(foreach lib, $(RDDLIBS), $(link_lib)) @@ -117,12 +117,12 @@ LD_RULE = $(link_exe_file) $(HB_USER_LDFLAGS) #Note: The empty line below HAVE TO exist! define lib_object -echo -+$(file) >> __lib__.tmp +@echo -+$(file) >> __lib__.tmp endef define create_library -echo $(LIB_DIR)/$@ > __lib__.tmp +@echo $(LIB_DIR)/$@ > __lib__.tmp $(foreach file, $(^F), $(lib_object)) $(AR) $(ARFLAGS) @__lib__.tmp endef diff --git a/harbour/utils/hbmk2/hbmk2.hu_HU.po b/harbour/utils/hbmk2/hbmk2.hu_HU.po index 1b053f4d25..5902188593 100644 --- a/harbour/utils/hbmk2/hbmk2.hu_HU.po +++ b/harbour/utils/hbmk2/hbmk2.hu_HU.po @@ -724,8 +724,8 @@ msgstr " hbmk [kapcsol #: hbmk2.prg:2937 hbmk2.prg:3341 #, c-format -msgid "Warning: Stub helper .c program couldn't be created." -msgstr "Figyelem: .c segédállományt nem sikerült létrehozni." +msgid "Error: Stub helper .c program couldn't be created." +msgstr "Hiba: .c segédállományt nem sikerült létrehozni." #: hbmk2.prg:5688 hbmk2.prg:6391 #, c-format diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index b5277e15ce..6816b6e7c3 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -263,25 +263,26 @@ REQUEST hbmk_KEYW #define _HBMK_aRESSRC 54 #define _HBMK_aRESCMP 55 #define _HBMK_aOBJUSER 56 +#define _HBMK_aICON 57 -#define _HBMK_aPO 57 -#define _HBMK_cHBL 58 -#define _HBMK_cHBLDir 59 -#define _HBMK_aLNG 60 -#define _HBMK_cPO 61 +#define _HBMK_aPO 58 +#define _HBMK_cHBL 59 +#define _HBMK_cHBLDir 60 +#define _HBMK_aLNG 61 +#define _HBMK_cPO 62 -#define _HBMK_lDEBUGTIME 62 -#define _HBMK_lDEBUGINC 63 -#define _HBMK_lDEBUGSTUB 64 -#define _HBMK_lDEBUGI18N 65 +#define _HBMK_lDEBUGTIME 63 +#define _HBMK_lDEBUGINC 64 +#define _HBMK_lDEBUGSTUB 65 +#define _HBMK_lDEBUGI18N 66 -#define _HBMK_cCCPATH 66 -#define _HBMK_cCCPREFIX 67 -#define _HBMK_cCCPOSTFIX 68 +#define _HBMK_cCCPATH 67 +#define _HBMK_cCCPREFIX 68 +#define _HBMK_cCCPOSTFIX 69 -#define _HBMK_lUTF8 69 +#define _HBMK_lUTF8 70 -#define _HBMK_MAX_ 69 +#define _HBMK_MAX_ 70 #ifndef _HBMK_EMBEDDED_ @@ -547,6 +548,7 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) LOCAL aLIB_BASE_RDD_MT LOCAL l_cCSTUB + LOCAL l_cRESSTUB LOCAL l_cHB_INSTALL_PREFIX LOCAL l_cHB_BIN_INSTALL @@ -1372,6 +1374,7 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) hbmk[ _HBMK_aLIBUSERGT ] := {} hbmk[ _HBMK_aLIBDYNHAS ] := {} hbmk[ _HBMK_aOBJUSER ] := {} + hbmk[ _HBMK_aICON ] := {} l_aOBJA := {} l_cPROGDIR := NIL l_cPROGNAME := NIL @@ -1685,6 +1688,13 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) ENDIF ENDIF + CASE Left( cParamL, Len( "-icon=" ) ) == "-icon=" + + cParam := MacroProc( hbmk, ArchCompFilter( hbmk, SubStr( cParam, Len( "-icon=" ) + 1 ) ), aParam[ _PAR_cFileName ] ) + IF ! Empty( cParam ) + AAdd( hbmk[ _HBMK_aICON ], cParam ) + ENDIF + CASE Left( cParamL, 2 ) == "-i" .AND. ; Len( cParamL ) > 2 @@ -2346,7 +2356,7 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) l_aLIBSHAREDPOST := { "hbmainstd", "hbmainwin" } - IF hbmk[ _HBMK_cCOMP ] $ "mingw|mingw64|mingwarm" .AND. Len( hbmk[ _HBMK_aRESSRC ] ) > 0 + IF hbmk[ _HBMK_cCOMP ] $ "mingw|mingw64|mingwarm" cBin_Res := hbmk[ _HBMK_cCCPREFIX ] + "windres" + cCCEXT_mingw cResExt := ".reso" cOpt_Res := "{FR} {IR} -O coff -o {OS}" @@ -2581,12 +2591,10 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) AAdd( hbmk[ _HBMK_aOPTL ], "FILE " + FN_ExtSet( l_cHB_LIB_INSTALL + hb_osPathSeparator() + iif( hbmk[ _HBMK_lGUI ], "hbmainwin", "hbmainstd" ), cLibExt ) ) ENDIF - IF Len( hbmk[ _HBMK_aRESSRC ] ) > 0 - cBin_Res := "wrc" - cResExt := ".res" - cOpt_Res := "-r {FR} -zm {IR} -fo={OS}" - cResPrefix := "OP res=" - ENDIF + cBin_Res := "wrc.exe" + cResExt := ".res" + cOpt_Res := "-r {FR} -zm {IR} -fo={OS}" + cResPrefix := "OP res=" CASE hbmk[ _HBMK_cARCH ] == "os2" .AND. hbmk[ _HBMK_cCOMP ] == "watcom" cLibPrefix := "LIB " @@ -2641,6 +2649,11 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) AAdd( hbmk[ _HBMK_aOPTL ], "OP MAP" ) ENDIF + cBin_Res := "wrc.exe" + cResExt := ".res" + cOpt_Res := "-r {FR} -zm {IR} -fo={OS}" + cResPrefix := "OP res=" + CASE hbmk[ _HBMK_cARCH ] == "linux" .AND. hbmk[ _HBMK_cCOMP ] == "watcom" cLibPrefix := "LIB " cLibExt := ".lib" @@ -3498,6 +3511,30 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) ENDIF ENDIF + IF hbmk[ _HBMK_cARCH ] $ "win|wce|os2" .AND. ; + ! Empty( hbmk[ _HBMK_aICON ] ) .AND. ! l_lCLEAN + + fhnd := hb_FTempCreateEx( @l_cRESSTUB, NIL, "hbmk_", ".rc" ) + IF fhnd != F_ERROR + + /* Build .rc stub */ + FWrite( fhnd, '/* This temp source file was generated by hbmk tool. */' + hb_osNewLine() +; + '/* You can safely delete it. */' + hb_osNewLine() +; + '' + hb_osNewLine() ) + AEval( hbmk[ _HBMK_aICON ], {|tmp, tmp1| FWrite( fhnd, 'ICON' + hb_ntos( tmp1 ) + ' ICON DISCARDABLE "' + PathSepToTarget( hbmk, tmp ) + '"' + hb_osNewLine() ) } ) + FClose( fhnd ) + + IF hbmk[ _HBMK_lDEBUGSTUB ] + OutStd( ".rc stub dump:" + hb_osNewLine() ) + OutStd( hb_MemoRead( l_cRESSTUB ) ) + ENDIF + hb_AIns( hbmk[ _HBMK_aRESSRC ], 1, l_cRESSTUB, .T. ) + AAdd( l_aRESSRC_TODO, l_cRESSTUB ) + ELSE + hbmk_OutErr( hbmk, I_( "Warning: Stub helper .rc file couldn't be created." ) ) + ENDIF + ENDIF + IF Len( l_aRESSRC_TODO ) > 0 .AND. ! Empty( cBin_Res ) .AND. ! l_lCLEAN IF hbmk[ _HBMK_lINC ] .AND. ! hbmk[ _HBMK_lQuiet ] @@ -3874,6 +3911,13 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) IF ! hb_FileExists( tmp + hb_osPathSeparator() + "PkgInfo" ) hb_MemoWrit( tmp + hb_osPathSeparator() + "PkgInfo", MacOSXFiles( hbmk, 2, FN_NameGet( l_cPROGNAME ) ) ) ENDIF + IF ! Empty( hbmk[ _HBMK_aICON ] ) + IF DirBuild( tmp + hb_osPathSeparator() + "Resources" ) + FOR EACH tmp1 IN hbmk[ _HBMK_aICON ] + hb_FCopy( tmp1, tmp + hb_osPathSeparator() + "Resources" + hb_osPathSeparator() + FN_NameExtGet( tmp1 ) ) + NEXT + ENDIF + ENDIF ENDIF ENDIF @@ -4005,6 +4049,10 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) FErase( l_cCSTUB ) FErase( FN_DirExtSet( l_cCSTUB, cWorkDir, cObjExt ) ) ENDIF + IF ! Empty( l_cRESSTUB ) + FErase( l_cRESSTUB ) + FErase( FN_DirExtSet( l_cRESSTUB, cWorkDir, cResExt ) ) + ENDIF IF ! hbmk[ _HBMK_lINC ] .OR. l_lCLEAN AEval( ListDirExt( hbmk[ _HBMK_aPRG ], cWorkDir, ".c" ), {|tmp| FErase( tmp ) } ) ENDIF @@ -6599,6 +6647,9 @@ STATIC FUNCTION MacOSXFiles( hbmk, nType, cPROGNAME ) cString := StrTran( cString, "%__APPNAME__%", cPROGNAME ) cString := StrTran( cString, "%__APPTYPE__%", "APPL" ) cString := StrTran( cString, "%__APPSIGN__%", PadR( cPROGNAME, 4, "?" ) ) + IF ! Empty( hbmk[ _HBMK_aICON ] ) + cString := StrTran( cString, "%__APPICON__%", FN_NameExtGet( hbmk[ _HBMK_aICON ][ 1 ] ) ) + ENDIF RETURN cString @@ -6714,6 +6765,7 @@ STATIC PROCEDURE ShowHelp( hbmk, lLong ) { "-[no]run" , I_( "run/don't run output executable" ) },; { "-vcshead=" , I_( "generate .ch header file with local repository information. SVN, Git and Mercurial are currently supported. Generated header will define macro _HBMK_VCS_TYPE_ with the name of detected VCS and _HBMK_VCS_ID_ with the unique ID of local repository" ) },; { "-tshead=" , I_( "generate .ch header file with timestamp information. Generated header will define macros _HBMK_BUILD_DATE_, _HBMK_BUILD_TIME_, _HBMK_BUILD_TIMESTAMP_ with the date/time of build" ) },; + { "-icon=" , I_( "set as application icon. should be a supported format on the target platform (experimental)" ) },; { "-instpath=" , I_( "copy target to . if is a directory, it should end with path separator. can be specified multiple times" ) },; { "-nohbc" , I_( "do not process .hbc files in current directory" ) },; { "-stop" , I_( "stop without doing anything" ) },; diff --git a/harbour/utils/hbmk2/hbmk2.pt_BR.po b/harbour/utils/hbmk2/hbmk2.pt_BR.po index 09d68fe285..34d9d98b70 100644 --- a/harbour/utils/hbmk2/hbmk2.pt_BR.po +++ b/harbour/utils/hbmk2/hbmk2.pt_BR.po @@ -202,8 +202,8 @@ msgstr "Linha de comando do Harbour:" #: hbmk2.prg:3387 #, c-format -msgid "Warning: Stub helper .c program couldn't be created." -msgstr "Aten‡Ćo: M˘dulo auxiliar .c nĆo p“de ser criado." +msgid "Error: Stub helper .c program couldn't be created." +msgstr "Erro: M˘dulo auxiliar .c nĆo p“de ser criado." #: hbmk2.prg:3481 #, c-format @@ -1006,4 +1006,3 @@ msgstr "" #, c-format msgid "wdo=EN" msgstr "wdo=EN" -