Bug 88565 - kdnetwork 3.3.0 fails to build when arts support is off
Summary: kdnetwork 3.3.0 fails to build when arts support is off
Status: RESOLVED FIXED
Alias: None
Product: kwireless
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Stefan Winter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-01 00:58 UTC by Steve
Modified: 2004-11-07 20:34 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch to disable arts support in wifi if --without-arts is passed (5.27 KB, patch)
2004-09-20 04:34 UTC, Caleb Tennis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steve 2004-09-01 00:58:28 UTC
Version:            (using KDE KDE 3.3.0)
Installed from:    Gentoo Packages
Compiler:          gcc version 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6) Configured with: /home/portage-build/portage/gcc-3.3.4-r1/work/gcc-3.3.4/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.3 --includedir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3/info --enable-shared --host=i686-pc-linux-gnu --target=i686-pc-linux-gnu --with-system-zlib --enable-languages=c,c++ --enable-threads=posix --enable-long-long --disable-checking --disable-libunwind-exceptions --enable-cstdio=stdio --enable-version-specific-runtime-libs --with-gxx-include-dir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/include/g++-v3 --with-local-prefix=/usr/local --enable-shared --disable-nls --disable-multilib --enable-__cxa_atexit --enable-clocale=generic
Thread model: posix
OS:                Linux

When arts support is off when building kdenetwork (using gentoo, I ran into this problem with a USE flag of -arts), syntax errors result when building kdenetwork. the errors are as follows:

make[3]: Entering directory `/var/tmp/portage/kdenetwork-3.3.0/work/kdenetwork-3.3.0/wifi'
/usr/qt/3/bin/moc ./interface_wireless.h -o interface_wireless.moc
/usr/qt/3/bin/moc ./interface_wireless_wirelessextensions.h -o interface_wireless_wirelessextensions.moc
/usr/qt/3/bin/moc ./kwifimanager.h -o kwifimanager.moc
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/kde/3.3/include -I/usr/qt/3/include -I/usr/X11R6/include   -DQT_THREAD_SUPPORT  -D_REENTRANT -D_FILE_OFFSET_BITS=64  -Wnon-virtual-dtor -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -DNDEBUG -DNO_DEBUG -O2 -march=pentium4 -mcpu=pentium4 -O2 -fomit-frame-pointer -ftracer -mmmx -msse -msse2 -pipe -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION  -c -o locator.o locator.cpp
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/kde/3.3/include -I/usr/qt/3/include -I/usr/X11R6/include   -DQT_THREAD_SUPPORT  -D_REENTRANT -D_FILE_OFFSET_BITS=64  -Wnon-virtual-dtor -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -DNDEBUG -DNO_DEBUG -O2 -march=pentium4 -mcpu=pentium4 -O2 -fomit-frame-pointer -ftracer -mmmx -msse -msse2 -pipe -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION  -c -o main.o main.cpp
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/kde/3.3/include -I/usr/qt/3/include -I/usr/X11R6/include   -DQT_THREAD_SUPPORT  -D_REENTRANT -D_FILE_OFFSET_BITS=64  -Wnon-virtual-dtor -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -DNDEBUG -DNO_DEBUG -O2 -march=pentium4 -mcpu=pentium4 -O2 -fomit-frame-pointer -ftracer -mmmx -msse -msse2 -pipe -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION  -c -o picture.o picture.cpp
In file included from locator.cpp:20:
interface_wireless.h:24:28: arts/iomanager.h: No such file or directory
interface_wireless.h:25:29: arts/dispatcher.h: No such file or directory
In file included from picture.cpp:23:
interface_wireless.h:24:28: arts/iomanager.h: No such file or directory
interface_wireless.h:25:29: arts/dispatcher.h: No such file or directory
In file included from picture.cpp:23:
interface_wireless.h:98: error: `Arts' is not a class or namespace
interface_wireless.h:99: error: `TimeNotify' is not a class or namespace
interface_wireless.h:99: error: invalid base-class specification
interface_wireless.h:101: error: syntax error before `::' token
interface_wireless.h:102: error: parse error before `::' token
interface_wireless.h:107: error: parse error before `}' token
In file included from locator.cpp:20:
interface_wireless.h:98: error: `Arts' is not a class or namespace
interface_wireless.h:99: error: `TimeNotify' is not a class or namespace
interface_wireless.h:99: error: invalid base-class specification
interface_wireless.h:101: error: syntax error before `::' token
interface_wireless.h:102: error: parse error before `::' token
interface_wireless.h:107: error: parse error before `}' token
make[3]: *** [locator.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [picture.o] Error 1
In file included from kwifimanager.h:43,
                 from main.cpp:25:
interface_wireless.h:24:28: arts/iomanager.h: No such file or directory
interface_wireless.h:25:29: arts/dispatcher.h: No such file or directory
In file included from kwifimanager.h:43,
                 from main.cpp:25:
interface_wireless.h:98: error: `Arts' is not a class or namespace
interface_wireless.h:99: error: `TimeNotify' is not a class or namespace
interface_wireless.h:99: error: invalid base-class specification
interface_wireless.h:101: error: syntax error before `::' token
interface_wireless.h:102: error: parse error before `::' token
interface_wireless.h:107: error: parse error before `}' token
make[3]: *** [main.o] Error 1
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/kdenetwork-3.3.0/work/kdenetwork-3.3.0/wifi'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/kdenetwork-3.3.0/work/kdenetwork-3.3.0'
make: *** [all] Error 2

