How can I specify the path to libpcap when configuring/making/installing?

1

1

I'm running Ubuntu 10.04.1 and am trying to get packet capturing working for my Bluetooth dongle using hcidump.

From what I've read, libpcap must be compiled to enable Bluetooth sniffing and given that hcidump isn't finding a single packet, I'm guessing the version Ubuntu has installed for me isn't compiled with bluetooth support.

So I downloaded a newer version of libpcap and installed the bluez header files. Configured libpcap and it gave a "Yes" for bluetooth support. It is now installed and sitting in /usr/local/lib/.

Now I'm trying to compile hcidump to use this lib rather than the system default but I can't figure out how...

I've read that GCC can be passed the -lpcap flag to set the path but I haven't figured out how to do this.

Any ideas?

bloo

Posted 2010-12-09T06:34:30.677

Reputation: 11

Answers

0

I had a quick look at the libpcap package and it appears that all you need to do to get Bluetooth support is to compile it with bluetooth development files installed. That is, install the libbluetooth-dev Install libbluetooth-dev package, then recompile libpcap:

sudo apt-get install libbluetooth-dev build-essential fakeroot
sudo apt-get build-dep libpcap
apt-get source libpcap
cd libpcap-*
dpkg-buildpackage -rfakeroot -b -nc -us -uc
sudo dpkg -iGO ../*.deb

(Better, before the dpkg-buildpackage step, add a version to debian/control so that your package bears a version number that's different from the official package, such as 1.0.0-6bloo1.)

Then try the hcidump executable from the bluez-hcidump Install bluez-hcidump.

If you do need to recompile hcidump and pass it a custom include file path (and probably a custom library file path as well), the way with most programs that have a configure script is to run

CFLAGS='-I /path/to/dependency/include' LDFLAGS='-L /path/to/dependency/lib' ./configure …

/usr/local/include and /usr/local/lib are usually included in the default search, though.

Gilles 'SO- stop being evil'

Posted 2010-12-09T06:34:30.677

Reputation: 58 319