@@ -65,8 +65,10 @@ implementation
6565 cTestBash = ' test_all.sh' ;
6666 cRunBash = ' run_all.sh' ;
6767
68+ { $IFDEF UNIX}
6869 cLazbuildDefault = ' %s \' #10 ' -B \' #10 ' "%s"' ;
6970 cLazbuildRelease = ' %s \' #10 ' -B \' #10 ' --bm="Release" \' #10 ' "%s"' ;
71+ { $ENDIF}
7072
7173 cReplaceName = ' [[name]]' ;
7274 cReplaceJSONResults = ' [[results-json]]' ;
@@ -75,8 +77,9 @@ implementation
7577 cReplaceEntryThreads = ' [[threads]]' ;
7678
7779 cBaselineBinary = ' baseline' ;
80+ { $IFDEF UNIX}
7881 cCompilerFPC = ' fpc' ;
79- { $IFNDEF FPC }
82+ { $ELSE }
8083 cCompilerDelphi = ' delphi' ;
8184 { $ENDIF}
8285 cSSD = ' SSD' ;
@@ -150,17 +153,25 @@ function TBuilder.GetHeader(const AHeader: String): String;
150153
151154function TBuilder.GetVariables : String;
152155begin
156+ Result:= ' ' ;
153157 { $IFDEF UNIX}
154- Result:= ' ROOT="' + FConfig.RootLinux + ' "' + LineEnding;
155158 Result:= Result + ' BIN="' + FConfig.BinLinux + ' "' + LineEnding;
156159 Result:= Result + ' ENTRIES="' + FConfig.EntriesLinux + ' "' + LineEnding;
160+ Result:= Result + ' RESULTS="' + FConfig.ResultsFolder + ' "' + LineEnding;
161+ Result:= Result + ' INPUT="' + FConfig.Input + ' "' + LineEnding;
157162 { $ELSE}
158- Result:= ' ROOT="' + FConfig.RootWindows + ' "' + LineEnding;
159163 Result:= Result + ' BIN="' + FConfig.BinWindows + ' "' + LineEnding;
160164 Result:= Result + ' ENTRIES="' + FConfig.EntriesWindows + ' "' + LineEnding;
165+ Result:= Result + ' DELPHICC="' + FConfig.DelphiCompiler + ' "' + LineEnding;
166+ Result:= Result + ' INCLUDE="c:\program files (x86)\embarcadero\studio\23.0\lib\Linux64\release;C:\Users\gcarr\Documents\Embarcadero\Studio\23.0\Imports;c:\program files (x86)\embarcadero\studio\23.0\Imports;C:\Users\Public\Documents\Embarcadero\Studio\23.0\Dcp\Linux64;c:\program files (x86)\embarcadero\studio\23.0\include;c:\program files (x86)\embarcadero\studio\23.0\redist\Linux64;C:\Users\Public\Documents\Embarcadero\Studio\23.0\Bpl\Linux64;C:\Users\gcarr\Documents\Embarcadero\Studio\23.0\CatalogRepository\ChatGPTWizard-2.2.0.9"' + LineEnding;
167+ Result:= Result + ' SDK="C:\Users\gcarr\Documents\Embarcadero\Studio\SDKs\ubuntu23.10.sdk"' + LineEnding;
168+ Result:= Result + ' LIBPATH="C:\Users\gcarr\Documents\Embarcadero\Studio\SDKs\ubuntu23.10.sdk\usr\lib\gcc\x86_64-linux-gnu\13;C:\Users\gcarr\Documents\Embarcadero\Studio\SDKs\ubuntu23.10.sdk\usr\lib\x86_64-linux-gnu;C:\Users\gcarr\Documents\Embarcadero\Studio\SDKs\ubuntu23.10.sdk\lib\x86_64-linux-gnu;C:\Users\gcarr\Documents\Embarcadero\Studio\SDKs\ubuntu23.10.sdk\lib64"' + LineEnding;
169+ Result:= Result + ' BPL="\Users\Public\Documents\Embarcadero\Studio\23.0\Bpl\Linux64"' + LineEnding;
170+ Result:= Result + ' DCP="\Users\Public\Documents\Embarcadero\Studio\23.0\Dcp\Linux64"' + LineEnding;
171+ Result:= Result + ' GENERICS="Generics.Collections=System.Generics.Collections;Generics.Defaults=System.Generics.Defaults"' + LineEnding;
172+ Result:= Result + ' HEADERS="\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Linux64"' + LineEnding;
173+ Result:= Result + ' DEFINES="RELEASE;LINUX"' + LineEnding;
161174 { $ENDIF}
162- Result:= Result + ' RESULTS="' + FConfig.ResultsFolder + ' "' + LineEnding;
163- Result:= Result + ' INPUT="' + FConfig.Input + ' "' + LineEnding;
164175 Result:= Result + LineEnding;
165176end ;
166177
@@ -188,7 +199,35 @@ function TBuilder.GetFunctionCompile(const AEntry: TEntry): String;
188199 LineEnding;
189200 end ;
190201 { $ELSE}
191- Result:= line + ' # Needs the Delphi command line stuff' + LineEnding;
202+ Result:= Result + Format(
203+ ' "${DELPHICC}" ' +
204+ ' -\$D0 ' +
205+ ' -\$L- ' +
206+ ' -\$Y- ' +
207+ ' --no-config ' +
208+ ' -B ' +
209+ ' -Q ' +
210+ ' "-A${GENERICS}" ' +
211+ ' "-D${DEFINES}" ' +
212+ ' "-E${BIN}" ' +
213+ ' "-I${INCLUDE}" ' +
214+ ' "-LEC:${BPL}" ' +
215+ ' "-LNC:${DCP}" ' +
216+ ' -NS ' +
217+ ' "-O${INCLUDE}" ' +
218+ ' "-R${INCLUDE}" ' +
219+ ' "-U${INCLUDE}" ' +
220+ ' "--syslibroot:${SDK}" ' +
221+ ' "--libpath:${LIBPATH}" ' +
222+ ' "-NHC:${HEADERS}" ' +
223+ ' "${ENTRIES}/%s/%s" && \' + LineEnding +
224+ ' scp ${BIN}/' + AEntry.EntryBinary + ' ' +
225+ ' gcarreno@10.42.0.1:/home/gcarreno/Programming/1brc-ObjectPascal/bin'
226+ ,
227+ [
228+ AEntry.EntryFolder,
229+ AEntry.DPR
230+ ]) + LineEnding;
192231 { $ENDIF}
193232 Result:= Result + ' echo "==========="' + LineEnding;
194233 Result:= Result + ' echo' + LineEnding + ' }' + LineEnding + LineEnding;
@@ -201,7 +240,7 @@ function TBuilder.GetFunctionTest(const AEntry: TEntry): String;
201240 Result:= ' function ' + AEntry.EntryBinary + ' () {' + LineEnding;
202241 Result:= Result + ' echo "===== ' + UTF8Encode(AEntry.Name ) +' ======"' + LineEnding;
203242 tmpStr:= Format(' %s/%s %s' , [
204- ' ${BIN}' ,// IncludeTrailingPathDelimiter(FConfig.BinLinux),
243+ ' ${BIN}' ,
205244 AEntry.EntryBinary,
206245 AEntry.RunParams
207246 ]);
@@ -219,20 +258,20 @@ function TBuilder.GetFunctionTest(const AEntry: TEntry): String;
219258 );
220259 tmpStr:= Format(' %s > %s/%s.output' , [
221260 tmpStr,
222- ' ${RESULTS}' , // IncludeTrailingPathDelimiter(FConfig.ResultsFolder),
261+ ' ${RESULTS}' ,
223262 AEntry.EntryBinary
224263 ]);
225264 Result:= Result + tmpStr + LineEnding;
226265 tmpStr:= Format(' sha256sum %s/%s.output' ,[
227- ' ${RESULTS}' , // IncludeTrailingPathDelimiter(FConfig.ResultsFolder),
266+ ' ${RESULTS}' ,
228267 AEntry.EntryBinary
229268 ]);
230269 Result:= Result + tmpStr + LineEnding;
231270 Result:= Result + Format(' echo "%s Official Output Hash"' ,[
232271 FConfig.OutputHash
233272 ]) + LineEnding;
234273 Result:= Result + Format(' rm %s/%s.output' ,[
235- ' ${RESULTS}' , // IncludeTrailingPathDelimiter(FConfig.ResultsFolder),
274+ ' ${RESULTS}' ,
236275 AEntry.EntryBinary
237276 ]) + LineEnding;
238277 Result:= Result + ' echo "==========="' + LineEnding;
@@ -308,7 +347,6 @@ procedure TBuilder.BuildCompileScriptBash;
308347 { $ELSE}
309348 if FConfig.Entries[index].Compiler <> cCompilerDelphi then continue;
310349 { $ENDIF}
311- // if FConfig.Entries[index].EntryBinary = cBaselineBinary then continue;
312350 line:= line + GetFunctionCompile(FConfig.Entries[index]);
313351 end ;
314352 line:= line + ' if [ "$1" == "" ];then' + LineEnding;
@@ -364,7 +402,6 @@ procedure TBuilder.BuildTestScriptBash;
364402 begin
365403 Write(GenerateProgressBar(index+1 , FConfig.Entries.Count, 50 ), lineBreak);
366404 if not FConfig.Entries[index].Active then continue;
367- // if FConfig.Entries[index].EntryBinary = cBaselineBinary then continue;
368405 line:= line + GetFunctionTest(FConfig.Entries[index]);
369406 end ;
370407 line:= line + ' if [ "$1" == "" ];then' + LineEnding;
0 commit comments