Browse Source

* Also pass global- and local-unitdir to fpmake, so that it still works with older versions

git-svn-id: trunk@34707 -
joost 8 years ago
parent
commit
723fc982b3
1 changed files with 13 additions and 1 deletions
  1. 13 1
      packages/fppkg/src/pkgfpmake.pp

+ 13 - 1
packages/fppkg/src/pkgfpmake.pp

@@ -258,6 +258,9 @@ Var
   FPMakeBin,
   FPMakeBin,
   OOptions : string;
   OOptions : string;
   InstallRepo: TFPRepository;
   InstallRepo: TFPRepository;
+  GlobalUnitDir,
+  LocalUnitDir: string;
+  BaseInstDir: string;
   i: Integer;
   i: Integer;
 
 
   procedure AddOption(const s:string);
   procedure AddOption(const s:string);
@@ -368,10 +371,19 @@ begin
           InstallRepo := TFPRepository(GFPpkg.RepositoryList[i]);
           InstallRepo := TFPRepository(GFPpkg.RepositoryList[i]);
           if (InstallRepo.RepositoryType = fprtInstalled) and Assigned(InstallRepo.DefaultPackagesStructure) then
           if (InstallRepo.RepositoryType = fprtInstalled) and Assigned(InstallRepo.DefaultPackagesStructure) then
             begin
             begin
-              CondAddOption('--searchpath', InstallRepo.DefaultPackagesStructure.GetBaseInstallDir);
+              BaseInstDir := InstallRepo.DefaultPackagesStructure.GetBaseInstallDir;
+              CondAddOption('--searchpath', BaseInstDir);
+              if LocalUnitDir='' then
+                LocalUnitDir := BaseInstDir
+              else if GlobalUnitDir='' then;
+                GlobalUnitDir := BaseInstDir;
             end;
             end;
         end;
         end;
     end;
     end;
+  if GlobalUnitDir<>'' then
+    CondAddOption('--globalunitdir', GlobalUnitDir);
+  if LocalUnitDir<>'' then
+    CondAddOption('--localunitdir', LocalUnitDir);
 
 
   { Run FPMake }
   { Run FPMake }
   FPMakeBin:='fpmake'+ExeExt;
   FPMakeBin:='fpmake'+ExeExt;