[Kde-nonlinux] Re: Fwd: Re: Compiling on Solaris 2.6

Simon Josefsson kde-nonlinux@kde.org
Sat, 16 Feb 2002 20:53:04 +0100


Michael Matz <matz@kde.org> writes:

>> but README.qt-copy didn't say it is required.
>
> % grep stl README.qtcopy
> ./configure -system-zlib -qt-gif -system-libpng -system-libjpeg
> -plugin-imgfmt-mng -thread -no-stl -no-xinerama -no-g++-exceptions
>
> You have in principle a point, because it says also, that if you need STL
> to omit the appropriate option.

IMHO, yes, KDE should work if QT is compiled with STL.

> But that point is mood: your original bugreport indicated an
> incompatibility between /usr/include/net/if.h and stl_map.h for
> Solaris 2.6.  These are system resp. g++ headers, on which we don't
> have an influence.  I bet we simply can't make that work easily, the
> system headers are broken.  An idea would be to #define away the
> conflicting symbol (map? --> shit_old_solaris_netif_map_bla) in the
> second header, but that can only be answered and tested by you.

It seems as if people have had this problem before, but I could not
find a good solution.  Unfortunately Solaris 8 seem to have the same
broken if.h.  So, I don't have any other ideas than the patch below.

Still, kdenetwork doesn't compile as Solaris 2.6 doesn't have
inet_aton().  I'm not sure how you want to solve it..

In file included from libkcm_lanbrowser_la.all_cpp.cpp:3:
../../../kdenetwork/lanbrowsing/kcmlisa/setupwizard.cpp: In method `void SetupWizard::generateLisaConfigInfo(QString)':
../../../kdenetwork/lanbrowsing/kcmlisa/setupwizard.cpp:523: implicit declaration of function `int inet_aton(...)'
make[1]: *** [libkcm_lanbrowser_la.all_cpp.lo] Error 1
make[1]: Leaving directory `/afs/pdc.kth.se/home/j/jas/src/kde/kdenetwork-o/lanbrowsing/kcmlisa'
make: *** [all-recursive] Error 1
my$ 

Index: lanbrowsing/kcmlisa/findnic.cpp
===================================================================
RCS file: /cvs/kdenetwork/lanbrowsing/kcmlisa/findnic.cpp,v
retrieving revision 1.4
diff -w -u -r1.4 findnic.cpp
--- lanbrowsing/kcmlisa/findnic.cpp     2001/09/27 22:11:59     1.4
+++ lanbrowsing/kcmlisa/findnic.cpp     2002/02/16 19:51:57
@@ -28,7 +28,15 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/socket.h>
+#ifdef USE_SOLARIS
+/* net/if.h is incompatible with STL on Solaris 2.6 and 2.8, redefine
+   map in the header file because we don't need it. -- Simon Josefsson */
+#define map junkmap
+#endif
 #include <net/if.h>
+#ifdef USE_SOLARIS
+#undef map
+#endif
 #include <sys/ioctl.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
Index: kcontrol/nics/nic.cpp
===================================================================
RCS file: /cvs/kdebase/kcontrol/nics/nic.cpp,v
retrieving revision 1.7
diff -w -u -r1.7 nic.cpp
--- kcontrol/nics/nic.cpp       2002/01/25 09:49:56     1.7
+++ kcontrol/nics/nic.cpp       2002/02/16 19:52:21
@@ -42,7 +42,15 @@
 #include <stdio.h>
 #include <unistd.h>
 #include <sys/socket.h>
+#if USE_SOLARIS
+/* net/if.h is incompatible with STL on Solaris 2.6 and 2.8, redefine
+   map in the header file because we don't need it. -- Simon Josefsson */
+#define map junkmap
+#endif
 #include <net/if.h>
+#if USE_SOLARIS
+#undef map
+#endif
 #include <sys/ioctl.h>
 
 typedef KGenericFactory<KCMNic, QWidget > KCMNicFactory;