1984 – the techblog

(Hopefully) useful various sysadmin and other stuff.

Compiling transmission fun (FreeBSD)

Com­pil­ing trans­mis­sion can be a bit funny (read: not fun) some­times. I faced this task on a locked down FreeBSD sys­tem. Here’s what errors I encoun­tered, and how I was able to solve them. Don’t for­get to do a make clean after you’ve mod­i­fied a file (per­haps even re-run configure).

make: don’t know how to make ./libtransmission.a.

You did a make -j X (where X is <= num­ber of cpu/cores in your sys­tem), didn’t you? Well, bad news. transmission’s build sys­tem can’t han­dle a par­al­lel build. Just omit the –j flag, and you’re good. (And seri­ously, guys? It’s two-oh-fucking-twelve, one could really expect mul­ti­ple cores and/or cpu’s!).

alloca.h: No such file or directory

Never heard of this file before trans­mis­sion. Google told me that it’s pur­pose is to declare alloca(), a func­tion to allo­cate mem­ory space on the stack. But the funny thing is, it’s use is dis­cour­aged! Pro­gram­mers seem to frown on it (as seen on stack­over­flow and at IECC, even in the Linux man-page).

Any­way, on glibc-based sys­tems, this file has been super­seded and the func­tion is now declared in stdlib.h. Even though FreeBSD isn’t glibc-based, they did so as well. For­tu­nately, 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 sys­tem doesn’t. Or some­thing along that. Since IPv6 isn’t widely adopted yet, and I just wanted a few down­loads, not a long-running server, I didn’t dig any fur­ther and opted to dis­able µTP com­pletely at first. But that led me to the next error:

error: pre­vi­ous dec­la­ra­tion of ‘UTP_Write’ was here

So, no. Luck­ily, just adding two header files 1 in third-party/libutp/utp.h:

#include <sys/types.h>
#include <netinet/in.h>

makes all the IPv6 dec­la­ra­tions known to the code.

At that point, trans­mis­sion com­piled com­pletely on my system:

$ make install
(...crunch, crunch...)
$ transmission-cli -V
transmission-cli 2.42 (13013)

Yay!

 

Notes:

  1. https://forum.transmissionbt.com/viewtopic.php?f=2&t=11669

Leave a Reply