+ creation of IDE configuration files

git-svn-id: trunk@3740 -
This commit is contained in:
florian 2006-05-29 20:42:10 +00:00
parent b784b2f39e
commit 4f199e533b
4 changed files with 148 additions and 13 deletions

2
.gitattributes vendored
View File

@ -482,9 +482,11 @@ compiler/utils/fpc.cft svneol=native#text/plain
compiler/utils/fpc.mpw -text
compiler/utils/fpc.pp svneol=native#text/plain
compiler/utils/fpccfg.inc svneol=native#text/plain
compiler/utils/fpcfg.inc svneol=native#text/plain
compiler/utils/fpcmkcfg.pp svneol=native#text/plain
compiler/utils/fpcsubst.pp svneol=native#text/plain
compiler/utils/fpimpdef.pp svneol=native#text/plain
compiler/utils/fpini.inc svneol=native#text/plain
compiler/utils/fppkg.pp svneol=native#text/plain
compiler/utils/gppc386.pp svneol=native#text/plain
compiler/utils/mk68kreg.pp svneol=native#text/plain

59
compiler/utils/fpcfg.inc Normal file
View File

@ -0,0 +1,59 @@
{$ifdef Delphi}
const fpcfg : array[0..3] of string[240]=(
{$else Delphi}
const fpcfg : array[0..3,1..240] of char=(
{$endif Delphi}
'#IFDEF NORMAL'#013#010+
' -T%fpctargetos%'#013#010+
' -Sg'#013#010+
' -O1'#013#010+
' -OG'#013#010+
' -Op3'#013#010+
' -Ratt'#013#010+
' -Fu%basepath%\units\%fpctarget%-%fpctargetos%'#013#010+
' -Fu%basepath%\units\%fpctarget%-%fpctargetos%\*'#013#010+
' -Fu%basepath%\units\%fpctarget%-%fpctargetos%\rtl'#013#010+
' -Cs131072'#013#010+
' -Ch2097152'#013,#010+
' -g-'#013#010+
' -p-'#013#010+
' -b-'#013#010+
'#ENDIF'#013#010+
#013#010+
'#IFDEF DEBUG'#013#010+
' -T%fpctargetos%'#013#010+
' -Sg'#013#010+
' -Cr'#013#010+
' -Ci'#013#010+
' -Co'#013#010+
' -OG'#013#010+
' -Op3'#013#010+
' -Ratt'#013#010+
' -Fu%basepath%\units\%fpctarget%-%fpctargetos%'#013#010+
' -Fu%basepath%\units\%fpctarget%-%fpctargetos%\*'#013#010+
' -Fu%basepath%\units\%fpctarget%-%fp','ctargetos%\rtl'#013#010+
' -Cs131072'#013#010+
' -Ch2097152'#013#010+
' -g'#013#010+
' -p-'#013#010+
' -b-'#013#010+
'#ENDIF'#013#010+
#013#010+
'#IFDEF RELEASE'#013#010+
' -T%fpctargetos%'#013#010+
' -Sg'#013#010+
' -O1'#013#010+
' -O2'#013#010+
' -OG'#013#010+
' -Op3'#013#010+
' -Ratt'#013#010+
' -Fu%basepath%\units\%fpctarget%-%fpctargetos%'#013#010+
' -Fu%basepath%\units\%fpctarget%-%fpctargetos%\*'#013#010+
' ','-Fu%basepath%\units\%fpctarget%-%fpctargetos%\rtl'#013#010+
' -Cs131072'#013#010+
' -Ch2097152'#013#010+
' -g-'#013#010+
' -p-'#013#010+
' -b-'#013#010+
'#ENDIF'#013#010
);

View File

@ -26,23 +26,29 @@ uses usubst,SysUtils,Classes;
}
{$i fpccfg.inc}
{$i fpini.inc}
{$i fpcfg.inc}
Const
BuildVersion={$I %FPCVERSION%};
BuildTarget={$I %FPCTARGET%};
BuildOSTarget={$I %FPCTARGETOS%};
Resourcestring
SUsage00 = 'Usage: %s [options]';
SUsage10 = 'Where options is one or more of';
SUSage20 = ' -t filename Template file name. Default is built-in';
SUSage30 = ' -o filename Set output file. Default is standard output.';
SUsage40 = ' -d name=value define name=value pair.';
SUsage50 = ' -h show this help and exit.';
SUsage60 = ' -u name remove name from list of name/value pairs.';
SUsage70 = ' -l filename read name/value pairs from filename';
SUsage80 = ' -b show builtin template and exit.';
SUsage90 = ' -v be verbose.';
SUsage00 = 'Usage: %s [options]';
SUsage10 = 'Where options is one or more of';
SUSage20 = ' -t filename Template file name. Default is built-in';
SUSage30 = ' -o filename Set output file. Default is standard output.';
SUsage40 = ' -d name=value define name=value pair.';
SUsage50 = ' -h show this help and exit.';
SUsage60 = ' -u name remove name from list of name/value pairs.';
SUsage70 = ' -l filename read name/value pairs from filename';
SUsage80 = ' -b show builtin template and exit.';
SUsage90 = ' -v be verbose.';
Susage100 = ' -0 use built in fpc.cfg template (default)';
Susage110 = ' -1 use built in fp.cfg template';
Susage120 = ' -2 use built in fp.ini template';
SErrUnknownOption = 'Error: Unknown option.';
SErrArgExpected = 'Error: Option "%s" requires an argument.';
SErrNoSuchFile = 'Error: File "%s" does not exist.';
@ -60,17 +66,18 @@ Var
List,Cfg : TStringList;
TemplateFileName,
OutputFileName : String;
IDEBuildin : Integer;
procedure Init;
begin
Verbose:=False;
IDEBuildIn:=0;
List:=TStringList.Create;
AddToList(List,'FPCVERSION',BuildVersion);
AddToList(List,'FPCTARGET',BuildTarget);
AddToList(List,'FPCTARGETOS',BuildOSTarget);
AddToList(List,'PWD',GetCurrentDir);
AddToList(List,'BUILDDATE',DateToStr(Date));
AddToList(List,'BUILDTIME',TimeToStr(Time));
@ -98,6 +105,9 @@ begin
Writeln(SUsage70);
Writeln(SUsage80);
Writeln(SUsage90);
Writeln(SUsage100);
Writeln(SUsage110);
Writeln(SUsage120);
Halt(1);
end;
@ -158,6 +168,9 @@ begin
'u' : AddPair(List,GetOptArg+'=');
'o' : OutputFileName:=GetoptArg;
's' : SkipBackup:=True;
'0' : IDEBuildin:=0;
'1' : IDEBuildin:=1;
'2' : IDEBuildin:=2;
else
UnknownOption(S);
end;
@ -174,7 +187,16 @@ begin
AddToList(List,'TEMPLATEFILE',TemplateFileName);
end
else
AddToList(List,'TEMPLATEFILE','builtin');
begin
case IDEBuildin of
1:
Cfg.Text:=StrPas(Addr(fpcfg));
2:
Cfg.Text:=StrPas(Addr(fpini));
end;
AddToList(List,'TEMPLATEFILE','builtin');
end;
end;

