[QGIS-trac] Re: [Quantum GIS] #2021: [FreeBSD] problem compiling Qgis with grass. Kpty.c qtermwidget

Quantum GIS qgis at qgis.org
Tue Aug 24 13:22:32 EDT 2010


#2021: [FreeBSD] problem compiling Qgis with grass. Kpty.c qtermwidget
------------------------------------------------+---------------------------
   Reporter:  slash                             |              Owner:  nobody       
       Type:  bug                               |             Status:  new          
   Priority:  major: does not work as expected  |          Milestone:  Version 1.5.0
  Component:  Build/Install                     |            Version:  1.3.0        
   Keywords:  freebsd grass                     |   Platform_version:  8.0          
   Platform:  FreeBSD                           |           Must_fix:  No           
Status_info:  0                                 |  
------------------------------------------------+---------------------------

Comment(by slash):

 Sorry, i was away from qgis for a time.

 The bug is still true in the current trunk.

 The solutions is the same :

 QGis use some functions of the Glibc. If you see the
 [http://www.gnu.org/software/coreutils/manual/libc/Manipulating-the-
 Database.html#index-getutent-3350 man page] of getutent & the others you
 have this disclaimer :

 Portability Note: Although many operating systems provide a subset of
 these functions, they are not standardized. There are often subtle
 differences in the return types, and there are considerable differences
 between the various definitions of struct utmp. When programming for the
 GNU system, it is probably best to stick with the functions described in
 this section. If however, '''you want your program to be portable''',
 consider using the XPG functions described in '''XPG Functions, or take a
 look at the BSD compatible functions in Logging In and Out.'''


 You can also include the functions in other source code like this change
 i've made to compile with grass plugins on my FreeBSD :

 Change in src/plugins/grass/qtermwidget/kpty.cpp :

 --- src/plugins/grass/qtermwidget/kpty.cpp.orig 2010-08-24
 18:47:22.000000000 +0
 +++ src/plugins/grass/qtermwidget/kpty.cpp      2010-08-24
 18:48:06.000000000 +0
 @@ -24,6 +24,10 @@

  #include "kpty_p.h"

 +#if defined(__FreeBSD__)
 +#include "kpty_hack_for_bsd"
 +#endif
 +
  #ifdef __sgi
  #define __svr4__
  #endif



 New file in src/plugins/grass/qtermwidget/:
 kpty_hack_for_bsd.h
 kpty_hack_for_bsd.cpp

 (this files includes functions getutent & other).

 This solutions is sometimes used on BSD.

 Also, i have add a path in the FindGRASS.cmake.

 In the attach file (freebsd_patch_qgis.tar.gz) you have :

 The diff file for FindGRASS.cmake with the 2 files (original and modified)
 The diff file for src/plugins/grass/qtermwidget/ktpy.cpp with the 2 files
 (original and modified)
 The new files in src/plugins/grass/qtermwidget/.

-- 
Ticket URL: <http://trac.osgeo.org/qgis/ticket/2021#comment:6>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats


More information about the QGIS-trac mailing list