[asterisk-dev] Cross compiling zaptel

Brian Capouch brianc at palaver.net
Wed Aug 22 01:54:10 CDT 2007


Russell Bryant wrote:

> 
>>3. Speaking of ast_expr2.c, I still suffer from the openWRT build 
>>choking on some math functions, namely REMAINDER ROUND and TRUNC.  That 
>>is beyond the problem I reported before, which is the definition of 
>>__USE_ISOC99, which causes the 'l' versions of all these functions to be 
>>selected instead of the vanilla ones.  The comment in the source code at 
>>the point of the #ifdef on this value (from murph) is not very reassuring.
> 
> 
> This issue isn't an obvious one to me, so you'll have to put it on the bug
> tracker to ensure that it gets followed up on.
> 

There are two situations in ast_expr2.c.

First, __USE_ISOC99 seems to be getting defined, even though I don't 
think it should be--certainly not in the case of an embedded 
cross-build.  There is a comment in the code that would indicate some 
confusion on the part of the person who wrote the code that causes that 
label to be #defined, as in "I'm not sure why but I think this is 
supposed to be defined."

The second, bigger problem is that the functions (remainder() round() 
and trunc()) don't exist in the libm.so file used by openWRT (and, I 
understand, other tiny versions of linux).

They'll have to be coded up by hand, such as was done earlier on, I 
think by Tilghman, for some other functions in that file that were 
missing in the Solaris library, IIRC.

> You said you got it to build.  What did you change?
> 

I copied in the function mentioned in #2 of my email into the two .c 
files where it was causing the missing identifier errors.

I also just nuked out the code associated with REMAINDER, TRUNC, and 
ROUND in ast_expr2.c (sigh, in both places, ~/utils and ~/main).

There is one other gotcha associated with the menuselect stuff, but I'm 
not sure yet that one isn't of my own making, so I haven't reported it.

Once I did those things, I got trunk to build.  Unfortch, though, it 
crashed soon and often after I installed it, so I've reverted back for now.

Thanks for following up.  I'll try building tonight against the code 
that contains your changes.

b.



More information about the asterisk-dev mailing list