Răsfoiți Sursa

* support building the IDE with the LLVM code generator

git-svn-id: trunk@44791 -
Jonas Maebe 5 ani în urmă
părinte
comite
723430ac34
3 a modificat fișierele cu 20 adăugiri și 0 ștergeri
  1. 3 0
      packages/Makefile.fpc
  2. 4 0
      packages/ide/Makefile.fpc
  3. 13 0
      packages/ide/fpmake.pp

+ 3 - 0
packages/Makefile.fpc

@@ -69,6 +69,9 @@ FPMAKE_OPT+=-bu
 ifndef BUILDFULLNATIVE
 FPMAKE_OPT+=-scp
 endif
+ifdef LLVM
+FPMAKE_OPT+=--LLVM=1
+endif
 .NOTPARALLEL:
 
 fpmkunit_clean_bootstrap:

+ 4 - 0
packages/ide/Makefile.fpc

@@ -90,6 +90,10 @@ ifdef PPC_TARGET
 FPMAKE_OPT+=--CompilerTarget=$(PPC_TARGET)
 endif
 
+ifdef LLVM
+FPMAKE_OPT+=--LLVM=1
+endif
+
 .NOTPARALLEL:
 
 PPC_TARGETS=i386 m68k powerpc sparc arm x86_64 powerpc64 mips mipsel avr jvm i8086 aarch64 sparc64

+ 13 - 0
packages/ide/fpmake.pp

@@ -148,6 +148,7 @@ begin
   AddCustomFpmakeCommandlineOption('GDBMI','If value=1 or ''Y'', builds IDE with GDB/MI support (no need for LibGDB)');
   AddCustomFpmakeCommandlineOption('NoIDE','If value=1 or ''Y'', the IDE will be skipped');
   AddCustomFpmakeCommandlineOption('IDE','If value=1 or ''Y'', the IDE will be build for each target');
+  AddCustomFpmakeCommandlineOption('LLVM','If value=1 or ''Y'', the Compiler codegenerator will use LLVM');
 end;
 
 procedure add_ide(const ADirectory: string);
@@ -158,6 +159,7 @@ Var
   CompilerTarget : TCpu;
   CompilerDir,
   s: string;
+  llvm: boolean;
 
 begin
   With Installer do
@@ -185,6 +187,11 @@ begin
       CompilerTarget:=StringToCPU(s)
     else
       CompilerTarget:=Defaults.CPU;
+    s:=GetCustomFpmakeCommandlineOptionValue('LLVM');
+    if (s='1') or (s='Y') then
+      llvm:=true
+    else
+      llvm:=false;
     { Only try to build natively }
     { or for cross-compile if the resulting executable
       does not depend on C libs }
@@ -261,6 +268,12 @@ begin
         if CompilerTarget = mipsel then
           P.Options.Add('-Fu'+CompilerDir+'/mips');
 
+        if llvm then
+          begin
+            P.Options.Add('-Fu'+CompilerDir+'/llvm');
+            P.Options.Add('-Fi'+CompilerDir+'/llvm');
+          end;
+
         { powerpc64-aix compiled IDE needs -CTsmalltoc option }
         if (Defaults.OS=aix) and (Defaults.CPU=powerpc64) then
         P.Options.Add('-CTsmalltoc');