Benedikt Meurer JavaScript Engine Hacker and Programming Language Enthusiast.

What to put in /etc/mk.conf

In order to get a sane build environment and to build sane packages out of your environment, you should consider overriding some default values in your /etc/mk.conf. For example, if you are running NetBSD/alpha, you shouldn't use any optimizations to cc(1), because gcc is still buggy on Alpha. And in general you should think twice before setting the optimization level above 2, because this might cause several programs to segfault frequently or not run at all. Here are some lines from my mk.conf, which might help you (they will honor all default values but -ON):


When trying to fix bugs in packages, it is helpful to append -Wall -Werror to COMMONCFLAGS, but beware: This might break a lot of configure scripts (so, you have the chance to fix them too ;-). Another needful thing to have in your mk.conf is support for sudo instead of the default su(1), so you may need not to type the root password everytime you install a package as a user. Here are the lines from my mk.conf:

.if exists(/usr/pkg/bin/sudo)
SU_CMD=/usr/pkg/bin/sudo /bin/sh -c

Another helpful thing to do, is to override the default MASTER_SITE with faster (local) mirrors. E.g. I have a local NetBSD mirror (thats the tatooine.kosmos.all line, so don't simply copy&paste to your mk.conf :-), from where pkgsrc should try to fetch the needed distfiles first and after that fails, it will try several other mirrors, and only if a distfile cannot be found there, it'll try to fetch it from the MASTER_SITEs specified for the package. Here are the lines from my mk.conf:

ftp://tatooine.kosmos.all/pub/NetBSD/packages/distfiles/ \ \ \ \