View Issue Details

IDProjectCategoryView StatusLast Update
0011024PatchesWidgetsetpublic2008-07-09 23:00
ReporterGraeme Geldenhuys Assigned ToMattias Gaertner  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Platformx86OSUbuntu Linux 
Product Version0.9.25 (SVN) 
Target Version0.9.26 
Summary0011024: CodeTools definetemplate update for fpGUI widgetset
DescriptionThe CodeTools built-in defines are still for the old fpGUI. Because of this you cannot compile the LCL-fpGUI widgetset using the latest fpGUI. Attached is a patch that updates them and fixes some previous copy & paste issues where defines were added to the IfDef part instead of Else part. See attached screenshot of CodeTools Define Editor showing the problem and then after the patch how I believe it should look.

No another problem.
Even with the patch applie, I am unable to compile the LCL-fpGUI widget set. It can't find the include files in the platform specific directories. Looking at the messages window, I can see the problem. The platform specific Include paths are not all added to IncPath. The code in the definestemplate unit looks correct, even compared to other code from other widget sets. If I add that include path manually and run the compile line from the command prompt, the LCL-fpGUI widgetset compiles correctly.
TagsNo tags attached.
Fixed in Revision
LazTarget-
WidgetsetfpGUI
Attached Files

Activities

2008-03-20 14:10

 

codetools_definetemplates.patch (5,532 bytes)   
Index: components/codetools/definetemplates.pas
===================================================================
--- components/codetools/definetemplates.pas	(revision 14596)
+++ components/codetools/definetemplates.pas	(working copy)
@@ -4302,7 +4302,7 @@
         ExtraSrcPath:=ExtraSrcPath+';../../../interfaces/gtk';
       if (CurWidgetSet='fpgui') then
         ExtraSrcPath:=ExtraSrcPath
