How to indicate source directory in other than /usr/src?

Thomas Mueller mueller23 at
Wed May 30 11:02:13 UTC 2012

>From Lowell Gilbert <freebsd-questions-local at>:

> For ports, I would would normally say that you want SRC_BASE. However,
> that's for building ports, not running them, so I may be missing the
> point.

That may be what I need.  I would be building ports.  For running ports, source code wouldn't come into play.

I couldn't find this, but just found it in 

I installed FreeBSD 9.0-BETA1 to this partition, mounted now as /BETA1, but might want to upgrade this to 10-CURRENT.

I noticed a BSDSRCDIR in NetBSD pkgsrc, ported to other mostly (quasi)-Unix OSes as well as NetBSD.

>> I may also want to build 10-CURRENT from 9-STABLE system without giving up the 9-STABLE source tree; I would need both source trees, but then after the
>> first successful build of 10-CURRENT, I could use that to build updated versions.

> MAKEOBJDIRPREFIX can do this, but in my case I would move the original
> /usr/obj tree out of the way to avoid damaging it by mistake.

I might put 10-CURRENT source tree in /BETA1/usr/src, forever overwriting 9.0-BETA1 source tree, then 
could set MAKEOBJDIRPREFIX to /BETA1/usr/obj, or is that not necessary?

>From "Michael Ross" <gmx at>:

> I often use nullfs for this kind of thing:

>       mount -t nullfs /where/your/sources/are /usr/src
>       mount -t nullfs /some/dir/for/objects /usr/obj

I hadn't thought of that, but now I need to check this out on "mount" man page.

>From uki <ukaszg at>:

> Don't know if that will help in Your case, but I just softlink my
> /usr/local/src-stable to /usr/src - never had any issues.

> Cheers,
> ??ukasz Gruner

I thought of that (symbolic link: ln -s) as something to fall back on if I don't find something more elegant.

There might have been some characters in your name that xterm couldn't understand; I need something better (mlterm?)


More information about the freebsd-questions mailing list