* copied from FreeBSD. Lazarus starts up under NetBSD, and doesn't need changes

git-svn-id: trunk@615 -
This commit is contained in:
marco 2002-01-22 19:02:05 +00:00
parent c30b72500e
commit d3e5d95a09
2 changed files with 117 additions and 0 deletions

1
.gitattributes vendored
View File

@ -123,6 +123,7 @@ ide/ideprocs.pp svneol=native#text/pascal
ide/include/freebsd/lazconf.inc svneol=native#text/pascal ide/include/freebsd/lazconf.inc svneol=native#text/pascal
ide/include/ide.inc svneol=native#text/pascal ide/include/ide.inc svneol=native#text/pascal
ide/include/linux/lazconf.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/include/win32/lazconf.inc svneol=native#text/pascal
ide/insertwatch.lrs svneol=native#text/pascal ide/insertwatch.lrs svneol=native#text/pascal
ide/keymapping.pp svneol=native#text/pascal ide/keymapping.pp svneol=native#text/pascal

View 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.
}