From a0e07d3940e58168db01d82440451f3f14c26cf8 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 27 Oct 2009 16:39:24 +0000 Subject: [PATCH] 2009-10-27 17:36 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbwin/axcore.c * Replaced duplicated constant with HB_SIZEOFARRAY() macro. * utils/hbmk2/hbmk2.prg + C compiler autodetection will now make sure to skip compilers where required Harbour core libraries aren't installed. This autodetection is disabled when HB_LIB_INSTALL is set manually and also when lib/ dir is missing altogether, assuming there is a single-compiler installation used in this case (where such autodetection cannot work reliably). When using -info option, a screen message is shown if autodetected C compiler is skipped for above reason. --- harbour/ChangeLog | 14 ++++++++++++++ harbour/contrib/hbwin/axcore.c | 2 +- harbour/utils/hbmk2/hbmk2.prg | 22 ++++++++++++++++++---- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d450caec3f..607ea6f97a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,20 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-10-27 17:36 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbwin/axcore.c + * Replaced duplicated constant with HB_SIZEOFARRAY() macro. + + * utils/hbmk2/hbmk2.prg + + C compiler autodetection will now make sure to skip compilers + where required Harbour core libraries aren't installed. + This autodetection is disabled when HB_LIB_INSTALL is set + manually and also when lib/ dir is missing altogether, + assuming there is a single-compiler installation used in this + case (where such autodetection cannot work reliably). + When using -info option, a screen message is shown if + autodetected C compiler is skipped for above reason. + 2009-10-27 11:51 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/contrib/xhb/xhbarr.c + added XHB_AINS(), XHB_ADEL() functions which accept negative indexes. diff --git a/harbour/contrib/hbwin/axcore.c b/harbour/contrib/hbwin/axcore.c index e4310a6e88..ed34401d3a 100644 --- a/harbour/contrib/hbwin/axcore.c +++ b/harbour/contrib/hbwin/axcore.c @@ -343,7 +343,7 @@ static HRESULT STDMETHODCALLTYPE Invoke( IDispatch* lpThis, DISPID dispid, REFII iCount = pParams->cArgs; - for( i = iRefs = 0; i < iCount && iRefs < 32; i++ ) + for( i = iRefs = 0; i < iCount && iRefs < HB_SIZEOFARRAY( refArray ); i++ ) { if( pParams->rgvarg[ i ].n1.n2.vt & VT_BYREF ) refArray[ iRefs++ ].item = hb_stackAllocItem(); diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index c387c5f3b1..c726127bcb 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -659,6 +659,8 @@ FUNCTION hbmk( aArgs, /* @ */ lPause ) LOCAL nStart := Seconds() + LOCAL lDoSupportDetection + hbmk[ _HBMK_lCreateLib ] := .F. hbmk[ _HBMK_lCreateDyn ] := .F. @@ -1195,14 +1197,26 @@ FUNCTION hbmk( aArgs, /* @ */ lPause ) ENDIF ELSE IF Empty( hbmk[ _HBMK_cCOMP ] ) .AND. ! Empty( aCOMPDET ) + lDoSupportDetection := Empty( l_cHB_LIB_INSTALL ) .AND. ; + hb_DirExists( PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) ) + "lib" + hb_osPathSeparator() + hbmk[ _HBMK_cPLAT ] ) /* Check compilers */ FOR tmp := 1 TO Len( aCOMPDET ) IF ! Empty( cPath_CompC := Eval( aCOMPDET[ tmp ][ _COMPDET_bBlock ] ) ) - hbmk[ _HBMK_cCOMP ] := aCOMPDET[ tmp ][ _COMPDET_cCOMP ] - IF Len( aCOMPDET[ tmp ] ) >= _COMPDET_cCCPREFIX - hbmk[ _HBMK_cCCPREFIX ] := aCOMPDET[ tmp ][ _COMPDET_cCCPREFIX ] + IF ! lDoSupportDetection .OR. ; + hb_DirExists( PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) ) + "lib" +; + hb_osPathSeparator() + hbmk[ _HBMK_cPLAT ] +; + hb_osPathSeparator() + aCOMPDET[ tmp ][ _COMPDET_cCOMP ] +; + iif( Empty( hbmk[ _HBMK_cBUILD ] ), "", PathSepToTarget( hbmk, hbmk[ _HBMK_cBUILD ] ) ) ) + hbmk[ _HBMK_cCOMP ] := aCOMPDET[ tmp ][ _COMPDET_cCOMP ] + IF Len( aCOMPDET[ tmp ] ) >= _COMPDET_cCCPREFIX + hbmk[ _HBMK_cCCPREFIX ] := aCOMPDET[ tmp ][ _COMPDET_cCCPREFIX ] + ENDIF + EXIT + ELSE + IF hbmk[ _HBMK_lInfo ] + hbmk_OutStd( hb_StrFormat( I_( "Autodetected C compiler '%1$s' skipped because required Harbour core libraries are not found." ), aCOMPDET[ tmp ][ _COMPDET_cCOMP ] ) ) + ENDIF ENDIF - EXIT ENDIF NEXT ENDIF