Kernel_Killer
August 1st, 2006, 16:17
I'm probably reading into this wrong, but I wanted to make sure. I was compiling thttpd to be a static binary. I added LDFLAGS+=-static to my makefile, did a make and make package. While it was configuring, it mentioned that linked libs were using -static, and when opening the new package, it did in fact only have the binary (aside from the CONTENTS, DESCR, etc), but when running 'file thttpd' it said that it was dynamically linked. Is this something I should overlook, or am I doing something wrong? I also tried compiling from the work directory, and setting static. No change.

bmw
August 2nd, 2006, 06:41
"file" doesn't lie. If it says dynamically linked, believe it. You should "make clean", then re-do the entire make, but capture all the output (eg use "script", or carefully redirect stdout and stderr to a file). Then examine each cc and ld line for args to see if your "-static" arg makes it into each link line.

make can be tricky, and mod'ing port makes is especially tricky.

There's a ports env-var or flag that you can set to force a given port to be compiled static. I forget the details now, but if I bump into it later I'll post it.