Compiling transmission fun (FreeBSD)
CompilingÂ transmission can be a bit funny (read: not fun) sometimes. I faced this task on a locked down FreeBSD system. Here’s what errors I encountered, and how I was able to solve them. Don’t forget to do a
make cleanÂ after you’ve modified a file (perhaps even re-run
make: don’t know how to make ./libtransmission.a.
You did a
make -j X (where X is <= number of cpu/cores in your system), didn’t you? Well, bad news. transmission’s build system can’t handle a parallel build. Just omit the –j flag, and you’re good. (And seriously, guys? It’s two-oh-fucking-twelve, one could really expect multiple cores and/or cpu’s!).
alloca.h: No such file or directory
Never heard of this file before transmission. Google told me that it’s purpose is to declare
alloca(), a function to allocate memory space on the stack. But the funny thing is, it’s use is discouraged!Â Programmers seem to frown on it (as seen on stackoverflowÂ and at IECC, even in the Linux man-page).
Anyway, on glibc-based systems, this file has been superseded and the function is now declared in
stdlib.h. Even though FreeBSD isn’t glibc-based, they did so as well. Fortunately, there’s only one reference:
$ grep -Ris alloca.h * libtransmission/peer-msgs.c:#include <alloca.h> $
Just delete the line in this file, asÂ
stdlib.h is already included.
error: ‘in6_addr’ does not name a type
The ÂµTP library wants to do IPv6, but your system doesn’t. Or something along that. Since IPv6 isn’t widely adopted yet, and I just wanted a few downloads, not a long-running server, I didn’t dig any further and opted to disableÂ ÂµTP completely at first. But that led me to the next error:
error: previous declaration of ‘UTP_Write’ was here
So, no. Luckily, just adding two header files 1 inÂ
#include <sys/types.h> #include <netinet/in.h>
makes all the IPv6 declarations known to the code.
At that point, transmission compiled completely on my system:
$ make install (...crunch, crunch...) $ transmission-cli -V transmission-cli 2.42 (13013)
- https://forum.transmissionbt.com/viewtopic.php?f=2&t=11669 ↩