From 5c631902b80d72ffedaccacc817ec2b4fd6a9b4e Mon Sep 17 00:00:00 2001 From: lazarus Date: Fri, 10 May 2002 13:05:25 +0000 Subject: [PATCH] MG: added extra options to build lazarus git-svn-id: trunk@1673 - --- Makefile | 17 +++++- Makefile.fpc | 8 ++- ide/buildlazdialog.pas | 122 +++++++++++++++++++++++++++++++-------- ide/codetoolsdefines.pas | 1 - 4 files changed, 120 insertions(+), 28 deletions(-) diff --git a/Makefile b/Makefile index 581956a411..6af32eb347 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # -# Don't edit, this file is generated by FPCMake Version 1.1 [2002/03/25] +# Don't edit, this file is generated by FPCMake Version 1.1 [2002/04/22] # default: all MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware @@ -529,6 +529,18 @@ EXEEXT= FPCMADE=fpcmade.qnx ZIPSUFFIX=qnx endif +ifeq ($(OS_TARGET),netware) +STATICLIBPREFIX= +PPUEXT=.ppn +OEXT=.on +ASMEXT=.s +SMARTEXT=.sl +STATICLIBEXT=.a +SHAREDLIBEXT=.nlm +FPCMADE=fpcmade.nw +ZIPSUFFIX=nw +EXEEXT=.nlm +endif ifndef ECHO ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH)))) ifeq ($(ECHO),) @@ -1644,7 +1656,7 @@ endif $(MAKE) --assume-new=lazarus.pp lazarus$(EXEEXT) tools: lcl components tools_all all: lcl components ide -clean: cleanall +cleanide: $(DEL) $(wildcard ./designer/*$(OEXT)) $(DEL) $(wildcard ./designer/*$(PPUEXT)) $(DEL) $(wildcard ./debugger/*$(OEXT)) @@ -1653,3 +1665,4 @@ ifeq ($(OS_TARGET), win32) $(DEL) $(wildcard *.res) $(DEL) lazarus.owr endif +clean: cleanall cleanide diff --git a/Makefile.fpc b/Makefile.fpc index 5fd7f97caf..f2caf8f61a 100644 --- a/Makefile.fpc +++ b/Makefile.fpc @@ -59,7 +59,7 @@ tools: lcl components tools_all all: lcl components ide -clean: cleanall +cleanide: $(DEL) $(wildcard ./designer/*$(OEXT)) $(DEL) $(wildcard ./designer/*$(PPUEXT)) $(DEL) $(wildcard ./debugger/*$(OEXT)) @@ -68,3 +68,9 @@ ifeq ($(OS_TARGET), win32) $(DEL) $(wildcard *.res) $(DEL) lazarus.owr endif + +clean: cleanall cleanide + + + + diff --git a/ide/buildlazdialog.pas b/ide/buildlazdialog.pas index 24ef554dd1..7b4f29b2cc 100644 --- a/ide/buildlazdialog.pas +++ b/ide/buildlazdialog.pas @@ -43,32 +43,40 @@ type TBuildLazarusOptions = class private fBuildLCL: TMakeMode; + fBuildComponents: TMakeMode; fBuildSynEdit: TMakeMode; fBuildCodeTools: TMakeMode; fBuildIDE: TMakeMode; fBuildExamples: TMakeMode; fCleanAll: boolean; fMakeFilename: string; + fExtraOptions: string; public constructor Create; procedure Load(XMLConfig: TXMLConfig; const Path: string); procedure Save(XMLConfig: TXMLConfig; const Path: string); property BuildLCL: TMakeMode read fBuildLCL write fBuildLCL; + property BuildComponents: TMakeMode + read fBuildComponents write fBuildComponents; property BuildSynEdit: TMakeMode read fBuildSynEdit write fBuildSynEdit; property BuildCodeTools: TMakeMode read fBuildCodeTools write fBuildCodeTools; property BuildIDE: TMakeMode read fBuildIDE write fBuildIDE; property BuildExamples: TMakeMode read fBuildExamples write fBuildExamples; property CleanAll: boolean read fCleanAll write fCleanAll; property MakeFilename: string read fMakeFilename write fMakeFilename; + property ExtraOptions: string read fExtraOptions write fExtraOptions; end; TConfigureBuildLazarusDlg = class(TForm) CleanAllCheckBox: TCheckBox; BuildLCLRadioGroup: TRadioGroup; + BuildComponentsRadioGroup: TRadioGroup; BuildSynEditRadioGroup: TRadioGroup; BuildCodeToolsRadioGroup: TRadioGroup; BuildIDERadioGroup: TRadioGroup; BuildExamplesRadioGroup: TRadioGroup; + OptionsLabel: TLabel; + OptionsEdit: TEdit; OkButton: TButton; CancelButton: TButton; procedure ConfigureBuildLazarusDlgResize(Sender: TObject); @@ -126,6 +134,17 @@ function BuildLazarus(Options: TBuildLazarusOptions; ExternalTools: TExternalToolList; Macros: TTransferMacroList): TModalResult; var Tool: TExternalToolOptions; + + procedure SetMakeParams(MakeMode: TMakeMode; ExtraOpts: string); + begin + if MakeMode=mmBuild then + Tool.CmdLineParams:='all' + else + Tool.CmdLineParams:='clean all'; + if ExtraOpts<>'' then + Tool.CmdLineParams:='OPT='''+ExtraOpts+''' '+Tool.CmdLineParams; + end; + begin Result:=mrCancel; Tool:=TExternalToolOptions.Create; @@ -145,10 +164,15 @@ begin // build lcl Tool.Title:='Build LCL'; Tool.WorkingDirectory:='$(LazarusDir)/lcl'; - if Options.BuildLCL=mmBuild then - Tool.CmdLineParams:='' - else - Tool.CmdLineParams:='clean all'; + SetMakeParams(Options.BuildLCL,Options.ExtraOptions); + Result:=ExternalTools.Run(Tool,Macros); + if Result<>mrOk then exit; + end; + if Options.BuildComponents<>mmNone then begin + // build components + Tool.Title:='Build Component'; + Tool.WorkingDirectory:='$(LazarusDir)/components'; + SetMakeParams(Options.BuildComponents,Options.ExtraOptions); Result:=ExternalTools.Run(Tool,Macros); if Result<>mrOk then exit; end; @@ -156,10 +180,7 @@ begin // build SynEdit Tool.Title:='Build SynEdit'; Tool.WorkingDirectory:='$(LazarusDir)/components/synedit'; - if Options.BuildSynEdit=mmBuild then - Tool.CmdLineParams:='' - else - Tool.CmdLineParams:='clean all'; + SetMakeParams(Options.BuildSynEdit,Options.ExtraOptions); Result:=ExternalTools.Run(Tool,Macros); if Result<>mrOk then exit; end; @@ -167,10 +188,7 @@ begin // build CodeTools Tool.Title:='Build CodeTools'; Tool.WorkingDirectory:='$(LazarusDir)/components/codetools'; - if Options.BuildCodeTools=mmBuild then - Tool.CmdLineParams:='' - else - Tool.CmdLineParams:='clean all'; + SetMakeParams(Options.BuildCodeTools,Options.ExtraOptions); Result:=ExternalTools.Run(Tool,Macros); if Result<>mrOk then exit; end; @@ -178,11 +196,14 @@ begin // build IDE Tool.Title:='Build IDE'; Tool.WorkingDirectory:='$(LazarusDir)'; - if Options.BuildIDE=mmBuild then - Tool.CmdLineParams:='ide' + if Options.ExtraOptions<>'' then + Tool.CmdLineParams:='OPT='''+Options.ExtraOptions+''' ' else - // ToDo: the Makefile needs a 'cleanide' - Tool.CmdLineParams:='clean all'; + Tool.CmdLineParams:=''; + if Options.BuildIDE=mmBuild then + Tool.CmdLineParams:=Tool.CmdLineParams+'ide' + else + Tool.CmdLineParams:=Tool.CmdLineParams+'cleanide ide'; Result:=ExternalTools.Run(Tool,Macros); if Result<>mrOk then exit; end; @@ -190,10 +211,7 @@ begin // build Examples Tool.Title:='Build Examples'; Tool.WorkingDirectory:='$(LazarusDir)/examples'; - if Options.BuildExamples=mmBuild then - Tool.CmdLineParams:='' - else - Tool.CmdLineParams:='clean all'; + SetMakeParams(Options.BuildExamples,Options.ExtraOptions); Result:=ExternalTools.Run(Tool,Macros); if Result<>mrOk then exit; end; @@ -211,7 +229,7 @@ begin inherited Create(AnOwner); if LazarusResources.Find(Classname)=nil then begin Width:=350; - Height:=320; + Height:=385; Position:=poScreenCenter; Caption:='Configure "Build Lazarus"'; OnResize:=@ConfigureBuildLazarusDlgResize; @@ -238,12 +256,27 @@ begin Visible:=true; end; + BuildComponentsRadioGroup:=TRadioGroup.Create(Self); + with BuildComponentsRadioGroup do begin + Parent:=Self; + Name:='BuildComponentsRadioGroup'; + SetBounds(10,BuildLCLRadioGroup.Top+BuildLCLRadioGroup.Height+5, + BuildLCLRadioGroup.Width,BuildLCLRadioGroup.Height); + Caption:='Build Components'; + for MakeMode:=Low(TMakeMode) to High(TMakeMode) do + Items.Add(MakeModeNames[MakeMode]); + Columns:=3; + Visible:=true; + end; + BuildSynEditRadioGroup:=TRadioGroup.Create(Self); with BuildSynEditRadioGroup do begin Parent:=Self; Name:='BuildSynEditRadioGroup'; - SetBounds(10,BuildLCLRadioGroup.Top+BuildLCLRadioGroup.Height+5, - BuildLCLRadioGroup.Width,BuildLCLRadioGroup.Height); + SetBounds(10, + BuildComponentsRadioGroup.Top+BuildComponentsRadioGroup.Height+5, + BuildComponentsRadioGroup.Width, + BuildLCLRadioGroup.Height); Caption:='Build SynEdit'; for MakeMode:=Low(TMakeMode) to High(TMakeMode) do Items.Add(MakeModeNames[MakeMode]); @@ -289,6 +322,28 @@ begin Columns:=3; Visible:=true; end; + + OptionsLabel:=TLabel.Create(Self); + with OptionsLabel do begin + Name:='OptionsLabel'; + Parent:=Self; + SetBounds(10, + BuildExamplesRadioGroup.Top+BuildExamplesRadioGroup.Height+5, + 80,Height); + Caption:='Options:'; + Visible:=true; + end; + + OptionsEdit:=TEdit.Create(Self); + with OptionsEdit do begin + Name:='OptionsEdit'; + Parent:=Self; + SetBounds(OptionsLabel.Left+OptionsLabel.Width+5, + OptionsLabel.Top, + BuildExamplesRadioGroup.Width-OptionsLabel.Width-5, + Height); + Visible:=true; + end; OkButton:=TButton.Create(Self); with OkButton do begin @@ -321,9 +376,12 @@ begin BuildLCLRadioGroup.SetBounds(10, CleanAllCheckBox.Top+CleanAllCheckBox.Height+5, CleanAllCheckBox.Width,40); - BuildSynEditRadioGroup.SetBounds(10, + BuildComponentsRadioGroup.SetBounds(10, BuildLCLRadioGroup.Top+BuildLCLRadioGroup.Height+5, BuildLCLRadioGroup.Width,BuildLCLRadioGroup.Height); + BuildSynEditRadioGroup.SetBounds(10, + BuildComponentsRadioGroup.Top+BuildComponentsRadioGroup.Height+5, + BuildComponentsRadioGroup.Width,BuildComponentsRadioGroup.Height); BuildCodeToolsRadioGroup.SetBounds(10, BuildSynEditRadioGroup.Top+BuildSynEditRadioGroup.Height+5, BuildLCLRadioGroup.Width,BuildLCLRadioGroup.Height); @@ -333,6 +391,13 @@ begin BuildExamplesRadioGroup.SetBounds(10, BuildIDERadioGroup.Top+BuildIDERadioGroup.Height+5, BuildLCLRadioGroup.Width,BuildLCLRadioGroup.Height); + OptionsLabel.SetBounds(10, + BuildExamplesRadioGroup.Top+BuildExamplesRadioGroup.Height+5, + 80,OptionsLabel.Height); + OptionsEdit.SetBounds(OptionsLabel.Left+OptionsLabel.Width+5, + OptionsLabel.Top, + BuildExamplesRadioGroup.Width-OptionsLabel.Width-5, + OptionsEdit.Height); OkButton.SetBounds(Self.ClientWidth-180,Self.ClientHeight-38,80,25); CancelButton.SetBounds(Self.ClientWidth-90,OkButton.Top, OkButton.Width,OkButton.Height); @@ -352,10 +417,12 @@ procedure TConfigureBuildLazarusDlg.Load(Options: TBuildLazarusOptions); begin CleanAllCheckBox.Checked:=Options.CleanAll; BuildLCLRadioGroup.ItemIndex:=MakeModeToInt(Options.BuildLCL); + BuildComponentsRadioGroup.ItemIndex:=MakeModeToInt(Options.BuildComponents); BuildSynEditRadioGroup.ItemIndex:=MakeModeToInt(Options.BuildSynEdit); BuildCodeToolsRadioGroup.ItemIndex:=MakeModeToInt(Options.BuildCodeTools); BuildIDERadioGroup.ItemIndex:=MakeModeToInt(Options.BuildIDE); BuildExamplesRadioGroup.ItemIndex:=MakeModeToInt(Options.BuildExamples); + OptionsEdit.Text:=Options.ExtraOptions; end; procedure TConfigureBuildLazarusDlg.Save(Options: TBuildLazarusOptions); @@ -363,10 +430,12 @@ begin if Options=nil then exit; Options.CleanAll:=CleanAllCheckBox.Checked; Options.BuildLCL:=IntToMakeMode(BuildLCLRadioGroup.ItemIndex); + Options.BuildComponents:=IntToMakeMode(BuildComponentsRadioGroup.ItemIndex); Options.BuildSynEdit:=IntToMakeMode(BuildSynEditRadioGroup.ItemIndex); Options.BuildCodeTools:=IntToMakeMode(BuildCodeToolsRadioGroup.ItemIndex); Options.BuildIDE:=IntToMakeMode(BuildIDERadioGroup.ItemIndex); Options.BuildExamples:=IntToMakeMode(BuildExamplesRadioGroup.ItemIndex); + Options.ExtraOptions:=OptionsEdit.Text; end; function TConfigureBuildLazarusDlg.MakeModeToInt(MakeMode: TMakeMode): integer; @@ -392,11 +461,13 @@ end; procedure TBuildLazarusOptions.Save(XMLConfig: TXMLConfig; const Path: string); begin XMLConfig.SetValue(Path+'BuildLCL/Value',MakeModeNames[fBuildLCL]); + XMLConfig.SetValue(Path+'BuildComponents/Value',MakeModeNames[fBuildComponents]); XMLConfig.SetValue(Path+'BuildSynEdit/Value',MakeModeNames[fBuildSynEdit]); XMLConfig.SetValue(Path+'BuildCodeTools/Value',MakeModeNames[fBuildCodeTools]); XMLConfig.SetValue(Path+'BuildIDE/Value',MakeModeNames[fBuildIDE]); XMLConfig.SetValue(Path+'BuildExamples/Value',MakeModeNames[fBuildExamples]); XMLConfig.SetValue(Path+'CleanAll/Value',fCleanAll); + XMLConfig.SetValue(Path+'ExtraOptions/Value',fExtraOptions); XMLConfig.SetValue(Path+'MakeFilename/Value',fMakeFilename); end; @@ -404,6 +475,8 @@ procedure TBuildLazarusOptions.Load(XMLConfig: TXMLConfig; const Path: string); begin fBuildLCL:=StrToMakeMode(XMLConfig.GetValue(Path+'BuildLCL/Value', MakeModeNames[fBuildLCL])); + fBuildComponents:=StrToMakeMode(XMLConfig.GetValue(Path+'BuildComponents/Value', + MakeModeNames[fBuildComponents])); fBuildSynEdit:=StrToMakeMode(XMLConfig.GetValue(Path+'BuildSynEdit/Value', MakeModeNames[fBuildSynEdit])); fBuildCodeTools:=StrToMakeMode(XMLConfig.GetValue(Path+'BuildCodeTools/Value', @@ -413,6 +486,7 @@ begin fBuildExamples:=StrToMakeMode(XMLConfig.GetValue(Path+'BuildExamples/Value', MakeModeNames[fBuildExamples])); fCleanAll:=XMLConfig.GetValue(Path+'CleanAll/Value',fCleanAll); + fExtraOptions:=XMLConfig.GetValue(Path+'ExtraOptions/Value',fExtraOptions); fMakeFilename:=XMLConfig.GetValue(Path+'MakeFilename/Value',fMakeFilename); end; diff --git a/ide/codetoolsdefines.pas b/ide/codetoolsdefines.pas index 483c3dacd1..eeb920fdbb 100644 --- a/ide/codetoolsdefines.pas +++ b/ide/codetoolsdefines.pas @@ -399,7 +399,6 @@ begin Left:=DefineTreeView.Left; Top:=SelGrpBoxTop; Width:=MaxX-2*Left; -writeln('AAA1 SelectedItemGroupBox=',Left,',',Top,',',Width,' MaxX=',MaxX,' MaxY=',MaxY); Height:=MaxY-Top-Left; end; SelItemMaxX:=SelectedItemGroupBox.ClientWidth-6;