Ignore:
Timestamp:
Sep 10, 2006 8:53:59 AM (18 years ago)
Author:
bennylp
Message:

Fixed autoconf on MacOS X

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/aconfigure.ac

    r697 r698  
    2222AC_DEFINE_UNQUOTED(PJ_M_NAME,["$target_cpu"]) 
    2323 
    24 # Endianness detection 
    25 AC_C_BIGENDIAN([AC_SUBST(ac_bigendian,1) 
    26                 AC_DEFINE(PJ_IS_LITTLE_ENDIAN,0) 
    27                 AC_DEFINE(PJ_IS_BIG_ENDIAN,1) 
    28                ], 
    29                [AC_SUBST(ac_bigendian,0) 
    30                 AC_DEFINE(PJ_IS_LITTLE_ENDIAN,1) 
    31                 AC_DEFINE(PJ_IS_BIG_ENDIAN,0) 
    32                ]) 
    33  
    34 # --disable-floating-point option 
     24dnl # Endianness detection 
     25AC_C_BIGENDIAN 
     26 
     27dnl # --disable-floating-point option 
    3528AC_ARG_ENABLE(floating-point, 
    3629              AC_HELP_STRING([--disable-floating-point], 
     
    9184AC_DEFINE(PJ_ATOMIC_VALUE_TYPE,long) 
    9285 
    93 # Determine if inet_aton() is available 
     86dnl # Determine if inet_aton() is available 
    9487AC_MSG_CHECKING([if inet_aton is available]) 
    95 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h> 
    96                                     #include <netinet/in.h> 
    97                                     #include <arpa/inet.h>]], 
     88AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <arpa/inet.h>]], 
    9889                                  [inet_aton(0, 0);])], 
    9990                  [AC_DEFINE(PJ_SOCK_HAS_INET_ATON,1) 
     
    10192                  [AC_MSG_RESULT(no)]) 
    10293 
    103 # Determine if sockaddr_in has sin_len member 
     94dnl # Determine if sockaddr_in has sin_len member 
    10495AC_MSG_CHECKING([if sockaddr_in has sin_len member]) 
    105 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h> 
    106                                     #include <netinet/in.h> 
    107                                     #include <arpa/inet.h>]], 
     96AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 
     97                                     #include <sys/socket.h> 
     98                                     #include <netinet/in.h> 
     99                                     #include <arpa/inet.h>]], 
    108100                                  [struct sockaddr_in a; a.sin_len=0;])], 
    109101                  [AC_DEFINE(PJ_SOCKADDR_HAS_LEN,1) 
     
    111103                  AC_MSG_RESULT(no)) 
    112104 
    113 # Determine if socklen_t is available 
     105dnl # Determine if socklen_t is available 
    114106AC_MSG_CHECKING([if socklen_t is available]) 
    115107AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], 
     
    119111                  AC_MSG_RESULT(no)) 
    120112 
    121 # Determine if SO_ERROR is available 
     113dnl # Determine if SO_ERROR is available 
    122114AC_MSG_CHECKING([if SO_ERROR is available]) 
    123 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h> 
    124                                     #include <netinet/in.h> 
    125                                     #include <arpa/inet.h>]], 
     115AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 
     116                                     #include <sys/socket.h> 
     117                                     #include <netinet/in.h> 
     118                                     #include <arpa/inet.h>]], 
    126119                                  [int i=SO_ERROR;])], 
    127120                  [AC_DEFINE(PJ_HAS_SO_ERROR,1) 
     
    129122                  AC_MSG_RESULT(no)) 
    130123 
    131 # Determine if RW-mutex is available 
     124dnl # Determine if RW-mutex is available 
    132125AC_MSG_CHECKING([if pthread_rwlock_t is available]) 
    133126AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>], 
     
    139132 
    140133 
    141 ########################################## 
    142 # 
    143 # PJMEDIA 
    144 # 
    145  
    146 # Sound device backend selection 
     134dnl ########################################## 
     135dnl # 
     136dnl # PJMEDIA 
     137dnl # 
     138 
     139dnl # Sound device backend selection 
    147140AC_SUBST(ac_pjmedia_snd) 
    148141case $target in 
    149   *cygwin* | *win* | *mingw*) 
     142  *darwin*) 
     143        ac_pjmedia_snd=pa_darwinos 
     144        AC_MSG_RESULT([Checking sound device backend... coreaudio]) 
     145        LIBS="$LIBS -framework CoreAudio" 
     146        ;; 
     147  *cygwin* | *mingw*) 
    150148        ac_pjmedia_snd=pa_win32 
    151149        AC_MSG_RESULT([Checking sound device backend... win32 sound]) 
     
    154152        ac_pjmedia_snd=null 
    155153        AC_MSG_RESULT([Checking sound device backend... null sound]) 
    156         ;; 
    157   *darwin*) 
    158         ac_pjmedia_snd=pa_darwin_os 
    159         AC_MSG_RESULT([Checking sound device backend... coreaudio]) 
    160154        ;; 
    161155  *) 
     
    170164esac 
    171165 
    172 # Include resampling small filter 
     166dnl # Include resampling small filter 
    173167AC_SUBST(ac_no_small_filter) 
    174168AC_ARG_ENABLE(small-filter, 
     
    181175              AC_MSG_RESULT([Checking if small filter is disabled... no])) 
    182176 
    183 # Include resampling large filter 
     177dnl # Include resampling large filter 
    184178AC_SUBST(ac_no_large_filter) 
    185179AC_ARG_ENABLE(large-filter, 
     
    192186              AC_MSG_RESULT([Checking if large filter is disabled... no])) 
    193187 
    194 # Include G.711 Annex A PLC 
     188dnl # Include G.711 Annex A PLC 
    195189AC_SUBST(ac_no_g711_plc) 
    196190AC_ARG_ENABLE(g711-plc, 
     
    203197              AC_MSG_RESULT([Checking if G.711 Annex A PLC is disabled...no])) 
    204198 
    205 # Include Speex AEC 
     199dnl # Include Speex AEC 
    206200AC_SUBST(ac_no_speex_aec) 
    207201AC_ARG_ENABLE(speex-aec, 
     
    214208              AC_MSG_RESULT([Checking if Speex AEC is disabled...no])) 
    215209 
    216 # Include G711 codec 
     210dnl # Include G711 codec 
    217211AC_SUBST(ac_no_g711_codec) 
    218212AC_ARG_ENABLE(g711-codec, 
     
    226220 
    227221 
    228 # Include L16 codec 
     222dnl # Include L16 codec 
    229223AC_SUBST(ac_no_l16_codec) 
    230224AC_ARG_ENABLE(l16-codec, 
     
    238232 
    239233 
    240 # Include GSM codec 
     234dnl # Include GSM codec 
    241235AC_SUBST(ac_no_gsm_codec) 
    242236AC_ARG_ENABLE(gsm-codec, 
     
    249243              AC_MSG_RESULT([Checking if GSM codec is disabled...no])) 
    250244 
    251 # Include Speex codec 
     245dnl # Include Speex codec 
    252246AC_SUBST(ac_no_speex_codec) 
    253247AC_ARG_ENABLE(speex-codec, 
     
    260254              AC_MSG_RESULT([Checking if Speex codec is disabled...no])) 
    261255 
    262 # Include iLBC codec 
     256dnl # Include iLBC codec 
    263257AC_SUBST(ac_no_ilbc_codec) 
    264258AC_ARG_ENABLE(ilbc-codec, 
     
    273267 
    274268 
    275 ########################################## 
    276 # 
    277 # MANUAL CONFIG 
    278 # 
    279  
    280  
    281 # Determine if select() requires nfds to be filled up with 
    282 # correct value (max_fd+1). If zero, nfds will be filled up with 
    283 # PJ_FD_SETSIZE 
     269dnl ########################################## 
     270dnl # 
     271dnl # MANUAL CONFIG 
     272dnl # 
     273 
     274 
     275dnl # Determine if select() requires nfds to be filled up with 
     276dnl # correct value (max_fd+1). If zero, nfds will be filled up with 
     277dnl # PJ_FD_SETSIZE 
    284278AC_MSG_CHECKING([if select() needs correct nfds]) 
    285279case $target in 
     
    293287esac 
    294288 
    295 # Determine if pj_thread_create() should enforce thread stack size when 
    296 # creating thread. Default is zero, to allow OS to allocate appropriate 
    297 # thread's stack size. 
     289dnl # Determine if pj_thread_create() should enforce thread stack size when 
     290dnl # creating thread. Default is zero, to allow OS to allocate appropriate 
     291dnl # thread's stack size. 
    298292AC_MSG_CHECKING([if pj_thread_create() should enforce stack size]) 
    299293case $target in 
     
    306300esac 
    307301 
    308 # Determine if pj_thread_create() should allocate thread's stack from 
    309 # the pool. Default is zero, to let OS allocate thread's stack. 
     302dnl # Determine if pj_thread_create() should allocate thread's stack from 
     303dnl # the pool. Default is zero, to let OS allocate thread's stack. 
    310304AC_MSG_CHECKING([if pj_thread_create() should allocate stack]) 
    311305case $target in 
     
    318312esac 
    319313 
    320 # This value specifies the value set in errno by the OS when a non-blocking 
    321 # socket recv() can not return immediate data. 
     314dnl # This value specifies the value set in errno by the OS when a non-blocking 
     315dnl # socket recv() can not return immediate data. 
    322316case $target in 
    323317  *) AC_DEFINE(PJ_BLOCKING_ERROR_VAL,EAGAIN) 
     
    326320esac 
    327321 
    328 # This value specifies the value set in errno by the OS when a non-blocking 
    329 # socket connect() can not get connected immediately. 
     322dnl # This value specifies the value set in errno by the OS when a non-blocking 
     323dnl # socket connect() can not get connected immediately. 
    330324case $target in 
    331325  *) AC_DEFINE(PJ_BLOCKING_CONNECT_ERROR_VAL,EINPROGRESS) 
Note: See TracChangeset for help on using the changeset viewer.