Browse Source

--- Merging r18086 into '.':
U packages/fcl-net/fpmake.pp
U packages/univint/fpmake.pp
--- Recording mergeinfo for merge of r18086 into '.':
U .
--- Merging r18087 into '.':
A packages/cocoaint/fpmake.pp
G packages/univint/fpmake.pp
--- Recording mergeinfo for merge of r18087 into '.':
G .
--- Merging r18095 into '.':
U packages/gdbint/fpmake.pp
--- Recording mergeinfo for merge of r18095 into '.':
G .
--- Merging r18096 into '.':
U packages/fpmake.pp
U packages/fpmake_add.inc
U packages/fpmake_proc.inc
--- Recording mergeinfo for merge of r18096 into '.':
G .

git-svn-id: branches/fixes_2_6@25390 -

joost 12 years ago
parent
commit
a11bb567ce

+ 1 - 0
.gitattributes

@@ -1016,6 +1016,7 @@ packages/chm/src/paslzx.pas svneol=native#text/plain
 packages/chm/src/paslzxcomp.pas svneol=native#text/plain
 packages/cocoaint/Makefile svneol=native#text/plain
 packages/cocoaint/Makefile.fpc svneol=native#text/plain
+packages/cocoaint/fpmake.pp svneol=native#text/plain
 packages/cocoaint/src/AnonClassDefinitionsCoredata.pas svneol=native#text/plain
 packages/cocoaint/src/AnonClassDefinitionsQuartzcore.pas svneol=native#text/plain
 packages/cocoaint/src/AnonClassDefinitionsWebkit.pas svneol=native#text/plain

+ 35 - 0
packages/cocoaint/fpmake.pp

@@ -0,0 +1,35 @@
+{$ifndef ALLPACKAGES}
+{$mode objfpc}{$H+}
+program fpmake;
+
+uses fpmkunit;
+
+Var
+  P : TPackage;
+  T : TTarget;
+begin
+  With Installer do
+    begin
+{$endif ALLPACKAGES}
+
+    P:=AddPackage('cocoaint');
+{$ifdef ALLPACKAGES}
+    P.Directory:='cocoaint';
+{$endif ALLPACKAGES}
+    P.Version:='2.7.1';
+    P.OSes:=[darwin,iphonesim];
+    P.Dependencies.Add('univint');
+    P.SourcePath.Add('src');
+
+    T:=P.Targets.AddUnit('CocoaAll.pp');
+    T:=P.Targets.AddUnit('WebKit.pp');
+    T:=P.Targets.AddUnit('CoreData.pp');
+
+    T:=P.Targets.AddImplicitUnit('AnonClassDefinitionsQuartzcore.pp');
+    T:=P.Targets.AddImplicitUnit('AnonClassDefinitionsWebkit.pp');
+
+{$ifndef ALLPACKAGES}
+    Run;
+    end;
+end.
+{$endif ALLPACKAGES}

+ 1 - 1
packages/fcl-net/fpmake.pp

@@ -52,7 +52,7 @@ begin
     T.ResourceStrings := True;
 
     // HTTP Client
-    T:=P.Targets.AddUnit('fpsock.pp',AllUnixOSes);
+    T:=P.Targets.AddUnit('fpsock.pp',[linux,freebsd,netbsd,openbsd]);
       with T.Dependencies do
         begin
           AddUnit('resolve');

+ 1 - 1
packages/fpmake.pp

@@ -2,7 +2,7 @@
 {$define allpackages}
 program fpmake;
 
-uses fpmkunit;
+uses fpmkunit, sysutils, Classes;
 
 Var
   TBuild,T : TTarget;

+ 1 - 1
packages/fpmake_add.inc

@@ -6,6 +6,7 @@
   add_cairo;
   add_cdrom;
   add_chm;
+  add_cocoaint;
   add_dbus;
   add_dts;
   add_fastcgi;
@@ -58,7 +59,6 @@
   add_libxml;
   add_lua;
   add_mad;
-  add_matroska;
   add_modplug;
   add_mysql;
   add_ncurses;

+ 6 - 10
packages/fpmake_proc.inc

@@ -46,6 +46,12 @@ begin
 {$include chm/fpmake.pp}
 end;
 
+procedure add_cocoaint;
+begin
+  with Installer do
+{$include cocoaint/fpmake.pp}
+end;
+
 procedure add_dbus;
 begin
   with Installer do
@@ -178,11 +184,7 @@ begin
 {$include fv/fpmake.pp}
 end;
 
-procedure add_gdbint;
-begin
-  with Installer do
 {$include gdbint/fpmake.pp}
-end;
 
 procedure add_gdbm;
 begin
@@ -358,12 +360,6 @@ begin
 {$include mad/fpmake.pp}
 end;
 
-procedure add_matroska;
-begin
-  with Installer do
-{$include matroska/fpmake.pp}
-end;
-
 procedure add_modplug;
 begin
   with Installer do

+ 122 - 5
packages/gdbint/fpmake.pp

@@ -2,7 +2,118 @@
 {$mode objfpc}{$H+}
 program fpmake;
 
