From d0c69a84f2ac433d89bf8affb1139094f0020eac Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 26 Jun 2010 16:26:55 +0000 Subject: [PATCH] 2010-06-26 18:25 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg + Added internal ${hb_workdynsub} variable to return subdir of intermediate files built for dynamic libs on platforms where dynamic libs require different compiler settings. + Adjusted the place where plugin event 'pre_c' is called from. * contrib/xhb/xhb.hbp ! Synced variable list with Makefile. * contrib/hbqt/hbmk2_plugin_moc.prg * contrib/hbide/resources/hbmk2_plugin_uip.prg + Reworked to properly support -clean + Reworked to not try building files when some other factors (f.e. -stop option) would skip building their output files. * contrib/hbqt/hbqt_hbqplaintextedit.cpp ! Fixed unused var warning. * contrib/hbziparc/hbziparc.hbp ! Added missing reference to hbmzip.hbc. * contrib/hbnf/ftint86.c ! Added another dummy function required by .prg files. * contrib/hbxpp/tbrowsex.prg ! Commented function call referencing a non-existent function (it's a STATIC function in core) * contrib/makefile.prg * Changed the way HB_BUILD_NAME is handled. * Changed the way how target dir is formed. (delegating more work to hbmk2) --- harbour/ChangeLog | 37 +++++++++++++- .../hbide/resources/hbmk2_plugin_uip.prg | 48 +++++++++--------- harbour/contrib/hbnf/ftint86.c | 6 +++ harbour/contrib/hbqt/hbmk2_plugin_moc.prg | 49 ++++++++++--------- .../contrib/hbqt/hbqt_hbqplaintextedit.cpp | 2 + harbour/contrib/hbxpp/tbrowsex.prg | 2 +- harbour/contrib/hbziparc/hbziparc.hbp | 2 + harbour/contrib/makefile.prg | 16 ++++-- harbour/contrib/xhb/xhb.hbp | 24 ++++----- harbour/utils/hbmk2/hbmk2.prg | 25 ++++++---- 10 files changed, 139 insertions(+), 72 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ae03155b85..3f9987db98 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,41 @@ The license applies to all entries newer than 2009-04-28. */ +2010-06-26 18:25 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * utils/hbmk2/hbmk2.prg + + Added internal ${hb_workdynsub} variable to return subdir of + intermediate files built for dynamic libs on platforms where + dynamic libs require different compiler settings. + + Adjusted the place where plugin event 'pre_c' is called from. + + * contrib/xhb/xhb.hbp + ! Synced variable list with Makefile. + + * contrib/hbqt/hbmk2_plugin_moc.prg + * contrib/hbide/resources/hbmk2_plugin_uip.prg + + Reworked to properly support -clean + + Reworked to not try building files when some other + factors (f.e. -stop option) would skip building + their output files. + + * contrib/hbqt/hbqt_hbqplaintextedit.cpp + ! Fixed unused var warning. + + * contrib/hbziparc/hbziparc.hbp + ! Added missing reference to hbmzip.hbc. + + * contrib/hbnf/ftint86.c + ! Added another dummy function required by .prg files. + + * contrib/hbxpp/tbrowsex.prg + ! Commented function call referencing a non-existent + function (it's a STATIC function in core) + + * contrib/makefile.prg + * Changed the way HB_BUILD_NAME is handled. + * Changed the way how target dir is formed. + (delegating more work to hbmk2) + 2010-06-26 15:51 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * external/pcre/pcreexec.c * external/pcre/pcre.h @@ -31,7 +66,7 @@ * external/pcre/pcrestud.c * external/pcre/Makefile * PCRE update to 8.10 (from 8.02) - ; Thanks to Tamas Tevesz for the patch. This update was done + ; Thanks to Tamas Tevesz for the patch. This update was done using the new patchup tool. 2010-06-26 15:25 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) diff --git a/harbour/contrib/hbide/resources/hbmk2_plugin_uip.prg b/harbour/contrib/hbide/resources/hbmk2_plugin_uip.prg index adcbd14293..cffca20cc8 100644 --- a/harbour/contrib/hbide/resources/hbmk2_plugin_uip.prg +++ b/harbour/contrib/hbide/resources/hbmk2_plugin_uip.prg @@ -15,31 +15,45 @@ FUNCTION hbmk2_plugin_uip( hbmk2 ) LOCAL cRetVal := "" LOCAL cHBQTUI_BIN + LOCAL aUI LOCAL aUI_Dst - LOCAL cCommand + LOCAL cSrc LOCAL cDst - LOCAL nError - LOCAL tmp, tmp1, tmp2 + LOCAL tSrc + LOCAL tDst + LOCAL cCommand + LOCAL nError LOCAL lBuildIt + LOCAL tmp + SWITCH hbmk2[ "cSTATE" ] CASE "pre_all" - aUI_Dst := {} - /* Gather input parameters */ aUI := {} + aUI_Dst := {} + FOR EACH tmp IN hbmk2[ "params" ] IF Lower( hbmk2_FNameExtGet( tmp ) ) == ".ui" AAdd( aUI, tmp ) + AAdd( aUI_Dst, cDst := hbmk2_FNameDirExtSet( hbmk2_FNameNameGet( cSrc ), hbmk2[ "cWorkDir" ], ".uip" ) ) + hbmk2_AddInput_PRG( hbmk2, cDst ) ENDIF NEXT - IF ! Empty( aUI ) + hbmk2[ "vars" ][ "aUI" ] := aUI + hbmk2[ "vars" ][ "aUI_Dst" ] := aUI_Dst + + EXIT + + CASE "pre_prg" + + IF ! Empty( hbmk2[ "vars" ][ "aUI" ] ) /* Detect 'hbqtui' tool location */ @@ -66,22 +80,20 @@ FUNCTION hbmk2_plugin_uip( hbmk2 ) /* Execute 'hbqtui' commands on input files */ - FOR EACH tmp IN aUI - - cDst := hbmk2_FNameDirExtSet( hbmk2_FNameNameGet( tmp ), hbmk2[ "cWorkDir" ], ".uip" ) + FOR EACH cSrc, cDst IN hbmk2[ "vars" ][ "aUI" ], hbmk2[ "vars" ][ "aUI_Dst" ] IF hbmk2[ "lINC" ] .AND. ! hbmk2[ "lREBUILD" ] - lBuildIt := ! hb_FGetDateTime( cDst, @tmp2 ) .OR. ; - ! hb_FGetDateTime( tmp, @tmp1 ) .OR. ; - tmp1 > tmp2 + lBuildIt := ! hb_FGetDateTime( cDst, @tDst ) .OR. ; + ! hb_FGetDateTime( cSrc, @tSrc ) .OR. ; + tSrc > tDst ELSE lBuildIt := .T. ENDIF - IF lBuildIt .AND. ! hbmk2[ "lCLEAN" ] + IF lBuildIt cCommand := cHBQTUI_BIN +; - " " + hbmk2_FNameEscape( hbmk2_PathSepToTarget( hbmk2, tmp ), hbmk2[ "nCmd_Esc" ], hbmk2[ "nCmd_FNF" ] ) +; + " " + hbmk2_FNameEscape( hbmk2_PathSepToTarget( hbmk2, cSrc ), hbmk2[ "nCmd_Esc" ], hbmk2[ "nCmd_FNF" ] ) +; " -o" + hbmk2_FNameEscape( hbmk2_PathSepToTarget( hbmk2, cDst ), hbmk2[ "nCmd_Esc" ], hbmk2[ "nCmd_FNF" ] ) IF hbmk2[ "lTRACE" ] @@ -100,19 +112,11 @@ FUNCTION hbmk2_plugin_uip( hbmk2 ) cRetVal := "error" EXIT ENDIF - ELSE - hbmk2_AddInput_PRG( hbmk2, cDst ) - AAdd( aUI_Dst, cDst ) ENDIF - ELSE - hbmk2_AddInput_PRG( hbmk2, cDst ) - AAdd( aUI_Dst, cDst ) ENDIF NEXT ENDIF - hbmk2[ "vars" ][ "aUI_Dst" ] := aUI_Dst - EXIT CASE "post_all" diff --git a/harbour/contrib/hbnf/ftint86.c b/harbour/contrib/hbnf/ftint86.c index 92bbe09d35..398b7a4aba 100644 --- a/harbour/contrib/hbnf/ftint86.c +++ b/harbour/contrib/hbnf/ftint86.c @@ -4,8 +4,14 @@ #include "hbapi.h" +/* TODO */ + HB_FUNC( FT_INT86 ) { #if defined( HB_OS_DOS ) #endif } + +HB_FUNC( _FT_SETVPG ) +{ +} diff --git a/harbour/contrib/hbqt/hbmk2_plugin_moc.prg b/harbour/contrib/hbqt/hbmk2_plugin_moc.prg index b0e41627b9..d692b00f71 100644 --- a/harbour/contrib/hbqt/hbmk2_plugin_moc.prg +++ b/harbour/contrib/hbqt/hbmk2_plugin_moc.prg @@ -15,32 +15,46 @@ FUNCTION hbmk2_plugin_moc( hbmk2 ) LOCAL cRetVal := "" LOCAL cMOC_BIN + LOCAL aMOC LOCAL aMOC_Dst - LOCAL cCommand + LOCAL cSrc LOCAL cDst - LOCAL nError - LOCAL tmp, tmp1, tmp2 + LOCAL tSrc + LOCAL tDst + LOCAL cCommand + LOCAL nError LOCAL lBuildIt + LOCAL tmp + SWITCH hbmk2[ "cSTATE" ] CASE "pre_all" - aMOC_Dst := {} - /* Gather input parameters */ aMOC := {} + aMOC_Dst := {} + FOR EACH tmp IN hbmk2[ "params" ] IF Lower( hbmk2_FNameExtGet( tmp ) ) == ".h" .OR. ; Lower( hbmk2_FNameExtGet( tmp ) ) == ".hpp" AAdd( aMOC, tmp ) + AAdd( aMOC_Dst, cDst := hbmk2_FNameDirExtSet( "moc_" + hbmk2_FNameNameGet( tmp ), hbmk2[ "cWorkDir" ], ".cpp" ) ) + hbmk2_AddInput_CPP( hbmk2, cDst ) ENDIF NEXT - IF ! Empty( aMOC ) + hbmk2[ "vars" ][ "aMOC" ] := aMOC + hbmk2[ "vars" ][ "aMOC_Dst" ] := aMOC_Dst + + EXIT + + CASE "pre_c" + + IF ! Empty( hbmk2[ "vars" ][ "aMOC" ] ) /* Detect 'moc' tool location */ @@ -85,21 +99,20 @@ FUNCTION hbmk2_plugin_moc( hbmk2 ) /* Execute 'moc' commands on input files */ - FOR EACH tmp IN aMOC - - cDst := hbmk2_FNameDirExtSet( "moc_" + hbmk2_FNameNameGet( tmp ), hbmk2[ "cWorkDir" ], ".cpp" ) + FOR EACH cSrc, cDst IN hbmk2[ "vars" ][ "aMOC" ], hbmk2[ "vars" ][ "aMOC_Dst" ] IF hbmk2[ "lINC" ] .AND. ! hbmk2[ "lREBUILD" ] - lBuildIt := ! hb_FGetDateTime( cDst, @tmp2 ) .OR. ; - ! hb_FGetDateTime( tmp, @tmp1 ) .OR. ; - tmp1 > tmp2 + lBuildIt := ! hb_FGetDateTime( cDst, @tDst ) .OR. ; + ! hb_FGetDateTime( cSrc, @tSrc ) .OR. ; + tSrc > tDst ELSE lBuildIt := .T. ENDIF - IF lBuildIt .AND. ! hbmk2[ "lCLEAN" ] + IF lBuildIt + cCommand := cMOC_BIN +; - " " + hbmk2_FNameEscape( hbmk2_PathSepToTarget( hbmk2, tmp ), hbmk2[ "nCmd_Esc" ], hbmk2[ "nCmd_FNF" ] ) +; + " " + hbmk2_FNameEscape( hbmk2_PathSepToTarget( hbmk2, cSrc ), hbmk2[ "nCmd_Esc" ], hbmk2[ "nCmd_FNF" ] ) +; " -o " + hbmk2_FNameEscape( hbmk2_PathSepToTarget( hbmk2, cDst ), hbmk2[ "nCmd_Esc" ], hbmk2[ "nCmd_FNF" ] ) IF hbmk2[ "lTRACE" ] @@ -118,19 +131,11 @@ FUNCTION hbmk2_plugin_moc( hbmk2 ) cRetVal := "error" EXIT ENDIF - ELSE - hbmk2_AddInput_CPP( hbmk2, cDst ) - AAdd( aMOC_Dst, cDst ) ENDIF - ELSE - hbmk2_AddInput_CPP( hbmk2, cDst ) - AAdd( aMOC_Dst, cDst ) ENDIF NEXT ENDIF - hbmk2[ "vars" ][ "aMOC_Dst" ] := aMOC_Dst - EXIT CASE "post_all" diff --git a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp index 224e829a2f..c0b4af3354 100644 --- a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp +++ b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp @@ -1452,6 +1452,8 @@ void HBQPlainTextEdit::paintEvent( QPaintEvent * event ) void HBQPlainTextEdit::hbDrawCursor( QPaintEvent *event ) { + HB_SYMBOL_UNUSED( event ); + QAbstractTextDocumentLayout::PaintContext pc = getPaintContext(); { if( caretState == 1 ) diff --git a/harbour/contrib/hbxpp/tbrowsex.prg b/harbour/contrib/hbxpp/tbrowsex.prg index af52a90dcb..683092c012 100644 --- a/harbour/contrib/hbxpp/tbrowsex.prg +++ b/harbour/contrib/hbxpp/tbrowsex.prg @@ -82,7 +82,7 @@ METHOD viewArea() CLASS xpp_TBrowse // TOFIX nWidth := nFrozenWidth := _TBR_COORD( ::n_Right ) - _TBR_COORD( ::n_Left ) + 1 - _MAXFREEZE( ::nFrozen, ::aColData, @nWidth ) + /* _MAXFREEZE( ::nFrozen, ::aColData, @nWidth ) */ nFrozenWidth -= nWidth RETURN { ::n_Top + ::nHeadHeight + iif( ::lHeadSep, 1, 0 ),; diff --git a/harbour/contrib/hbziparc/hbziparc.hbp b/harbour/contrib/hbziparc/hbziparc.hbp index 1c76e73c45..489c865b7a 100644 --- a/harbour/contrib/hbziparc/hbziparc.hbp +++ b/harbour/contrib/hbziparc/hbziparc.hbp @@ -10,4 +10,6 @@ -w3 -es2 +../hbmzip/hbmzip.hbc + hbziparc.prg diff --git a/harbour/contrib/makefile.prg b/harbour/contrib/makefile.prg index d83cfe1ec3..f105477ca6 100644 --- a/harbour/contrib/makefile.prg +++ b/harbour/contrib/makefile.prg @@ -11,7 +11,8 @@ 1. error handling / reporting / feedback 2. copy headers and other stuff (hbide) 3. add .dll generation for contrib libs - 4. first do all the 'clean's + 4. first do all the clean's + 5. hbmk2 fix to create work dir before calling out plugin */ #pragma warninglevel=3 @@ -136,6 +137,7 @@ PROCEDURE Main( ... ) LOCAL cTargetDir LOCAL cOptions := "" + LOCAL lBuildName LOCAL cFilter := GetEnv( "HB_CONTRIBLIBS" ) LOCAL aFilter @@ -168,6 +170,12 @@ PROCEDURE Main( ... ) IF GetEnv( "HB_BUILD_DEBUG" ) == "yes" cOptions += " -debug" ENDIF + IF ! Empty( GetEnv( "HB_BUILD_NAME" ) ) + cOptions += " -build=" + GetEnv( "HB_BUILD_NAME" ) + lBuildName := .T. + ELSE + lBuildName := .F. + ENDIF FOR EACH tmp IN aParams tmp := Lower( tmp ) @@ -208,11 +216,11 @@ PROCEDURE Main( ... ) SWITCH cType CASE "lib" CASE "implib" - cTargetDir := "lib/" + GetEnv( "HB_PLATFORM" ) + "/" + GetEnv( "HB_COMPILER" ) + iif( Empty( GetEnv( "HB_BUILD_NAME" ) ), "", "/" + GetEnv( "HB_BUILD_NAME" ) ) + cTargetDir := "lib/${hb_plat}/${hb_comp}" + iif( lBuildName, "/${hb_build}", "" ) cInstallDirVar := "HB_LIB_INSTALL_" EXIT CASE "bin" - cTargetDir := "bin/" + GetEnv( "HB_PLATFORM" ) + "/" + GetEnv( "HB_COMPILER" ) + iif( Empty( GetEnv( "HB_BUILD_NAME" ) ), "", "/" + GetEnv( "HB_BUILD_NAME" ) ) + cTargetDir := "bin/${hb_plat}/${hb_comp}" + iif( lBuildName, "/${hb_build}", "" ) cInstallDirVar := "HB_BIN_INSTALL_" EXIT ENDSWITCH @@ -266,7 +274,7 @@ STATIC FUNCTION call_hbmk2( cProject, cTargetDir, cOptions, lDyn ) " -quiet -lang=en -width=1000 -q0" + cOptions +; " " + cProject +; iif( lDyn, " -hbdyn -nohblib- " + FN_ExtSet( cProject, ".hbc" ), "" ) +; - " -workdir=" + cTargetDir + "/${hb_work}/" + cName + iif( lDyn, "_dyn", "" ) +; + " -workdir=" + cTargetDir + "/${hb_work}/" + cName + "${hb_workdynsub}" +; " -o" + cTargetDir + "/" ) IF nErrorLevel != 0 OutStd( hb_StrFormat( "'%s' returned status: %s" + hb_osNewLine(), cProject, hb_ntos( nErrorLevel ) ) ) diff --git a/harbour/contrib/xhb/xhb.hbp b/harbour/contrib/xhb/xhb.hbp index d225ff73eb..a48deac15d 100644 --- a/harbour/contrib/xhb/xhb.hbp +++ b/harbour/contrib/xhb/xhb.hbp @@ -23,7 +23,6 @@ hboutdbg.c hbserv.c hbsyslog.c hbxml.c -hbxml1.c txtline.c xhbarr.c xhbat.c @@ -43,8 +42,8 @@ xhbini.c xhbis.c xhbmsgs.c xhbmtc.c -xhbproc.c xhbqself.c +xhbproc.c xhbregx.c xhbsave.c xhbscr.c @@ -65,18 +64,9 @@ hbcomprs.prg hblog.prg hblognet.prg hbstruct.prg -hjwindow.prg -hterrsys.prg -htjlist.prg -htmutil.prg regexrpl.prg sprintf.prg stream.prg -tcgi.prg -tedit.prg -tfile.prg -tframe.prg -thtm.prg traceprg.prg trpc.prg trpccli.prg @@ -90,5 +80,15 @@ xhbfunp.prg xhbinkey.prg xhbmt.prg xhbver.prg -xhw32prn.prg xthrow.prg +xhw32prn.prg + +hjwindow.prg +hterrsys.prg +htjlist.prg +htmutil.prg +tcgi.prg +tedit.prg +tfile.prg +tframe.prg +thtm.prg diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 1888566f48..d2d58d9f61 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -372,16 +372,17 @@ REQUEST hbmk_KEYW #define _HBMK_cCCEXT 98 #define _HBMK_cWorkDir 99 -#define _HBMK_nCmd_Esc 100 -#define _HBMK_nScr_Esc 101 -#define _HBMK_nCmd_FNF 102 -#define _HBMK_nScr_FNF 103 -#define _HBMK_nErrorLevel 104 +#define _HBMK_cWorkDirDynSub 100 +#define _HBMK_nCmd_Esc 101 +#define _HBMK_nScr_Esc 102 +#define _HBMK_nCmd_FNF 103 +#define _HBMK_nScr_FNF 104 +#define _HBMK_nErrorLevel 105 -#define _HBMK_cPROGDIR 105 -#define _HBMK_cPROGNAME 106 +#define _HBMK_cPROGDIR 106 +#define _HBMK_cPROGNAME 107 -#define _HBMK_MAX_ 106 +#define _HBMK_MAX_ 107 #define _HBMK_DEP_CTRL_MARKER ".control." /* must be an invalid path */ @@ -2412,8 +2413,10 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) IMPORTANT: Keep this condition in sync with setting -DHB_DYNLIB C compiler flag */ IF hbmk[ _HBMK_lCreateDyn ] .AND. !( hbmk[ _HBMK_cCOMP ] $ "mingw|mingw64|mingwarm|cygwin" ) DEFAULT hbmk[ _HBMK_cWorkDir ] TO FN_DirGet( hbmk[ _HBMK_cPROGNAME ] ) + _WORKDIR_DEF_ + hb_osPathSeparator() + "hbdyn" + hbmk[ _HBMK_cWorkDirDynSub ] := "/hbdyn" ELSE DEFAULT hbmk[ _HBMK_cWorkDir ] TO FN_DirGet( hbmk[ _HBMK_cPROGNAME ] ) + _WORKDIR_DEF_ + hbmk[ _HBMK_cWorkDirDynSub ] := "" ENDIF IF ! Empty( hbmk[ _HBMK_cWorkDir ] ) IF ! DirBuild( hbmk[ _HBMK_cWorkDir ] ) @@ -4835,6 +4838,8 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) IF ! hbmk[ _HBMK_lCLEAN ] + PlugIn_Execute( hbmk, "pre_c" ) + FOR EACH tmp3 IN { _CCOMP_PASS_C, _CCOMP_PASS_CPP } IF tmp3 == _CCOMP_PASS_C @@ -4849,8 +4854,6 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) IF ! Empty( cBin_CompCGEN ) - PlugIn_Execute( hbmk, "pre_c" ) - IF hbmk[ _HBMK_lINC ] .AND. ! hbmk[ _HBMK_lQuiet ] IF tmp3 == _CCOMP_PASS_C hbmk_OutStd( hbmk, I_( "Compiling..." ) ) @@ -8098,6 +8101,8 @@ STATIC FUNCTION MacroProc( hbmk, cString, cFileName, cMacroPrefix ) cMacro := hbmk_CPU( hbmk ) ; EXIT CASE "HB_WORK" cMacro := _WORKDIR_BASE_ ; EXIT + CASE "HB_WORKDYNSUB" + cMacro := hbmk[ _HBMK_cWorkDirDynSub ] ; EXIT CASE "HB_MAJOR" cMacro := hb_ntos( hb_Version( HB_VERSION_MAJOR ) ) ; EXIT CASE "HB_MINOR"