diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 1fbcc78790..862833126f 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,27 @@ The license applies to all entries newer than 2009-04-28. */ +2010-07-06 14:07 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * utils/hbrun/hbrun.prg + + Extended to look in current dir, hbrun dir and PATH for + passed script name, if no extension was passed, it will + try .hbs and .hrb in that order. This means hbrun is + pretty much like a shell command processor now. + + * bin/hbxpatch.hbs + * utils/hbmk2/hbmk2.prg + * utils/hbrun/hbrun.prg + * contrib/hbqt/hbmk2_plugin_qt.hbs + * config/postinst.hbs + * HB_OSPATHSEPARATOR() -> HB_PS() + * HB_OSNEWLINE() -> HB_EOL() + + * utils/hbmk2/hbmk2.prg + * Using string literals instead of Chr() in few places. + ! FindInPath() corrected to honor original dir in filename + it receives. This may affect plugins if they pass such + argument. + 2010-07-06 13:02 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/console.c * src/rtl/philes.c diff --git a/harbour/bin/hbxpatch.hbs b/harbour/bin/hbxpatch.hbs index 300fcd1412..7505bf86ab 100644 --- a/harbour/bin/hbxpatch.hbs +++ b/harbour/bin/hbxpatch.hbs @@ -212,14 +212,11 @@ #endif #if defined( _TRACE ) - #define TRACE( str ) OutStd( "T: " + str + OSNL ) + #define TRACE( str ) OutStd( "T: " + str + hb_eol() ) #else #define TRACE( str ) #endif -#define OSPS hb_osPathSeparator() -#define OSNL hb_osNewLine() - #define ONEARG_KW 2 /* one-arg line keyword */ #define ONEARG_ARG 3 /* one-arg line argument */ #define TWOARG_KW 2 /* two-arg line keyword */ @@ -289,7 +286,7 @@ PROCEDURE Main( ... ) IF ! hb_FileExists( cFileName := "Makefile" ) IF Empty( aDir := Directory( "*.hbp" ) ) - OutStd( "No `Makefile' or '*.hbp' file in the current directory." + OSNL ) + OutStd( "No `Makefile' or '*.hbp' file in the current directory." + hb_eol() ) ErrorLevel( 1 ) QUIT ELSE @@ -325,30 +322,30 @@ PROCEDURE Main( ... ) /* Do not allow implicit destination with non-flat source spec */ IF Empty( aRegexMatch[ TWOARG_ARG1 ] ) .AND. "/" $ aRegexMatch[ TWOARG_ARG2 ] OutStd( hb_strFormat( "E: Non-flat source spec with implicit " + ; - "destination, offending line %d:%s:", nMemoLine, OSNL ) ) - OutStd( aRegexMatch[ 1 ] + OSNL ) + "destination, offending line %d:%s:", nMemoLine, hb_eol() ) ) + OutStd( aRegexMatch[ 1 ] + hb_eol() ) ErrorLevel( 2 ) QUIT ENDIF /* Do not allow tree spec in the destination ever */ IF "/" $ aRegexMatch[ TWOARG_ARG2 ] OutStd( hb_strFormat( "E: Non-flat destination, offending line %d:%s", ; - nMemoLine, OSNL ) ) - OutStd( aRegexMatch[ 1 ] + OSNL ) + nMemoLine, hb_eol() ) ) + OutStd( aRegexMatch[ 1 ] + hb_eol() ) ErrorLevel( 2 ) QUIT ENDIF /* If the source argument indicates the source tree is not flat, convert * path separator to native. The HB tree is always flattened. */ IF "/" $ aRegexMatch[ TWOARG_ARG1 ] - aRegexMatch[ TWOARG_ARG1 ] := StrTran( aRegexMatch[ TWOARG_ARG1 ], "/", OSPS ) + aRegexMatch[ TWOARG_ARG1 ] := StrTran( aRegexMatch[ TWOARG_ARG1 ], "/", hb_ps() ) ENDIF /* The destination argument must fit in the 8+3 scheme */ IF Len( FN_NameGet( aRegexMatch[ TWOARG_ARG2 ] ) ) > 8 .OR. ; Len( FN_ExtGet( aRegexMatch[ TWOARG_ARG2 ] ) ) > 3 OutStd( hb_strFormat( "E: Destination does not fit 8+3, offending "+ ; - "line %d:%s", nMemoLine, OSNL ) ) - OutStd( aRegexMatch[ 1 ] + OSNL ) + "line %d:%s", nMemoLine, hb_eol() ) ) + OutStd( aRegexMatch[ 1 ] + hb_eol() ) ErrorLevel( 2 ) QUIT ENDIF @@ -368,8 +365,8 @@ PROCEDURE Main( ... ) cTopIndicator := s_aChangeMap[ 1 ][ FN_ORIG ] IF "/" $ cTopIndicator OutStd( hb_strFormat( "E: First `MAP' entry is not flat, offending " + ; - "line %d:%s", nMemoLine, OSNL ) ) - OutStd( aRegexMatch[ 1 ] + OSNL ) + "line %d:%s", nMemoLine, hb_eol() ) ) + OutStd( aRegexMatch[ 1 ] + hb_eol() ) ErrorLevel( 2 ) QUIT ENDIF @@ -379,20 +376,20 @@ PROCEDURE Main( ... ) NEXT IF Empty( s_aChangeMap ) .AND. cDiffFile == NIL - OutStd( "No file name changes and no local diff, nothing to do." + OSNL ) + OutStd( "No file name changes and no local diff, nothing to do." + hb_eol() ) QUIT ENDIF IF ! lRediff .AND. cDiffFile != NIL .AND. ! hb_FileExists( cDiffFile ) - OutStd( "E: `" + cDiffFile + "' does not exist" + OSNL ) + OutStd( "E: `" + cDiffFile + "' does not exist" + hb_eol() ) ErrorLevel( 2 ) QUIT ENDIF - cCWD := hb_CurDrive() + hb_osDriveSeparator() + OSPS + CurDir() + cCWD := hb_CurDrive() + hb_osDriveSeparator() + hb_ps() + CurDir() #if defined( _CURDIR ) - cRoot := cCWD + OSPS + cRoot := cCWD + hb_ps() #endif FClose( hb_FTempCreateEx( @s_cTempDir, cRoot, FN_NameGet( hb_ProgName() ) + "_" ) ) @@ -406,21 +403,21 @@ PROCEDURE Main( ... ) MakeDir( CombinePath( s_cTempDir, "root" ) ) IF lRediff .AND. cDiffFile == NIL - OutStd( "Requested rediff mode with no existing local diff, attempting to create one." + OSNL ) + OutStd( "Requested rediff mode with no existing local diff, attempting to create one." + hb_eol() ) cDiffFile := cThisComponent + ".dif" ENDIF IF ! FetchAndExtract( cArchiveURL ) - OutStd( "E: Fetching or extracting the source archive failed." + OSNL ) - OutStd( " Inspect `" + s_cTempDir + "' for further clues." + OSNL ) + OutStd( "E: Fetching or extracting the source archive failed." + hb_eol() ) + OutStd( " Inspect `" + s_cTempDir + "' for further clues." + hb_eol() ) ErrorLevel( 2 ) QUIT ENDIF s_cSourceRoot := WalkAndFind( CombinePath( s_cTempDir, "root" ), cTopIndicator ) IF s_cSourceRoot == NIL - OutStd( "E: Unable to find the new tree's root" + OSNL ) - OutStd( " Inspect `" + s_cTempDir + "'" + OSNL ) + OutStd( "E: Unable to find the new tree's root" + hb_eol() ) + OutStd( " Inspect `" + s_cTempDir + "'" + hb_eol() ) ErrorLevel( 2 ) QUIT ENDIF @@ -432,8 +429,8 @@ PROCEDURE Main( ... ) */ FOR EACH aOneMap IN s_aChangeMap IF ! hb_FileExists( CombinePath( s_cSourceRoot, aOneMap[ FN_ORIG ] ) ) - OutStd( "W: `" + aOneMap[ FN_ORIG ] + "' does not exist in the source tree" + OSNL ) - OutStd( " I will do what i can, but you'd better check the results manually." + OSNL ) + OutStd( "W: `" + aOneMap[ FN_ORIG ] + "' does not exist in the source tree" + hb_eol() ) + OutStd( " I will do what i can, but you'd better check the results manually." + hb_eol() ) s_nErrors++ ELSE /* Create the `pristine tree' */ @@ -470,7 +467,7 @@ PROCEDURE Main( ... ) nRunResult := hb_processRun( cCommand, , @cStdOut, @cStdErr, .F. ) SaveLog( "patch", cStdOut, cStdErr ) IF nRunResult != 0 - OutStd( "W: Unexpected events happened during patching, inspect " + s_cTempDir + OSNL ) + OutStd( "W: Unexpected events happened during patching, inspect " + s_cTempDir + hb_eol() ) s_nErrors++ ENDIF ENDIF @@ -490,12 +487,12 @@ PROCEDURE Main( ... ) nDiffFD := FCreate( cDiffFile ) FWrite( nDiffFD, cDiffText ) FClose( nDiffFD ) - OutStd( "Local changes saved to `" + cDiffFile + "'; you may need to adjust `DIFF'." + OSNL ) + OutStd( "Local changes saved to `" + cDiffFile + "'; you may need to adjust `DIFF'." + hb_eol() ) ELSE - OutStd( "No local changes; you may need to adjust `DIFF'." + OSNL ) + OutStd( "No local changes; you may need to adjust `DIFF'." + hb_eol() ) IF hb_FileExists( cDiffFile ) FErase( cDiffFile ) - OutStd( "Removed existing `" + cDiffFile + "'." + OSNL ) + OutStd( "Removed existing `" + cDiffFile + "'." + hb_eol() ) ENDIF ENDIF @@ -516,14 +513,14 @@ PROCEDURE Main( ... ) ENDIF ELSE - OutStd( "Errors were encountered, no changes are made to your Harbour tree." + OSNL ) - OutStd( "Inspect " + s_cTempDir + " for further clues." + OSNL ) + OutStd( "Errors were encountered, no changes are made to your Harbour tree." + hb_eol() ) + OutStd( "Inspect " + s_cTempDir + " for further clues." + hb_eol() ) ENDIF IF ! lRediff - OutStd( "Don't forget to update `" + cFileName + "' with the new version and URL information." + OSNL ) + OutStd( "Don't forget to update `" + cFileName + "' with the new version and URL information." + hb_eol() ) ENDIF - OutStd( "The temporary directory `" + s_cTempDir + "' has not been removed." +OSNL ) + OutStd( "The temporary directory `" + s_cTempDir + "' has not been removed." + hb_eol() ) RETURN @@ -560,7 +557,7 @@ STATIC PROCEDURE SetupTools() FOR EACH cTool in hb_HKeys( s_aTools ) IF s_aTools[ cTool ] == NIL - OutStd( "E: Can not find " + cTool + OSNL ) + OutStd( "E: Can not find " + cTool + hb_eol() ) ErrorLevel( 1 ) QUIT ENDIF @@ -575,11 +572,11 @@ STATIC FUNCTION CombinePath( ... ) LOCAL nI IF Len( aArguments ) == 2 - cRetVal := aArguments[ 1 ] + OSPS + aArguments[ 2 ] + cRetVal := aArguments[ 1 ] + hb_ps() + aArguments[ 2 ] ELSE - cRetVal := aArguments[ 1 ] + OSPS + cRetVal := aArguments[ 1 ] + hb_ps() FOR nI := 2 TO Len( aArguments ) - 1 - cRetVal += aArguments[ nI ] + OSPS + cRetVal += aArguments[ nI ] + hb_ps() NEXT cRetVal += aArguments[ Len( aArguments ) ] ENDIF @@ -592,7 +589,7 @@ STATIC FUNCTION WalkAndFind( cTop, cLookFor ) LOCAL aDirEntry LOCAL cRetVal := NIL - cTop += iif( Right( cTop, 1 ) $ "/\", "", hb_osPathSeparator() ) + cTop += iif( Right( cTop, 1 ) $ "/\", "", hb_ps() ) aDir := Directory( cTop + hb_osFileMask(), "D" ) ASORT( aDir,,, { |aLeft| !( aLeft[ F_ATTR ] $ "D" ) } ) /* Files first */ @@ -681,7 +678,7 @@ STATIC FUNCTION FetchAndExtract( cArchiveURL ) IF cArchiver == NIL OutStd( "E: Can not find archiver for `" + ; - FN_NameExtGet( cArchiveURL ) + "'" + OSNL ) + FN_NameExtGet( cArchiveURL ) + "'" + hb_eol() ) RETURN .F. ELSE /* Fetch */ @@ -692,7 +689,7 @@ STATIC FUNCTION FetchAndExtract( cArchiveURL ) nResult := hb_processRun( cCommand, , , @cStdErr, .F. ) SaveLog( "fetch", cStdOut, cStdErr ) IF nResult != 0 - OutStd( "E: Error fetching " + cArchiveURL + OSNL ) + OutStd( "E: Error fetching " + cArchiveURL + hb_eol() ) RETURN .F. ENDIF @@ -704,7 +701,7 @@ STATIC FUNCTION FetchAndExtract( cArchiveURL ) nResult := hb_processRun( cCommand, , @cStdOut, @cStdErr, .F. ) SaveLog( "extract", cStdOut, cStdErr ) IF nResult != 0 - OutStd( "E: Error extracting " + cFileName + OSNL ) + OutStd( "E: Error extracting " + cFileName + hb_eol() ) RETURN .F. ENDIF ELSE @@ -715,13 +712,13 @@ STATIC FUNCTION FetchAndExtract( cArchiveURL ) cCommand := hb_strFormat( "%s " + cArchiverArgs + " %s", ; cArchiver, CombinePath( s_cTempDir, cExtractedFileName ) ) TRACE( "Running " + cCommand ) - cCWD := hb_CurDrive() + hb_osDriveSeparator() + OSPS + CurDir() + cCWD := hb_CurDrive() + hb_osDriveSeparator() + hb_ps() + CurDir() DirChange( CombinePath( s_cTempDir, "root" ) ) nResult := hb_processRun( cCommand, , @cStdOut, @cStdErr, .F. ) DirChange( cCWD ) SaveLog( "archive", cStdOut, cStdErr ) IF nResult != 0 - OutStd( "E: Error unarchiving " + cFileName + OSNL ) + OutStd( "E: Error unarchiving " + cFileName + hb_eol() ) RETURN .F. ENDIF ENDIF @@ -735,11 +732,11 @@ PROCEDURE SaveLog( cFNTemplate, cStdOut, cStdErr ) nLogFD := FCreate( CombinePath( s_cTempDir, cFNTemplate + ".log" ) ) IF cStdOut != NIL - FWrite( nLogFd, "stdout:" + OSNL ) + FWrite( nLogFd, "stdout:" + hb_eol() ) FWrite( nLogFD, cStdOut ) ENDIF IF cStdErr != NIL - FWrite( nLogFd, "stderr:" + OSNL ) + FWrite( nLogFd, "stderr:" + hb_eol() ) FWrite( nLogFD, cStdErr ) ENDIF FClose( nLogFD ) @@ -748,8 +745,8 @@ PROCEDURE SaveLog( cFNTemplate, cStdOut, cStdErr ) PROCEDURE Usage( nExitVal ) - OutStd( "Usage: " + FN_NameExtGet( hb_ProgName() ) + " [-h|-help|-rediff]" + OSNL ) - OutStd( " Documentation is provided in the source code." + OSNL ) + OutStd( "Usage: " + FN_NameExtGet( hb_ProgName() ) + " [-h|-help|-rediff]" + hb_eol() ) + OutStd( " Documentation is provided in the source code." + hb_eol() ) ErrorLevel( nExitVal ) QUIT @@ -828,7 +825,7 @@ STATIC FUNCTION hb_FileTran( cFileName ) cTransformedContent := StrTran( cFileContent, Chr( 13 ) + Chr( 10 ), Chr( 10 ) ) /* LF -> native */ - cTransformedContent := StrTran( cTransformedContent, Chr( 10 ), OSNL ) + cTransformedContent := StrTran( cTransformedContent, Chr( 10 ), hb_eol() ) FOR EACH aChange IN s_aChangeMap diff --git a/harbour/config/postinst.hbs b/harbour/config/postinst.hbs index af5303a86a..b0b97e0db3 100644 --- a/harbour/config/postinst.hbs +++ b/harbour/config/postinst.hbs @@ -16,8 +16,6 @@ #define F_NAME 1 /* File name */ #define F_ATTR 5 /* File attribute */ -#define _PS_ hb_osPathSeparator() - PROCEDURE Main() LOCAL nErrorLevel := 0 LOCAL cFile @@ -34,7 +32,7 @@ PROCEDURE Main() Empty( GetEnv( "HB_LIB_INSTALL" ) ) .OR. ; Empty( GetEnv( "HB_INC_INSTALL" ) ) - OutStd( "! Error: This program has to be called from the GNU Make process." + hb_osNewLine() ) + OutStd( "! Error: This program has to be called from the GNU Make process." + hb_eol() ) ErrorLevel( 1 ) RETURN ENDIF @@ -43,30 +41,30 @@ PROCEDURE Main() lContent := .F. cFile := "" - cFile += "# hbmk2 configuration" + hb_osNewLine() - cFile += "# Generated by Harbour build process" + hb_osNewLine() - cFile += hb_osNewLine() + cFile += "# hbmk2 configuration" + hb_eol() + cFile += "# Generated by Harbour build process" + hb_eol() + cFile += hb_eol() IF GetEnv( "HB_PLATFORM" ) == "dos" .AND. ; ! Empty( GetEnv( "HB_HAS_WATT" ) ) - cFile += hb_osNewLine() - cFile += "{dos&djgpp}syslibs=watt" + hb_osNewLine() - cFile += "{dos&watcom}syslibs=wattcpwf" + hb_osNewLine() - cFile += "{dos}libpaths=${WATT_ROOT}/lib" + hb_osNewLine() + cFile += hb_eol() + cFile += "{dos&djgpp}syslibs=watt" + hb_eol() + cFile += "{dos&watcom}syslibs=wattcpwf" + hb_eol() + cFile += "{dos}libpaths=${WATT_ROOT}/lib" + hb_eol() lContent := .T. ENDIF IF ! Empty( GetEnv( "HB_HAS_GPM" ) ) - cFile += hb_osNewLine() - cFile += "{" + GetEnv( "HB_PLATFORM" ) + "&" + GetEnv( "HB_COMPILER" ) + "}syslibs=gpm" + hb_osNewLine() + cFile += hb_eol() + cFile += "{" + GetEnv( "HB_PLATFORM" ) + "&" + GetEnv( "HB_COMPILER" ) + "}syslibs=gpm" + hb_eol() lContent := .T. ENDIF IF lContent - OutStd( "! Making " + GetEnv( "HB_BIN_INSTALL" ) + _PS_ + "hbmk.hbc..." + hb_osNewLine() ) - hb_MemoWrit( GetEnv( "HB_BIN_INSTALL" ) + _PS_ + "hbmk.hbc", cFile ) + OutStd( "! Making " + GetEnv( "HB_BIN_INSTALL" ) + hb_ps() + "hbmk.hbc..." + hb_eol() ) + hb_MemoWrit( GetEnv( "HB_BIN_INSTALL" ) + hb_ps() + "hbmk.hbc", cFile ) ELSE - FErase( GetEnv( "HB_BIN_INSTALL" ) + _PS_ + "hbmk.hbc" ) + FErase( GetEnv( "HB_BIN_INSTALL" ) + hb_ps() + "hbmk.hbc" ) ENDIF /* Installing some misc files */ @@ -74,19 +72,19 @@ PROCEDURE Main() IF GetEnv( "HB_PLATFORM" ) $ "win|wce|os2|dos" .AND. ; ! Empty( GetEnv( "HB_INSTALL_PREFIX" ) ) - OutStd( "! Copying root documents..." + hb_osNewLine() ) + OutStd( "! Copying root documents..." + hb_eol() ) FOR EACH aFile IN Directory( "Change*" ) - hb_FCopy( aFile[ F_NAME ], GetEnv( "HB_INSTALL_PREFIX" ) + _PS_ + iif( GetEnv( "HB_PLATFORM" ) == "dos", "CHANGES", aFile[ F_NAME ] ) ) + hb_FCopy( aFile[ F_NAME ], GetEnv( "HB_INSTALL_PREFIX" ) + hb_ps() + iif( GetEnv( "HB_PLATFORM" ) == "dos", "CHANGES", aFile[ F_NAME ] ) ) NEXT - hb_FCopy( "COPYING", GetEnv( "HB_INSTALL_PREFIX" ) + _PS_ + "COPYING" ) - hb_FCopy( "INSTALL", GetEnv( "HB_INSTALL_PREFIX" ) + _PS_ + "INSTALL" ) - hb_FCopy( "TODO" , GetEnv( "HB_INSTALL_PREFIX" ) + _PS_ + "TODO" ) + hb_FCopy( "COPYING", GetEnv( "HB_INSTALL_PREFIX" ) + hb_ps() + "COPYING" ) + hb_FCopy( "INSTALL", GetEnv( "HB_INSTALL_PREFIX" ) + hb_ps() + "INSTALL" ) + hb_FCopy( "TODO" , GetEnv( "HB_INSTALL_PREFIX" ) + hb_ps() + "TODO" ) /* public Harbour scripts */ FOR EACH tmp IN { "hbxpatch.hbs" } - hb_FCopy( "bin" + _PS_ + tmp, GetEnv( "HB_BIN_INSTALL" ) + _PS_ + tmp ) + hb_FCopy( "bin" + hb_ps() + tmp, GetEnv( "HB_BIN_INSTALL" ) + hb_ps() + tmp ) NEXT ENDIF @@ -96,9 +94,9 @@ PROCEDURE Main() GetEnv( "HB_BUILD_PKG" ) == "yes" .AND. ; ! Empty( GetEnv( "HB_TOP" ) ) - tmp := GetEnv( "HB_TOP" ) + _PS_ + GetEnv( "HB_PKGNAME" ) + ".zip" + tmp := GetEnv( "HB_TOP" ) + hb_ps() + GetEnv( "HB_PKGNAME" ) + ".zip" - OutStd( "! Making Harbour .zip install package: '" + tmp + "'" + hb_osNewLine() ) + OutStd( "! Making Harbour .zip install package: '" + tmp + "'" + hb_eol() ) FErase( tmp ) @@ -108,26 +106,26 @@ PROCEDURE Main() no zip 2.x compatible way to force creation of a new .zip, so we have to delete it first to avoid mixing in an existing .zip file. [vszakats] */ - cOldDir := _PS_ + CurDir() - DirChange( GetEnv( "HB_INSTALL_PREFIX" ) + _PS_ + ".." ) + cOldDir := hb_ps() + CurDir() + DirChange( GetEnv( "HB_INSTALL_PREFIX" ) + hb_ps() + ".." ) mk_hb_processRun( PathSepToSelf( GetEnv( "HB_DIR_ZIP" ) ) + "zip" +; " -q -9 -X -r -o" +; " " + FN_Escape( tmp ) +; - " . -i " + FN_Escape( GetEnv( "HB_PKGNAME" ) + _PS_ + "*" ) +; + " . -i " + FN_Escape( GetEnv( "HB_PKGNAME" ) + hb_ps() + "*" ) +; " -x *.tds -x *.exp" ) DirChange( cOldDir ) IF GetEnv( "HB_PLATFORM" ) $ "win|wce" - tmp := GetEnv( "HB_TOP" ) + _PS_ + GetEnv( "HB_PKGNAME" ) + ".exe" + tmp := GetEnv( "HB_TOP" ) + hb_ps() + GetEnv( "HB_PKGNAME" ) + ".exe" - OutStd( "! Making Harbour .exe install package: '" + tmp + "'" + hb_osNewLine() ) + OutStd( "! Making Harbour .exe install package: '" + tmp + "'" + hb_eol() ) mk_hb_processRun( PathSepToSelf( GetEnv( "HB_DIR_NSIS" ) ) + "makensis.exe" +; " -V2" +; - " " + FN_Escape( StrTran( "package/mpkg_win.nsi", "/", _PS_ ) ) ) + " " + FN_Escape( StrTran( "package/mpkg_win.nsi", "/", hb_ps() ) ) ) ENDIF ENDIF @@ -137,7 +135,7 @@ PROCEDURE Main() STATIC FUNCTION mk_hb_processRun( cCommand ) - OutStd( cCommand + hb_osNewLine() ) + OutStd( cCommand + hb_eol() ) RETURN hb_processRun( cCommand ) diff --git a/harbour/contrib/hbqt/hbmk2_plugin_qt.hbs b/harbour/contrib/hbqt/hbmk2_plugin_qt.hbs index 4f4c6c8523..8431e1bbc1 100644 --- a/harbour/contrib/hbqt/hbmk2_plugin_qt.hbs +++ b/harbour/contrib/hbqt/hbmk2_plugin_qt.hbs @@ -161,12 +161,12 @@ FUNCTION hbmk2_plugin_qt( hbmk2 ) ENDIF ELSE /* Create little .prg stub which includes the binary */ - cTmp := "/* WARNING: Automatically generated source file. DO NOT EDIT! */" + hb_osNewLine() +; - hb_osNewLine() +; - "#pragma -km+" + hb_osNewLine() +; - hb_osNewLine() +; - "FUNCTION hbqtres_" + hbmk2_FNameToSymbol( hbmk2_FNameNameGet( cSrc ) ) + "()" + hb_osNewLine() +; - " #pragma __binarystreaminclude " + Chr( 34 ) + hbmk2_FNameNameExtGet( cDst ) + Chr( 34 ) + "|RETURN %s" + hb_osNewLine() + cTmp := "/* WARNING: Automatically generated source file. DO NOT EDIT! */" + hb_eol() +; + hb_eol() +; + "#pragma -km+" + hb_eol() +; + hb_eol() +; + "FUNCTION hbqtres_" + hbmk2_FNameToSymbol( hbmk2_FNameNameGet( cSrc ) ) + "()" + hb_eol() +; + " #pragma __binarystreaminclude " + Chr( 34 ) + hbmk2_FNameNameExtGet( cDst ) + Chr( 34 ) + "|RETURN %s" + hb_eol() IF ! hb_MemoWrit( cPRG, cTmp ) hbmk2_OutErr( hbmk2, hb_StrFormat( "Error: Cannot create file: %1$s", cPRG ) ) @@ -410,14 +410,14 @@ PROCEDURE Main( cSrc, cDst ) nError := 9 ENDIF ELSE - OutErr( "Error: Calling 'uic' tool: " + hb_ntos( nError ) + hb_osNewLine() ) + OutErr( "Error: Calling 'uic' tool: " + hb_ntos( nError ) + hb_eol() ) ENDIF EXIT ENDSWITCH FErase( cTmp ) ELSE - OutErr( "Missing parameter. Call with: " + hb_osNewLine() ) + OutErr( "Missing parameter. Call with: " + hb_eol() ) nError := 8 ENDIF @@ -445,7 +445,7 @@ STATIC FUNCTION uic_to_prg( hbmk2, cFileNameSrc, cFileNameDst, cName ) IF ! Empty( aLinesPRG ) cFile := "" - AEval( aLinesPRG, {| cLine | cFile += cLine + hb_osNewLine() } ) + AEval( aLinesPRG, {| cLine | cFile += cLine + hb_eol() } ) IF hb_MemoWrit( cFileNameDst, cFile ) RETURN .T. ELSE diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index b6f4da58f9..8664ae2ae7 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -227,10 +227,10 @@ REQUEST hbmk_KEYW #define _VAR_MODE_INSERT 3 #define _VAR_MODE_DELETE 4 -#define _COMPEMBED_BASE_ ( "comp" + hb_osPathSeparator() ) +#define _COMPEMBED_BASE_ ( "comp" + hb_ps() ) #define _WORKDIR_BASE_ ".hbmk" -#define _WORKDIR_DEF_ ( _WORKDIR_BASE_ + hb_osPathSeparator() + hbmk[ _HBMK_cPLAT ] + hb_osPathSeparator() + hbmk[ _HBMK_cCOMP ] ) +#define _WORKDIR_DEF_ ( _WORKDIR_BASE_ + hb_ps() + hbmk[ _HBMK_cPLAT ] + hb_ps() + hbmk[ _HBMK_cCOMP ] ) #define _BCC_BIN_DETECT() FindInPath( "bcc32.exe" ) @@ -561,52 +561,52 @@ STATIC PROCEDURE hbmk_COMP_Setup( cARCH, cCOMP, cBasePath ) DO CASE CASE cARCH == "dos" .AND. cCOMP == "djgpp" - hb_SetEnv( "DJGPP", cBasePath + hb_osPathSeparator() + "djgpp.env" ) - hb_SetEnv( "PATH", cBasePath + hb_osPathSeparator() + "bin" + hb_osPathListSeparator() + hb_GetEnv( "PATH" ) ) + hb_SetEnv( "DJGPP", cBasePath + hb_ps() + "djgpp.env" ) + hb_SetEnv( "PATH", cBasePath + hb_ps() + "bin" + hb_osPathListSeparator() + hb_GetEnv( "PATH" ) ) CASE cARCH == "win" .AND. cCOMP == "pocc" - hb_SetEnv( "PATH", cBasePath + hb_osPathSeparator() + "Bin" + hb_osPathListSeparator() + hb_GetEnv( "PATH" ) ) - hb_SetEnv( "INCLUDE", cBasePath + hb_osPathSeparator() + "Include" + hb_osPathListSeparator() + cBasePath + hb_osPathSeparator() + "Include" + hb_osPathSeparator() + "Win" ) - hb_SetEnv( "LIB", cBasePath + hb_osPathSeparator() + "Lib" + hb_osPathListSeparator() + cBasePath + hb_osPathSeparator() + "Lib" + hb_osPathSeparator() + "Win" ) + hb_SetEnv( "PATH", cBasePath + hb_ps() + "Bin" + hb_osPathListSeparator() + hb_GetEnv( "PATH" ) ) + hb_SetEnv( "INCLUDE", cBasePath + hb_ps() + "Include" + hb_osPathListSeparator() + cBasePath + hb_ps() + "Include" + hb_ps() + "Win" ) + hb_SetEnv( "LIB", cBasePath + hb_ps() + "Lib" + hb_osPathListSeparator() + cBasePath + hb_ps() + "Lib" + hb_ps() + "Win" ) CASE cARCH == "win" .AND. cCOMP == "pocc64" - hb_SetEnv( "PATH", cBasePath + hb_osPathSeparator() + "Bin" + hb_osPathListSeparator() + hb_GetEnv( "PATH" ) ) - hb_SetEnv( "INCLUDE", cBasePath + hb_osPathSeparator() + "Include" + hb_osPathListSeparator() + cBasePath + hb_osPathSeparator() + "Include" + hb_osPathSeparator() + "Win" ) - hb_SetEnv( "LIB", cBasePath + hb_osPathSeparator() + "Lib" + hb_osPathListSeparator() + cBasePath + hb_osPathSeparator() + "Lib" + hb_osPathSeparator() + "Win64" ) + hb_SetEnv( "PATH", cBasePath + hb_ps() + "Bin" + hb_osPathListSeparator() + hb_GetEnv( "PATH" ) ) + hb_SetEnv( "INCLUDE", cBasePath + hb_ps() + "Include" + hb_osPathListSeparator() + cBasePath + hb_ps() + "Include" + hb_ps() + "Win" ) + hb_SetEnv( "LIB", cBasePath + hb_ps() + "Lib" + hb_osPathListSeparator() + cBasePath + hb_ps() + "Lib" + hb_ps() + "Win64" ) CASE cARCH == "wce" .AND. cCOMP == "poccarm" - hb_SetEnv( "PATH", cBasePath + hb_osPathSeparator() + "Bin" + hb_osPathListSeparator() + hb_GetEnv( "PATH" ) ) - hb_SetEnv( "INCLUDE", cBasePath + hb_osPathSeparator() + "Include" + hb_osPathSeparator() + "WinCE" + hb_osPathListSeparator() + cBasePath + hb_osPathSeparator() + "Include" ) - hb_SetEnv( "LIB", cBasePath + hb_osPathSeparator() + "Lib" + hb_osPathListSeparator() + cBasePath + hb_osPathSeparator() + "Lib" + hb_osPathSeparator() + "WinCE" ) + hb_SetEnv( "PATH", cBasePath + hb_ps() + "Bin" + hb_osPathListSeparator() + hb_GetEnv( "PATH" ) ) + hb_SetEnv( "INCLUDE", cBasePath + hb_ps() + "Include" + hb_ps() + "WinCE" + hb_osPathListSeparator() + cBasePath + hb_ps() + "Include" ) + hb_SetEnv( "LIB", cBasePath + hb_ps() + "Lib" + hb_osPathListSeparator() + cBasePath + hb_ps() + "Lib" + hb_ps() + "WinCE" ) CASE cCOMP == "watcom" hb_SetEnv( "WATCOM", cBasePath ) - hb_SetEnv( "EDPATH", cBasePath + hb_osPathSeparator() + "eddat" ) + hb_SetEnv( "EDPATH", cBasePath + hb_ps() + "eddat" ) #if defined( __PLATFORM__WINDOWS ) - hb_SetEnv( "PATH", cBasePath + hb_osPathSeparator() + "binnt" + hb_osPathListSeparator() + cBasePath + hb_osPathSeparator() + "binw" + hb_osPathListSeparator() + hb_GetEnv( "PATH" ) ) + hb_SetEnv( "PATH", cBasePath + hb_ps() + "binnt" + hb_osPathListSeparator() + cBasePath + hb_ps() + "binw" + hb_osPathListSeparator() + hb_GetEnv( "PATH" ) ) #elif defined( __PLATFORM__OS2 ) - hb_SetEnv( "PATH", cBasePath + hb_osPathSeparator() + "binp" + hb_osPathListSeparator() + cBasePath + hb_osPathSeparator() + "binw" + hb_osPathListSeparator() + hb_GetEnv( "PATH" ) ) + hb_SetEnv( "PATH", cBasePath + hb_ps() + "binp" + hb_osPathListSeparator() + cBasePath + hb_ps() + "binw" + hb_osPathListSeparator() + hb_GetEnv( "PATH" ) ) #elif defined( __PLATFORM__DOS ) - hb_SetEnv( "PATH", cBasePath + hb_osPathSeparator() + "binw" + hb_osPathListSeparator() + hb_GetEnv( "PATH" ) ) + hb_SetEnv( "PATH", cBasePath + hb_ps() + "binw" + hb_osPathListSeparator() + hb_GetEnv( "PATH" ) ) #elif defined( __PLATFORM__LINUX ) - hb_SetEnv( "PATH", cBasePath + hb_osPathSeparator() + "binl" + hb_osPathListSeparator() + hb_GetEnv( "PATH" ) ) + hb_SetEnv( "PATH", cBasePath + hb_ps() + "binl" + hb_osPathListSeparator() + hb_GetEnv( "PATH" ) ) #endif DO CASE CASE cARCH == "win" - hb_SetEnv( "INCLUDE", cBasePath + hb_osPathSeparator() + "h" + hb_osPathListSeparator() + cBasePath + hb_osPathSeparator() + "h" + hb_osPathSeparator() + "nt" ) + hb_SetEnv( "INCLUDE", cBasePath + hb_ps() + "h" + hb_osPathListSeparator() + cBasePath + hb_ps() + "h" + hb_ps() + "nt" ) CASE cARCH == "os2" - hb_SetEnv( "INCLUDE", cBasePath + hb_osPathSeparator() + "h" + hb_osPathListSeparator() + cBasePath + hb_osPathSeparator() + "h" + hb_osPathSeparator() + "os2" ) - hb_SetEnv( "BEGINLIBPATH", cBasePath + hb_osPathSeparator() + "binp" + hb_osPathSeparator() + "dll" ) + hb_SetEnv( "INCLUDE", cBasePath + hb_ps() + "h" + hb_osPathListSeparator() + cBasePath + hb_ps() + "h" + hb_ps() + "os2" ) + hb_SetEnv( "BEGINLIBPATH", cBasePath + hb_ps() + "binp" + hb_ps() + "dll" ) CASE cARCH == "dos" - hb_SetEnv( "INCLUDE", cBasePath + hb_osPathSeparator() + "h" ) + hb_SetEnv( "INCLUDE", cBasePath + hb_ps() + "h" ) CASE cARCH == "linux" - hb_SetEnv( "INCLUDE", cBasePath + hb_osPathSeparator() + "lh" ) + hb_SetEnv( "INCLUDE", cBasePath + hb_ps() + "lh" ) ENDCASE ENDCASE @@ -1237,12 +1237,12 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) DO CASE CASE hb_FileExists( DirAddPathSep( hb_DirBase() ) + cBin_CompPRG + hbmk[ _HBMK_cCCEXT ] ) l_cHB_INSTALL_PREFIX := DirAddPathSep( hb_DirBase() ) + ".." - CASE hb_FileExists( DirAddPathSep( hb_DirBase() ) + "bin" + hb_osPathSeparator() + cBin_CompPRG + hbmk[ _HBMK_cCCEXT ] ) + CASE hb_FileExists( DirAddPathSep( hb_DirBase() ) + "bin" + hb_ps() + cBin_CompPRG + hbmk[ _HBMK_cCCEXT ] ) l_cHB_INSTALL_PREFIX := DirAddPathSep( hb_DirBase() ) - CASE hb_FileExists( DirAddPathSep( hb_DirBase() ) + ".." + hb_osPathSeparator() + ".." + hb_osPathSeparator() + "bin" + hb_osPathSeparator() + cBin_CompPRG + hbmk[ _HBMK_cCCEXT ] ) - l_cHB_INSTALL_PREFIX := DirAddPathSep( hb_DirBase() ) + ".." + hb_osPathSeparator() + ".." - CASE hb_FileExists( DirAddPathSep( hb_DirBase() ) + ".." + hb_osPathSeparator() + ".." + hb_osPathSeparator() + ".." + hb_osPathSeparator() + "bin" + hb_osPathSeparator() + cBin_CompPRG + hbmk[ _HBMK_cCCEXT ] ) - l_cHB_INSTALL_PREFIX := DirAddPathSep( hb_DirBase() ) + ".." + hb_osPathSeparator() + ".." + hb_osPathSeparator() + ".." + CASE hb_FileExists( DirAddPathSep( hb_DirBase() ) + ".." + hb_ps() + ".." + hb_ps() + "bin" + hb_ps() + cBin_CompPRG + hbmk[ _HBMK_cCCEXT ] ) + l_cHB_INSTALL_PREFIX := DirAddPathSep( hb_DirBase() ) + ".." + hb_ps() + ".." + CASE hb_FileExists( DirAddPathSep( hb_DirBase() ) + ".." + hb_ps() + ".." + hb_ps() + ".." + hb_ps() + "bin" + hb_ps() + cBin_CompPRG + hbmk[ _HBMK_cCCEXT ] ) + l_cHB_INSTALL_PREFIX := DirAddPathSep( hb_DirBase() ) + ".." + hb_ps() + ".." + hb_ps() + ".." OTHERWISE hbmk_OutErr( hbmk, I_( "Error: HB_INSTALL_PREFIX not set, failed to autodetect.\nPlease run this tool from its original location inside the Harbour installation or set HB_INSTALL_PREFIX environment variable to Harbour's root directory." ) ) RETURN 3 @@ -1250,31 +1250,31 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) ENDIF /* Detect special non-installed dir layout (after simple 'make') */ - IF hb_FileExists( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + ".." + hb_osPathSeparator() + ".." + hb_osPathSeparator() + "include" +; - hb_osPathSeparator() + "hbvm.h" ) - l_cHB_INSTALL_PREFIX := DirAddPathSep( l_cHB_INSTALL_PREFIX ) + ".." + hb_osPathSeparator() + ".." + hb_osPathSeparator() + IF hb_FileExists( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + ".." + hb_ps() + ".." + hb_ps() + "include" +; + hb_ps() + "hbvm.h" ) + l_cHB_INSTALL_PREFIX := DirAddPathSep( l_cHB_INSTALL_PREFIX ) + ".." + hb_ps() + ".." + hb_ps() /* Detect special multi-host dir layout */ - ELSEIF hb_FileExists( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + ".." + hb_osPathSeparator() + "include" +; - hb_osPathSeparator() + "hbvm.h" ) - l_cHB_INSTALL_PREFIX := DirAddPathSep( l_cHB_INSTALL_PREFIX ) + ".." + hb_osPathSeparator() + 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() ENDIF /* Detect special *nix dir layout (/bin, /lib/harbour, /lib64/harbour, /include/harbour) */ IF hb_FileExists( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + "include" +; - hb_osPathSeparator() + iif( hbmk[ _HBMK_nHBMODE ] == _HBMODE_XHB, "xharbour", "harbour" ) +; - hb_osPathSeparator() + "hbvm.h" ) + hb_ps() + iif( hbmk[ _HBMK_nHBMODE ] == _HBMODE_XHB, "xharbour", "harbour" ) +; + hb_ps() + "hbvm.h" ) IF Empty( l_cHB_BIN_INSTALL ) l_cHB_BIN_INSTALL := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + "bin" ) ENDIF IF Empty( l_cHB_LIB_INSTALL ) - IF hb_DirExists( tmp := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + "lib64" + hb_osPathSeparator() + iif( hbmk[ _HBMK_nHBMODE ] == _HBMODE_XHB, "xharbour", "harbour" ) ) ) + IF hb_DirExists( tmp := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + "lib64" + hb_ps() + iif( hbmk[ _HBMK_nHBMODE ] == _HBMODE_XHB, "xharbour", "harbour" ) ) ) l_cHB_LIB_INSTALL := tmp ELSE - l_cHB_LIB_INSTALL := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + "lib" + hb_osPathSeparator() + iif( hbmk[ _HBMK_nHBMODE ] == _HBMODE_XHB, "xharbour", "harbour" ) ) + l_cHB_LIB_INSTALL := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + "lib" + hb_ps() + iif( hbmk[ _HBMK_nHBMODE ] == _HBMODE_XHB, "xharbour", "harbour" ) ) ENDIF ENDIF IF Empty( l_cHB_INC_INSTALL ) - l_cHB_INC_INSTALL := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + "include" + hb_osPathSeparator() + iif( hbmk[ _HBMK_nHBMODE ] == _HBMODE_XHB, "xharbour", "harbour" ) ) + l_cHB_INC_INSTALL := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + "include" + hb_ps() + iif( hbmk[ _HBMK_nHBMODE ] == _HBMODE_XHB, "xharbour", "harbour" ) ) ENDIF ENDIF @@ -1310,39 +1310,39 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) tmp3 := NIL; HB_SYMBOL_UNUSED( tmp3 ) - AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "mingw" + hb_osPathSeparator() + "bin" ), iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "win" , "mingw" , "" , NIL, NIL } ) - AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "mingw64" + hb_osPathSeparator() + "bin" ), iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "win" , "mingw64" , "i686-w64-mingw32-" , NIL, NIL } ) - AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "mingw64" + hb_osPathSeparator() + "bin" ), iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "win" , "mingw64" , "x86_64-w64-mingw32-" , NIL, NIL } ) - AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "mingwarm" + hb_osPathSeparator() + "bin" ), iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "wce" , "mingwarm", "arm-mingw32ce-" , NIL, NIL } ) - AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "mingwarm" + hb_osPathSeparator() + "bin" ), iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "wce" , "mingwarm", "arm-wince-mingw32ce-", NIL, NIL } ) - AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "mingwarm" + hb_osPathSeparator() + "bin" ), iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "wce" , "mingw" , "i386-mingw32ce-" , NIL, NIL } ) - AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "djgpp" + hb_osPathSeparator() + "bin" ), iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "gcc.exe" ), tmp1, NIL ) }, "dos" , "djgpp" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_osPathSeparator() + ".." ) } } ) - AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "watcom" + hb_osPathSeparator() + "binnt" ), iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "wcc386.exe" ), tmp1, NIL ) }, "win" , "watcom" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_osPathSeparator() + ".." ) } } ) - AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "watcom" + hb_osPathSeparator() + "binnt" ), iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "wcc386.exe" ), tmp1, NIL ) }, "dos" , "watcom" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_osPathSeparator() + ".." ) } } ) - AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "watcom" + hb_osPathSeparator() + "binnt" ), iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "wcc386.exe" ), tmp1, NIL ) }, "os2" , "watcom" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_osPathSeparator() + ".." ) } } ) - AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "watcom" + hb_osPathSeparator() + "binnt" ), iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "wcc386.exe" ), tmp1, NIL ) }, "linux", "watcom" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_osPathSeparator() + ".." ) } } ) - AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "pocc" + hb_osPathSeparator() + "Bin" ), iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "pocc.exe" ), tmp1, NIL ) }, "win" , "pocc" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_osPathSeparator() + ".." ) } } ) - AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "pocc" + hb_osPathSeparator() + "Bin" ), iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "pocc.exe" ), tmp1, NIL ) }, "win" , "pocc64" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_osPathSeparator() + ".." ) } } ) - AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "pocc" + hb_osPathSeparator() + "Bin" ), iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "pocc.exe" ), tmp1, NIL ) }, "wce" , "poccarm" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_osPathSeparator() + ".." ) } } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "mingw" + hb_ps() + "bin" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "win" , "mingw" , "" , NIL, NIL } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "mingw64" + hb_ps() + "bin" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "win" , "mingw64" , "i686-w64-mingw32-" , NIL, NIL } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "mingw64" + hb_ps() + "bin" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "win" , "mingw64" , "x86_64-w64-mingw32-" , NIL, NIL } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "mingwarm" + hb_ps() + "bin" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "wce" , "mingwarm", "arm-mingw32ce-" , NIL, NIL } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "mingwarm" + hb_ps() + "bin" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "wce" , "mingwarm", "arm-wince-mingw32ce-", NIL, NIL } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "mingwarm" + hb_ps() + "bin" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "wce" , "mingw" , "i386-mingw32ce-" , NIL, NIL } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "djgpp" + hb_ps() + "bin" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "gcc.exe" ), tmp1, NIL ) }, "dos" , "djgpp" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_ps() + ".." ) } } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "watcom" + hb_ps() + "binnt" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "wcc386.exe" ), tmp1, NIL ) }, "win" , "watcom" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_ps() + ".." ) } } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "watcom" + hb_ps() + "binnt" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "wcc386.exe" ), tmp1, NIL ) }, "dos" , "watcom" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_ps() + ".." ) } } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "watcom" + hb_ps() + "binnt" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "wcc386.exe" ), tmp1, NIL ) }, "os2" , "watcom" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_ps() + ".." ) } } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "watcom" + hb_ps() + "binnt" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "wcc386.exe" ), tmp1, NIL ) }, "linux", "watcom" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_ps() + ".." ) } } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "pocc" + hb_ps() + "Bin" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "pocc.exe" ), tmp1, NIL ) }, "win" , "pocc" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_ps() + ".." ) } } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "pocc" + hb_ps() + "Bin" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "pocc.exe" ), tmp1, NIL ) }, "win" , "pocc64" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_ps() + ".." ) } } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "pocc" + hb_ps() + "Bin" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "pocc.exe" ), tmp1, NIL ) }, "wce" , "poccarm" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_ps() + ".." ) } } ) #elif defined( __PLATFORM__DOS ) tmp3 := NIL; HB_SYMBOL_UNUSED( tmp3 ) - AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "djgpp" + hb_osPathSeparator() + "bin" ), iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "gcc.exe" ), tmp1, NIL ) }, "dos" , "djgpp" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_osPathSeparator() + ".." ) } } ) - AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "watcom" + hb_osPathSeparator() + "binw" ), iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "wcc386.exe" ), tmp1, NIL ) }, "dos" , "watcom" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_osPathSeparator() + ".." ) } } ) - AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "watcom" + hb_osPathSeparator() + "binw" ), iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "wcc386.exe" ), tmp1, NIL ) }, "win" , "watcom" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_osPathSeparator() + ".." ) } } ) - AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "watcom" + hb_osPathSeparator() + "binw" ), iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "wcc386.exe" ), tmp1, NIL ) }, "os2" , "watcom" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_osPathSeparator() + ".." ) } } ) - AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "watcom" + hb_osPathSeparator() + "binw" ), iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "wcc386.exe" ), tmp1, NIL ) }, "linux", "watcom" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_osPathSeparator() + ".." ) } } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "djgpp" + hb_ps() + "bin" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "gcc.exe" ), tmp1, NIL ) }, "dos" , "djgpp" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_ps() + ".." ) } } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "watcom" + hb_ps() + "binw" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "wcc386.exe" ), tmp1, NIL ) }, "dos" , "watcom" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_ps() + ".." ) } } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "watcom" + hb_ps() + "binw" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "wcc386.exe" ), tmp1, NIL ) }, "win" , "watcom" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_ps() + ".." ) } } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "watcom" + hb_ps() + "binw" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "wcc386.exe" ), tmp1, NIL ) }, "os2" , "watcom" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_ps() + ".." ) } } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "watcom" + hb_ps() + "binw" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "wcc386.exe" ), tmp1, NIL ) }, "linux", "watcom" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_ps() + ".." ) } } ) #elif defined( __PLATFORM__OS2 ) tmp3 := NIL; HB_SYMBOL_UNUSED( tmp3 ) - AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "watcom" + hb_osPathSeparator() + "binp" ), iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "wcc386.exe" ), tmp1, NIL ) }, "os2" , "watcom" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_osPathSeparator() + ".." ) } } ) - AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "watcom" + hb_osPathSeparator() + "binp" ), iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "wcc386.exe" ), tmp1, NIL ) }, "win" , "watcom" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_osPathSeparator() + ".." ) } } ) - AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "watcom" + hb_osPathSeparator() + "binp" ), iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "wcc386.exe" ), tmp1, NIL ) }, "dos" , "watcom" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_osPathSeparator() + ".." ) } } ) - AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "watcom" + hb_osPathSeparator() + "binp" ), iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "wcc386.exe" ), tmp1, NIL ) }, "linux", "watcom" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_osPathSeparator() + ".." ) } } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "watcom" + hb_ps() + "binp" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "wcc386.exe" ), tmp1, NIL ) }, "os2" , "watcom" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_ps() + ".." ) } } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "watcom" + hb_ps() + "binp" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "wcc386.exe" ), tmp1, NIL ) }, "win" , "watcom" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_ps() + ".." ) } } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "watcom" + hb_ps() + "binp" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "wcc386.exe" ), tmp1, NIL ) }, "dos" , "watcom" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_ps() + ".." ) } } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) + _COMPEMBED_BASE_ + "watcom" + hb_ps() + "binp" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "wcc386.exe" ), tmp1, NIL ) }, "linux", "watcom" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_ps() + ".." ) } } ) #elif defined( __PLATFORM__UNIX ) @@ -1356,15 +1356,15 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) FOR EACH tmp IN { "/usr", "/usr/local", "/usr/local/mingw32", "/opt/xmingw" } FOR EACH tmp2 IN { "i?86-mingw", "i?86-pc-mingw", "i?86-mingw32", "i?86-pc-mingw32", "i?86-mingw32msvc", "i?86-pc-mingw32msvc" } FOR tmp3 := 3 TO 6 - AAdd( aCOMPDET_EMBED, { {| cPrefix, tmp1 | iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "win", "mingw", StrTran( tmp2, "?", hb_ntos( tmp3 ) ) + "-", tmp + hb_osPathSeparator() + "bin", NIL } ) - AAdd( aCOMPDET_EMBED, { {| cPrefix, tmp1 | iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "win", "mingw", "", tmp + hb_osPathSeparator() + StrTran( tmp2, "?", hb_ntos( tmp3 ) ) + hb_osPathSeparator() + "bin", NIL } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix, tmp1 | iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "win", "mingw", StrTran( tmp2, "?", hb_ntos( tmp3 ) ) + "-", tmp + hb_ps() + "bin", NIL } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix, tmp1 | iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "win", "mingw", "", tmp + hb_ps() + StrTran( tmp2, "?", hb_ntos( tmp3 ) ) + hb_ps() + "bin", NIL } ) NEXT NEXT NEXT CASE hbmk[ _HBMK_cPLAT ] == "wce" - AAdd( aCOMPDET_EMBED, { {| cPrefix, tmp1 | iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "wce", "mingwarm", "arm-mingw32ce-" , "/opt/mingw32ce/bin" , NIL } ) - AAdd( aCOMPDET_EMBED, { {| cPrefix, tmp1 | iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "wce", "mingwarm", "arm-wince-mingw32ce-", "/opt/mingw32ce/bin" , NIL } ) - AAdd( aCOMPDET_EMBED, { {| cPrefix, tmp1 | iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "wce", "mingw" , "i386-mingw32ce-" , "/opt/x86mingw32ce/bin", NIL } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix, tmp1 | iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "wce", "mingwarm", "arm-mingw32ce-" , "/opt/mingw32ce/bin" , NIL } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix, tmp1 | iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "wce", "mingwarm", "arm-wince-mingw32ce-", "/opt/mingw32ce/bin" , NIL } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix, tmp1 | iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "wce", "mingw" , "i386-mingw32ce-" , "/opt/x86mingw32ce/bin", NIL } ) ENDCASE ENDIF @@ -1392,14 +1392,14 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) 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 ] ) + hb_DirExists( PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) ) + "lib" + hb_ps() + hbmk[ _HBMK_cPLAT ] ) /* Check compilers */ FOR tmp := 1 TO Len( aCOMPDET ) IF ! Empty( cPath_CompC := Eval( aCOMPDET[ tmp ][ _COMPDET_bBlock ] ) ) IF ! lDoSupportDetection .OR. ; hb_DirExists( PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) ) + "lib" +; - hb_osPathSeparator() + hbmk[ _HBMK_cPLAT ] +; - hb_osPathSeparator() + aCOMPDET[ tmp ][ _COMPDET_cCOMP ] +; + hb_ps() + hbmk[ _HBMK_cPLAT ] +; + hb_ps() + aCOMPDET[ tmp ][ _COMPDET_cCOMP ] +; iif( Empty( hbmk[ _HBMK_cBUILD ] ), "", PathSepToSelf( hbmk[ _HBMK_cBUILD ] ) ) ) hbmk[ _HBMK_cCOMP ] := aCOMPDET[ tmp ][ _COMPDET_cCOMP ] IF Len( aCOMPDET[ tmp ] ) >= _COMPDET_cCCPREFIX @@ -1480,18 +1480,18 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) ENDIF IF ! Empty( cPath_CompC ) /* NOTE: Automatically configure bcc installation with missing configuration. [vszakats] */ - IF ! hb_FileExists( FN_DirGet( cPath_CompC ) + ".." + hb_osPathSeparator() + "Bin" + hb_osPathSeparator() + "bcc32.cfg" ) .OR. ; - ! hb_FileExists( FN_DirGet( cPath_CompC ) + ".." + hb_osPathSeparator() + "Bin" + hb_osPathSeparator() + "ilink32.cfg" ) + IF ! hb_FileExists( FN_DirGet( cPath_CompC ) + ".." + hb_ps() + "Bin" + hb_ps() + "bcc32.cfg" ) .OR. ; + ! hb_FileExists( FN_DirGet( cPath_CompC ) + ".." + hb_ps() + "Bin" + hb_ps() + "ilink32.cfg" ) /* NOTE: BCC 5.8 has different casing: 'include', 'lib', 'psdk' respectively. */ - AAdd( hbmk[ _HBMK_aINCPATH ], PathNormalize( FN_DirGet( cPath_CompC ) + ".." + hb_osPathSeparator() + "Include" ) ) - AAdd( hbmk[ _HBMK_aLIBPATH ], PathNormalize( FN_DirGet( cPath_CompC ) + ".." + hb_osPathSeparator() + "Lib" ) ) + AAdd( hbmk[ _HBMK_aINCPATH ], PathNormalize( FN_DirGet( cPath_CompC ) + ".." + hb_ps() + "Include" ) ) + AAdd( hbmk[ _HBMK_aLIBPATH ], PathNormalize( FN_DirGet( cPath_CompC ) + ".." + hb_ps() + "Lib" ) ) /* NOTE: BCC 5.8 (and upper ?) thing */ - tmp := PathNormalize( FN_DirGet( cPath_CompC ) + ".." + hb_osPathSeparator() + "Include" + hb_osPathSeparator() + "dinkumware" ) + tmp := PathNormalize( FN_DirGet( cPath_CompC ) + ".." + hb_ps() + "Include" + hb_ps() + "dinkumware" ) IF hb_DirExists( tmp ) AAdd( hbmk[ _HBMK_aINCPATH ], tmp ) ENDIF ENDIF - AAdd( hbmk[ _HBMK_aLIBPATH ], PathNormalize( FN_DirGet( cPath_CompC ) + ".." + hb_osPathSeparator() + "Lib" + hb_osPathSeparator() + "PSDK" ) ) + AAdd( hbmk[ _HBMK_aLIBPATH ], PathNormalize( FN_DirGet( cPath_CompC ) + ".." + hb_ps() + "Lib" + hb_ps() + "PSDK" ) ) ENDIF ENDCASE @@ -1509,8 +1509,8 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) IF Empty( l_cHB_LIB_INSTALL ) /* Autodetect multi-compiler/platform lib structure */ IF hb_DirExists( tmp := PathNormalize( DirAddPathSep( l_cHB_INSTALL_PREFIX ) ) + "lib" +; - hb_osPathSeparator() + hbmk[ _HBMK_cPLAT ] +; - hb_osPathSeparator() + hbmk[ _HBMK_cCOMP ] +; + hb_ps() + hbmk[ _HBMK_cPLAT ] +; + hb_ps() + hbmk[ _HBMK_cCOMP ] +; iif( Empty( hbmk[ _HBMK_cBUILD ] ), "", PathSepToSelf( hbmk[ _HBMK_cBUILD ] ) ) ) l_cHB_LIB_INSTALL := tmp ELSE @@ -1548,9 +1548,9 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) AAddNotEmpty( hbmk[ _HBMK_aINCPATH ], l_cHB_INC_INSTALL ) /* Add default search paths for .hbc files */ - l_cHB_ADD_INSTALL := PathNormalize( l_cHB_BIN_INSTALL + hb_osPathSeparator() + ".." ) - AAdd( hbmk[ _HBMK_aLIBPATH ], l_cHB_ADD_INSTALL + hb_osPathSeparator() + "contrib" + hb_osPathSeparator() + "%{hb_name}" ) - AAdd( hbmk[ _HBMK_aLIBPATH ], l_cHB_ADD_INSTALL + hb_osPathSeparator() + "addons" + hb_osPathSeparator() + "%{hb_name}" ) + l_cHB_ADD_INSTALL := PathNormalize( l_cHB_BIN_INSTALL + hb_ps() + ".." ) + AAdd( hbmk[ _HBMK_aLIBPATH ], l_cHB_ADD_INSTALL + hb_ps() + "contrib" + hb_ps() + "%{hb_name}" ) + AAdd( hbmk[ _HBMK_aLIBPATH ], l_cHB_ADD_INSTALL + hb_ps() + "addons" + hb_ps() + "%{hb_name}" ) /* Build with shared libs by default, if we're installed to default system locations. */ @@ -2411,7 +2411,7 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) "( win || wce ) & !( allmingw | cygwin )". This may change in the future. 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" + DEFAULT hbmk[ _HBMK_cWorkDir ] TO FN_DirGet( hbmk[ _HBMK_cPROGNAME ] ) + _WORKDIR_DEF_ + hb_ps() + "hbdyn" hbmk[ _HBMK_cWorkDirDynSub ] := "/hbdyn" ELSE DEFAULT hbmk[ _HBMK_cWorkDir ] TO FN_DirGet( hbmk[ _HBMK_cPROGNAME ] ) + _WORKDIR_DEF_ @@ -2575,7 +2575,7 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) hbmk[ _HBMK_aLIBCOREGT ] := {} ENDIF - #define _HBLIB_FULLPATH( cName ) ( DirAddPathSep( l_cHB_LIB_INSTALL ) + hb_osPathSeparator() + cLibLibPrefix + cName + cLibLibExt ) + #define _HBLIB_FULLPATH( cName ) ( DirAddPathSep( l_cHB_LIB_INSTALL ) + hb_ps() + cLibLibPrefix + cName + cLibLibExt ) DO CASE /* GCC family */ @@ -2885,10 +2885,10 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) cOpt_Lib := "{FA} rcs {OL} {LO}" cLibObjPrefix := NIL IF ! Empty( hbmk[ _HBMK_cCCPATH ] ) - cBin_Lib := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_osPathSeparator() + cBin_Lib, hbmk[ _HBMK_nCmd_Esc ] ) - cBin_CompCPP := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_osPathSeparator() + cBin_CompCPP, hbmk[ _HBMK_nCmd_Esc ] ) - cBin_CompC := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_osPathSeparator() + cBin_CompC, hbmk[ _HBMK_nCmd_Esc ] ) - cBin_Link := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_osPathSeparator() + cBin_Link, hbmk[ _HBMK_nCmd_Esc ] ) + cBin_Lib := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_ps() + cBin_Lib, hbmk[ _HBMK_nCmd_Esc ] ) + cBin_CompCPP := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_ps() + cBin_CompCPP, hbmk[ _HBMK_nCmd_Esc ] ) + cBin_CompC := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_ps() + cBin_CompC, hbmk[ _HBMK_nCmd_Esc ] ) + cBin_Link := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_ps() + cBin_Link, hbmk[ _HBMK_nCmd_Esc ] ) ENDIF IF !( hbmk[ _HBMK_cPLAT ] == "wce" ) IF hbmk[ _HBMK_lGUI ] @@ -2975,7 +2975,7 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) cResExt := ".reso" cOpt_Res := "{FR} {IR} -O coff -o {OS}" IF ! Empty( hbmk[ _HBMK_cCCPATH ] ) - cBin_Res := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_osPathSeparator() + cBin_Res, hbmk[ _HBMK_nCmd_Esc ] ) + cBin_Res := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_ps() + cBin_Res, hbmk[ _HBMK_nCmd_Esc ] ) ENDIF ENDIF @@ -3075,12 +3075,12 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) #endif IF ! Empty( hbmk[ _HBMK_cCCPATH ] ) - cBin_Lib := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_osPathSeparator() + cBin_Lib, hbmk[ _HBMK_nCmd_Esc ] ) - cBin_CompCPP := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_osPathSeparator() + cBin_CompCPP, hbmk[ _HBMK_nCmd_Esc ] ) - cBin_CompC := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_osPathSeparator() + cBin_CompC, hbmk[ _HBMK_nCmd_Esc ] ) - cBin_Link := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_osPathSeparator() + cBin_Link, hbmk[ _HBMK_nCmd_Esc ] ) + cBin_Lib := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_ps() + cBin_Lib, hbmk[ _HBMK_nCmd_Esc ] ) + cBin_CompCPP := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_ps() + cBin_CompCPP, hbmk[ _HBMK_nCmd_Esc ] ) + cBin_CompC := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_ps() + cBin_CompC, hbmk[ _HBMK_nCmd_Esc ] ) + cBin_Link := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_ps() + cBin_Link, hbmk[ _HBMK_nCmd_Esc ] ) #if 0 - cBin_Res := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_osPathSeparator() + cBin_Res, hbmk[ _HBMK_nCmd_Esc ] ) + cBin_Res := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_ps() + cBin_Res, hbmk[ _HBMK_nCmd_Esc ] ) #endif ENDIF @@ -3160,10 +3160,10 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) "harbour" + cLibExt ) } IF ! Empty( hbmk[ _HBMK_cCCPATH ] ) - cBin_Lib := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_osPathSeparator() + cBin_Lib, hbmk[ _HBMK_nCmd_Esc ] ) - cBin_CompCPP := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_osPathSeparator() + cBin_CompCPP, hbmk[ _HBMK_nCmd_Esc ] ) - cBin_CompC := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_osPathSeparator() + cBin_CompC, hbmk[ _HBMK_nCmd_Esc ] ) - cBin_Link := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_osPathSeparator() + cBin_Link, hbmk[ _HBMK_nCmd_Esc ] ) + cBin_Lib := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_ps() + cBin_Lib, hbmk[ _HBMK_nCmd_Esc ] ) + cBin_CompCPP := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_ps() + cBin_CompCPP, hbmk[ _HBMK_nCmd_Esc ] ) + cBin_CompC := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_ps() + cBin_CompC, hbmk[ _HBMK_nCmd_Esc ] ) + cBin_Link := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_ps() + cBin_Link, hbmk[ _HBMK_nCmd_Esc ] ) ENDIF /* Watcom family */ @@ -3256,8 +3256,8 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) CASE hbmk[ _HBMK_cPLAT ] == "dos" ; cBin_Dyn := NIL CASE hbmk[ _HBMK_cPLAT ] == "linux" ; cOpt_Dyn := "OP quiet FORM elf dll OP exportall {FD} NAME {OD} {LO} {DL} {LL} {LB}{SCRIPT}" IF hbmk[ _HBMK_lCreateDyn ] - AAdd( hbmk[ _HBMK_aLIBPATH ], PathSepToSelf( GetEnv( "WATCOM") + hb_osPathSeparator() + "lib386" ) ) - AAdd( hbmk[ _HBMK_aLIBPATH ], PathSepToSelf( GetEnv( "WATCOM") + hb_osPathSeparator() + "lib386" + hb_osPathSeparator() + "linux" ) ) + AAdd( hbmk[ _HBMK_aLIBPATH ], PathSepToSelf( GetEnv( "WATCOM") + hb_ps() + "lib386" ) ) + AAdd( hbmk[ _HBMK_aLIBPATH ], PathSepToSelf( GetEnv( "WATCOM") + hb_ps() + "lib386" + hb_ps() + "linux" ) ) ENDIF CASE hbmk[ _HBMK_cPLAT ] == "win" ; cOpt_Dyn := "OP quiet SYS nt_dll {FD} {IM} NAME {OD} {LO} {DL} {LL} {LB} {LS}{SCRIPT}" CASE hbmk[ _HBMK_cPLAT ] == "os2" ; cOpt_Dyn := "OP quiet SYS os2v2_dll {FD} {IM} NAME {OD} {LO} {DL} {LL} {LB} {LS}{SCRIPT}" @@ -3317,7 +3317,7 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) "harbour" + cDL_Version_Alter + cLibExt ) } IF hbmk[ _HBMK_lSHARED ] - AAdd( hbmk[ _HBMK_aOPTL ], "FILE " + FN_ExtSet( l_cHB_LIB_INSTALL + hb_osPathSeparator() + iif( hbmk[ _HBMK_lGUI ], "hbmainwin", "hbmainstd" ), cLibExt ) ) + AAdd( hbmk[ _HBMK_aOPTL ], "FILE " + FN_ExtSet( l_cHB_LIB_INSTALL + hb_ps() + iif( hbmk[ _HBMK_lGUI ], "hbmainwin", "hbmainstd" ), cLibExt ) ) ENDIF CASE hbmk[ _HBMK_cPLAT ] == "os2" l_aLIBSYS := ArrayAJoin( { l_aLIBSYS, l_aLIBSYSCORE, l_aLIBSYSMISC } ) @@ -3326,7 +3326,7 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) IF hbmk[ _HBMK_lSHARED ] /* TOFIX: This line is plain guessing. */ - AAdd( hbmk[ _HBMK_aOPTL ], "FILE " + FN_ExtSet( l_cHB_LIB_INSTALL + hb_osPathSeparator() + iif( hbmk[ _HBMK_lGUI ], "hbmainstd", "hbmainstd" ), cLibExt ) ) + AAdd( hbmk[ _HBMK_aOPTL ], "FILE " + FN_ExtSet( l_cHB_LIB_INSTALL + hb_ps() + iif( hbmk[ _HBMK_lGUI ], "hbmainstd", "hbmainstd" ), cLibExt ) ) ENDIF CASE hbmk[ _HBMK_cPLAT ] == "linux" l_aLIBSYS := ArrayAJoin( { l_aLIBSYS, l_aLIBSYSCORE, l_aLIBSYSMISC } ) @@ -3469,7 +3469,7 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) nCCompVer := 1200 CASE "2003" $ tmp nCCompVer := 1300 - CASE "8" + hb_osPathSeparator() $ tmp /* Visual Studio 2005 */ + CASE "8" + hb_ps() $ tmp /* Visual Studio 2005 */ nCCompVer := 1400 CASE "9.0" $ tmp /* Visual Studio 2008 or Windows SDK 7.0 */ nCCompVer := 1500 @@ -3888,9 +3888,9 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) ENDIF IF ! Empty( hbmk[ _HBMK_cCCPATH ] ) - cBin_CompCPP := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_osPathSeparator() + cBin_CompCPP, hbmk[ _HBMK_nCmd_Esc ] ) - cBin_CompC := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_osPathSeparator() + cBin_CompC, hbmk[ _HBMK_nCmd_Esc ] ) - cBin_Link := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_osPathSeparator() + cBin_Link, hbmk[ _HBMK_nCmd_Esc ] ) + cBin_CompCPP := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_ps() + cBin_CompCPP, hbmk[ _HBMK_nCmd_Esc ] ) + cBin_CompC := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_ps() + cBin_CompC, hbmk[ _HBMK_nCmd_Esc ] ) + cBin_Link := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_ps() + cBin_Link, hbmk[ _HBMK_nCmd_Esc ] ) ENDIF ENDCASE @@ -5108,21 +5108,21 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) /* Build app bundle for OS X GUI apps. (experimental) */ tmp := FN_DirGet( hbmk[ _HBMK_cPROGNAME ] ) IF ! Empty( tmp ) - tmp += hb_osPathSeparator() + tmp += hb_ps() ENDIF - tmp += FN_NameGet( hbmk[ _HBMK_cPROGNAME ] ) + ".app" + hb_osPathSeparator() + "Contents" - IF DirBuild( tmp + hb_osPathSeparator() + "MacOS" ) - hb_FCopy( hbmk[ _HBMK_cPROGNAME ], tmp + hb_osPathSeparator() + "MacOS" + hb_osPathSeparator() + FN_NameGet( hbmk[ _HBMK_cPROGNAME ] ) ) - IF ! hb_FileExists( tmp + hb_osPathSeparator() + "Info.plist" ) - hb_MemoWrit( tmp + hb_osPathSeparator() + "Info.plist", MacOSXFiles( hbmk, 1, FN_NameGet( hbmk[ _HBMK_cPROGNAME ] ) ) ) + tmp += FN_NameGet( hbmk[ _HBMK_cPROGNAME ] ) + ".app" + hb_ps() + "Contents" + IF DirBuild( tmp + hb_ps() + "MacOS" ) + hb_FCopy( hbmk[ _HBMK_cPROGNAME ], tmp + hb_ps() + "MacOS" + hb_ps() + FN_NameGet( hbmk[ _HBMK_cPROGNAME ] ) ) + IF ! hb_FileExists( tmp + hb_ps() + "Info.plist" ) + hb_MemoWrit( tmp + hb_ps() + "Info.plist", MacOSXFiles( hbmk, 1, FN_NameGet( hbmk[ _HBMK_cPROGNAME ] ) ) ) ENDIF - IF ! hb_FileExists( tmp + hb_osPathSeparator() + "PkgInfo" ) - hb_MemoWrit( tmp + hb_osPathSeparator() + "PkgInfo", MacOSXFiles( hbmk, 2, FN_NameGet( hbmk[ _HBMK_cPROGNAME ] ) ) ) + IF ! hb_FileExists( tmp + hb_ps() + "PkgInfo" ) + hb_MemoWrit( tmp + hb_ps() + "PkgInfo", MacOSXFiles( hbmk, 2, FN_NameGet( hbmk[ _HBMK_cPROGNAME ] ) ) ) ENDIF IF ! Empty( hbmk[ _HBMK_aICON ] ) - IF DirBuild( tmp + hb_osPathSeparator() + "Resources" ) + IF DirBuild( tmp + hb_ps() + "Resources" ) FOR EACH tmp1 IN hbmk[ _HBMK_aICON ] - hb_FCopy( tmp1, tmp + hb_osPathSeparator() + "Resources" + hb_osPathSeparator() + FN_NameExtGet( tmp1 ) ) + hb_FCopy( tmp1, tmp + hb_ps() + "Resources" + hb_ps() + FN_NameExtGet( tmp1 ) ) NEXT ENDIF ENDIF @@ -5430,7 +5430,7 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) cCommand := hbmk[ _HBMK_cPROGNAME ] #if defined( __PLATFORM__UNIX ) IF Empty( FN_DirGet( hbmk[ _HBMK_cPROGNAME ] ) ) - cCommand := "." + hb_osPathSeparator() + hbmk[ _HBMK_cPROGNAME ] + cCommand := "." + hb_ps() + hbmk[ _HBMK_cPROGNAME ] ENDIF #endif #if defined( __PLATFORM__WINDOWS ) @@ -5978,7 +5978,7 @@ STATIC FUNCTION deplst_read( hbmk, hDeps, cFileName ) LOCAL nLine := 0 cFileBody := StrTran( cFileBody, Chr( 13 ) + Chr( 10 ), Chr( 10 ) ) - cFileBody := StrTran( cFileBody, Chr( 9 ), Chr( 32 ) ) + cFileBody := StrTran( cFileBody, Chr( 9 ), " " ) FOR EACH cLine IN hb_ATokens( cFileBody, Chr( 10 ) ) ++nLine @@ -6365,7 +6365,7 @@ STATIC FUNCTION HeaderExists( cDir, cFileName ) #if defined( __PLATFORM__DARWIN ) LOCAL nPos IF ( nPos := At( "/", cFileName ) ) > 0 - tmp := DirAddPathSep( PathSepToSelf( cDir ) ) + Left( cFileName, nPos - 1 ) + ".framework" + hb_osPathSeparator() + "Headers" + hb_osPathSeparator() + SubStr( cFileName, nPos + 1 ) + tmp := DirAddPathSep( PathSepToSelf( cDir ) ) + Left( cFileName, nPos - 1 ) + ".framework" + hb_ps() + "Headers" + hb_ps() + SubStr( cFileName, nPos + 1 ) IF hb_FileExists( tmp ) RETURN tmp ENDIF @@ -6787,7 +6787,7 @@ STATIC FUNCTION FindInPath( cFileName, cPath ) LOCAL cName LOCAL cExt - hb_FNameSplit( cFileName,, @cName, @cExt ) + hb_FNameSplit( cFileName, @cDir, @cName, @cExt ) #if defined( __PLATFORM__WINDOWS ) .OR. ; defined( __PLATFORM__DOS ) .OR. ; defined( __PLATFORM__OS2 ) @@ -6796,7 +6796,7 @@ STATIC FUNCTION FindInPath( cFileName, cPath ) ENDIF #endif - /* Check in current dir. */ + /* Check original filename (in supplied path or current dir) */ IF hb_FileExists( cFileName := hb_FNameMerge( cDir, cName, cExt ) ) RETURN cFileName ENDIF @@ -7103,7 +7103,7 @@ STATIC FUNCTION PathNormalize( cPath, lNormalize ) IF lNormalize - aDir := hb_ATokens( cPath, hb_osPathSeparator() ) + aDir := hb_ATokens( cPath, hb_ps() ) FOR EACH cDir IN aDir DESCEND IF cDir == "." @@ -7123,12 +7123,12 @@ STATIC FUNCTION PathNormalize( cPath, lNormalize ) FOR EACH cDir IN aDir cPath += cDir IF cDir:__enumIndex() < Len( cDir:__enumBase() ) - cPath += hb_osPathSeparator() + cPath += hb_ps() ENDIF NEXT IF Empty( cPath ) - cPath := "." + hb_osPathSeparator() + cPath := "." + hb_ps() ENDIF ENDIF ENDIF @@ -7212,7 +7212,7 @@ STATIC FUNCTION PathMakeRelative( cPathBase, cPathTarget, lForceRelative ) /* Force to return relative paths even when base is different. */ IF lForceRelative - RETURN FN_FromArray( aPathTarget, tmp, NIL, cTargetFileName, Replicate( ".." + hb_osPathSeparator(), Len( aPathBase ) - tmp ) ) + RETURN FN_FromArray( aPathTarget, tmp, NIL, cTargetFileName, Replicate( ".." + hb_ps(), Len( aPathBase ) - tmp ) ) ENDIF RETURN cPathTarget @@ -7226,7 +7226,7 @@ STATIC FUNCTION FN_ToArray( cPath, /* @ */ cFileName ) cFileName := cName + cExt ENDIF - RETURN hb_ATokens( cDir, hb_osPathSeparator() ) + RETURN hb_ATokens( cDir, hb_ps() ) STATIC FUNCTION FN_FromArray( aPath, nFrom, nTo, cFileName, cDirPrefix ) LOCAL cDir @@ -7251,7 +7251,7 @@ STATIC FUNCTION FN_FromArray( aPath, nFrom, nTo, cFileName, cDirPrefix ) cDir := "" FOR tmp := nFrom TO nTo - cDir += aPath[ tmp ] + hb_osPathSeparator() + cDir += aPath[ tmp ] + hb_ps() NEXT RETURN hb_FNameMerge( DirDelPathSep( DirAddPathSep( cDirPrefix ) + cDir ), cFileName ) @@ -7282,8 +7282,8 @@ STATIC FUNCTION PathSepToTarget( hbmk, cFileName, nStart ) STATIC FUNCTION DirAddPathSep( cDir ) - IF ! Empty( cDir ) .AND. !( Right( cDir, 1 ) == hb_osPathSeparator() ) - cDir += hb_osPathSeparator() + IF ! Empty( cDir ) .AND. !( Right( cDir, 1 ) == hb_ps() ) + cDir += hb_ps() ENDIF RETURN cDir @@ -7291,12 +7291,12 @@ STATIC FUNCTION DirAddPathSep( cDir ) STATIC FUNCTION DirDelPathSep( cDir ) IF Empty( hb_osDriveSeparator() ) - DO WHILE Len( cDir ) > 1 .AND. Right( cDir, 1 ) == hb_osPathSeparator() + DO WHILE Len( cDir ) > 1 .AND. Right( cDir, 1 ) == hb_ps() cDir := hb_StrShrink( cDir, 1 ) ENDDO ELSE - DO WHILE Len( cDir ) > 1 .AND. Right( cDir, 1 ) == hb_osPathSeparator() .AND. ; - !( Right( cDir, 2 ) == hb_osDriveSeparator() + hb_osPathSeparator() ) + DO WHILE Len( cDir ) > 1 .AND. Right( cDir, 1 ) == hb_ps() .AND. ; + !( Right( cDir, 2 ) == hb_osDriveSeparator() + hb_ps() ) cDir := hb_StrShrink( cDir, 1 ) ENDDO ENDIF @@ -7322,9 +7322,9 @@ STATIC FUNCTION DirBuild( cDir ) cDirTemp := "" ENDIF - FOR EACH cDirItem IN hb_ATokens( cDir, hb_osPathSeparator() ) - IF !( Right( cDirTemp, 1 ) == hb_osPathSeparator() ) .AND. ! Empty( cDirTemp ) - cDirTemp += hb_osPathSeparator() + FOR EACH cDirItem IN hb_ATokens( cDir, hb_ps() ) + IF !( Right( cDirTemp, 1 ) == hb_ps() ) .AND. ! Empty( cDirTemp ) + cDirTemp += hb_ps() ENDIF IF ! Empty( cDirItem ) /* Skip root path, if any */ cDirTemp += cDirItem @@ -7361,7 +7361,7 @@ STATIC FUNCTION DirUnbuild( cDir ) RETURN .F. ENDIF ENDIF - IF ( tmp := RAt( hb_osPathSeparator(), cDirTemp ) ) == 0 + IF ( tmp := RAt( hb_ps(), cDirTemp ) ) == 0 EXIT ENDIF cDirTemp := Left( cDirTemp, tmp - 1 ) @@ -7401,8 +7401,8 @@ STATIC FUNCTION FN_Escape( cFileName, nEscapeMode, nFNNotation ) hb_FNameSplit( cFileName, @cDir, @cName, @cExt, @cDrive ) IF ! Empty( cDrive ) cDir := SubStr( cDir, Len( cDrive + hb_osDriveSeparator() ) + 1 ) - IF Left( cDir, Len( hb_osPathSeparator() ) ) == hb_osPathSeparator() - cDir := SubStr( cDir, Len( hb_osPathSeparator() ) + 1 ) + IF Left( cDir, Len( hb_ps() ) ) == hb_ps() + cDir := SubStr( cDir, Len( hb_ps() ) + 1 ) ENDIF cDir := "/cygdrive/" + Lower( Left( cDrive, 1 ) ) + "/" + cDir cFileName := hb_FNameMerge( cDir, cName, cExt ) @@ -7413,8 +7413,8 @@ STATIC FUNCTION FN_Escape( cFileName, nEscapeMode, nFNNotation ) hb_FNameSplit( cFileName, @cDir, @cName, @cExt, @cDrive ) IF ! Empty( cDrive ) cDir := SubStr( cDir, Len( cDrive + hb_osDriveSeparator() ) + 1 ) - IF Left( cDir, Len( hb_osPathSeparator() ) ) == hb_osPathSeparator() - cDir := SubStr( cDir, Len( hb_osPathSeparator() ) + 1 ) + IF Left( cDir, Len( hb_ps() ) ) == hb_ps() + cDir := SubStr( cDir, Len( hb_ps() ) + 1 ) ENDIF cDir := "/" + Lower( Left( cDrive, 1 ) ) + "/" + cDir cFileName := hb_FNameMerge( cDir, cName, cExt ) @@ -7589,10 +7589,10 @@ STATIC FUNCTION HBC_ProcessOne( hbmk, cFileName, nNestingLevel ) cFile := MemoRead( cFileName ) /* NOTE: Intentionally using MemoRead() which handles EOF char. */ - IF !( hb_osNewLine() == _CHR_EOL ) - cFile := StrTran( cFile, hb_osNewLine(), _CHR_EOL ) + IF !( hb_eol() == _CHR_EOL ) + cFile := StrTran( cFile, hb_eol(), _CHR_EOL ) ENDIF - IF !( hb_osNewLine() == Chr( 13 ) + Chr( 10 ) ) + IF !( hb_eol() == Chr( 13 ) + Chr( 10 ) ) cFile := StrTran( cFile, Chr( 13 ) + Chr( 10 ), _CHR_EOL ) ENDIF @@ -8049,8 +8049,8 @@ STATIC FUNCTION IsGTRequested( hbmk, cWhichGT ) STATIC FUNCTION StrStripQuote( cString ) RETURN iif( Left( cString, 1 ) == '"' .AND. Right( cString, 1 ) == '"',; - SubStr( cString, 2, Len( cString ) - 2 ),; - cString ) + SubStr( cString, 2, Len( cString ) - 2 ),; + cString ) STATIC FUNCTION ValueIsT( cString ) cString := Lower( cString ) @@ -8071,10 +8071,10 @@ STATIC PROCEDURE HBM_Load( hbmk, aParams, cFileName, nNestingLevel ) cFile := MemoRead( cFileName ) /* NOTE: Intentionally using MemoRead() which handles EOF char. */ - IF !( hb_osNewLine() == _CHR_EOL ) - cFile := StrTran( cFile, hb_osNewLine(), _CHR_EOL ) + IF !( hb_eol() == _CHR_EOL ) + cFile := StrTran( cFile, hb_eol(), _CHR_EOL ) ENDIF - IF !( hb_osNewLine() == Chr( 13 ) + Chr( 10 ) ) + IF !( hb_eol() == Chr( 13 ) + Chr( 10 ) ) cFile := StrTran( cFile, Chr( 13 ) + Chr( 10 ), _CHR_EOL ) ENDIF @@ -8224,7 +8224,7 @@ STATIC FUNCTION ArchCompFilter( hbmk, cItem ) RETURN cItem STATIC FUNCTION hb_pwd() - RETURN DirAddPathSep( hb_CurDrive() + hb_osDriveSeparator() + hb_osPathSeparator() + CurDir() ) + RETURN DirAddPathSep( hb_CurDrive() + hb_osDriveSeparator() + hb_ps() + CurDir() ) STATIC FUNCTION MacroProc( hbmk, cString, cFileName, cMacroPrefix ) LOCAL nStart @@ -9240,8 +9240,8 @@ STATIC FUNCTION win_implib_command_msvc( hbmk, cCommand, cSourceDLL, cTargetLib, IF hb_processRun( cCommandDump,, @cExports ) == 0 - cFuncList := "LIBRARY " + Chr( 34 ) + FN_NameExtGet( cSourceDLL ) + Chr( 34 ) + hb_osNewLine() +; - "EXPORTS" + hb_osNewLine() + cFuncList := "LIBRARY " + '"' + FN_NameExtGet( cSourceDLL ) + '"' + hb_eol() +; + "EXPORTS" + hb_eol() cExports := StrTran( cExports, Chr( 13 ) + Chr( 10 ), Chr( 10 ) ) @@ -9254,7 +9254,7 @@ STATIC FUNCTION win_implib_command_msvc( hbmk, cCommand, cSourceDLL, cTargetLib, IF ! Empty( cLine ) aCols := hb_ATokens( cLine ) IF Len( aCols ) >= 4 - cFuncList += aCols[ 4 ] + hb_osNewLine() + cFuncList += aCols[ 4 ] + hb_eol() ENDIF ENDIF NEXT @@ -9627,7 +9627,7 @@ STATIC PROCEDURE convert_hbmake_to_hbp( hbmk, cSrcName, cDstName ) ENDIF cSrc := StrTran( cSrc, Chr( 13 ) + Chr( 10 ), Chr( 10 ) ) - cSrc := StrTran( cSrc, Chr( 9 ), Chr( 32 ) ) + cSrc := StrTran( cSrc, Chr( 9 ), " " ) FOR EACH cLine IN hb_ATokens( cSrc, Chr( 10 ) ) tmp := At( " =", cLine ) @@ -9724,7 +9724,7 @@ STATIC PROCEDURE convert_hbmake_to_hbp( hbmk, cSrcName, cDstName ) cDst := "" FOR EACH tmp IN aDst - cDst += tmp + hb_osNewLine() + cDst += tmp + hb_eol() NEXT hbmk_OutStd( hbmk, hb_StrFormat( I_( "Saving as .hbp file: %1$s" ), cDstName ) ) @@ -9754,7 +9754,7 @@ STATIC PROCEDURE convert_xbp_to_hbp( hbmk, cSrcName, cDstName ) ENDIF cSrc := StrTran( cSrc, Chr( 13 ) + Chr( 10 ), Chr( 10 ) ) - cSrc := StrTran( cSrc, Chr( 9 ), Chr( 32 ) ) + cSrc := StrTran( cSrc, Chr( 9 ), " " ) FOR EACH cLine IN hb_ATokens( cSrc, Chr( 10 ) ) IF Left( cLine, 1 ) == "[" .AND. Right( cLine, 1 ) == "]" @@ -9841,7 +9841,7 @@ STATIC PROCEDURE convert_xbp_to_hbp( hbmk, cSrcName, cDstName ) cDst := "" FOR EACH tmp IN aDst - cDst += tmp + hb_osNewLine() + cDst += tmp + hb_eol() NEXT hbmk_OutStd( hbmk, hb_StrFormat( I_( "Saving as .hbp file: %1$s" ), cDstName ) ) @@ -9874,7 +9874,7 @@ STATIC PROCEDURE convert_xhp_to_hbp( hbmk, cSrcName, cDstName ) ENDIF cSrc := StrTran( cSrc, Chr( 13 ) + Chr( 10 ), Chr( 10 ) ) - cSrc := StrTran( cSrc, Chr( 9 ), Chr( 32 ) ) + cSrc := StrTran( cSrc, Chr( 9 ), " " ) FOR EACH cLine IN hb_ATokens( cSrc, Chr( 10 ) ) IF cLine == "[Files]" @@ -9933,7 +9933,7 @@ STATIC PROCEDURE convert_xhp_to_hbp( hbmk, cSrcName, cDstName ) IF Left( tmp, 2 ) == "-I" tmp := SubStr( tmp, 3 ) ENDIF - AAdd( aDst, "-incpath=" + StrTran( StrTran( tmp, Chr( 34 ) ), "%HOME%\" ) ) + AAdd( aDst, "-incpath=" + StrTran( StrTran( tmp, '"' ), "%HOME%\" ) ) NEXT EXIT CASE "Define" @@ -9961,7 +9961,7 @@ STATIC PROCEDURE convert_xhp_to_hbp( hbmk, cSrcName, cDstName ) cDst := "" FOR EACH tmp IN aDst - cDst += tmp + hb_osNewLine() + cDst += tmp + hb_eol() NEXT hbmk_OutStd( hbmk, hb_StrFormat( I_( "Saving as .hbp file: %1$s" ), cDstName ) ) @@ -10218,7 +10218,7 @@ STATIC PROCEDURE OutOpt( hbmk, aOpt ) OutStd( _OUT_EOL ) ELSE IF Len( aOpt ) > 1 - aOpt[ 2 ] := StrTran( aOpt[ 2 ], "\n", hb_osNewLine() ) + aOpt[ 2 ] := StrTran( aOpt[ 2 ], "\n", hb_eol() ) nLines := Max( MLCount( aOpt[ 2 ], hbmk[ _HBMK_nMaxCol ] - _OPT_WIDTH ),; MLCount( aOpt[ 1 ], _OPT_WIDTH ) ) FOR nLine := 1 TO nLines @@ -10237,7 +10237,7 @@ STATIC PROCEDURE OutNote( hbmk, cText ) LOCAL nLines LOCAL tmp - cText := StrTran( cText, "\n", hb_osNewLine() ) + cText := StrTran( cText, "\n", hb_eol() ) nLines := MLCount( cText, hbmk[ _HBMK_nMaxCol ] - 4 ) FOR nLine := 1 TO nLines IF ! Empty( tmp := RTrim( MemoLine( cText, hbmk[ _HBMK_nMaxCol ] - 4, nLine ) ) ) @@ -10257,7 +10257,7 @@ STATIC PROCEDURE hbmk_OutStd( hbmk, cText ) LOCAL nLines LOCAL tmp - cText := StrTran( cText, "\n", hb_osNewLine() ) + cText := StrTran( cText, "\n", hb_eol() ) nLines := MLCount( cText, hbmk[ _HBMK_nMaxCol ] - 7 ) FOR nLine := 1 TO nLines IF ! Empty( tmp := RTrim( MemoLine( cText, hbmk[ _HBMK_nMaxCol ] - 7, nLine ) ) ) @@ -10277,7 +10277,7 @@ STATIC PROCEDURE hbmk_OutErr( hbmk, cText ) LOCAL nLines LOCAL tmp - cText := StrTran( cText, "\n", hb_osNewLine() ) + cText := StrTran( cText, "\n", hb_eol() ) nLines := MLCount( cText, hbmk[ _HBMK_nMaxCol ] - 7 ) FOR nLine := 1 TO nLines IF ! Empty( tmp := RTrim( MemoLine( cText, hbmk[ _HBMK_nMaxCol ] - 7, nLine ) ) ) diff --git a/harbour/utils/hbrun/hbrun.prg b/harbour/utils/hbrun/hbrun.prg index 9906a8732f..0c34c40578 100644 --- a/harbour/utils/hbrun/hbrun.prg +++ b/harbour/utils/hbrun/hbrun.prg @@ -116,33 +116,36 @@ PROCEDURE _APPMAIN( cFile, ... ) hbrun_Prompt() EXIT OTHERWISE - hb_FNameSplit( cFile, NIL, NIL, @cExt ) - cExt := lower( cExt ) - SWITCH cExt - CASE ".prg" - CASE ".hbs" - CASE ".hrb" - CASE ".dbf" - EXIT - OTHERWISE - cExt := hbrun_FileSig( cFile ) - ENDSWITCH - SWITCH cExt - CASE ".dbf" - hbrun_Prompt( "USE " + cFile ) - EXIT - CASE ".prg" - CASE ".hbs" - cFile := HB_COMPILEBUF( HB_ARGV( 0 ), "-n2", "-w", "-es2", "-q0", ; - s_aIncDir, "-D" + "__HBSCRIPT__HBRUN", cFile ) - IF cFile == NIL - ERRORLEVEL( 1 ) - ENDIF - OTHERWISE - hb_argShift( .T. ) - hb_hrbRun( cFile, ... ) - EXIT - ENDSWITCH + cFile := hbrun_FindInPath( cFile ) + IF ! Empty( cFile ) + hb_FNameSplit( cFile, NIL, NIL, @cExt ) + cExt := lower( cExt ) + SWITCH cExt + CASE ".prg" + CASE ".hbs" + CASE ".hrb" + CASE ".dbf" + EXIT + OTHERWISE + cExt := hbrun_FileSig( cFile ) + ENDSWITCH + SWITCH cExt + CASE ".dbf" + hbrun_Prompt( "USE " + cFile ) + EXIT + CASE ".prg" + CASE ".hbs" + cFile := HB_COMPILEBUF( HB_ARGV( 0 ), "-n2", "-w", "-es2", "-q0", ; + s_aIncDir, "-D" + "__HBSCRIPT__HBRUN", cFile ) + IF cFile == NIL + ERRORLEVEL( 1 ) + ENDIF + OTHERWISE + hb_argShift( .T. ) + hb_hrbRun( cFile, ... ) + EXIT + ENDSWITCH + ENDIF ENDSWITCH ELSE hbrun_Prompt() @@ -284,11 +287,11 @@ STATIC PROCEDURE hbrun_Prompt( cCommand ) STATIC PROCEDURE hbrun_Usage() - OutStd( 'Harbour "DOt Prompt" Console / runner ' + HBRawVersion() + HB_OSNewLine() +; - "Copyright (c) 1999-2010, Przemyslaw Czerpak" + HB_OSNewLine() + ; - "http://harbour-project.org/" + HB_OSNewLine() +; - HB_OSNewLine() +; - "Syntax: hbrun [ []]" + HB_OSNewLine() ) + OutStd( 'Harbour "DOt Prompt" Console / runner ' + HBRawVersion() + hb_eol() +; + "Copyright (c) 1999-2010, Przemyslaw Czerpak" + hb_eol() + ; + "http://harbour-project.org/" + hb_eol() +; + hb_eol() +; + "Syntax: hbrun [ []]" + hb_eol() ) RETURN @@ -352,7 +355,7 @@ STATIC PROCEDURE hbrun_Err( oErr, cCommand ) STATIC PROCEDURE hbrun_Exec( cCommand ) LOCAL pHRB, cHRB, cFunc, bBlock, cEol - cEol := hb_osNewLine() + cEol := hb_eol() cFunc := "STATIC FUNC __HBDOT()" + cEol + ; "RETURN {||" + cEol + ; " " + cCommand + cEol + ; @@ -418,7 +421,7 @@ STATIC PROCEDURE hbrun_HistorySave() cHistory := "" FOR EACH cLine IN s_aHistory IF !( Lower( AllTrim( cLine ) ) == "quit" ) - cHistory += AllTrim( cLine ) + hb_osNewLine() + cHistory += AllTrim( cLine ) + hb_eol() ENDIF NEXT hb_MemoWrit( hbrun_HistoryFileName(), cHistory ) @@ -444,7 +447,7 @@ STATIC FUNCTION hbrun_HistoryFileName() #endif IF ! Empty( GetEnv( cEnvVar ) ) - cDir := GetEnv( cEnvVar ) + hb_osPathSeparator() + ".harbour" + cDir := GetEnv( cEnvVar ) + hb_ps() + ".harbour" ELSE cDir := hb_dirBase() ENDIF @@ -453,4 +456,58 @@ STATIC FUNCTION hbrun_HistoryFileName() MakeDir( cDir ) ENDIF - RETURN cDir + hb_osPathSeparator() + cFileName + RETURN cDir + hb_ps() + cFileName + +STATIC FUNCTION hbrun_FindInPath( cFileName ) + LOCAL cDir + LOCAL cName + LOCAL cExt + + LOCAL cDirPATH + + hb_FNameSplit( cFileName, @cDir, @cName, @cExt ) + + FOR EACH cExt IN iif( Empty( cExt ), { ".hbs", ".hrb" }, { cExt } ) + + /* Check original filename (in supplied path or current dir) */ + IF hb_FileExists( cFileName := hb_FNameMerge( cDir, cName, cExt ) ) + RETURN cFileName + ENDIF + + /* Check in the dir of this executable. */ + IF ! Empty( hb_DirBase() ) + IF hb_FileExists( cFileName := hb_FNameMerge( hb_DirBase(), cName, cExt ) ) + RETURN cFileName + ENDIF + ENDIF + + /* Check in the PATH. */ + #if defined( __PLATFORM__WINDOWS ) .OR. ; + defined( __PLATFORM__DOS ) .OR. ; + defined( __PLATFORM__OS2 ) + FOR EACH cDirPATH IN hb_ATokens( GetEnv( "PATH" ), hb_osPathListSeparator(), .T., .T. ) + #else + FOR EACH cDirPATH IN hb_ATokens( GetEnv( "PATH" ), hb_osPathListSeparator() ) + #endif + IF ! Empty( cDirPATH ) + IF hb_FileExists( cFileName := hb_FNameMerge( hbrun_DirAddPathSep( hbrun_StrStripQuote( cDirPATH ) ), cName, cExt ) ) + RETURN cFileName + ENDIF + ENDIF + NEXT + NEXT + + RETURN NIL + +STATIC FUNCTION hbrun_DirAddPathSep( cDir ) + + IF ! Empty( cDir ) .AND. !( Right( cDir, 1 ) == hb_ps() ) + cDir += hb_ps() + ENDIF + + RETURN cDir + +STATIC FUNCTION hbrun_StrStripQuote( cString ) + RETURN iif( Left( cString, 1 ) == '"' .AND. Right( cString, 1 ) == '"',; + SubStr( cString, 2, Len( cString ) - 2 ),; + cString )