[Asterisk-bsd] FreeBSD & -current

Malcolm Davenport asterisk-bsd@lists.digium.com
Tue, 08 Jun 2004 17:13:44 -0500


Howdy, 

-HEAD isn't going to work right now because FreeBSD, MacOSX, et al.don't
have support for recursive mutexes.  The stable branch should beokay to
use, as it does not make use of recursive mutexes.Give a look at the bug
report here:

http://bugs.digium.com/bug_view_page.php?bug_id=0001411Where some work
has been done on the situation.  If you've got a chance, give the patch
a go and let them know your results.

Cheers.

*Reposting to the list*


On Tue, 2004-06-08 at 16:43, Ryan Mansager wrote:
> New to Asterisk. Just curious as to whether -current is expected to 
> compile on FreeBSD or not. I get the following error after a fresh cvs 
> checkout:
> 
> In file included from localtime.c:27:
> ../include/asterisk/lock.h: In function `ast_mutex_init':
> ../include/asterisk/lock.h:183: `PTHREAD_MUTEX_RECURSIVE_NP' undeclared 
> (first use in this function)
> ../include/asterisk/lock.h:183: (Each undeclared identifier is reported 
> only once
> ../include/asterisk/lock.h:183: for each function it appears in.)
> localtime.c: At top level:
> localtime.c:187: `PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' undeclared 
> here (not in a function)
> localtime.c:188: `PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' undeclared 
> here (not in a function)
> localtime.c:189: `PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' undeclared 
> here (not in a function)
> localtime.c:190: `PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' undeclared 
> here (not in a function)
> localtime.c: In function `gmtsub':
> localtime.c:1088: warning: assignment discards qualifiers from pointer 
> target type
> gmake[1]: *** [localtime.o] Error 1
> gmake[1]: Leaving directory `/home/rmger/src/asterisk/stdtime'
> gmake: *** [stdtime/libtime.a] Error 2
> 
> Adding "#define _GNU_SOURCE" before the includes at the top of lock.h 
> does not fix the problem in this case (as it apparently does with 
> similar problems in rxfax & txfax).
> 
> More specifically, it appears to be this chunk from lock.h:
> 
> --
> 
> /* From now on, Asterisk REQUIRES Recursive (not error checking) mutexes
>     and will not run without them. */
> 
> #define AST_MUTEX_INITIALIZER      { 
> PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP, NULL, 0, NULL, 0 }
> #define AST_MUTEX_KIND             PTHREAD_MUTEX_RECURSIVE_NP
> 
> --
> 
> that specifically references PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP 
> (which doesn't exist anywhere in my /usr/include/*) whereas back in the 
> lock.h in version 0.9.0 (the version used in the FreeBSD port), if it 
> hadn't previously been defined, AST_MUTEX_INITIALIZER falls back to 
> using PTHREAD_MUTEX_INITIALIZER (which does exist in my 
> /usr/include/pthread.h).
> 
> I'm running FreeBSD 4.8-STABLE on this specific machine (although the 
> definition in question doesn't exist in my pthread.h on a new 5.2.1 
> installation) and I'm not a big C coder. Just making some observations 
> that someone might be able to help shed some light on.
> 
> Suggestions?
> 
> Thanks much,
> 
> -Ryan
> 
> _______________________________________________
> Asterisk-BSD mailing list
> Asterisk-BSD@lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-bsd
-- 
Malcolm Davenport
+1-256-428-6252
+1-256-864-0464 (fax)
malcolmd@digium.com

Digium
150 West Park Loop
Suite 100
Huntsville, AL 35806
United States