mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-30 06:50:40 +02:00
default fpc src dirs and clean ups
git-svn-id: trunk@3836 -
This commit is contained in:
parent
77d4affa64
commit
7795c91d30
@ -223,6 +223,7 @@ type
|
||||
procedure Save(OnlyDesktop:boolean);
|
||||
property Filename: string read FFilename write SetFilename;
|
||||
procedure SetLazarusDefaultFilename;
|
||||
procedure GetDefaultFPCSourceDirectory;
|
||||
property OnApplyWindowLayout: TOnApplyIDEWindowLayout
|
||||
read FOnApplyWindowLayout write SetOnApplyWindowLayout;
|
||||
|
||||
@ -519,6 +520,7 @@ function FilenameIsPascalSource(const Filename: string): boolean;
|
||||
function FilenameIsFormText(const Filename: string): boolean;
|
||||
function AmbigiousFileActionNameToType(const Action: string): TAmbigiousFileAction;
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
|
||||
@ -704,6 +706,11 @@ begin
|
||||
Filename:=ConfFilename;
|
||||
end;
|
||||
|
||||
procedure TEnvironmentOptions.GetDefaultFPCSourceDirectory;
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TEnvironmentOptions.SetFileName(const NewFilename: string);
|
||||
begin
|
||||
if FFilename=NewFilename then exit;
|
||||
@ -3528,7 +3535,7 @@ function TEnvironmentOptionsDialog.CheckValues: boolean;
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
function CheckFPCSourceDir: boolean;
|
||||
function IsFPCSourceDir: boolean;
|
||||
var
|
||||
NewFPCSrcDir: string;
|
||||
StopChecking: boolean;
|
||||
@ -3539,11 +3546,7 @@ function TEnvironmentOptionsDialog.CheckValues: boolean;
|
||||
if (not Result) or StopChecking then exit;
|
||||
|
||||
// FPC source directory specific tests
|
||||
NewFPCSrcDir:=AppendPathDelim(NewFPCSrcDir);
|
||||
if not DirectoryExists(NewFPCSrcDir+'fcl')
|
||||
or not DirectoryExists(NewFPCSrcDir+'rtl')
|
||||
or not DirectoryExists(NewFPCSrcDir+'packages')
|
||||
then begin
|
||||
if not CheckFPCSourceDir(NewFPCSrcDir) then begin
|
||||
Result:=(MessageDlg(Format(lisEnvOptDlgInvalidFPCSrcDir,[NewFPCSrcDir]),
|
||||
mtWarning,[mbIgnore,mbCancel],0)=mrIgnore);
|
||||
exit;
|
||||
@ -3575,7 +3578,7 @@ begin
|
||||
// check lazarus directory
|
||||
if not CheckLazarusDir then exit;
|
||||
// check fpc source directory
|
||||
if not CheckFPCSourceDir then exit;
|
||||
if not IsFPCSourceDir then exit;
|
||||
// check test directory
|
||||
if not CheckTestDir then exit;
|
||||
|
||||
|
@ -24,8 +24,21 @@
|
||||
|
||||
{Should become unit Unix in the future. For both Linux and FreeBSD}
|
||||
uses
|
||||
{$IFDEF VER1_1}
|
||||
unix;
|
||||
{$ELSE}
|
||||
linux;
|
||||
|
||||
{$ENDIF}
|
||||
|
||||
|
||||
const
|
||||
DefaultFPCSrcDirs: array[1..4] of string = (
|
||||
'/usr/lib/fpc',
|
||||
'/usr/local/lib/fpc',
|
||||
'/vol/fpc',
|
||||
'/vol/lib/fpc'
|
||||
);
|
||||
|
||||
var
|
||||
PrimaryConfigPath,
|
||||
SecondaryConfigPath: string;
|
||||
@ -120,13 +133,20 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
initialization
|
||||
{---------------------------------------------------------------------------
|
||||
procedure InternalInit;
|
||||
---------------------------------------------------------------------------}
|
||||
procedure InternalInit;
|
||||
begin
|
||||
PrimaryConfigPath:=FExpand('~/.lazarus');
|
||||
SecondaryConfigPath:='/etc/lazarus';
|
||||
|
||||
end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.8 2003/02/06 20:46:51 mattias
|
||||
default fpc src dirs and clean ups
|
||||
|
||||
Revision 1.7 2002/12/20 11:08:47 mattias
|
||||
method resolution clause, class ancestor find declaration, 1.1. makros
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
// included by lazconf.pp
|
||||
|
||||
{***************************************************************************
|
||||
lazconf.inc
|
||||
***************************************************************************
|
||||
@ -28,6 +30,14 @@ uses
|
||||
linux;
|
||||
{$ENDIF}
|
||||
|
||||
const
|
||||
DefaultFPCSrcDirs: array[1..4] of string = (
|
||||
'/usr/lib/fpc',
|
||||
'/usr/local/lib/fpc',
|
||||
'/vol/fpc',
|
||||
'/vol/lib/fpc'
|
||||
);
|
||||
|
||||
var
|
||||
PrimaryConfigPath,
|
||||
SecondaryConfigPath: string;
|
||||
@ -101,6 +111,9 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{---------------------------------------------------------------------------
|
||||
function CreateCompilerTestPascalFilename: string;
|
||||
---------------------------------------------------------------------------}
|
||||
function CreateCompilerTestPascalFilename: string;
|
||||
var
|
||||
fs: TFileStream;
|
||||
@ -112,22 +125,38 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{---------------------------------------------------------------------------
|
||||
function FindDefaultCompilerPath: string;
|
||||
---------------------------------------------------------------------------}
|
||||
function FindDefaultCompilerPath: string;
|
||||
begin
|
||||
Result:=SearchFileInPath('ppc386','',GetEnv('PATH'),':');
|
||||
end;
|
||||
|
||||
{---------------------------------------------------------------------------
|
||||
function FindDefaultMakePath: string;
|
||||
---------------------------------------------------------------------------}
|
||||
function FindDefaultMakePath: string;
|
||||
begin
|
||||
Result:=SearchFileInPath('make','',GetEnv('PATH'),':');
|
||||
end;
|
||||
|
||||
initialization
|
||||
{---------------------------------------------------------------------------
|
||||
procedure InternalInit;
|
||||
---------------------------------------------------------------------------}
|
||||
procedure InternalInit;
|
||||
begin
|
||||
PrimaryConfigPath:=FExpand('~/.lazarus');
|
||||
SecondaryConfigPath:='/etc/lazarus';
|
||||
end;
|
||||
|
||||
// included by lazconf.pp
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.10 2003/02/06 20:46:51 mattias
|
||||
default fpc src dirs and clean ups
|
||||
|
||||
Revision 1.9 2002/12/20 11:08:47 mattias
|
||||
method resolution clause, class ancestor find declaration, 1.1. makros
|
||||
|
||||
|
@ -24,8 +24,21 @@
|
||||
|
||||
{Should become unit Unix in the future. For both Linux and FreeBSD}
|
||||
uses
|
||||
{$IFDEF VER1_1}
|
||||
unix;
|
||||
{$ELSE}
|
||||
linux;
|
||||
|
||||
{$ENDIF}
|
||||
|
||||
|
||||
const
|
||||
DefaultFPCSrcDirs: array[1..4] of string = (
|
||||
'/usr/lib/fpc',
|
||||
'/usr/local/lib/fpc',
|
||||
'/vol/fpc',
|
||||
'/vol/lib/fpc'
|
||||
);
|
||||
|
||||
var
|
||||
PrimaryConfigPath,
|
||||
SecondaryConfigPath: string;
|
||||
@ -120,13 +133,20 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
initialization
|
||||
{---------------------------------------------------------------------------
|
||||
procedure InternalInit;
|
||||
---------------------------------------------------------------------------}
|
||||
procedure InternalInit;
|
||||
begin
|
||||
PrimaryConfigPath:=FExpand('~/.lazarus');
|
||||
SecondaryConfigPath:='/etc/lazarus';
|
||||
|
||||
end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.5 2003/02/06 20:46:51 mattias
|
||||
default fpc src dirs and clean ups
|
||||
|
||||
Revision 1.4 2002/12/20 11:08:47 mattias
|
||||
method resolution clause, class ancestor find declaration, 1.1. makros
|
||||
|
||||
|
@ -21,6 +21,11 @@
|
||||
* *
|
||||
***************************************************************************
|
||||
}
|
||||
const
|
||||
DefaultFPCSrcDirs: array[1..1] of string = (
|
||||
'C:\pp'
|
||||
);
|
||||
|
||||
var
|
||||
PrimaryConfigPath,
|
||||
SecondaryConfigPath: string;
|
||||
@ -114,15 +119,22 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
initialization
|
||||
{---------------------------------------------------------------------------
|
||||
procedure InternalInit;
|
||||
---------------------------------------------------------------------------}
|
||||
procedure InternalInit;
|
||||
begin
|
||||
PrimaryConfigPath:=ExtractFilePath(Paramstr(0));
|
||||
{ This need some work. Probably one can use the Windows API to
|
||||
get the system path. }
|
||||
SecondaryConfigPath:='\windows\system';
|
||||
|
||||
end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.8 2003/02/06 20:46:51 mattias
|
||||
default fpc src dirs and clean ups
|
||||
|
||||
Revision 1.7 2002/12/20 11:08:47 mattias
|
||||
method resolution clause, class ancestor find declaration, 1.1. makros
|
||||
|
||||
|
@ -67,17 +67,51 @@ uses
|
||||
|
||||
function FindDefaultCompilerPath: string;
|
||||
function FindDefaultMakePath: string;
|
||||
|
||||
function FindDefaultFPCSrcDirectory: string;
|
||||
function CheckFPCSourceDir(const ADirectory: string): boolean;
|
||||
|
||||
function CreateCompilerTestPascalFilename: string;
|
||||
|
||||
implementation
|
||||
|
||||
|
||||
{$I lazconf.inc}
|
||||
|
||||
function CheckFPCSourceDir(const ADirectory: string): boolean;
|
||||
var
|
||||
Dir: String;
|
||||
begin
|
||||
Result:=false;
|
||||
if DirectoryExists(ADirectory) then begin
|
||||
Dir:=AppendPathDelim(ADirectory);
|
||||
Result:=DirectoryExists(Dir+'fcl')
|
||||
and DirectoryExists(Dir+'rtl')
|
||||
and DirectoryExists(Dir+'packages');
|
||||
end;
|
||||
end;
|
||||
|
||||
function FindDefaultFPCSrcDirectory: string;
|
||||
var
|
||||
i: integer;
|
||||
begin
|
||||
for i:=Low(DefaultFPCSrcDirs) to High(DefaultFPCSrcDirs) do begin
|
||||
Result:=DefaultFPCSrcDirs[i];
|
||||
writeln('FindDefaultFPCSrcDirectory A ',Result,' ',CheckFPCSourceDir(Result));
|
||||
if CheckFPCSourceDir(Result) then exit;
|
||||
end;
|
||||
Result:='';
|
||||
end;
|
||||
|
||||
initialization
|
||||
InternalInit;
|
||||
|
||||
end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.11 2003/02/06 20:46:51 mattias
|
||||
default fpc src dirs and clean ups
|
||||
|
||||
Revision 1.10 2002/12/23 13:20:45 mattias
|
||||
fixed backuping symlinks
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user