Bug 274462

Summary: build failure in kmemoryinfo - swapctl
Product: [Applications] digikam Reporter: tropikhajma <tropikhajma>
Component: Portability-CompilationAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles
Priority: NOR    
Version: 2.0.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Solaris   
Latest Commit: Version Fixed In: 2.0.0
Sentry Crash Report:

Description tropikhajma 2011-05-29 22:30:21 UTC
Version:           2.0.0 (using KDE 4.6.2) 
OS:                Solaris

building digikam-2.0.0-beta5 on Solaris 11e/amd64 with gcc 4.5.2 fails with: 

...
In file included from /home/test/packages/BUILD/digikam-2.0.0-beta5/i386/digikam-2.0.0-beta5/core/libs/3rdparty/kmemoryinfo/kmemoryinfo_backend.cpp:408:0,
                 from /home/test/packages/BUILD/digikam-2.0.0-beta5/i386/digikam-2.0.0-beta5/core/libs/3rdparty/kmemoryinfo/kmemoryinfo.cpp:182:
/usr/include/sys/swap.h:51:2: error: #error "Cannot use swapctl in the large files compilation environment"

Just for the record, the below patch lets me proceed, but there's no doubt it's just a crude hack and not a proper solution:

--- digikam-2.0.0-beta5/core/libs/3rdparty/kmemoryinfo/kmemoryinfo_backend.cpp.orig	2011-05-29 22:01:30.372131120 +0200
+++ digikam-2.0.0-beta5/core/libs/3rdparty/kmemoryinfo/kmemoryinfo_backend.cpp	2011-05-29 22:02:06.723252758 +0200
@@ -404,6 +404,9 @@
 // ----------------------------------------------------------------------------
 
 #ifdef Q_OS_SOLARIS
+#ifdef _FILE_OFFSET_BITS
+#undef _FILE_OFFSET_BITS
+#endif
 #include <sys/stat.h>
 #include <sys/swap.h>
 #include <unistd.h>


Reproducible: Always
Comment 1 caulier.gilles 2011-06-08 13:12:25 UTC
As i don't have a Solaris computer, i cannot found a better way to fix this problem.

Gilles Caulier
Comment 2 caulier.gilles 2011-06-08 13:13:10 UTC
Git commit 497a0cc2e9e601366875151dfd2a01de69a0f20e by Gilles Caulier.
Committed on 08/06/2011 at 13:12.
Pushed by cgilles into branch 'master'.

fix broken compilation under Solaris
BUGS: 274462

M  +3    -0    libs/3rdparty/kmemoryinfo/kmemoryinfo_backend.cpp     

http://commits.kde.org/digikam/497a0cc2e9e601366875151dfd2a01de69a0f20e
Comment 3 Francesco Riosa 2011-06-10 14:29:11 UTC
Git commit 054de546570266f8c5dd224eb72814a42d4679b4 by Francesco Riosa, on behalf of Gilles Caulier.
Committed on 08/06/2011 at 13:12.
Pushed by riosa into branch 'sql/2.0'.

fix broken compilation under Solaris
BUGS: 274462

M  +3    -0    libs/3rdparty/kmemoryinfo/kmemoryinfo_backend.cpp     

http://commits.kde.org/digikam/054de546570266f8c5dd224eb72814a42d4679b4