1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
|
{%MainUnit ../linux/lazconf.inc}
// included by linux/lazconf.inc, freebsd/lazconf.inc, netbsd/lazconf.inc
// todo: use $target here ?
{
***************************************************************************
* *
* This source is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This code is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* General Public License for more details. *
* *
* A copy of the GNU General Public License is available on the World *
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
* obtain it by writing to the Free Software Foundation, *
* Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1335, USA. *
* *
***************************************************************************
}
const
DefaultFPCSrcDirs: array[1..15] of string = (
// search first for sources with right version
'/usr/share/fpcsrc/$(FPCVer)',
// then search for global paths
'/usr/share/fpcsrc',
'/usr/local/share/fpcsrc',
'/usr/fpcsrc',
'/usr/share/fpc/src',
'/usr/fpc/src',
'/usr/local/fpc/src',
'/usr/local/share/fpc/src',
'/usr/local/src/fpc',
'/usr/lib/fpc/src',
'/usr/local/lib/fpc/src',
'/vol/fpc/src',
'/vol/lib/fpc/src',
// These paths are created by the fpc rpm creation script and do not
// contain all sources. So, they are searched last.
'/usr/src/fpc',
'/vol/src/fpc'
);
DefaultLazarusSrcDirs: array[1..8] of string = (
'/usr/share/lazarus',
'/usr/local/share/lazarus',
'/usr/local/lib/lazarus',
'/usr/local/lazarus',
'/usr/lib/lazarus',
'/usr/lib/lazarus/'+LazarusVersionStr,
'~/pascal/lazarus',
'~/lazarus'
);
var
PrimaryConfigPath,
SecondaryConfigPath: string;
{---------------------------------------------------------------------------
function FindDefaultCompilerPath: string;
---------------------------------------------------------------------------}
function FindDefaultCompilerPath: string;
begin
Result:=FindDefaultExecutablePath(GetDefaultCompilerFilename);
end;
{---------------------------------------------------------------------------
function FindDefaultMakePath: string;
---------------------------------------------------------------------------}
function FindDefaultMakePath: string;
begin
{$IFDEF FreeBSD}
Result:=FindDefaultExecutablePath('gmake');
{$ELSE}
Result:=FindDefaultExecutablePath('make');
{$ENDIF}
end;
function GetDefaultCompiledUnitExt(FPCVersion, FPCRelease: integer): string;
begin
Result:='.ppu';
end;
function OSLocksExecutables: boolean;
begin
Result:=false;
end;
function GetDefaultTestBuildDirectory: string;
begin
Result:='~/tmp/';
end;
procedure GetDefaultCompilerFilenames(List: TStrings);
begin
AddFilenameToList(List,'/usr/local/bin/'+GetDefaultCompilerFilename);
AddFilenameToList(List,'/usr/bin/'+GetDefaultCompilerFilename);
AddFilenameToList(List,'/opt/fpc/'+GetDefaultCompilerFilename);
end;
procedure GetDefaultMakeFilenames(List: TStrings);
begin
AddFilenameToList(List,'/usr/bin/make');
end;
procedure GetDefaultTestBuildDirs(List: TStrings);
begin
AddFilenameToList(List,'~/tmp/');
AddFilenameToList(List,'/tmp/');
AddFilenameToList(List,'/var/tmp/');
end;
procedure GetDefaultBrowser(var Browser, Params: string);
function Find(const ShortFilename: string; var Filename: string): boolean;
begin
Filename:=SearchFileInPath(ShortFilename,'',
GetEnvironmentVariableUTF8('PATH'),PathSeparator,[]);
Result:=Filename<>'';
end;
begin
Params:='%s';
Browser:='';
// prefer open source ;)
if Find('xdg-open',Browser) then exit;
if Find('mozilla',Browser) then exit;
if Find('galeon',Browser) then exit;
if Find('konqueror',Browser) then exit;
if Find('safari',Browser) then exit;
if Find('netscape',Browser) then exit;
if Find('opera',Browser) then exit;
if Find('iexplore.exe',Browser) then exit;
end;
{---------------------------------------------------------------------------
procedure InternalInit;
---------------------------------------------------------------------------}
procedure InternalInit;
begin
// For the Unix file functions only the slash is a directory separator.
// The RTL defines AllowDirectorySeparators ['/','\'] for historical reasons.
AllowDirectorySeparators:=['/'];
PrimaryConfigPath:=ExpandFileNameUTF8('~/.lazarus');
SecondaryConfigPath:='/etc/lazarus';
end;
|