# Compile FreeBSD on other Build Environment



## prp-e (Nov 20, 2012)

Hi All. 

Can I compile FreeBSD sources on other build environments like Linux or other BSD(s)? 
(We can compile Minix, Haiku, ReactOS, and many other Open Source OSs from source on other build environment).

Regards.


----------



## arapaima (Nov 20, 2012)

I'm not sure, but it sounds like a bad idea. I would use a FreeBSD VM for this purpose.


----------



## prp-e (Nov 20, 2012)

A VM is not suitable for cross-compiling on my weak laptop. I like to compile FreeBSD on my Linux to create an ISO image.


----------



## UNIXgod (Nov 20, 2012)

prp-e said:
			
		

> Hi All.
> 
> Can I compile FreeBSD sources on other build environments like Linux or other BSD(s)?
> (We can compile Minix, Haiku, ReactOS, and many other Open Source OSs from source on other build environment).
> ...



Maybe. Though your best bet is to use the appropriate environment to build. I imagine looking into nanobsd to gain perspective on how to make your own distro per se.

If it's just a build server you'll want to look into devel/distcc and cross compiling with gcc. Most likely have one of the newer gcc versions from the ports( lang/gcc48 or lang/gcc47 ). I'm not sure how well supported clang would be for other oses though I know it supports arm if your going for embedded or gadgets and ios.


----------



## Amzo (Nov 21, 2012)

Probably. You'd need to install BSD make and the /usr/share/mk* files.

Then theoretically. You could:


```
bmake MACHINE=i386 BUILDWORLD && bmake INSTALL WORLD DESTDIR=~/freebsd_world
```

Always worth a try.


----------



## prp-e (Nov 21, 2012)

Thanks all. 
Problem is solved


----------

