started package system (packager)

git-svn-id: trunk@3879 -
This commit is contained in:
mattias 2003-02-28 10:14:28 +00:00
parent 0627920453
commit 6d6ed821e8
10 changed files with 383 additions and 153 deletions

View File

@ -1,8 +1,8 @@
#
# Don't edit, this file is generated by FPCMake Version 1.1 [2002/09/21]
# Don't edit, this file is generated by FPCMake Version 1.1 [2003/02/27]
#
default: all
MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx
MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx palmos macos macosx
override PATH:=$(subst \,/,$(PATH))
ifeq ($(findstring ;,$(PATH)),)
inUnix=1
@ -58,6 +58,9 @@ ifdef inUnix
PATHSEP=/
else
PATHSEP:=$(subst /,\,/)
ifdef inCygWin
PATHSEP=/
endif
endif
ifdef PWD
BASEDIR:=$(subst \,/,$(shell $(PWD)))
@ -107,37 +110,38 @@ endif
override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
ifndef FPC_VERSION
FPC_VERSION:=$(shell $(FPC) -iV)
FPC_COMPILERINFO:=$(shell $(FPC) -iVSPTPSOTO)
FPC_VERSION:=$(word 1,$(FPC_COMPILERINFO))
endif
export FPC FPC_VERSION
export FPC FPC_VERSION FPC_COMPILERINFO
unexport CHECKDEPEND ALLDEPENDENCIES
ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
ifndef CPU_SOURCE
CPU_SOURCE:=$(word 1,$(COMPILERINFO))
endif
ifndef CPU_TARGET
CPU_TARGET:=$(word 2,$(COMPILERINFO))
ifdef CPU_TARGET_DEFAULT
CPU_TARGET=$(CPU_TARGET_DEFAULT)
endif
ifndef OS_SOURCE
OS_SOURCE:=$(word 3,$(COMPILERINFO))
endif
ifndef OS_TARGET
OS_TARGET:=$(word 4,$(COMPILERINFO))
ifdef OS_TARGET_DEFAULT
OS_TARGET=$(OS_TARGET_DEFAULT)
endif
endif
ifneq ($(words $(FPC_COMPILERINFO)),5)
FPC_COMPILERINFO+=$(shell $(FPC) -iSP)
FPC_COMPILERINFO+=$(shell $(FPC) -iTP)
FPC_COMPILERINFO+=$(shell $(FPC) -iSO)
FPC_COMPILERINFO+=$(shell $(FPC) -iTO)
endif
else
ifndef CPU_SOURCE
CPU_SOURCE:=$(shell $(FPC) -iSP)
CPU_SOURCE:=$(word 2,$(FPC_COMPILERINFO))
endif
ifndef CPU_TARGET
CPU_TARGET:=$(shell $(FPC) -iTP)
CPU_TARGET:=$(word 3,$(FPC_COMPILERINFO))
endif
ifndef OS_SOURCE
OS_SOURCE:=$(shell $(FPC) -iSO)
OS_SOURCE:=$(word 4,$(FPC_COMPILERINFO))
endif
ifndef OS_TARGET
OS_TARGET:=$(shell $(FPC) -iTO)
endif
OS_TARGET:=$(word 5,$(FPC_COMPILERINFO))
endif
FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
@ -217,7 +221,7 @@ override INSTALL_BASEDIR=lib/lazarus
override DIST_DESTDIR=$(BASEDIR)/dist
override COMPILER_OPTIONS+=-gl
override COMPILER_INCLUDEDIR+=include include/$(OS_TARGET)
override COMPILER_UNITDIR+=components/custom lcl/units lcl/units/$(LCL_PLATFORM) designer designer/units debugger components/units .
override COMPILER_UNITDIR+=components/custom lcl/units lcl/units/$(LCL_PLATFORM) designer designer/units debugger packager components/units .
override COMPILER_TARGETDIR+=.
ifdef REQUIRE_UNITSDIR
override UNITSDIR+=$(REQUIRE_UNITSDIR)
@ -562,6 +566,15 @@ FPCMADE=fpcmade.nw
ZIPSUFFIX=nw
EXEEXT=.nlm
endif
ifeq ($(OS_TARGET),macos)
PPUEXT=.ppu
ASMEXT=.s
OEXT=.o
SMARTEXT=.sl
STATICLIBEXT=.a
EXEEXT=
FPCMADE=fpcmade.mcc
endif
ifndef ECHO
ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(ECHO),)
@ -882,6 +895,24 @@ REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_FCL=1
REQUIRE_PACKAGES_REGEXPR=1
endif
ifeq ($(OS_TARGET),palmos)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_FCL=1
REQUIRE_PACKAGES_REGEXPR=1
endif
ifeq ($(OS_TARGET),macos)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_FCL=1
REQUIRE_PACKAGES_REGEXPR=1
endif
ifeq ($(OS_TARGET),macosx)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_FCL=1
REQUIRE_PACKAGES_REGEXPR=1
endif
ifdef REQUIRE_PACKAGES_RTL
PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
ifneq ($(PACKAGEDIR_RTL),)
@ -1154,6 +1185,11 @@ override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
endif
endif
ifeq ($(OS_TARGET),linux)
ifeq ($(FPC_VERSION),1.0.6)
override FPCOPTDEF+=HASUNIX
endif
endif
ifdef GCCLIBDIR
override FPCOPT+=-Fl$(GCCLIBDIR)
endif
@ -1476,6 +1512,7 @@ fpc_baseinfo:
@$(ECHO) Rm........ $(RMPROG)
@$(ECHO) GInstall.. $(GINSTALL)
@$(ECHO) Echo...... $(ECHO)
@$(ECHO) Shell..... $(SHELL)
@$(ECHO) Date...... $(DATE)
@$(ECHO) FPCMake... $(FPCMAKE)
@$(ECHO) PPUMove... $(PPUMOVE)
@ -1750,6 +1787,8 @@ cleanide:
$(DEL) $(wildcard ./designer/*$(PPUEXT))
$(DEL) $(wildcard ./debugger/*$(OEXT))
$(DEL) $(wildcard ./debugger/*$(PPUEXT))
$(DEL) $(wildcard ./packager/*$(OEXT))
$(DEL) $(wildcard ./packager/*$(PPUEXT))
ifeq ($(OS_TARGET), win32)
$(DEL) $(wildcard *.res)
$(DEL) lazarus.owr

View File

@ -18,7 +18,7 @@ exampledirs=examples
options=-gl
unitdir=components/custom \
lcl/units lcl/units/$(LCL_PLATFORM) designer designer/units debugger \
components/units .
packager components/units .
includedir=include include/$(OS_TARGET)
targetdir=.
@ -70,6 +70,8 @@ cleanide:
$(DEL) $(wildcard ./designer/*$(PPUEXT))
$(DEL) $(wildcard ./debugger/*$(OEXT))
$(DEL) $(wildcard ./debugger/*$(PPUEXT))
$(DEL) $(wildcard ./packager/*$(OEXT))
$(DEL) $(wildcard ./packager/*$(PPUEXT))
ifeq ($(OS_TARGET), win32)
$(DEL) $(wildcard *.res)
$(DEL) lazarus.owr

View File

@ -182,6 +182,7 @@ ResourceString
ctsCustomComponentsDirectory = 'Custom Components Directory';
ctsToolsDirectory = 'Tools Directory';
ctsDesignerDirectory = 'Designer Directory';
ctsPackagerDirectory = 'Packager Directory';
ctsLazarusMainDirectory = 'lazarus main directory';
ctsDebuggerDirectory = 'Debugger Directory';
ctsLazarusSources = 'Lazarus Sources';

View File

@ -2470,6 +2470,7 @@ begin
'designer;'
+'designer'+ds+'jitform;'
+'debugger;'
+'packager;'
+'components'+ds+'synedit;'
+'components'+ds+'codetools;'
+'components'+ds+'custom;'
@ -2484,6 +2485,84 @@ begin
MainDir.AddChild(TDefineTemplate.Create('Nested Comments',
ctsNestedCommentsOn,ExternalMacroStart+'NestedComments','',da_DefineRecurse));
// include
// designer
DirTempl:=TDefineTemplate.Create('Designer',ctsDesignerDirectory,
'','designer',da_Directory);
DirTempl.AddChild(TDefineTemplate.Create('LCL path addition',
Format(ctsAddsDirToSourcePath,['lcl']),
ExternalMacroStart+'SrcPath',
'..'+ds+'lcl'
+';..'+ds+'lcl'+ds+'interfaces'+ds+WidgetType
+';'+SrcPath
,da_Define));
DirTempl.AddChild(TDefineTemplate.Create('main path addition',
Format(ctsAddsDirToSourcePath,[ctsLazarusMainDirectory]),
ExternalMacroStart+'SrcPath',
'..;'+SrcPath
,da_Define));
DirTempl.AddChild(TDefineTemplate.Create('components path addition',
Format(ctsAddsDirToSourcePath,['synedit']),
ExternalMacroStart+'SrcPath',
'..'+ds+'components'+ds+'synedit;'
+'..'+ds+'components'+ds+'codetools;'
+'..'+ds+'components'+ds+'custom;'
+'jitform;'
+SrcPath
,da_Define));
DirTempl.AddChild(TDefineTemplate.Create('includepath addition',
Format(ctsIncludeDirectoriesPlusDirs,['include']),
ExternalMacroStart+'IncPath',
'..'+ds+'include;..'+ds+'include'+ds+TargetOS,
da_Define));
MainDir.AddChild(DirTempl);
// images
// debugger
DirTempl:=TDefineTemplate.Create('Debugger',ctsDebuggerDirectory,
'','debugger',da_Directory);
DirTempl.AddChild(TDefineTemplate.Create('LCL path addition',
Format(ctsAddsDirToSourcePath,['lcl']),
ExternalMacroStart+'SrcPath',
'..'+ds+'lcl'
+';..'+ds+'lcl'+ds+'interfaces'+ds+WidgetType
+';'+SrcPath
,da_DefineRecurse));
MainDir.AddChild(DirTempl);
// packager
DirTempl:=TDefineTemplate.Create('Packager',ctsDesignerDirectory,
'','packager',da_Directory);
DirTempl.AddChild(TDefineTemplate.Create('LCL path addition',
Format(ctsAddsDirToSourcePath,['lcl']),
ExternalMacroStart+'SrcPath',
'..'+ds+'lcl'
+';..'+ds+'lcl'+ds+'interfaces'+ds+WidgetType
+';'+SrcPath
,da_Define));
DirTempl.AddChild(TDefineTemplate.Create('main path addition',
Format(ctsAddsDirToSourcePath,[ctsLazarusMainDirectory]),
ExternalMacroStart+'SrcPath',
'..;'+SrcPath
,da_Define));
DirTempl.AddChild(TDefineTemplate.Create('components path addition',
Format(ctsAddsDirToSourcePath,['synedit']),
ExternalMacroStart+'SrcPath',
'..'+ds+'components'+ds+'synedit;'
+'..'+ds+'components'+ds+'codetools;'
+'..'+ds+'components'+ds+'custom;'
+SrcPath
,da_Define));
DirTempl.AddChild(TDefineTemplate.Create('includepath addition',
Format(ctsIncludeDirectoriesPlusDirs,['include']),
ExternalMacroStart+'IncPath',
'..'+ds+'include;..'+ds+'include'+ds+TargetOS,
da_Define));
MainDir.AddChild(DirTempl);
// examples
DirTempl:=TDefineTemplate.Create('Examples',
Format(ctsNamedDirectory,['Examples']),
@ -2592,54 +2671,6 @@ begin
,da_Define));
MainDir.AddChild(DirTempl);
// include
// designer
DirTempl:=TDefineTemplate.Create('Designer',ctsDesignerDirectory,
'','designer',da_Directory);
DirTempl.AddChild(TDefineTemplate.Create('LCL path addition',
Format(ctsAddsDirToSourcePath,['lcl']),
ExternalMacroStart+'SrcPath',
'..'+ds+'lcl'
+';..'+ds+'lcl'+ds+'interfaces'+ds+WidgetType
+';'+SrcPath
,da_Define));
DirTempl.AddChild(TDefineTemplate.Create('main path addition',
Format(ctsAddsDirToSourcePath,[ctsLazarusMainDirectory]),
ExternalMacroStart+'SrcPath',
'..;'+SrcPath
,da_Define));
DirTempl.AddChild(TDefineTemplate.Create('components path addition',
Format(ctsAddsDirToSourcePath,['synedit']),
ExternalMacroStart+'SrcPath',
'..'+ds+'components'+ds+'synedit;'
+'..'+ds+'components'+ds+'codetools;'
+'..'+ds+'components'+ds+'custom;'
+'jitform;'
+SrcPath
,da_Define));
DirTempl.AddChild(TDefineTemplate.Create('includepath addition',
Format(ctsIncludeDirectoriesPlusDirs,['include']),
ExternalMacroStart+'IncPath',
'..'+ds+'include;..'+ds+'include'+ds+TargetOS,
da_Define));
MainDir.AddChild(DirTempl);
// images
// debugger
DirTempl:=TDefineTemplate.Create('Debugger',ctsDebuggerDirectory,
'','debugger',da_Directory);
DirTempl.AddChild(TDefineTemplate.Create('LCL path addition',
Format(ctsAddsDirToSourcePath,['lcl']),
ExternalMacroStart+'SrcPath',
'..'+ds+'lcl'
+';..'+ds+'lcl'+ds+'interfaces'+ds+WidgetType
+';'+SrcPath
,da_DefineRecurse));
MainDir.AddChild(DirTempl);
if MainDir<>nil then begin
Result:=TDefineTemplate.Create(StdDefTemplLazarusSources,
ctsLazarusSources,'','',da_Block);

View File

@ -46,16 +46,16 @@ uses
LazarusIDEStrConsts;
type
{ Compiler Options object used to hold the compiler options }
{ TBaseCompilerOptions }
TCompilerOptions = class(TObject)
TBaseCompilerOptions = class(TObject)
private
FModified: boolean;
FOnModified: TNotifyEvent;
fOptionsString: String;
xmlconfig: TXMLConfig;
fProjectFile: String;
fXMLFile: String;
fTargetFilename: string;
fLoaded: Boolean;
@ -135,17 +135,19 @@ type
fConfigFilePath: String;
fCustomOptions: string;
procedure LoadTheCompilerOptions;
procedure SaveTheCompilerOptions;
procedure LoadTheCompilerOptions(const Path: string);
procedure SaveTheCompilerOptions(const Path: string);
procedure SetModified(const AValue: boolean);
public
constructor Create;
destructor Destroy; override;
procedure LoadFromXMLConfig(AXMLConfig: TXMLConfig; const Path: string);
procedure SaveToXMLConfig(AXMLConfig: TXMLConfig; const Path: string);
procedure LoadCompilerOptions(UseExistingFile: Boolean);
procedure SaveCompilerOptions(UseExistingFile: Boolean);
procedure Assign(CompOpts: TCompilerOptions);
function IsEqual(CompOpts: TCompilerOptions): boolean;
procedure Assign(CompOpts: TBaseCompilerOptions);
function IsEqual(CompOpts: TBaseCompilerOptions): boolean;
function MakeOptionsString: String;
function MakeOptionsString(const MainSourceFileName: string): String;
@ -159,7 +161,7 @@ type
property Modified: boolean read FModified write SetModified;
property OnModified: TNotifyEvent read FOnModified write FOnModified;
property ProjectFile: String read fProjectFile write fProjectFile;
property XMLFile: String read fXMLFile write fXMLFile;
property TargetFilename: String read fTargetFilename write fTargetFilename;
property XMLConfigFile: TXMLConfig read xmlconfig write xmlconfig;
property Loaded: Boolean read fLoaded write fLoaded;
@ -242,8 +244,49 @@ type
property ConfigFilePath: String read fConfigFilePath write fConfigFilePath;
property CustomOptions: string read fCustomOptions write fCustomOptions;
end;
{ TAdditionalCompilerOptions
Additional Compiler options are used by packages to define, what a project
or a package or the IDE needs to use the package.
}
TAdditionalCompilerOptions = class
private
FCustomOptions: string;
FIncludePath: string;
FLibraryPath: string;
FLinkerOptions: string;
FObjectPath: string;
FUnitPath: string;
procedure SetCustomOptions(const AValue: string);
procedure SetIncludePath(const AValue: string);
procedure SetLibraryPath(const AValue: string);
procedure SetLinkerOptions(const AValue: string);
procedure SetObjectPath(const AValue: string);
procedure SetUnitPath(const AValue: string);
public
constructor Create;
destructor Destroy; override;
procedure Clear;
procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string);
procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string);
public
property UnitPath: string read FUnitPath write SetUnitPath;
property IncludePath: string read FIncludePath write SetIncludePath;
property ObjectPath: string read FObjectPath write SetObjectPath;
property LibraryPath: string read FLibraryPath write SetLibraryPath;
property LinkerOptions: string read FLinkerOptions write SetLinkerOptions;
property CustomOptions: string read FCustomOptions write SetCustomOptions;
end;
{ TCompilerOptions }
TCompilerOptions = class(TBaseCompilerOptions)
end;
{ Compiler options form }
TfrmCompilerOptions = class(TForm)
@ -399,7 +442,7 @@ type
function GetOtherSourcePath: string;
procedure SetOtherSourcePath(const AValue: string);
public
CompilerOpts: TCompilerOptions;
CompilerOpts: TBaseCompilerOptions;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
@ -425,9 +468,9 @@ const
Config_Filename = 'compileroptions.xml';
{------------------------------------------------------------------------------}
{ TCompilerOptions Constructor }
{ TBaseCompilerOptions Constructor }
{------------------------------------------------------------------------------}
constructor TCompilerOptions.Create;
constructor TBaseCompilerOptions.Create;
begin
inherited Create;
Assert(False, 'Trace:Compiler Options Class Created');
@ -436,29 +479,51 @@ begin
end;
{------------------------------------------------------------------------------}
{ TCompilerOptions Destructor }
{ TBaseCompilerOptions Destructor }
{------------------------------------------------------------------------------}
destructor TCompilerOptions.Destroy;
destructor TBaseCompilerOptions.Destroy;
begin
inherited Destroy;
end;
{------------------------------------------------------------------------------}
{ TfrmCompilerOptions LoadCompilerOptions }
{------------------------------------------------------------------------------}
procedure TCompilerOptions.LoadCompilerOptions(UseExistingFile: Boolean);
{------------------------------------------------------------------------------
procedure TBaseCompilerOptions.LoadFromXMLConfig(AXMLConfig: TXMLConfig;
const Path: string);
------------------------------------------------------------------------------}
procedure TBaseCompilerOptions.LoadFromXMLConfig(AXMLConfig: TXMLConfig;
const Path: string);
begin
XMLConfigFile := AXMLConfig;
LoadTheCompilerOptions(Path);
end;
{------------------------------------------------------------------------------
procedure TBaseCompilerOptions.SaveToXMLConfig(XMLConfig: TXMLConfig;
const Path: string);
------------------------------------------------------------------------------}
procedure TBaseCompilerOptions.SaveToXMLConfig(AXMLConfig: TXMLConfig;
const Path: string);
begin
XMLConfigFile := AXMLConfig;
SaveTheCompilerOptions(Path);
end;
{------------------------------------------------------------------------------
TfrmCompilerOptions LoadCompilerOptions
------------------------------------------------------------------------------}
procedure TBaseCompilerOptions.LoadCompilerOptions(UseExistingFile: Boolean);
var
confPath: String;
begin
if (UseExistingFile and (XMLConfigFile <> nil)) then
begin
LoadTheCompilerOptions;
LoadTheCompilerOptions('');
end
else
begin
confPath := GetXMLConfigPath;
XMLConfigFile := TXMLConfig.Create(SetDirSeparators(confPath));
LoadTheCompilerOptions;
LoadTheCompilerOptions('');
XMLConfigFile.Free;
XMLConfigFile := nil;
end;
@ -468,14 +533,17 @@ end;
{------------------------------------------------------------------------------}
{ TfrmCompilerOptions LoadTheCompilerOptions }
{------------------------------------------------------------------------------}
procedure TCompilerOptions.LoadTheCompilerOptions;
procedure TBaseCompilerOptions.LoadTheCompilerOptions(const Path: string);
var
p: String;
begin
{ Load the compiler options from the XML file }
if Path='' then
p:='CompilerOptions/Target/'
else
p:=Path;
{ Target }
p:='CompilerOptions/Target/';
TargetFilename := XMLConfigFile.GetValue(p+'Filename/Value', '');
{ SearchPaths }
@ -562,19 +630,19 @@ end;
{------------------------------------------------------------------------------}
{ TfrmCompilerOptions SaveCompilerOptions }
{------------------------------------------------------------------------------}
procedure TCompilerOptions.SaveCompilerOptions(UseExistingFile: Boolean);
procedure TBaseCompilerOptions.SaveCompilerOptions(UseExistingFile: Boolean);
var
confPath: String;
begin
if ((UseExistingFile) and (XMLConfigFile <> nil)) then
begin
SaveTheCompilerOptions;
SaveTheCompilerOptions('');
end
else
begin
confPath := GetXMLConfigPath;
XMLConfigFile := TXMLConfig.Create(SetDirSeparators(confPath));
SaveTheCompilerOptions;
SaveTheCompilerOptions('');
XMLConfigFile.Free;
XMLConfigFile := nil;
end;
@ -584,14 +652,17 @@ end;
{------------------------------------------------------------------------------}
{ TfrmCompilerOptions SaveTheCompilerOptions }
{------------------------------------------------------------------------------}
procedure TCompilerOptions.SaveTheCompilerOptions;
procedure TBaseCompilerOptions.SaveTheCompilerOptions(const Path: string);
var
P: string;
begin
{ Save the compiler options to the XML file }
if Path='' then
p:='CompilerOptions/Target/'
else
p:=Path;
{ Target }
p:='CompilerOptions/Target/';
XMLConfigFile.SetDeleteValue(p+'Filename/Value', TargetFilename,'');
{ SearchPaths }
@ -677,7 +748,7 @@ begin
XMLConfigFile.Flush;
end;
procedure TCompilerOptions.SetModified(const AValue: boolean);
procedure TBaseCompilerOptions.SetModified(const AValue: boolean);
begin
if FModified=AValue then exit;
FModified:=AValue;
@ -686,37 +757,33 @@ begin
end;
{------------------------------------------------------------------------------}
{ TCompilerOptions CreateTargetFilename }
{ TBaseCompilerOptions CreateTargetFilename }
{------------------------------------------------------------------------------}
function TCompilerOptions.CreateTargetFilename(
function TBaseCompilerOptions.CreateTargetFilename(
const MainSourceFileName: string): string;
var Ext: string;
begin
if (TargetFilename <> '') then begin
Result:=ExtractFilePath(MainSourceFileName)+TargetFilename;
end else begin
if MainSourceFileName<>'' then begin
Result:=ExtractFileName(MainSourceFileName);
Ext:=ExtractFileExt(Result);
Result:=copy(Result,1,length(Result)-length(Ext));
Result:=lowercase(Result);
if fTargetOS = 'win32'
then Result:=Result+'.exe';
Result:=ExtractFileNameOnly(MainSourceFileName);
if Result<>'' then begin
Result:=ExtractFilePath(MainSourceFileName)+Result;
if fTargetOS = 'win32' then
Result:=Result+'.exe';
end else
Result:='';
end;
end;
{------------------------------------------------------------------------------}
{ TCompilerOptions MakeOptionsString }
{ TBaseCompilerOptions MakeOptionsString }
{------------------------------------------------------------------------------}
function TCompilerOptions.MakeOptionsString: String;
function TBaseCompilerOptions.MakeOptionsString: String;
begin
Result:=MakeOptionsString('')
end;
function TCompilerOptions.MakeOptionsString(
function TBaseCompilerOptions.MakeOptionsString(
const MainSourceFilename: string): String;
var
switches, tempsw: String;
@ -1182,7 +1249,7 @@ begin
Result := fOptionsString;
end;
function TCompilerOptions.CustomOptionsAsString: string;
function TBaseCompilerOptions.CustomOptionsAsString: string;
var
i: Integer;
begin
@ -1195,9 +1262,9 @@ begin
end;
{------------------------------------------------------------------------------}
{ TCompilerOptions ParseSearchPaths }
{ TBaseCompilerOptions ParseSearchPaths }
{------------------------------------------------------------------------------}
function TCompilerOptions.ParseSearchPaths(const switch, paths: String): String;
function TBaseCompilerOptions.ParseSearchPaths(const switch, paths: String): String;
var
tempsw, SS, Delim: String;
M: Integer;
@ -1241,9 +1308,9 @@ begin
end;
{------------------------------------------------------------------------------
TCompilerOptions ParseOptions
TBaseCompilerOptions ParseOptions
------------------------------------------------------------------------------}
function TCompilerOptions.ParseOptions(const Delim, Switch,
function TBaseCompilerOptions.ParseOptions(const Delim, Switch,
OptionStr: string): string;
var Startpos, EndPos: integer;
begin
@ -1261,16 +1328,15 @@ begin
end;
{------------------------------------------------------------------------------
TCompilerOptions GetXMLConfigPath
TBaseCompilerOptions GetXMLConfigPath
------------------------------------------------------------------------------}
function TCompilerOptions.GetXMLConfigPath: String;
function TBaseCompilerOptions.GetXMLConfigPath: String;
var
fn: String;
begin
// Setup the filename to write to
if (ProjectFile <> '') then
fn := ProjectFile
else
fn := XMLFile;
if (fn = '') then
fn := Config_Filename;
Result := GetPrimaryConfigPath + '/' + fn;
CopySecondaryConfigFile(fn);
@ -1278,9 +1344,9 @@ end;
{------------------------------------------------------------------------------}
{ TCompilerOptions Clear }
{ TBaseCompilerOptions Clear }
{------------------------------------------------------------------------------}
procedure TCompilerOptions.Clear;
procedure TBaseCompilerOptions.Clear;
begin
fOptionsString := '';
fLoaded := false;
@ -1361,7 +1427,7 @@ begin
fCustomOptions := '';
end;
procedure TCompilerOptions.Assign(CompOpts: TCompilerOptions);
procedure TBaseCompilerOptions.Assign(CompOpts: TBaseCompilerOptions);
begin
fOptionsString := CompOpts.fOptionsString;
fLoaded := CompOpts.fLoaded;
@ -1441,7 +1507,7 @@ begin
fCustomOptions := CompOpts.fCustomOptions;
end;
function TCompilerOptions.IsEqual(CompOpts: TCompilerOptions): boolean;
function TBaseCompilerOptions.IsEqual(CompOpts: TBaseCompilerOptions): boolean;
begin
Result:=
// search paths
@ -1797,11 +1863,11 @@ var
code: LongInt;
hs: LongInt;
i: integer;
OldCompOpts: TCompilerOptions;
OldCompOpts: TBaseCompilerOptions;
begin
{ Put the compiler options into the TCompilerOptions class to be saved }
OldCompOpts:=TCompilerOptions.Create;
OldCompOpts:=TBaseCompilerOptions.Create;
OldCompOpts.Assign(CompilerOpts);
if (radStyleIntel.Checked) then
@ -3336,5 +3402,86 @@ begin
end;
{ TAdditionalCompilerOptions }
procedure TAdditionalCompilerOptions.SetCustomOptions(const AValue: string);
begin
if FCustomOptions=AValue then exit;
FCustomOptions:=AValue;
end;
procedure TAdditionalCompilerOptions.SetIncludePath(const AValue: string);
begin
if FIncludePath=AValue then exit;
FIncludePath:=AValue;
end;
procedure TAdditionalCompilerOptions.SetLibraryPath(const AValue: string);
begin
if FLibraryPath=AValue then exit;
FLibraryPath:=AValue;
end;
procedure TAdditionalCompilerOptions.SetLinkerOptions(const AValue: string);
begin
if FLinkerOptions=AValue then exit;
FLinkerOptions:=AValue;
end;
procedure TAdditionalCompilerOptions.SetObjectPath(const AValue: string);
begin
if FObjectPath=AValue then exit;
FObjectPath:=AValue;
end;
procedure TAdditionalCompilerOptions.SetUnitPath(const AValue: string);
begin
if FUnitPath=AValue then exit;
FUnitPath:=AValue;
end;
constructor TAdditionalCompilerOptions.Create;
begin
Clear;
end;
destructor TAdditionalCompilerOptions.Destroy;
begin
inherited Destroy;
end;
procedure TAdditionalCompilerOptions.Clear;
begin
FCustomOptions:='';
FIncludePath:='';
FLibraryPath:='';
FLinkerOptions:='';
FObjectPath:='';
FUnitPath:='';
end;
procedure TAdditionalCompilerOptions.LoadFromXMLConfig(XMLConfig: TXMLConfig;
const Path: string);
begin
Clear;
fCustomOptions:=XMLConfig.GetValue(Path+'CustomOptions/Value','');
FIncludePath:=XMLConfig.GetValue(Path+'IncludePath/Value','');
FLibraryPath:=XMLConfig.GetValue(Path+'LibraryPath/Value','');
fLinkerOptions:=XMLConfig.GetValue(Path+'LinkerOptions/Value','');
FObjectPath:=XMLConfig.GetValue(Path+'ObjectPath/Value','');
FUnitPath:=XMLConfig.GetValue(Path+'UnitPath/Value','');
end;
procedure TAdditionalCompilerOptions.SaveToXMLConfig(XMLConfig: TXMLConfig;
const Path: string);
begin
XMLConfig.SetDeleteValue(Path+'CustomOptions/Value',fCustomOptions,'');
XMLConfig.SetDeleteValue(Path+'IncludePath/Value',FIncludePath,'');
XMLConfig.SetDeleteValue(Path+'LibraryPath/Value',FLibraryPath,'');
XMLConfig.SetDeleteValue(Path+'LinkerOptions/Value',fLinkerOptions,'');
XMLConfig.SetDeleteValue(Path+'ObjectPath/Value',FObjectPath,'');
XMLConfig.SetDeleteValue(Path+'UnitPath/Value',FUnitPath,'');
end;
end.

View File

@ -109,14 +109,14 @@ const
ecNew = ecUserFirst + 201;
ecNewUnit = ecUserFirst + 202;
ecNewForm = ecUserFirst + 203;
ecOpen = ecUserFirst + 204;
ecRevert = ecUserFirst + 205;
ecSave = ecUserFirst + 206;
ecSaveAs = ecUserFirst + 207;
ecSaveAll = ecUserFirst + 208;
ecClose = ecUserFirst + 209;
ecCloseAll = ecUserFirst + 210;
ecQuit = ecUserFirst + 211;
ecOpen = ecUserFirst + 205;
ecRevert = ecUserFirst + 206;
ecSave = ecUserFirst + 207;
ecSaveAs = ecUserFirst + 208;
ecSaveAll = ecUserFirst + 209;
ecClose = ecUserFirst + 210;
ecCloseAll = ecUserFirst + 211;
ecQuit = ecUserFirst + 212;
ecJumpToEditor = ecUserFirst + 300;
ecToggleFormUnit = ecUserFirst + 301;

View File

@ -104,6 +104,7 @@ resourcestring
lisMenuNewUnit = 'New Unit';
lisMenuNewForm = 'New Form';
lisMenuNewOther = 'New ...';
lisMenuOpen = 'Open';
lisMenuRevert = 'Revert';
lisMenuOpenRecent = 'Open Recent';

View File

@ -79,14 +79,15 @@ type
TSaveFlags = set of TSaveFlag;
// open file flags
TOpenFlag = (ofProjectLoading,// this open is part of opening a whole project
ofOnlyIfExists, // do not auto create non existing files
ofRevert, // reload file if already open
ofQuiet, // less messages
ofAddToRecent, // add file to recent files
ofRegularFile, // open as regular file (e.g. not a whole project)
ofVirtualFile // open the virtual file
);
TOpenFlag = (
ofProjectLoading,// this open is part of opening a whole project
ofOnlyIfExists, // do not auto create non existing files
ofRevert, // reload file if already open
ofQuiet, // less messages
ofAddToRecent, // add file to recent files
ofRegularFile, // open as regular file (e.g. not a whole project)
ofVirtualFile // open the virtual file
);
TOpenFlags = set of TOpenFlag;
// revert file flags
@ -146,8 +147,9 @@ type
mnuWindows: TMenuItem;
mnuHelp: TMenuItem;
itmFileNewUnit : TMenuItem;
itmFileNewForm : TMenuItem;
itmFileNewUnit: TMenuItem;
itmFileNewForm: TMenuItem;
itmFileNewOther: TMenuItem;
itmFileOpen: TMenuItem;
itmFileRevert: TMenuItem;
itmFileRecentOpen: TMenuItem;
@ -421,6 +423,13 @@ begin
itmFileNewForm.Graphic:=LoadPixmap('menu_new');
mnuFile.Add(itmFileNewForm);
itmFileNewOther := TMenuItem.Create(Self);
itmFileNewOther.Name:='itmFileNewOther';
itmFileNewOther.Caption := lisMenuNewOther;
itmFileNewOther.Graphic:=LoadPixmap('menu_new');
itmFileNewOther.Enabled:=false;
mnuFile.Add(itmFileNewOther);
mnuFile.Add(CreateMenuSeparator);
itmFileOpen := TMenuItem.Create(Self);
@ -1028,7 +1037,7 @@ begin
itmToolMakeResourceString := TMenuItem.Create(Self);
itmToolMakeResourceString.Name:='itmToolMakeResourceString';
itmToolMakeResourceString.Caption := lisMenuMakeResourceString;
//itmToolMakeResourceString.Enabled:=false;
itmToolMakeResourceString.Enabled:=false;
mnuTools.Add(itmToolMakeResourceString);
mnuTools.Add(CreateMenuSeparator);
@ -1097,6 +1106,7 @@ begin
with EditorOpts.KeyMap do begin
itmFileNewUnit.ShortCut:=CommandToShortCut(ecNewUnit);
itmFileNewForm.ShortCut:=CommandToShortCut(ecNewForm);
itmFileNewOther.ShortCut:=CommandToShortCut(ecNew);
itmFileOpen.ShortCut:=CommandToShortCut(ecOpen);
itmFileRevert.ShortCut:=CommandToShortCut(ecRevert);
//itmFileRecentOpen.ShortCut:=CommandToShortCut(ec);

View File

@ -49,7 +49,8 @@ uses
{$ENDIF}
Classes, SysUtils, LCLLinux, LCLType, Laz_XMLCfg, LazConf, CompilerOptions,
FileCtrl, CodeToolManager, CodeCache, Forms, Controls, EditorOptions, Dialogs,
IDEProcs, RunParamsOpts, ProjectDefs, EditDefineTree, DefineTemplates;
IDEProcs, RunParamsOpts, ProjectDefs, EditDefineTree, DefineTemplates,
PackageDefs;
type
TUnitInfo = class;
@ -1216,7 +1217,6 @@ begin
// Save the compiler options
CompilerOptions.XMLConfigFile := xmlconfig;
CompilerOptions.ProjectFile := confPath;
CompilerOptions.SaveCompilerOptions(true);
// save the Publish Options
@ -1315,7 +1315,6 @@ begin
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TProject.ReadProject E reading comp sets');{$ENDIF}
// Load the compiler options
CompilerOptions.XMLConfigFile := xmlconfig;
CompilerOptions.ProjectFile := MainFilename;
CompilerOptions.LoadCompilerOptions(true);
CreateProjectDefineTemplate(CompilerOptions,FSrcPath);
@ -2203,6 +2202,9 @@ end.
{
$Log$
Revision 1.92 2003/02/28 10:14:28 mattias
started package system (packager)
Revision 1.91 2003/02/26 12:44:52 mattias
readonly flag is now only saved if user set

View File

@ -370,7 +370,7 @@ begin
else
Pages.Add(dlgRunOLocal);
Pages.Add(dlgRunOEnvironment);
Visible:=true;
PageIndex:=0;
end;
SetupLocalPage;
@ -434,7 +434,6 @@ begin
Parent:=NoteBook.Page[0];
SetBounds(
5,CmdLineParametersGroupBox.Top+CmdLineParametersGroupBox.Height+10,w,60);
Visible:=true;
end;
UseLaunchingApplicationCheckBox:=TCheckBox.Create(Self);
@ -443,9 +442,7 @@ begin
Parent:=NoteBook.Page[0];
SetBounds(15,
CmdLineParametersGroupBox.Top+CmdLineParametersGroupBox.Height+10,245,25);
Caption:=dlgUseLaunchingApp ;
Checked:=false;
Visible:=true;
Caption:=dlgUseLaunchingApp;
end;
UseLaunchingApplicationComboBox:=TComboBox.Create(Self);