# OLSRD port, Missing dependency operator



## hilal (Dec 3, 2010)

Hi, I am trying to compile the olsr port (/usr/port/net/olsrd): but I get this error when running make:


```
RSPRO3# make
===>  Building for olsrd-0.6.0
"Makefile.inc", line 21: Missing dependency operator
"Makefile.inc", line 23: Need an operator
"Makefile.inc", line 24: Missing dependency operator
"Makefile.inc", line 26: Need an operator
"Makefile.inc", line 35: Missing dependency operator
"Makefile.inc", line 37: Need an operator
"Makefile.inc", line 39: Need an operator
"Makefile.inc", line 40: Missing dependency operator
"Makefile.inc", line 42: Need an operator
"Makefile.inc", line 44: Need an operator
"Makefile.inc", line 61: Missing dependency operator
"Makefile.inc", line 63: Need an operator
"Makefile.inc", line 66: Need an operator
"Makefile.inc", line 67: Need an operator
"Makefile.inc", line 94: Missing dependency operator
"Makefile.inc", line 97: Need an operator
"Makefile.inc", line 106: Missing dependency operator
"Makefile.inc", line 108: Need an operator
Unknown modifier ';'

Unknown modifier ';'

"Makefile.inc", line 120: Need an operator
"Makefile.inc", line 127: Need an operator
"Makefile.inc", line 128: Missing dependency operator
"Makefile.inc", line 130: Need an operator
"Makefile.inc", line 132: Need an operator
"Makefile.inc", line 135: Missing dependency operator
"Makefile.inc", line 137: Need an operator
"Makefile.inc", line 141: Need an operator
"Makefile.inc", line 143: Missing dependency operator
"Makefile.inc", line 145: Need an operator
"Makefile.inc", line 147: Need an operator
"Makefile.inc", line 149: Need an operator
"Makefile.inc", line 156: Missing dependency operator
"Makefile.inc", line 158: Need an operator
"Makefile.inc", line 178: Missing dependency operator
"Makefile.inc", line 180: Need an operator
"Makefile.inc", line 183: Could not find ./make/Makefile.
"Makefile.inc", line 184: Need an operator
"Makefile.inc", line 190: Missing dependency operator
"Makefile.inc", line 193: Need an operator
"Makefile.inc", line 195: Need an operator
"Makefile.inc", line 196: Missing dependency operator
"Makefile.inc", line 198: Need an operator
"Makefile.inc", line 210: Missing dependency operator
"Makefile.inc", line 211: Need an operator
"Makefile.inc", line 212: Need an operator
"Makefile.inc", line 213: Missing dependency operator
"Makefile.inc", line 214: Need an operator
"Makefile.inc", line 215: Need an operator
Error expanding embedded variable.
*** Error code 1

Stop in /usr/ports/net/olsrd.
```

read somewhere that I should use gmake, but that didnt help. I created a sym link from gmake to make:


```
RSPRO3# make
Makefile:38: *** missing separator.  Stop.
```

I am running FreeBSD Current 201010 on a mips machine. 
I compiled gmake from ports also, but both it and the make that comes with freebsd doest work... 

br,


----------



## SirDice (Dec 3, 2010)

Gmake isn't going to help you. The Makefile is FreeBSD's make specific. You only use gmake for Makefiles that are made for GNU make.

As for the inclusion of Makefile.inc. There shouldn't be any.


----------



## hilal (Dec 3, 2010)

SirDice said:
			
		

> As for the inclusion of Makefile.inc. There shouldn't be any.



how should I remove Makefile.inc?

thank you,


----------



## SirDice (Dec 3, 2010)

With rm?


```
root@build:/usr/ports/net/olsrd#ls -l
total 10
-rw-r--r--  1 root  wheel  1268 Jun 18 19:56 Makefile
-rw-r--r--  1 root  wheel   193 Jun 18 19:56 distinfo
drwxr-xr-x  2 root  wheel   512 Jun 18 19:56 files
-rw-r--r--  1 root  wheel   309 Mar 30  2009 pkg-descr
-rw-r--r--  1 root  wheel   382 Jun 18 19:56 pkg-plist
```

Do you have something different?


----------



## hilal (Dec 3, 2010)

