ports/lang/fpc-devel/files/patch-compiler_globals.pas
Jose Alonso Cardenas Marquez db9286bab5
lang/fpc-devel: New port: Free Pascal compiler with Turbo and Delphi (devel)
Free Pascal is a mature, versatile, open source Pascal compiler. It can target
many processor architectures: Intel x86 (16 and 32 bit), AMD64/x86-64, PowerPC,
PowerPC64, SPARC, SPARC64, ARM, AArch64, MIPS, Motorola 68k, AVR, and the JVM.

Supported operating systems include Windows (16/32/64 bit, CE, and native NT),
Linux, Mac OS X/iOS/iPhoneSimulator/Darwin, FreeBSD and other BSD flavors, DOS
(16 bit, or 32 bit DPMI), OS/2, AIX, Android, Haiku, Nintendo GBA/DS/Wii,
AmigaOS, MorphOS, AROS, Atari TOS, and various embedded platforms. Additionally,
support for RISC-V (32/64), Xtensa, and Z80 architectures, and for the LLVM
compiler infrastructure is available in the development version. Additionally,
the Free Pascal team maintains a transpiler for pascal to Javascript called
pas2js.
2023-10-28 17:54:03 -05:00

32 lines
1 KiB
ObjectPascal

--- compiler/globals.pas 2023-10-27 23:30:38.797736000 -0500
+++ compiler/globals.pas 2023-10-27 23:31:45.729414000 -0500
@@ -1023,6 +1023,19 @@
FreeEnvPChar(envvalue);
end;
{$endif openbsd}
+{$ifdef freebsd}
+ function GetFreeBSDLocalBase: ansistring;
+ var
+ envvalue: pchar;
+ begin
+ envvalue := GetEnvPChar('LOCALBASE');
+ if assigned(envvalue) then
+ Result:=envvalue
+ else
+ Result:='/usr/local';
+ FreeEnvPChar(envvalue);
+ end;
+{$endif freebsd}
var
envstr: string;
envvalue: pchar;
@@ -1062,6 +1075,9 @@
Replace(s,'$OPENBSD_LOCALBASE',GetOpenBSDLocalBase);
Replace(s,'$OPENBSD_X11BASE',GetOpenBSDX11Base);
{$endif openbsd}
+{$ifdef freebsd}
+ Replace(s,'$FREEBSD_LOCALBASE',GetFreeBSDLocalBase);
+{$endif freebsd}
if not substitute_env_variables then
exit;
{ Replace environment variables between dollar signs }