Now, the solution to this problem, for me, and a few others, was to apply the following patch:

diff -uraN wifi.orig/interface_wireless.cpp wifi/interface_wireless.cpp
--- wifi.orig/interface_wireless.cpp	2004-06-25 13:10:25.000000000 +0400
+++ wifi/interface_wireless.cpp	2004-08-22 03:52:11.000000000 +0400
@@ -19,10 +19,6 @@
 #include <qdir.h>
 #include <qfile.h>
 #include <qstringlist.h>
-#include <arts/artsflow.h>
-#include <arts/connect.h>
-#include <arts/iomanager.h>
-#include <arts/referenceclean.h>
 #include <iostream>
 #include <string>
 #include <klocale.h>
@@ -148,35 +144,6 @@
     return false;
 }
 
-void
-sinus_wave (double frequency)
-{
-  using namespace Arts;
-  StdIOManager *limiter = new StdIOManager;
-  Dispatcher dispatcher (limiter);
-  MyTimeNotify *zeit = new MyTimeNotify (&dispatcher);
-  Synth_FREQUENCY freq;
-  Synth_WAVE_SIN sin;
-  Synth_PLAY play;
-  setValue (freq, frequency);
-  connect (freq, sin);
-  connect (sin, play, "invalue_left");
-  freq.start ();
-  sin.start ();
-  play.start ();
-  limiter->addTimer (250, zeit);
-  dispatcher.run ();
-  play.stop ();
-  sin.stop ();
-  freq.stop ();
-}
-
-void
-MyTimeNotify::notifyTime ()
-{
-  test->terminate ();
-}
-
 QString
 whois (const char *MAC_ADR, QStringList APList)
 {
diff -uraN wifi.orig/interface_wireless.h wifi/interface_wireless.h
--- wifi.orig/interface_wireless.h	2004-07-17 23:10:48.000000000 +0400
+++ wifi/interface_wireless.h	2004-08-22 03:51:11.000000000 +0400
@@ -21,8 +21,6 @@
 #include <qobject.h>
 #include <qstring.h>
 #include <qstringlist.h>
-#include <arts/iomanager.h>
-#include <arts/dispatcher.h>
 
 const int POLL_DELAY_MS = 250;	// how much time between device polls
 const int MAX_HISTORY = 240;	// number of device states to be saved
@@ -92,20 +90,6 @@
   QStringList * ignoreInterfaces;
 };
 
-void sinus_wave (double frequency);
-
-class MyTimeNotify:public
-  Arts::TimeNotify
-{
-public:
-  Arts::Dispatcher * test;
-  MyTimeNotify (Arts::Dispatcher * siff)
-  {
-    test = siff;
-  };
-  void notifyTime ();
-};
-
 QString whois (const char *MAC_ADR, QStringList APList);
 
 #endif /*  INTERFACE_WIRELESS_H */
diff -uraN wifi.orig/interface_wireless_wirelessextensions.cpp wifi/interface_wireless_wirelessextensions.cpp
--- wifi.orig/interface_wireless_wirelessextensions.cpp	2004-07-17 23:10:48.000000000 +0400
+++ wifi/interface_wireless_wirelessextensions.cpp	2004-08-22 03:53:18.000000000 +0400
@@ -21,10 +21,6 @@
 #include <qdir.h>
 #include <qfile.h>
 #include <qstringlist.h>
-#include <arts/artsflow.h>
-#include <arts/connect.h>
-#include <arts/iomanager.h>
-#include <arts/referenceclean.h>
 #include <iostream>
 #include <string>
 #include <klocale.h>
diff -uraN wifi.orig/interface_wireless_wirelessextensions.h wifi/interface_wireless_wirelessextensions.h
--- wifi.orig/interface_wireless_wirelessextensions.h	2004-06-25 13:10:25.000000000 +0400
+++ wifi/interface_wireless_wirelessextensions.h	2004-08-22 03:53:01.000000000 +0400
@@ -20,8 +20,6 @@
 
 #include <qstring.h>
 #include <qstringlist.h>
