I'm using ubuntu, and try compile bandwidthd.
I've already got bandwidthd to work from binarys, but want to make some little changes to the source. This looks easy - once i have got it to build from source.
After the pain of getting ./configure to pass, I moved onto make.
Firstly i get:
make: *** No rule to make target `sqlight.o', needed by `bandwidthd'. Stop.
I tried removing sqlight.o from the makefile, and where its used, as i don't think i need it. And I don't know where I'm meant to get this file from.
gcc -Wall -g -O2 -I/usr/local/include -DHAVE_CONFIG_H bandwidthd.o graph.o conf.tab.o conf.l.o pgsql.o extensions.o -o bandwidthd -L/usr/local/lib -lsqlite3 -lpcap -lgd -lpng -lm -lresolv -lnsl
bandwidthd.o: In function `main':
/home/jenny/bandwidthd/bandwidthd/bandwidthd/bandwidthd.c:366: undefined reference to `bdconfig_in'
conf.tab.o: In function `bdconfig_parse':
/home/jenny/bandwidthd/bandwidthd/bandwidthd/y.tab.c:1377: undefined reference to `bdconfig_lex'
collect2: ld returned 1 exit status
make: *** Error 1
I don't understand the bdconfig mechanism, and so can't work out how to fix this.
Can someone suggest what it is I've missed?
issue can be fixed by installing flex, the make error should have given understanding error message
I find that if something's being a pain to build, and there's a Debian package, I can use the Debian build mechanism to produce a package that's configured and buildable very easily:
sudo apt-get build-dep bandwidthd
sudo apt-get install devscripts
apt-get source bandwidthd
That will download the source, extract it, patch it so it works, configure it, and then build it. It'll then probably grind to a halt complaining about gpg keys but by that point you have a version of the source that will build with a simple 'make' in the right directory.
Note that debuild will attempt to build bandwidthd several times with different configurations, so you may need to reconfigure it with the settings you want and then do make clean && make.
This doesn't exactly answer your question, but it might be easier than trying to make the original source build.
I tried that, and it works great!