no its the same, Makefile.inc is in the work directory that is created:


```
/usr/ports/net/olsrd/work/olsrd-0.6.0/Makefile.inc
```

which is included from 


```
/usr/ports/net/olsrd/work/olsrd-0.6.0/Makefile
```

I tried to delete it,but got this error: 

```
RSPRO3# make
===>  Building for olsrd-0.6.0
"Makefile", line 45: Could not find Makefile.inc
"Makefile", line 52: Missing dependency operator
"Makefile", line 55: Need an operator
Error expanding embedded variable.
*** Error code 1

Stop in /usr/ports/net/olsrd.
```

if I comment the include file I get this error:

```
RSPRO3# make
===>  Building for olsrd-0.6.0
"Makefile", line 52: Missing dependency operator
"Makefile", line 55: Need an operator
Error expanding embedded variable.
*** Error code 1

Stop in /usr/ports/net/olsrd.
```


----------



## SirDice (Dec 3, 2010)

I just built olsrd and it builds fine. No errors. 

Do a *make clean* and try again.


----------



## hilal (Dec 3, 2010)

I get the same error, I tried to build it in VirtualBox and it build fine. So could it be a mips bug? 

A side question, when I cross compile buildworld in VirtualBox, can I tell it to add a port with it? Or must I compile a port from the target machine?


```
RSPRO3# make clean
===>  Cleaning for olsrd-0.6.0
RSPRO3# make

 To enable IPv4 multiple interface support make with
 WITH_MULTI_IF defined

===>  Vulnerability check disabled, database not found
===>  License check disabled, port has not defined LICENSE
===>  Extracting for olsrd-0.6.0
=> MD5 Checksum OK for olsrd-0.6.0.tar.bz2.
=> SHA256 Checksum OK for olsrd-0.6.0.tar.bz2.
===>  Patching for olsrd-0.6.0
===>  Applying FreeBSD patches for olsrd-0.6.0
===>   olsrd-0.6.0 depends on executable: makedepend - found
===>   olsrd-0.6.0 depends on executable: gmake - found
===>   olsrd-0.6.0 depends on executable: bison - found
===>  Configuring for olsrd-0.6.0
===>  Building for olsrd-0.6.0
"Makefile.inc", line 21: Missing dependency operator
"Makefile.inc", line 23: Need an operator
"Makefile.inc", line 24: Missing dependency operator
"Makefile.inc", line 26: Need an operator
"Makefile.inc", line 35: Missing dependency operator
"Makefile.inc", line 37: Need an operator
"Makefile.inc", line 39: Need an operator
"Makefile.inc", line 40: Missing dependency operator
"Makefile.inc", line 42: Need an operator
"Makefile.inc", line 44: Need an operator
"Makefile.inc", line 61: Missing dependency operator
"Makefile.inc", line 63: Need an operator
"Makefile.inc", line 66: Need an operator
"Makefile.inc", line 67: Need an operator
"Makefile.inc", line 94: Missing dependency operator
"Makefile.inc", line 97: Need an operator
"Makefile.inc", line 106: Missing dependency operator
"Makefile.inc", line 108: Need an operator
Unknown modifier ';'

Unknown modifier ';'

"Makefile.inc", line 120: Need an operator
"Makefile.inc", line 127: Need an operator
"Makefile.inc", line 128: Missing dependency operator
"Makefile.inc", line 130: Need an operator
"Makefile.inc", line 132: Need an operator
"Makefile.inc", line 135: Missing dependency operator
"Makefile.inc", line 137: Need an operator
"Makefile.inc", line 141: Need an operator
"Makefile.inc", line 143: Missing dependency operator
"Makefile.inc", line 145: Need an operator
"Makefile.inc", line 147: Need an operator
"Makefile.inc", line 149: Need an operator
"Makefile.inc", line 156: Missing dependency operator
"Makefile.inc", line 158: Need an operator
"Makefile.inc", line 178: Missing dependency operator
"Makefile.inc", line 180: Need an operator
"Makefile.inc", line 183: Could not find ./make/Makefile.
"Makefile.inc", line 184: Need an operator
"Makefile.inc", line 190: Missing dependency operator
"Makefile.inc", line 193: Need an operator
"Makefile.inc", line 195: Need an operator
"Makefile.inc", line 196: Missing dependency operator
"Makefile.inc", line 198: Need an operator
"Makefile.inc", line 210: Missing dependency operator
"Makefile.inc", line 211: Need an operator
"Makefile.inc", line 212: Need an operator
"Makefile.inc", line 213: Missing dependency operator
"Makefile.inc", line 214: Need an operator
"Makefile.inc", line 215: Need an operator
Error expanding embedded variable.
*** Error code 1

Stop in /usr/ports/net/olsrd.
```