-#include <arts/iomanager.h>
-#include <arts/dispatcher.h>
 
 #include "interface_wireless.h"
 
diff -uraN wifi.orig/kwifimanager.cpp wifi/kwifimanager.cpp
--- wifi.orig/kwifimanager.cpp	2004-07-17 23:10:48.000000000 +0400
+++ wifi/kwifimanager.cpp	2004-08-22 03:53:51.000000000 +0400
@@ -378,7 +378,6 @@
 {
   int sig, noi, qual;
   device->get_current_quality (sig, noi, qual);
-  sinus_wave (150.0 + qual * 20);
   if (qual == 0)
     {
       tricorder_trigger->changeInterval (2000);
diff -uraN wifi.orig/Makefile.in wifi/Makefile.in
--- wifi.orig/Makefile.in	2004-08-16 13:12:47.000000000 +0400
+++ wifi/Makefile.in	2004-08-22 03:55:34.000000000 +0400
@@ -454,7 +454,7 @@
 			asusled.cpp interface_dcop_skel.cpp
 
 kwifimanager_LDFLAGS = $(all_libraries)
-kwifimanager_LDADD = -lartsflow -lmcop -liw $(LIB_KDEUI)
+kwifimanager_LDADD = -liw $(LIB_KDEUI)
 noinst_HEADERS = interface_wireless.h \
 			interface_wireless_wirelessextensions.h \
 			interface_dcop.h \
diff -uraN wifi.orig/status.cpp wifi/status.cpp
--- wifi.orig/status.cpp	2004-05-23 00:57:36.000000000 +0400
+++ wifi/status.cpp	2004-08-22 03:54:35.000000000 +0400
@@ -16,6 +16,7 @@
  ***************************************************************************/
 
 #include <klocale.h>
+#include <unistd.h>
 #include "status.h"
 #include "interface_wireless.h"
 
After this, it compiles just fine. 

This has been documented in a gentoo bug on bugs.gentoo.org (including the patch), under bug number 61186. Which can be found at http://bugs.gentoo.org/show_bug.cgi?id=61186 .

Thanks, Steve
Comment 1 Nicolas Goutte 2004-09-01 10:29:49 UTC
KWifi seems to be part of kwireless, so moving the bug there...

Also be careful that patches should not be entered as simple text but attached to the bug report (which you can do once the bug report is created), otherwise they could get corrupted very easily.

Have a nice day!
Comment 2 Stefan Winter 2004-09-01 10:53:09 UTC
Well, your patch seems to resolve the issue, BUT it completely removes a feature that was requested by several users. Namely: emit beeps in varying frequencies (depending on signal strength) when you are in range of a wireless network.
Sorry, I won´t apply that. One could think of a set of #DEFINE statements to exclude the code in question when arts is not present, but no altogether removal.
Comment 3 Steve 2004-09-01 16:13:33 UTC
I'd agree with that, you can alter the configure script to add a -DARTS or -DNARTS (and place the removals in the patch under a IFDEF ARTS and the additions under IFNDEF ARTS or IFDEF NARTS. 

The patch I applied is really just a cheap hack, it works on gentoo because there is a use flag for arts, so in the ebuild one can just check to see if its a -arts situation, you could get the same result (only having the patch take effect if arts is disabled on the ./configure options) by placing the contents of the patch in each file in a ifdef statment.

Steve
Comment 4 Caleb Tennis 2004-09-20 04:34:57 UTC
Created attachment 7586 [details]
Patch to disable arts support in wifi if --without-arts is passed

Should apply to HEAD cleanly - just needs tested.
Comment 5 Stefan Winter 2004-09-20 08:29:27 UTC
Hi,

I´ll check your patch ASAP (i.e. not before another 26 hours, until I have completed my diploma).

Stefan
Comment 6 Caleb Tennis 2004-10-04 02:34:32 UTC
Any word on this?  I'd like to get this fix committed this for upcoming releases.  It's already too late for 3.3.1.
Comment 7 Stefan Winter 2004-10-04 07:34:37 UTC
Yes, I looked into it lately. It fixes compilation --without-arts alright, but it fails to build when it is present.
Seems like HAS_ARTS is not set correctly in the build envirmonment, the -l phrases are never set, even if they should be.
I am not sure if the problem is within your patch, but you could halp me if you'd double-check this.
Comment 8 Stefan Winter 2004-11-02 17:37:07 UTC
The bug was just fixed in KDE CVS in the HEAD branch and will be available in KDE 3.4.
I´ll wait some time to see if everything works flawlessly (some changes in the patch were necessary) and will then probably backport it to KDE_3_3_BRANCH.
Comment 9 Stefan Winter 2004-11-07 12:57:31 UTC
The backport for 3.3.x branch is in place now.