2010-09-26 23:03 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* utils/hbmk2/hbmk2.prg
    + Harbour environment autodetection will now work if pathseps 
      are present in HB_BUILD_NAME/-build= setting.
      (so now it's in sync with Harbour build in this regard)
This commit is contained in:
Viktor Szakats
2010-09-26 21:05:32 +00:00
parent a64cae6dd4
commit b11e7cd952
2 changed files with 22 additions and 1 deletions

View File

@@ -16,6 +16,12 @@
The license applies to all entries newer than 2009-04-28.
*/
2010-09-26 23:03 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* utils/hbmk2/hbmk2.prg
+ Harbour environment autodetection will now work if pathseps
are present in HB_BUILD_NAME/-build= setting.
(so now it's in sync with Harbour build in this regard)
2010-09-26 17:28 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* examples/gtwvw/tests/wvwtest9.prg
+ Changed to use HB_GTI_INKEYFILTER instead of xhb specific

View File

@@ -1024,7 +1024,7 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel )
CASE Left( cParamL, 10 ) == "-platform=" ; ParseCOMPPLATCPU( hbmk, SubStr( cParam, 11 ), _TARG_PLAT )
CASE Left( cParamL, 6 ) == "-arch=" ; ParseCOMPPLATCPU( hbmk, SubStr( cParam, 7 ), _TARG_PLAT ) /* Compatibility */
CASE Left( cParamL, 5 ) == "-cpu=" ; ParseCOMPPLATCPU( hbmk, SubStr( cParam, 6 ), _TARG_CPU )
CASE Left( cParamL, 7 ) == "-build=" ; hbmk[ _HBMK_cBUILD ] := SubStr( cParam, 8 )
CASE Left( cParamL, 7 ) == "-build=" ; hbmk[ _HBMK_cBUILD ] := PathSepToSelf( SubStr( cParam, 8 ) )
CASE Left( cParamL, 6 ) == "-build" ; hbmk[ _HBMK_lStopAfterHarbour ] := .T.
CASE Left( cParamL, 6 ) == "-lang=" ; hbmk[ _HBMK_cUILNG ] := SubStr( cParam, 7 ) ; SetUILang( hbmk )
CASE Left( cParamL, 4 ) == "-shl" ; hbmk[ _HBMK_lShowLevel ] := .T.
@@ -1417,6 +1417,11 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel )
ELSEIF hb_FileExists( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + ".." + hb_ps() + "include" +;
hb_ps() + "hbvm.h" )
l_cHB_INSTALL_PREFIX := DirAddPathSep( l_cHB_INSTALL_PREFIX ) + ".." + hb_ps()
/* Detect non-installed dir layout with build name containing sub-dirs */
ELSEIF PathSepCount( hbmk[ _HBMK_cBUILD ] ) > 0 .AND. ;
hb_FileExists( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + Replicate( ".." + hb_ps(), PathSepCount( hbmk[ _HBMK_cBUILD ] ) ) + ".." + hb_ps() + ".." + hb_ps() + "include" +;
hb_ps() + "hbvm.h" )
l_cHB_INSTALL_PREFIX := DirAddPathSep( l_cHB_INSTALL_PREFIX ) + Replicate( ".." + hb_ps(), PathSepCount( hbmk[ _HBMK_cBUILD ] ) ) + ".." + hb_ps() + ".." + hb_ps()
ENDIF
/* Detect special *nix dir layout (/bin, /lib/harbour, /lib64/harbour, /include/harbour) */
@@ -8310,6 +8315,16 @@ STATIC FUNCTION FN_FromArray( aPath, nFrom, nTo, cFileName, cDirPrefix )
RETURN hb_FNameMerge( DirDelPathSep( DirAddPathSep( cDirPrefix ) + cDir ), cFileName )
STATIC FUNCTION PathSepCount( cPath )
LOCAL nCount := 0
LOCAL c
FOR EACH c IN cPath
IF c == hb_ps()
++nCount
ENDIF
NEXT
RETURN nCount
STATIC FUNCTION PathSepToForward( cFileName )
RETURN StrTran( cFileName, "\", "/" )