mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-02 12:50:27 +02:00
Make idfpath and idf_version macros available as replacement vars in fpc.cfg
This commit is contained in:
parent
14b3c11c0d
commit
e0229632fb
@ -986,6 +986,22 @@ implementation
|
||||
result:=getrealtime(st);
|
||||
end;
|
||||
|
||||
function idfversionstring(version : longint):string;
|
||||
{
|
||||
Convert back the numerical idf_version for esp32 to string
|
||||
}
|
||||
begin
|
||||
result := '';
|
||||
if version > 0 then
|
||||
begin
|
||||
result := inttostr(version div 10000)+'.';
|
||||
version := version - (version div 10000)*10000;
|
||||
result := result + inttostr(version div 100)+'.';
|
||||
version := version - (version div 100)*100;
|
||||
result := result + inttostr(version);
|
||||
end;
|
||||
end;
|
||||
|
||||
{****************************************************************************
|
||||
Default Macro Handling
|
||||
****************************************************************************}
|
||||
@ -1065,6 +1081,19 @@ implementation
|
||||
Replace(s,'$OPENBSD_LOCALBASE',GetOpenBSDLocalBase);
|
||||
Replace(s,'$OPENBSD_X11BASE',GetOpenBSDX11Base);
|
||||
{$endif openbsd}
|
||||
{$ifdef xtensa}
|
||||
if idf_version > 0 then
|
||||
Replace(s,'$IDF_VERSION',idfversionstring(idf_version));
|
||||
if idfpath <> '' then
|
||||
Replace(s,'$IDFPATH',idfpath);
|
||||
{$endif xtensa}
|
||||
{$ifdef riscv32}
|
||||
if idf_version > 0 then
|
||||
Replace(s,'$IDF_VERSION',idfversionstring(idf_version));
|
||||
if idfpath <> '' then
|
||||
Replace(s,'$IDFPATH',idfpath);
|
||||
{$endif riscv32}
|
||||
|
||||
if not substitute_env_variables then
|
||||
exit;
|
||||
{ Replace environment variables between dollar signs }
|
||||
|
Loading…
Reference in New Issue
Block a user