From d3e5d95a09ced59ee60d45a918cb3a3571a53ef4 Mon Sep 17 00:00:00 2001 From: marco Date: Tue, 22 Jan 2002 19:02:05 +0000 Subject: [PATCH] * copied from FreeBSD. Lazarus starts up under NetBSD, and doesn't need changes git-svn-id: trunk@615 - --- .gitattributes | 1 + ide/include/netbsd/lazconf.inc | 116 +++++++++++++++++++++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 ide/include/netbsd/lazconf.inc diff --git a/.gitattributes b/.gitattributes index fe01207d1e..9575c9c4b2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/ide/include/netbsd/lazconf.inc b/ide/include/netbsd/lazconf.inc new file mode 100644 index 0000000000..55c44a7173 --- /dev/null +++ b/ide/include/netbsd/lazconf.inc @@ -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= cmd line option + + Revision 1.1 2001/01/14 20:50:23 marco + * Initial version. Same as Linux, and probably will be that way. + +} +