From 1404afd589d0e1359b4072e9f3ea0bf8923b2db7 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 25 Aug 2008 18:37:34 +0000 Subject: [PATCH] 2008-08-25 20:36 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * utils/hbmake/hbmake.prg ! Harbour executable detection cleanups and fix to look into current dir and detect Darwin as a Unix platform. (usable state is still very far) --- harbour/ChangeLog | 6 +++++ harbour/utils/hbmake/hbmake.prg | 45 +++++++++++++++------------------ 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 1d14a98c98..219355a80a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,12 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-08-25 20:36 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * utils/hbmake/hbmake.prg + ! Harbour executable detection cleanups and fix to look + into current dir and detect Darwin as a Unix platform. + (usable state is still very far) + 2008-08-25 20:14 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/contrib/hbw32/w32_ole.c * removed hack with malloc()/free() directly used to avoid diff --git a/harbour/utils/hbmake/hbmake.prg b/harbour/utils/hbmake/hbmake.prg index 401000b2ef..0a92c281c5 100644 --- a/harbour/utils/hbmake/hbmake.prg +++ b/harbour/utils/hbmake/hbmake.prg @@ -6790,38 +6790,33 @@ RETURN aDir FUNCTION GetHarbourDir() *----------------------- - LOCAL cPath := "" - LOCAL cEnv := GETE( "PATH" ) - LOCAL lLinux := "LINUX" $ upper(OS()) - LOCAL lUnix := iif( "UNIX" $ upper(OS()) .OR. "HP-UX" $ upper(OS()), .T., .F. ) - LOCAL aEnv - LOCAL cCurEnv := "" - LOCAL cBar := iif( lLinux .or. lUnix, "/" , "\" ) - LOCAL HBSTRG := "" - LOCAL cPathUni:= GETE( "PATH_HARBOUR" ) + LOCAL lUnix := "LINUX" $ Upper( OS() ) .OR. ; + "UNIX" $ Upper( OS() ) .OR. ; + "HP-UX" $ Upper( OS() ) .OR. ; + "DARWIN" $ Upper( OS() ) - hbstrg := IIF ( lLinux .or. lUnix, "harbour" , "harbour.exe" ) + LOCAL cBar := iif( lUnix, "/" , "\" ) + LOCAL HBSTRG := iif( lUnix, "harbour", "harbour.exe" ) + LOCAL cPathUni := GetEnv( "PATH_HARBOUR" ) + LOCAL aEnv := hb_ATokens( GetEnv( "PATH" ), iif( lUnix, ":", ";" ) ) + LOCAL cCurEnv - If lUnix - If cPathUni == Nil - cPathUni := "" - EndIF - cEnv += ":" + cPathUni - EndIf + AAdd( aEnv, "." + cBar ) - aEnv := HB_ATokens( cEnv, iif(lLinux .or. lUnix,":",";") ) + IF !Empty( cPathUni ) + AAdd( aEnv, cPathUni ) + ENDIF - FOR EACH cCurEnv IN aEnv + FOR EACH cCurEnv IN aEnv - IF FILE( cCurEnv + cBar + hbstrg ) .OR. FILE( UPPER( cCurEnv ) + cBar + upper(hbstrg) ) - cPath := cCurEnv - cPath := LEFT( cPath, RAT( cBar, cPath ) - 1 ) - EXIT - ENDIF + IF File( cCurEnv + cBar + hbstrg ) .OR. ; + File( Upper( cCurEnv + cBar + hbstrg ) ) - NEXT + RETURN Left( cCurEnv, RAt( cBar, cCurEnv ) - 1 ) + ENDIF + NEXT -RETURN cPath + RETURN "" *------------------- FUNCTION GetBccDir()