-uses fpmkunit;
+uses fpmkunit, classes, sysutils;
+
+{$endif ALLPACKAGES}
+
+const
+  GdbLibName = 'libgdb.a';
+  MinGWGdbLibName = 'libmingw32.a';
+
+procedure BeforeCompile_gdbint(Sender: TObject);
+var
+  L : TStrings;
+  P : TPackage;
+  GdbLibDir, GdbLibFile: string;
+  GdbLibFound: boolean;
+  GdbVerTarget: TTarget;
+  HostOS: TOS;
+  HostCPU: TCpu;
+begin
+  P := Sender as TPackage;
+  HostOS:=StringToOS({$I %FPCTARGETOS%});
+  HostCPU:=StringToCPU({$I %FPCTARGETCPU%});
+  // Search for a libgdb file.
+  GdbLibFound:=false;
+
+  // First try the environment setting GDBLIBDIR
+  GdbLibDir := GetEnvironmentVariable('GDBLIBDIR');
+  if (GdbLibDir<>'') and DirectoryExists(GdbLibDir) then
+    begin
+      GdbLibFile:=IncludeTrailingPathDelimiter(GdbLibDir)+GdbLibName;
+      if not FileExists(GdbLibFile) then
+        Installer.BuildEngine.Log(vlCommand,'GDBLIBDIR environment variable set, but libgdb not found. ('+GdbLibFile+')')
+      else
+        GdbLibFound:=true;
+    end;
+
+  // Try the default locations
+  if not GdbLibFound then
+    begin
+      GdbLibDir:='..'+PathDelim+'..'+PathDelim+'libgdb';
+      if DirectoryExists(GdbLibDir) then
+        begin
+          GdbLibDir:=GdbLibDir+PathDelim+OSToString(Defaults.OS);
+          GdbLibFile:=GdbLibDir+PathDelim+GdbLibName;
+          if FileExists(GdbLibFile) then
+            GdbLibFound:=true
+          else
+            begin
+              GdbLibDir:=GdbLibDir+PathDelim+CPUToString(Defaults.CPU);
+              GdbLibFile:=GdbLibDir+PathDelim+GdbLibName;
+              GdbLibFound:=FileExists(GdbLibFile);
+            end;
+        end;
+    end;
+
+  // When we're cross-compiling, running the gdbver executable to detect the
+  // gdb-version is not possible, unless a i386-win32 to i386-go32v2 compilation
+  // is performed.
+  if GdbLibFound and
+     (((Defaults.CPU=HostCPU) and (Defaults.OS=HostOS))
+       or ((Defaults.CPU=i386) and (Defaults.OS=go32v2) and (HostOS=win32) and (HostCPU=i386))) then
+    begin
+      P.Options.Add('-Fl'+GdbLibDir);
+      GdbVerTarget:=p.Targets.AddUnit('src'+PathDelim+'gdbver.pp');
+      Installer.BuildEngine.ResolveFileNames(p,HostCPU,HostOS,false);
+      Installer.BuildEngine.Log(vlCommand,'GDB-lib found, compiling and running gdbver to obtain GDB-version');
+      Installer.BuildEngine.Compile(P,GdbVerTarget);
+      p.Targets.Delete(GdbVerTarget.Index);
+      Installer.BuildEngine.ExecuteCommand('src/gdbver','-o src/gdbver.inc');
+
+      // Pass -dUSE_MINGW_GDB to the compiler when a MinGW gdb is used
+      if FileExists(GdbLibDir+PathDelim+MinGWGdbLibName) then
+        begin
+          P.Options.Add('-dUSE_MINGW_GDB');
+          Installer.BuildEngine.Log(vlCommand,'Using GDB (MinGW)')
+        end
+      else
+        begin
+          Installer.BuildEngine.Log(vlCommand,'Using GDB')
+        end;
+    end
+  else
+    begin
+      // No suitable gdb found, use gdb_nogdb.inc
+      L := TStringList.Create;
+      try
+        if P.Directory<>'' then
+          L.values['src'+DirectorySeparator+'gdbver_nogdb.inc'] := IncludeTrailingPathDelimiter(P.Directory) +'src'+DirectorySeparator+'gdbver.inc'
+        else
+          L.values['src'+DirectorySeparator+'gdbver_nogdb.inc'] := 'src'+DirectorySeparator+'gdbver.inc';
+        Installer.BuildEngine.cmdcopyfiles(L, Installer.BuildEngine.StartDir);
+      finally
+        L.Free;
+      end;
+
+    end;
+end;
+
+procedure AfterCompile_gdbint(Sender: TObject);
+var
+  L : TStrings;
+begin
+  // Remove the generated gdbver.inc
+  L := TStringList.Create;
+  try
+    L.add(IncludeTrailingPathDelimiter(Installer.BuildEngine.StartDir)+'src/gdbver.inc');
+    Installer.BuildEngine.CmdDeleteFiles(L);
+  finally
+    L.Free;
+  end;
+end;
+
+procedure add_gdbint;
 
 Var
   P : TPackage;
@@ -10,8 +121,6 @@ Var
 begin
   With Installer do
     begin
-{$endif ALLPACKAGES}
-
     P:=AddPackage('gdbint');
 {$ifdef ALLPACKAGES}
     P.Directory:='gdbint';
@@ -26,6 +135,10 @@ begin
 
     P.SourcePath.Add('src');
     P.IncludePath.Add('src');
+
+    P.BeforeCompileProc:=@BeforeCompile_gdbint;
+    P.AfterCompileProc:=@AfterCompile_gdbint;
+
     //
     // NOTE: the gdbver.inc dependancies gives warnings because the makefile.fpc
     // does a "cp src/gdbver_nogdb.inc src/gdbver.inc" to create it
@@ -40,9 +153,13 @@ begin
         begin
           AddInclude('gdbver.inc');
         end;
+    end;
+end;
 
 {$ifndef ALLPACKAGES}
-    Run;
-    end;
+begin
+  add_gdbint;
+  Installer.Run;
 end.
 {$endif ALLPACKAGES}
+

File diff suppressed because it is too large
+ 126 - 125
packages/univint/fpmake.pp


Some files were not shown because too many files changed in this diff