PDA

View Full Version : Installing on OpenBSD



wendigo
05-04-2008, 04:02 AM
Howdy,

I am attempting to install ShowEQ on OpenBSD 4.1. I am curious about the specific dependencies for OpenBSD. I am having trouble with configure not being able to find the QT libraries. I have installed QT 3.3.7 from ports. I've played with the configure flags a bit, but nothing seems to get past the error with the libraries.

checking for Qt... yes
>> Found version.: 3.3.7
>>> Headers......: /usr/local/lib/qt3//include/
>>>> Libraries...: Unable to locate?!?
configure: error: Please verify your Qt lib install!

Any direction on where I can look or dependencies I have missed is much appreciated. Thanks in advance for your time.

purple
05-05-2008, 03:50 PM
It's been awhile, but I think there is a QT3DIR environment variable maybe? Where do you have qt installed? Is it split up or installed all under one directory?

I seem to also remember that there are some math function differences. I don't remember if I ever accepted trunk monkey's patch to fix them.

wendigo
05-08-2008, 05:27 AM
Howdy,

Thanks for your reply. I have used every QT configure flag and environment variable to the same results. I've actually managed to get the configure process to complete. I just hit this error during the make:


g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local//include -I/usr/X11R6/include -DPKGDATADIR=\"/usr/local/share/showeq/\" -I/usr/include/pcap -O2 -Wall -g -ggdb -DDEBUG -finline-functions -DQT_THREAD_SUPPORT=1 -DDISPLAY_ICONS=false -DICON_DIR=\"/eq-icons/\" -g -O2 -MT spellshell.o -MD -MP -MF .deps/spellshell.Tpo -c -o spellshell.o spellshell.cpp
In file included from spellshell.cpp:19:
packetcommon.h:111:2: warning: #warning "BigEndian hasn't been tested."
spellshell.cpp: In member function `QString SpellItem::castTimeStr() const':
spellshell.cpp:47: error: invalid conversion from `const long int*' to `const
time_t*'
*** Error code 1


So I'm curious if there is a dependency I have missed somewhere. OpenBSD doesn't have the same packages available to it, such as qt-devel. I don't think glibc is available, either, is it?

purple
05-08-2008, 12:39 PM
struct tm *CreationLocalTime = localtime( &(m_castTime.tv_sec) );


localtime takes a const time_t* on both openbsd and linux. On linux, timeval.tv_sec is time_t, so this works fine. I assume from the error that timeval.tv_sec on openbsd is a long.

Try opening up src/spellshell.cpp and go to line 47 and change it to:


struct tm *CreationLocalTime = localtime((time_t*) &(m_castTime.tv_sec) );



Maybe?

wendigo
05-09-2008, 03:24 AM
Howdy,

Thanks again! That got me through that step. The next issue I encountered is as follows:


g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local//include -I/usr/X11R6/include -DPKGDATADIR=\"/usr/local/share/showeq/\" -I/usr/include/pcap -O2 -Wall -g -ggdb -DDEBUG -finline-functions -DQT_THREAD_SUPPORT=1 -DDISPLAY_ICONS=false -DICON_DIR=\"/eq-icons/\" -g -O2 -MT spelllist.o -MD -MP -MF .deps/spelllist.Tpo -c -o spelllist.o spelllist.cpp
spelllist.cpp:400:25: spelllist.moc: No such file or directory
*** Error code 1

To correct this, I generated this file manually:


/usr/local//bin/moc src/spelllist.h -o src/spelllist.moc
-rw-r--r-- 1 root wheel 7.9K May 9 04:18 src/spelllist.moc

So this got me through the next step, but now I'm hitting the following:


g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local//include -I/usr/X11R6/include -DPKGDATADIR=\"/usr/local/share/showeq/\" -I/usr/include/pcap -O2 -Wall -g -ggdb -DDEBUG -finline-functions -DQT_THREAD_SUPPORT=1 -DDISPLAY_ICONS=false -DICON_DIR=\"/eq-icons/\" -g -O2 -MT vpacket.o -MD -MP -MF .deps/vpacket.Tpo -c -o vpacket.o vpacket.cpp
vpacket.cpp: In member function `int VPacket::flush()':
vpacket.cpp:513: error: `fdatasync' undeclared (first use this function)
vpacket.cpp:513: error: (Each undeclared identifier is reported only once for
each function it appears in.)
*** Error code 1

purple
05-09-2008, 07:31 AM
You can



#define fdatasync fsync


If you're planning on submitting a diff when you're done to help others on OpenBSD, be sure to put that #define inside in ifdef for openbsd somehow.

