diff --git a/.gitattributes b/.gitattributes index cbfe01b0aa..115f525e37 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7921,6 +7921,9 @@ tools/install/slacktgz/slack-desc svneol=native#text/plain tools/install/smart_strip.sh svneol=native#text/plain tools/install/win/RemovedFiles32.iss svneol=native#text/plain tools/install/win/RemovedFiles64.iss svneol=native#text/plain +tools/install/win/ReplaceText/ReplaceText.lpi svneol=native#text/pascal +tools/install/win/ReplaceText/ReplaceText.lpr svneol=native#text/pascal +tools/install/win/ReplaceText/readme.txt svneol=native#text/pascal tools/install/win/build-cross.bat svneol=native#text/x-msdos-program tools/install/win/build-fpc.bat svneol=native#text/x-msdos-program tools/install/win/build-lazarus.bat svneol=native#text/x-msdos-program diff --git a/tools/install/win/ReplaceText/ReplaceText.lpi b/tools/install/win/ReplaceText/ReplaceText.lpi new file mode 100644 index 0000000000..7b95526e7a --- /dev/null +++ b/tools/install/win/ReplaceText/ReplaceText.lpi @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <i18n> + <EnableI18N LFM="False"/> + </i18n> + <VersionInfo> + <StringTable ProductVersion=""/> + </VersionInfo> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + </local> + </RunParams> + <RequiredPackages Count="1"> + <Item1> + <PackageName Value="LazUtils"/> + </Item1> + </RequiredPackages> + <Units Count="1"> + <Unit0> + <Filename Value="ReplaceText.lpr"/> + <IsPartOfProject Value="True"/> + <UnitName Value="ReplaceText"/> + </Unit0> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="ReplaceText"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Linking> + <Debugging> + <DebugInfoType Value="dsDwarf2Set"/> + <UseHeaptrc Value="True"/> + </Debugging> + </Linking> + <Other> + <CompilerMessages> + <UseMsgFile Value="True"/> + </CompilerMessages> + <CompilerPath Value="$(CompPath)"/> + </Other> + </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/tools/install/win/ReplaceText/ReplaceText.lpr b/tools/install/win/ReplaceText/ReplaceText.lpr new file mode 100644 index 0000000000..feccbb77d1 --- /dev/null +++ b/tools/install/win/ReplaceText/ReplaceText.lpr @@ -0,0 +1,22 @@ +program ReplaceText; + +uses Classes, strutils, LazLogger; + +var + s: TStringList; + i, j: Integer; + x: String; +begin + s := TStringList.Create; + s.LoadFromFile(ParamStr(1)); + j := 0; + for i := 0 to s.Count-1 do begin + x := AnsiReplaceText(s[i], ParamStr(2), ParamStr(3)); + if s[i] <> x then inc(j); + s[i] := x; + end; + s.SaveToFile(ParamStr(1)); + s.Free; + DebugLn(['Replaced in ', j, ' lines for file ', ParamStr(1), ' ',ParamStr(2)]); +end. + diff --git a/tools/install/win/ReplaceText/readme.txt b/tools/install/win/ReplaceText/readme.txt new file mode 100644 index 0000000000..ac36cb07ae --- /dev/null +++ b/tools/install/win/ReplaceText/readme.txt @@ -0,0 +1 @@ +This is a helper to modify the Makefile.compiled for cross compiler builds (adding the -T... -P... flags) \ No newline at end of file