mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 14:39:20 +02:00
* copied from FreeBSD. Lazarus starts up under NetBSD, and doesn't need changes
git-svn-id: trunk@615 -
This commit is contained in:
parent
c30b72500e
commit
d3e5d95a09
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -123,6 +123,7 @@ ide/ideprocs.pp svneol=native#text/pascal
|
||||
ide/include/freebsd/lazconf.inc svneol=native#text/pascal
|
||||
ide/include/ide.inc svneol=native#text/pascal
|
||||
ide/include/linux/lazconf.inc svneol=native#text/pascal
|
||||
ide/include/netbsd/lazconf.inc svneol=native#text/pascal
|
||||
ide/include/win32/lazconf.inc svneol=native#text/pascal
|
||||
ide/insertwatch.lrs svneol=native#text/pascal
|
||||
ide/keymapping.pp svneol=native#text/pascal
|
||||
|
116
ide/include/netbsd/lazconf.inc
Normal file
116
ide/include/netbsd/lazconf.inc
Normal file
@ -0,0 +1,116 @@
|
||||
{***************************************************************************
|
||||
lazconf.inc
|
||||
***************************************************************************}
|
||||
|
||||
{Should become unit Unix in the future. For both Linux and FreeBSD}
|
||||
uses
|
||||
linux;
|
||||
|
||||
var
|
||||
PrimaryConfigPath,
|
||||
SecondaryConfigPath: string;
|
||||
|
||||
{---------------------------------------------------------------------------
|
||||
getPrimaryConfigPath function
|
||||
---------------------------------------------------------------------------}
|
||||
function GetPrimaryConfigPath: String;
|
||||
begin
|
||||
Result := PrimaryConfigPath;
|
||||
end;
|
||||
|
||||
{---------------------------------------------------------------------------
|
||||
getSecondaryConfigPath function
|
||||
---------------------------------------------------------------------------}
|
||||
function GetSecondaryConfigPath: String;
|
||||
begin
|
||||
Result := SecondaryConfigPath;
|
||||
end;
|
||||
|
||||
{---------------------------------------------------------------------------
|
||||
createPrimaryConfigPath function
|
||||
---------------------------------------------------------------------------}
|
||||
procedure CreatePrimaryConfigPath;
|
||||
begin
|
||||
CreateDir(GetPrimaryConfigPath);
|
||||
//MkDir(GetPrimaryConfigPath);
|
||||
end;
|
||||
|
||||
{---------------------------------------------------------------------------
|
||||
SetPrimaryConfigPath procedure
|
||||
---------------------------------------------------------------------------}
|
||||
procedure SetPrimaryConfigPath(const NewValue: String);
|
||||
begin
|
||||
PrimaryConfigPath:=FExpand(NewValue);
|
||||
end;
|
||||
|
||||
{---------------------------------------------------------------------------
|
||||
SetSecondaryConfigPath procedure
|
||||
---------------------------------------------------------------------------}
|
||||
procedure SetSecondaryConfigPath(const NewValue: String);
|
||||
begin
|
||||
SecondaryConfigPath:=FExpand(NewValue);
|
||||
end;
|
||||
|
||||
{---------------------------------------------------------------------------
|
||||
CopySecondaryConfigFile procedure
|
||||
---------------------------------------------------------------------------}
|
||||
procedure CopySecondaryConfigFile(const AFilename: String);
|
||||
var
|
||||
PrimaryFilename, SecondaryFilename: string;
|
||||
SrcFS, DestFS: TFileStream;
|
||||
begin
|
||||
PrimaryFilename:=GetPrimaryConfigPath+PathDelim+AFilename;
|
||||
SecondaryFilename:=GetSecondaryConfigPath+PathDelim+AFilename;
|
||||
if not FileExists(PrimaryFilename) then begin
|
||||
try
|
||||
SrcFS:=TFileStream.Create(SecondaryFilename,fmOpenRead);
|
||||
try
|
||||
DestFS:=TFileStream.Create(PrimaryFilename,fmCreate);
|
||||
try
|
||||
DestFS.CopyFrom(SrcFS,SrcFS.Size);
|
||||
finally
|
||||
DestFS.Free;
|
||||
end;
|
||||
finally
|
||||
SrcFS.Free;
|
||||
end;
|
||||
except
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
function FindDefaultCompilerPath: string;
|
||||
begin
|
||||
if FileIsExecutable('/usr/bin/ppc386') then
|
||||
Result:='/usr/bin/ppc386'
|
||||
else if FileIsExecutable('/opt/fpc/ppc386') then
|
||||
Result:='/opt/fpc/ppc386'
|
||||
else
|
||||
Result:='';
|
||||
end;
|
||||
|
||||
|
||||
initialization
|
||||
PrimaryConfigPath:=FExpand('~/.lazarus');
|
||||
SecondaryConfigPath:='/etc/lazarus';
|
||||
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.1 2002/01/22 19:02:05 marco
|
||||
* copied from FreeBSD. Lazarus starts up under NetBSD, and doesn't need changes
|
||||
|
||||
Revision 1.4 2001/12/16 22:24:55 lazarus
|
||||
MG: changes for new compiler 20011216
|
||||
|
||||
Revision 1.3 2001/12/10 08:44:23 lazarus
|
||||
MG: added search for compiler, if not set
|
||||
|
||||
Revision 1.2 2001/05/27 11:52:01 lazarus
|
||||
MG: added --primary-config-path=<filename> cmd line option
|
||||
|
||||
Revision 1.1 2001/01/14 20:50:23 marco
|
||||
* Initial version. Same as Linux, and probably will be that way.
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user