wendigo
05-09-2008, 10:43 AM
Howdy,

Where should I add this, to configure itself? Sorry, I'm not much of a coder.

Thanks!

purple
05-09-2008, 12:44 PM
You can just put it in vpacket.cpp at the top.

wendigo
05-09-2008, 09:40 PM
Howdy,

Silly me! Ok, that got us onto the next step.


g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local//include -I/usr/X11R6/include -DPKGDATADIR=\"/usr/local/share/showeq/\" -I/usr/include/pcap -O2 -Wall -g -ggdb -DDEBUG -finline-functions -DQT_THREAD_SUPPORT=1 -DDISPLAY_ICONS=false -DICON_DIR=\"/eq-icons/\" -g -O2 -MT editor.o -MD -MP -MF .deps/editor.Tpo -c -o editor.o editor.cpp
editor.cpp:230:22: editor.moc: No such file or directory

So, again, I generated it manually:


/usr/local//bin/moc src/editor.h -o src/editor.moc
-rw-r--r-- 1 root wheel 3.3K May 9 22:06 src/editor.moc

Now I am at:


g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local//include -I/usr/X11R6/include -DPKGDATADIR=\"/usr/local/share/showeq/\" -I/usr/include/pcap -O2 -Wall -g -ggdb -DDEBUG -finline-functions -DQT_THREAD_SUPPORT=1 -DDISPLAY_ICONS=false -DICON_DIR=\"/eq-icons/\" -g -O2 -MT packetfragment.o -MD -MP -MF .deps/packetfragment.Tpo -c -o packetfragment.o packetfragment.cpp
In file included from packetfragment.h:16,
from packetfragment.cpp:13:
packetcommon.h:111:2: warning: #warning "BigEndian hasn't been tested."
In file included from packetformat.h:26,
from packetfragment.cpp:14:
/usr/include/netinet/ip.h:153: error: syntax error before `[' token
/usr/include/netinet/ip.h:156: error: 'n_time' is used as a type, but is not
defined as a type.
*** Error code 1

Let me know if I should paste in all of /usr/include/netinet/ip.h. Here's the chunk in question:



151 #endif
152 union ipt_timestamp {
153 n_time ipt_time[1];
154 struct ipt_ta {
155 struct in_addr ipt_addr;
156 n_time ipt_time;
157 } ipt_ta[1];
158 } ipt_timestamp;
159 };

Minion
05-10-2008, 09:26 PM
I've been running showeq under NetBSD and here's the general overview of what I've had to do:

1) Patch most files to change:


#ifdef __FreeBSD__


to


#if defined(__FreeBSD__) || defined(__NetBSD__)


2) Patch src/packet.h by adding before #include <netinet/in.h>


#if defined(__NetBSD__)
#include <net/if.h>
#include


3) Patch src/util.h to use <math.h> for the definitions of lrint(), lrintf() and lroundf() when on NetBSD.

4) Patch src/packetcapture.cpp: the includes before #include "packetcapure.h" looks like:


#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/udp.h>
#include <net/if.h>
#include <netinet/if_ether.h>


5) NetBSD has a libutil with an include of util.h, which causes conflicts with showeq's util.h. So I've had to rename showeq's util.h to equtil.h and patch the files to include that.

wendigo
05-11-2008, 04:17 PM
Howdy,

Thanks for your post. I will experiment with these changes in the coming days and update with my results.

wendigo
05-12-2008, 01:19 AM
Howdy,

I made your suggested changes, and they seem to have eliminated a few errors. I still had to make purple's change to spellshell.cpp. I am now encountering this error:


g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local//include -I/usr/X11R6/include -DPKGDATADIR=\"/usr/local/share/showeq/\" -I/usr/include/pcap -O2 -Wall -g -ggdb -DDEBUG -finline-functions -DQT_THREAD_SUPPORT=1 -DDISPLAY_ICONS=false -DICON_DIR=\"/eq-icons/\" -g -O2 -MT packetcapture.o -MD -MP -MF .deps/packetcapture.Tpo -c -o packetcapture.o packetcapture.cpp
In file included from packetcapture.cpp:15:
/usr/include/netinet/ip.h:67: error: field `ip_src' has incomplete type
/usr/include/netinet/ip.h:67: error: field `ip_dst' has incomplete type
/usr/include/netinet/ip.h:153: error: syntax error before `[' token
/usr/include/netinet/ip.h:155: error: field `ipt_addr' has incomplete type
/usr/include/netinet/ip.h:156: error: 'n_time' is used as a type, but is not
defined as a type.
/usr/include/netinet/ip.h:191: error: field `ippseudo_src' has incomplete type
/usr/include/netinet/ip.h:192: error: field `ippseudo_dst' has incomplete type
In file included from packetcapture.cpp:17:
/usr/include/netinet/if_ether.h:140: error: field `ea_hdr' has incomplete type
/usr/include/netinet/if_ether.h:158: error: field `ac_if' has incomplete type
/usr/include/netinet/if_ether.h:161: error: syntax error before `,' token
/usr/include/netinet/if_ether.h:166: error: syntax error before `;' token
/usr/include/netinet/if_ether.h:177: error: field `sin_addr' has incomplete
type
/usr/include/netinet/if_ether.h:178: error: field `sin_srcaddr' has incomplete
type
/usr/include/netinet/if_ether.h:222: error: syntax error before `;' token
In file included from packetcapture.cpp:28:
/usr/include/net/if.h:221: error: `AF_MAX' was not declared in this scope
/usr/include/net/if.h:492: error: field `ifru_addr' has incomplete type
/usr/include/net/if.h:493: error: field `ifru_dstaddr' has incomplete type
/usr/include/net/if.h:494: error: field `ifru_broadaddr' has incomplete type
/usr/include/net/if.h:511: error: field `ifra_addr' has incomplete type
/usr/include/net/if.h:512: error: field `ifra_dstaddr' has incomplete type
/usr/include/net/if.h:514: error: field `ifra_mask' has incomplete type
/usr/include/net/if.h:552: error: field `addr' has incomplete type
/usr/include/net/if.h:553: error: field `dstaddr' has incomplete type
In file included from /usr/include/net/if.h:570,
from packetcapture.cpp:28:
/usr/include/net/if_arp.h:79: error: field `arp_pa' has incomplete type
/usr/include/net/if_arp.h:80: error: field `arp_ha' has incomplete type
packetcapture.cpp: In member function `void PacketCaptureThread::start(const
char*, const char*, bool, unsigned char)':
packetcapture.cpp:170: error: `ioctl' undeclared (first use this function)
packetcapture.cpp:170: error: (Each undeclared identifier is reported only once
for each function it appears in.)
packetcapture.cpp: In static member function `static void
PacketCaptureThread::packetCallBack(u_char*, const pcap_pkthdr*, const
u_char*)':
packetcapture.cpp:339: error: no match for 'operator=' in '
myThis->PacketCaptureThread::m_tvLastProcessedOriginal = ph->pcap_pkthdr::ts
'
/usr/include/sys/time.h:49: error: candidates are: timeval&
timeval::operator=(const timeval&)
packetcapture.cpp:370: error: no match for 'operator=' in '
myThis->PacketCaptureThread::m_tvLastProcessedOriginal = ph->pcap_pkthdr::ts
'
/usr/include/sys/time.h:49: error: candidates are: timeval&
timeval::operator=(const timeval&)
*** Error code 1

wendigo
05-12-2008, 02:08 AM
Howdy,

Ok, I added:


#include <netinet/in.h>

before


#include <netinet/ip.h>

and this has resolved a large chunk of the erorrs I was receiving. I am now down to:


g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local//include -I/usr/X11R6/include -DPKGDATADIR=\"/usr/local/share/showeq/\" -I/usr/include/pcap -O2 -Wall -g -ggdb -DDEBUG -finline-functions -DQT_THREAD_SUPPORT=1 -DDISPLAY_ICONS=false -DICON_DIR=\"/eq-icons/\" -g -O2 -MT packetcapture.o -MD -MP -MF .deps/packetcapture.Tpo -c -o packetcapture.o packetcapture.cpp
In file included from packetcapture.cpp:21:
/usr/include/net/if.h:221: error: `AF_MAX' was not declared in this scope
/usr/include/net/if.h:492: error: field `ifru_addr' has incomplete type
/usr/include/net/if.h:493: error: field `ifru_dstaddr' has incomplete type
/usr/include/net/if.h:494: error: field `ifru_broadaddr' has incomplete type
/usr/include/net/if.h:511: error: field `ifra_addr' has incomplete type
/usr/include/net/if.h:512: error: field `ifra_dstaddr' has incomplete type
/usr/include/net/if.h:514: error: field `ifra_mask' has incomplete type
/usr/include/net/if.h:552: error: field `addr' has incomplete type
/usr/include/net/if.h:553: error: field `dstaddr' has incomplete type
In file included from /usr/include/net/if.h:570,
from packetcapture.cpp:21:
/usr/include/net/if_arp.h:79: error: field `arp_pa' has incomplete type
/usr/include/net/if_arp.h:80: error: field `arp_ha' has incomplete type
packetcapture.cpp: In member function `void PacketCaptureThread::start(const
char*, const char*, bool, unsigned char)':
packetcapture.cpp:166: error: `ioctl' undeclared (first use this function)
packetcapture.cpp:166: error: (Each undeclared identifier is reported only once
for each function it appears in.)
packetcapture.cpp: In static member function `static void
PacketCaptureThread::packetCallBack(u_char*, const pcap_pkthdr*, const
u_char*)':
packetcapture.cpp:335: error: no match for 'operator=' in '
myThis->PacketCaptureThread::m_tvLastProcessedOriginal = ph->pcap_pkthdr::ts
'
/usr/include/sys/time.h:49: error: candidates are: timeval&
timeval::operator=(const timeval&)
packetcapture.cpp:366: error: no match for 'operator=' in '
myThis->PacketCaptureThread::m_tvLastProcessedOriginal = ph->pcap_pkthdr::ts
'
/usr/include/sys/time.h:49: error: candidates are: timeval&
timeval::operator=(const timeval&)
*** Error code 1

I'll play around with this some more and update if I make any headway. Thanks for all the help so far!

wendigo
05-12-2008, 02:18 AM
Howdy,

I had to throw socket.h in there, so here are my packetcapture.cpp includes:


#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/udp.h>
#include <net/if.h>
#include <netinet/if_ether.h>
#include <arpa/inet.h>
#include <netinet/tcp.h>
#include "packetcapture.h"
#include "diagnosticmessages.h"

Still hitting the following:


g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local//include -I/usr/X11R6/include -DPKGDATADIR=\"/usr/local/share/showeq/\" -I/usr/include/pcap -O2 -Wall -g -ggdb -DDEBUG -finline-functions -DQT_THREAD_SUPPORT=1 -DDISPLAY_ICONS=false -DICON_DIR=\"/eq-icons/\" -g -O2 -MT packetcapture.o -MD -MP -MF .deps/packetcapture.Tpo -c -o packetcapture.o packetcapture.cpp
packetcapture.cpp: In member function `void PacketCaptureThread::start(const
char*, const char*, bool, unsigned char)':
packetcapture.cpp:167: error: `ioctl' undeclared (first use this function)
packetcapture.cpp:167: error: (Each undeclared identifier is reported only once
for each function it appears in.)
packetcapture.cpp: In static member function `static void
PacketCaptureThread::packetCallBack(u_char*, const pcap_pkthdr*, const
u_char*)':
packetcapture.cpp:336: error: no match for 'operator=' in '
myThis->PacketCaptureThread::m_tvLastProcessedOriginal = ph->pcap_pkthdr::ts
'
/usr/include/sys/time.h:49: error: candidates are: timeval&
timeval::operator=(const timeval&)
packetcapture.cpp:367: error: no match for 'operator=' in '
myThis->PacketCaptureThread::m_tvLastProcessedOriginal = ph->pcap_pkthdr::ts
'
/usr/include/sys/time.h:49: error: candidates are: timeval&
timeval::operator=(const timeval&)
*** Error code 1

wendigo
05-12-2008, 02:29 AM
Howdy,

Had to add


#include <sys/ioctl.h>

Now down to:


g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local//include -I/usr/X11R6/include -DPKGDATADIR=\"/usr/local/share/showeq/\" -I/usr/include/pcap -O2 -Wall -g -ggdb -DDEBUG -finline-functions -DQT_THREAD_SUPPORT=1 -DDISPLAY_ICONS=false -DICON_DIR=\"/eq-icons/\" -g -O2 -MT packetcapture.o -MD -MP -MF .deps/packetcapture.Tpo -c -o packetcapture.o packetcapture.cpp
packetcapture.cpp: In static member function `static void
PacketCaptureThread::packetCallBack(u_char*, const pcap_pkthdr*, const
u_char*)':
packetcapture.cpp:337: error: no match for 'operator=' in '
myThis->PacketCaptureThread::m_tvLastProcessedOriginal = ph->pcap_pkthdr::ts
'
/usr/include/sys/time.h:49: error: candidates are: timeval&
timeval::operator=(const timeval&)
packetcapture.cpp:368: error: no match for 'operator=' in '
myThis->PacketCaptureThread::m_tvLastProcessedOriginal = ph->pcap_pkthdr::ts
'
/usr/include/sys/time.h:49: error: candidates are: timeval&
timeval::operator=(const timeval&)
*** Error code 1