# Building OpenWrt on FreeBSD



## balanga (Jul 4, 2018)

Is it possible to build OpenWrt on FreeBSD?

This guide shows what you need, and even says





> The build system works on Linux, *BSD* or MacOSX operating system. A case-sensitive filesystem is required.



Just wondered if anyone has tried it and what you might need to do to build it successfully...

An initial concern is that I would need to use gmake rather than make, but I wouldn't want to change any Makefiles, so can I set some global variable before I start so that make would be interpreted as gmake?


----------



## balanga (Jul 6, 2018)

I see there is a BSDmakefile in addition to a Makefile. Does it take precedence? ie if I run make() does it first look for a BSDmakefile before looking for a Makefile?


----------



## shkhln (Jul 6, 2018)

balanga said:


> I see there is a BSDmakefile in addition to a Makefile. Does it take precedence? ie if I run make() does it first look for a BSDmakefile before looking for a Makefile?



https://github.com/freebsd/freebsd/...6b29327a48da153695e84c10/share/mk/sys.mk#L318


----------



## balanga (Jul 6, 2018)

According to https://wiki.openwrt.org/doc/howto/buildroot.exigence

you need to

```
git clone https://github.com/openwrt/openwrt.git
cd openwrt
./scripts/feeds update -a
./scripts/feeds install -a
```

This is what I get:


> root@Vbox:~/openwrt # ./scripts/update -a
> 
> Updating feed 'packages' from 'https://git.openwrt.org/feed/packages.git' ...
> Already up to date.
> ...



Would sysutils/coreutils stop some of these fails?


----------



## balanga (Jul 8, 2018)

After installing coreutils and various individual GNU utils, I'm almost there:-


> Create index file './feeds/packages.index'
> Checking 'working-make'... ok.
> Checking 'case-sensitive-fs'... ok.
> Checking 'proper-umask'... ok.
> ...



Any ideas as to why 'time' might have failed?


----------