-          +';../../../interfaces/fpgui/gfx'
+          +';../../../interfaces/fpgui/corelib'
           +';../../../interfaces/fpgui/gui';
       LCLUnitsCPUOSWidgetSetDir.AddChild(
         TDefineTemplate.Create('CompiledSrcPath',
@@ -4313,10 +4313,10 @@
         IfTemplate:=TDefineTemplate.Create('IFDEF windows',
           ctsIfDefWindows, 'windows', '', da_IfDef);
           // then add gfx/gdi to CompiledSrcPath
-          IfTemplate.AddChild(TDefineTemplate.Create('Add gfx/gdi to CompiledSrcPath',
-            Format(ctsAddsDirToSourcePath,['gfx/gdi']),
+          IfTemplate.AddChild(TDefineTemplate.Create('Add corelib/gdi to CompiledSrcPath',
+            Format(ctsAddsDirToSourcePath,['corelib/gdi']),
               ExternalMacroStart+'CompiledSrcPath',
-              d(LazarusSrcDir+'/lcl/interfaces/fpgui/gfx/gdi')
+              d(LazarusSrcDir+'/lcl/interfaces/fpgui/corelib/gdi')
               +';'+CompiledSrcPath
               ,da_Define));
         LCLUnitsCPUOSWidgetSetDir.AddChild(IfTemplate);
@@ -4324,10 +4324,10 @@
         ElseTemplate:=TDefineTemplate.Create('ELSE',
           ctsElse, '', '', da_Else);
           // then add gfx/x11 to CompiledSrcPath
-          IfTemplate.AddChild(TDefineTemplate.Create('Add gfx/x11 to CompiledSrcPath',
-            Format(ctsAddsDirToSourcePath,['gfx/x11']),
+          ElseTemplate.AddChild(TDefineTemplate.Create('Add corelib/x11 to CompiledSrcPath',
+            Format(ctsAddsDirToSourcePath,['corelib/x11']),
               ExternalMacroStart+'SrcPath',
-              d(LazarusSrcDir+'/lcl/interfaces/fpgui/gfx/x11')
+              d(LazarusSrcDir+'/lcl/interfaces/fpgui/corelib/x11')
               +';'+CompiledSrcPath
               ,da_Define));
         LCLUnitsCPUOSWidgetSetDir.AddChild(ElseTemplate);
@@ -4416,42 +4416,56 @@
   IntfDirTemplate:=TDefineTemplate.Create('fpgui',
     ctsIntfDirectory,'','fpgui',da_Directory);
     // add unit paths
-    IntfDirTemplate.AddChild(TDefineTemplate.Create('Add gui, gfx to SrcPath',
-    Format(ctsAddsDirToSourcePath,['gui, gfx']),
+    IntfDirTemplate.AddChild(TDefineTemplate.Create('Add gui, corelib to SrcPath',
+    Format(ctsAddsDirToSourcePath,['gui, corelib']),
       ExternalMacroStart+'SrcPath',
       d(LazarusSrcDir+'/lcl/interfaces/fpgui/gui')
-      +';'+d(LazarusSrcDir+'/lcl/interfaces/fpgui/gfx')
+      +';'+d(LazarusSrcDir+'/lcl/interfaces/fpgui/corelib')
       +';'+SrcPath
       ,da_DefineRecurse));
-    // ifdef windows
+    // and include path
+    IntfDirTemplate.AddChild(TDefineTemplate.Create('Add corelib to IncPath',
+    Format(ctsAddsDirToIncludePath,['corelib']),
+      ExternalMacroStart+'IncPath',
+      d(LazarusSrcDir+'/lcl/interfaces/fpgui/corelib')
+      +';'+IncPath
+      ,da_Define));
+    // platform specific paths (unit and include)
     IfTemplate:=TDefineTemplate.Create('IFDEF windows',
       ctsIfDefWindows, 'windows', '', da_IfDef);
-      // then add gdi to SrcPath
-      IfTemplate.AddChild(TDefineTemplate.Create('Add gdi to SrcPath',
+      // then add corelib/gdi to SrcPath
+      IfTemplate.AddChild(TDefineTemplate.Create('Add corelib/gdi to SrcPath',
         Format(ctsAddsDirToSourcePath,['gdi']),
           ExternalMacroStart+'SrcPath',
-          d(LazarusSrcDir+'/lcl/interfaces/fpgui/gfx/gdi')
+          d(LazarusSrcDir+'/lcl/interfaces/fpgui/corelib/gdi')
           +';'+SrcPath
           ,da_DefineRecurse));
+      // then add corelib/gdi to IncPath
+      IfTemplate.AddChild(TDefineTemplate.Create('Add corelib/gdi to IncPath',
+        Format(ctsAddsDirToIncludePath,['gdi']),
+          ExternalMacroStart+'IncPath',
+          d(LazarusSrcDir+'/lcl/interfaces/fpgui/corelib/gdi')
+          +';'+IncPath
+          ,da_Define));
     IntfDirTemplate.AddChild(IfTemplate);
     // else
     ElseTemplate:=TDefineTemplate.Create('ELSE',
       ctsElse, '', '', da_Else);
-      // then add gfx/x11 to SrcPath
-      IfTemplate.AddChild(TDefineTemplate.Create('Add x11 to SrcPath',
+      // then add corelib/x11 to SrcPath
+      ElseTemplate.AddChild(TDefineTemplate.Create('Add corelib/x11 to SrcPath',
         Format(ctsAddsDirToSourcePath,['x11']),
           ExternalMacroStart+'SrcPath',
-          d(LazarusSrcDir+'/lcl/interfaces/fpgui/gfx/x11')
+          d(LazarusSrcDir+'/lcl/interfaces/fpgui/corelib/x11')
           +';'+SrcPath
           ,da_DefineRecurse));
+      // then add corelib/x11 to IncPath
+      ElseTemplate.AddChild(TDefineTemplate.Create('Add corelib/x11 to IncPath',
+        Format(ctsAddsDirToIncludePath,['x11']),
+          ExternalMacroStart+'IncPath',
+          d(LazarusSrcDir+'/lcl/interfaces/fpgui/corelib/x11')
+          +';'+IncPath
+          ,da_Define));
     IntfDirTemplate.AddChild(ElseTemplate);
-    // add include paths
-    IntfDirTemplate.AddChild(TDefineTemplate.Create('Add gfx to IncPath',
-    Format(ctsAddsDirToSourcePath,['gfx']),
-      ExternalMacroStart+'IncPath',
-      d(LazarusSrcDir+'/lcl/interfaces/fpgui/gfx')
-      +';'+IncPath
-      ,da_DefineRecurse));
   SubDirTempl.AddChild(IntfDirTemplate);
 
   // <LazarusSrcDir>/components

2008-03-20 14:10

 

Screenshot_before.gif (20,158 bytes)   
Screenshot_before.gif (20,158 bytes)   

2008-03-20 14:11

 

Screenshot_after.gif (16,908 bytes)   
Screenshot_after.gif (16,908 bytes)   

Graeme Geldenhuys

2008-03-20 14:15

reporter   ~0018392

I forgot to show the directory structure of the latest fpGUI, if the paths in codetoolsdefines unit is unclear.

fpGUI/src
   .
   |-corelib
   |---carbon
   |---gdi
   |---x11
   |-gui
   |---db

2008-03-20 14:17

 

compiler_messages.txt (1,661 bytes)   
make: Entering directory `/opt/lazarus/lcl'
/bin/rm -f units/i386-linux/alllclunits.ppu
/opt/fpc/bin/fpc -gl -Fu. -Funonwin32 -Fuforms -Fuwidgetset -Fiinclude -FE. -FUunits/i386-linux -Fl/usr/lib/gcc/i486-linux-gnu/4.1.3 -Flinclude -Fl/etc/ld.so.conf.d/*.conf -di386 alllclunits.pp
Free Pascal Compiler version 2.2.0 [2007/08/31] for i386
Copyright (c) 1993-2007 by Florian Klaempfl
Target OS: Linux for i386
Compiling alllclunits.pp
75 lines compiled, 0.6 sec
/usr/bin/make -C interfaces all
make[1]: Entering directory `/opt/lazarus/lcl/interfaces'
/usr/bin/make -C fpgui all
make[2]: Entering directory `/opt/lazarus/lcl/interfaces/fpgui'
/bin/rm -f ../../units/i386-linux/fpgui/interfaces.ppu \
		../../units/i386-linux/fpgui/interfaces.o
/opt/fpc/bin/fpc -gl -dfpgui -Fu../../units/i386-linux -Fu. -Fucorelib -Fugui -Fucorelib/x11 -Ficorelib -FE. -FU../../units/i386-linux/fpgui -di386 interfaces.pp
Free Pascal Compiler version 2.2.0 [2007/08/31] for i386
Copyright (c) 1993-2007 by Florian Klaempfl
Target OS: Linux for i386
Compiling interfaces.pp
Compiling fpguiint.pp
Compiling ./corelib/fpgfx.pas
Compiling ./corelib/gfxbase.pas
Compiling ./corelib/fpgfx.pas
Compiling ./corelib/x11/gfx_x11.pas
Compiling ./corelib/fpgfx.pas
Compiling ./corelib/gfx_translations.pas
Compiling ./corelib/gfx_utils.pas
/opt/lazarus/lcl/interfaces/fpgui/corelib/gfx_utils.pas(43,2) Fatal: Can't open include file "gfx_utils_impl.inc"


*******
This is what the last compile line should have looked like:

fpc -gl -dfpgui -Fu../../units/i386-linux -Fu. -Fucorelib -Fugui -Fucorelib/x11 -Ficorelib -Ficorelib/x11 -FE. -FU../../units/i386-linux/fpgui -di386 interfaces.pp

compiler_messages.txt (1,661 bytes)   

Graeme Geldenhuys

2008-03-20 14:19

reporter   ~0018393

I also upload the compiler messages. If you look at the last FPC call, you can see the -Ficorelib/x11 is missing from the compiler line, yet it looks correct in the CodeTools Defines Editor.

Mattias Gaertner

2008-03-20 17:31

manager   ~0018395

You forgot the Makefile.

Issue History

Date Modified Username Field Change
2008-03-20 14:10 Graeme Geldenhuys New Issue
2008-03-20 14:10 Graeme Geldenhuys File Added: codetools_definetemplates.patch
2008-03-20 14:10 Graeme Geldenhuys Widgetset => fpGUI
2008-03-20 14:10 Graeme Geldenhuys File Added: Screenshot_before.gif
2008-03-20 14:11 Graeme Geldenhuys File Added: Screenshot_after.gif
2008-03-20 14:15 Graeme Geldenhuys Note Added: 0018392
2008-03-20 14:17 Graeme Geldenhuys File Added: compiler_messages.txt
2008-03-20 14:19 Graeme Geldenhuys Note Added: 0018393
2008-03-20 17:31 Mattias Gaertner LazTarget => -
2008-03-20 17:31 Mattias Gaertner Note Added: 0018395
2008-03-20 17:31 Mattias Gaertner Assigned To => Mattias Gaertner
2008-03-20 17:31 Mattias Gaertner Status new => resolved
2008-03-20 17:31 Mattias Gaertner Resolution open => fixed
2008-04-24 07:49 Vincent Snijders Target Version => 0.9.26
2008-07-09 23:00 Marc Weustink Status resolved => closed