Ignore:
Timestamp:
Feb 7, 2008 1:11:39 PM (15 years ago)
Author:
bennylp
Message:

Ticket #470, #471, and #472: Compile error when semaphore.h is not present, Compilation error if pthread_mutexattr_set_type() is not present, and Problem with setting up FD_SETSIZE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/aconfigure.ac

    r1738 r1783  
    1 AC_INIT(pjproject,0.7) 
     1AC_INIT(pjproject,0.8) 
    22 
    33host_orig="$host" 
     
    147147AC_CHECK_HEADER(net/if.h,[AC_DEFINE(PJ_HAS_NET_IF_H,1)]) 
    148148AC_CHECK_HEADER(ifaddrs.h,[AC_DEFINE(PJ_HAS_IFADDRS_H,1)]) 
     149AC_CHECK_HEADER(semaphore.h,[AC_DEFINE(PJ_HAS_SEMAPHORE_H,1)]) 
    149150AC_CHECK_HEADER(setjmp.h,[AC_DEFINE(PJ_HAS_SETJMP_H,1)]) 
    150151AC_CHECK_HEADER(stdarg.h,[AC_DEFINE(PJ_HAS_STDARG_H,1)]) 
     
    269270                                   [pthread_rwlock_t *x;])], 
    270271                  [AC_DEFINE(PJ_EMULATE_RWMUTEX,0) 
     272                   ac_rwmutex="yes" 
    271273                   AC_MSG_RESULT(yes)], 
    272274                  [AC_DEFINE(PJ_EMULATE_RWMUTEX,1) 
     275                   ac_rwmutex="no" 
    273276                   AC_MSG_RESULT(no)]) 
     277 
     278dnl # If rwmutex is not detected, check again but this time 
     279dnl # with _POSIX_READER_WRITER_LOCKS defined (newlib needs this) 
     280if test "$ac_rwmutex" = "no"; then 
     281    AC_MSG_CHECKING([if pthread_rwlock_t is available with _POSIX_READER_WRITER_LOCKS]) 
     282    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _POSIX_READER_WRITER_LOCKS 
     283                                         #include <pthread.h>]], 
     284                                       [pthread_rwlock_t *x;])], 
     285                      [AC_DEFINE(PJ_EMULATE_RWMUTEX,0) 
     286                       CFLAGS="$CFLAGS -D_POSIX_THREADS -D_POSIX_READER_WRITER_LOCKS" 
     287                       AC_MSG_RESULT(yes)], 
     288                      [AC_DEFINE(PJ_EMULATE_RWMUTEX,1) 
     289                       AC_MSG_RESULT(no)]) 
     290fi 
     291 
     292dnl # Do we have pthread_mutexattr_settype()? 
     293AC_MSG_CHECKING([if pthread_mutexattr_settype() is available]) 
     294AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>], 
     295                                   [pthread_mutexattr_settype(0,PTHREAD_MUTEX_FAST_NP);])], 
     296                  [AC_DEFINE(PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE,1) 
     297                   AC_MSG_RESULT(yes)], 
     298                  [AC_MSG_RESULT(no)]) 
     299 
     300dnl # Does pthread_mutexattr_t has "recursive" member? 
     301AC_MSG_CHECKING([if pthread_mutexattr_t has recursive member]) 
     302AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>], 
     303                                   [[pthread_mutexattr_t attr; 
     304                                     attr.recursive=1;]])], 
     305                  [AC_DEFINE(PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE,1) 
     306                   AC_MSG_RESULT(yes)], 
     307                  [AC_MSG_RESULT(no)]) 
    274308 
    275309AC_SUBST(ac_os_objs) 
Note: See TracChangeset for help on using the changeset viewer.