52
compiler/utils/fpini.inc Normal file
View File

@ -0,0 +1,52 @@
{$ifdef Delphi}
const fpini : array[0..2] of string[240]=(
{$else Delphi}
const fpini : array[0..2,1..240] of char=(
{$endif Delphi}
'[Compile]'#013#010+
'CompileMode=DEBUG'#013#010+
#013#010+
'[Help]'#013#010+
'Files="%basepath%\doc\fpctoc.htx"'#013#010+
#013#010+
'[Editor]'#013#010+
'DefaultTabSize=8'#013#010+
'DefaultFlags=20599'#013#010+
'DefaultSaveExt=.pas'#013#010+
'DefaultIndentSize=1'#013#010+
#013#010+
'[Highlight]'#013#010+
'Exts="*.pas;*.pp;*.inc"'#013#010+
'NeedsTabs="make*;make*.*"'#013#010+
#013#010+
'[Sou','rcePath]'#013#010+
'SourceList=""'#013#010+
#013#010+
'[Mouse]'#013#010+
'DoubleDelay=8'#013#010+
'ReverseButtons=0'#013#010+
'AltClickAction=6'#013#010+
'CtrlClickAction=1'#013#010+
#013#010+
'[Search]'#013#010+
'FindFlags=4'#013#010+
#013#010+
'[Breakpoints]'#013#010+
'Count=0'#013#010+
#013#010+
'[Watches]'#013#010+
'Count=0'#013#010+
#013#010+
'[Preferences]'#013#010+
'DesktopFileFlags=209'#013#010+
'CenterCurrentLineWhile','Debugging=1'#013#010+
'AutoSaveFlags=7'#013#010+
'MiscOptions=6'#013#010+
'DesktopLocation=1'#013#010+
#013#010+
'[Misc]'#013#010+
'ShowReadme=1'#013#010+
#013#010+
'[Files]'#013#010+
'OpenExts="*.pas;*.pp;*.inc"'#013#010
);