----------



## SirDice (Dec 3, 2010)

hilal said:
			
		

> I get the same error, I tried to build it in VirtualBox and it build fine. So could it be a mips bug?


It would be a rather weird bug but I guess it's possible. 



> A side question, when I cross compile buildworld in VirtualBox, can I tell it to add a port with it? Or must I compile a port from the target machine?



The base OS and ports are two separate entities. But just like you crosscompiled world you can also crosscompile ports.


----------



## hilal (Dec 3, 2010)

SirDice said:
			
		

> The base OS and ports are two separate entities. But just like you crosscompiled world you can also crosscompile ports.



I searched abit about crosscompiling ports, but didnt find much:
someone already asked this months ago: http://149.20.54.209/showthread.php?p=70150
but no answer


I read in the file: /usr/ports/Mk/bsd.port.mk


```
# ARCH			- The architecture of the target machine, such as would be
#				  returned by "uname -p".  (Note: Ports should test against
#				  ARCH, and not the host machine's architecture which is
#				  MACHINE_ARCH, to enable ports to be cross-built.)
```

so I added ARCH=mips to the Makefile of olsrd, but nothing happened, I added an echo to verify that ARCH is changed. 

According to the text above it is for cross-built.

Can you guide me to how to cross compile ports?

br,


----------



## SirDice (Dec 3, 2010)

I've never cross compiled anything but I know it's possible. The machines that build all the FreeBSD packages are running on AMD64 but produce packages for different architectures.

I think you need to use mipsel or mipseb depending on the endianness of your MIPS.

Found some interesting information that might be helpful here: http://bsdimp.blogspot.com/2006/09/cross-building-freebsd.html


----------



## hilal (Dec 6, 2010)

SirDice said:
			
		

> I've never cross compiled anything but I know it's possible. The machines that build all the FreeBSD packages are running on AMD64 but produce packages for different architectures.



I searched a little around the net and found that you need a port called Tinderbox. Check this good site: http://wiki.freebsd.org/Tinderbox




			
				SirDice said:
			
		

> Found some interesting information that might be helpful here: http://bsdimp.blogspot.com/2006/09/cross-building-freebsd.html



yes, I have found this one too, is a really interesting reading 

I have solved my problem, it seems I have during my rampage created a symbolic link /usr/bin/gmake -> /usr/bin/make (I am affected by several years of using Ubuntu!! )

so when I run make it thought gmake is installed!! I deleted it, and make install a real gmake, and everything compiled fine!!

Sorry for makeing such a big mess, but I guess I learned two things that I can share with everyone

1- gmake is not make in FreeBSD in constrast to Ubuntu 
2- want to cross compile ports on your host machine? Try Tinderbox!

thank you SirDice for you help! 

btw, how do I mark a thread as solved?

EDIT------

I forgot to attach this link: http://vboxtindi.chruetertee.ch/
"FreeBSD VirtualBox Image for Port Maintainers"


----------



## DutchDaemon (Dec 6, 2010)

[Solved] -> Edit first post -> Go Advanced -> Pull-down menu next to title.


----------



## wblock@ (Dec 7, 2010)

hilal said:
			
		

> I read in the file: /usr/ports/Mk/bsd.port.mk
> 
> 
> ```
> ...



ARCH is set by the ports system (in bsd.port.mk) so Makefiles can read it and act differently on different target architectures.

For an example, see /usr/ports/lang/clisp/Makefile:

```
.if ${ARCH} == "amd64"
CONFIGURE_ARGS+=--disable-mmap
.endif
```

Setting a different value in ARCH is not going to cross-compile the port.  That's up to the build environment ...I think.


----------

