Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 1 | AC_INIT(pjproject,0.5.8) |
| 2 | AC_CANONICAL_BUILD |
| 3 | AC_CANONICAL_HOST |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 4 | AC_CANONICAL_TARGET |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 5 | AC_CONFIG_HEADER([pjlib/include/pj/compat/os_auto.h |
| 6 | pjlib/include/pj/compat/m_auto.h |
| 7 | ]) |
| 8 | AC_CONFIG_FILES([build.mak |
| 9 | build/os-auto.mak |
| 10 | pjlib/build/os-auto.mak |
| 11 | pjlib-util/build/os-auto.mak |
| 12 | pjmedia/build/os-auto.mak |
| 13 | pjsip/build/os-auto.mak |
| 14 | ]) |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 15 | AC_PROG_CC |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 16 | AC_PROG_CXX |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 17 | AC_LANG_C |
| 18 | |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 19 | AC_CHECK_LIB(pthread,pthread_create) |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 20 | AC_CHECK_LIB(wsock32,puts) |
| 21 | AC_CHECK_LIB(ws2_32,puts) |
| 22 | AC_CHECK_LIB(ole32,puts) |
| 23 | AC_CHECK_LIB(winmm,puts) |
| 24 | AC_CHECK_LIB(socket,puts) |
| 25 | AC_CHECK_LIB(rt,puts) |
| 26 | AC_CHECK_LIB(nsl,puts) |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 27 | |
| 28 | AC_MSG_RESULT([Setting PJ_M_NAME to $target_cpu]) |
| 29 | AC_DEFINE_UNQUOTED(PJ_M_NAME,["$target_cpu"]) |
| 30 | |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 31 | dnl |
Benny Prijono | 1d97162 | 2006-09-10 22:27:40 +0000 | [diff] [blame] | 32 | dnl Memory alignment detection |
| 33 | dnl |
| 34 | AC_MSG_CHECKING([memory alignment]) |
| 35 | case $target in |
| 36 | ia64-* | x86_64-* ) |
| 37 | AC_DEFINE(PJ_POOL_ALIGNMENT, 8) |
| 38 | AC_MSG_RESULT([8 bytes]) |
| 39 | ;; |
| 40 | * ) |
| 41 | AC_DEFINE(PJ_POOL_ALIGNMENT, 4) |
| 42 | AC_MSG_RESULT([4 bytes (default)]) |
| 43 | ;; |
| 44 | esac |
| 45 | |
| 46 | |
| 47 | dnl |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 48 | dnl Endianness detection |
| 49 | dnl |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 50 | AC_C_BIGENDIAN |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 51 | |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 52 | dnl |
| 53 | dnl Legacy macros |
| 54 | dnl |
| 55 | case $target in |
| 56 | *mingw* | *cygw* | *win32* | *w32* ) |
| 57 | AC_DEFINE(PJ_WIN32,1) |
| 58 | AC_DEFINE(PJ_WIN32_WINNT,0x0400) |
| 59 | AC_DEFINE(WIN32_LEAN_AND_MEAN) |
| 60 | ;; |
| 61 | *darwin*) |
| 62 | AC_DEFINE(PJ_DARWINOS,1) |
| 63 | ;; |
| 64 | *linux*) |
| 65 | AC_DEFINE(PJ_LINUX,1) |
| 66 | ;; |
| 67 | *rtems*) |
| 68 | AC_DEFINE(PJ_RTEMS,1) |
| 69 | ;; |
| 70 | *sunos* | *solaris* ) |
| 71 | AC_DEFINE(PJ_SUNOS,1) |
| 72 | ;; |
| 73 | *) |
| 74 | ;; |
| 75 | esac |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 80 | dnl # --disable-floating-point option |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 81 | AC_ARG_ENABLE(floating-point, |
| 82 | AC_HELP_STRING([--disable-floating-point], |
| 83 | [Disable floating point where possible]), |
| 84 | [if test "$enable_floating_point" = "no"; then |
| 85 | AC_DEFINE(PJ_HAS_FLOATING_POINT,0) |
| 86 | AC_MSG_RESULT([Checking if floating point is disabled... yes]) |
| 87 | fi], |
| 88 | [ |
| 89 | AC_DEFINE(PJ_HAS_FLOATING_POINT,1) |
| 90 | AC_MSG_RESULT([Checking if floating point is disabled... no]) |
| 91 | AC_CHECK_LIB(m,fmod) |
| 92 | ]) |
| 93 | |
| 94 | |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 95 | AC_CHECK_HEADER(arpa/inet.h,[AC_DEFINE(PJ_HAS_ARPA_INET_H,1)]) |
| 96 | AC_CHECK_HEADER(assert.h,[AC_DEFINE(PJ_HAS_ASSERT_H,1)]) |
| 97 | AC_CHECK_HEADER(ctype.h,[AC_DEFINE(PJ_HAS_CTYPE_H,1)]) |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 98 | |
| 99 | case $target in |
| 100 | *mingw* | *cygw* | *win32* | *w32* ) |
| 101 | AC_DEFINE(PJ_HAS_ERRNO_H,0) |
| 102 | ;; |
| 103 | *) |
| 104 | AC_CHECK_HEADER(errno.h,[AC_DEFINE(PJ_HAS_ERRNO_H,1)]) |
| 105 | ;; |
| 106 | esac |
| 107 | |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 108 | AC_CHECK_HEADER(linux/socket.h,[AC_DEFINE(PJ_HAS_LINUX_SOCKET_H,1)]) |
| 109 | AC_CHECK_HEADER(malloc.h,[AC_DEFINE(PJ_HAS_MALLOC_H,1)]) |
| 110 | AC_CHECK_HEADER(netdb.h,[AC_DEFINE(PJ_HAS_NETDB_H,1)]) |
| 111 | AC_CHECK_HEADER(netinet/in.h,[AC_DEFINE(PJ_HAS_NETINET_IN_H,1)]) |
| 112 | AC_CHECK_HEADER(setjmp.h,[AC_DEFINE(PJ_HAS_SETJMP_H,1)]) |
| 113 | AC_CHECK_HEADER(stdarg.h,[AC_DEFINE(PJ_HAS_STDARG_H,1)]) |
| 114 | AC_CHECK_HEADER(stddef.h,[AC_DEFINE(PJ_HAS_STDDEF_H,1)]) |
| 115 | AC_CHECK_HEADER(stdio.h,[AC_DEFINE(PJ_HAS_STDIO_H,1)]) |
| 116 | AC_CHECK_HEADER(stdlib.h,[AC_DEFINE(PJ_HAS_STDLIB_H,1)]) |
| 117 | AC_CHECK_HEADER(string.h,[AC_DEFINE(PJ_HAS_STRING_H,1)]) |
| 118 | AC_CHECK_HEADER(sys/ioctl.h,[AC_DEFINE(PJ_HAS_SYS_IOCTL_H,1)]) |
| 119 | AC_CHECK_HEADER(sys/select.h,[AC_DEFINE(PJ_HAS_SYS_SELECT_H,1)]) |
| 120 | AC_CHECK_HEADER(sys/socket.h,[AC_DEFINE(PJ_HAS_SYS_SOCKET_H,1)]) |
| 121 | AC_CHECK_HEADER(sys/time.h,[AC_DEFINE(PJ_HAS_SYS_TIME_H,1)]) |
| 122 | AC_CHECK_HEADER(sys/timeb.h,[AC_DEFINE(PJ_HAS_SYS_TIMEB_H,1)]) |
| 123 | AC_CHECK_HEADER(sys/types.h,[AC_DEFINE(PJ_HAS_SYS_TYPES_H,1)]) |
| 124 | AC_CHECK_HEADER(time.h,[AC_DEFINE(PJ_HAS_TIME_H,1)]) |
| 125 | AC_CHECK_HEADER(unistd.h,[AC_DEFINE(PJ_HAS_UNISTD_H,1)]) |
| 126 | AC_CHECK_HEADER(mswsock.h,[AC_DEFINE(PJ_HAS_MSWSOCK_H,1)]) |
| 127 | AC_CHECK_HEADER(winsock.h,[AC_DEFINE(PJ_HAS_WINSOCK_H,1)]) |
| 128 | AC_CHECK_HEADER(winsock2.h,[AC_DEFINE(PJ_HAS_WINSOCK2_H,1)]) |
| 129 | |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 130 | AC_MSG_RESULT([Setting PJ_OS_NAME to $target]) |
| 131 | AC_DEFINE_UNQUOTED(PJ_OS_NAME,["$target"]) |
| 132 | |
| 133 | AC_MSG_RESULT([Setting PJ_HAS_ERRNO_VAR to 1]) |
| 134 | AC_DEFINE(PJ_HAS_ERRNO_VAR,1) |
| 135 | |
| 136 | AC_MSG_RESULT([Setting PJ_HAS_HIGH_RES_TIMER to 1]) |
| 137 | AC_DEFINE(PJ_HAS_HIGH_RES_TIMER,1) |
| 138 | |
| 139 | AC_MSG_RESULT([Setting PJ_HAS_MALLOC to 1]) |
| 140 | AC_DEFINE(PJ_HAS_MALLOC,1) |
| 141 | |
| 142 | AC_MSG_RESULT([Setting PJ_NATIVE_STRING_IS_UNICODE to 0]) |
| 143 | AC_DEFINE(PJ_NATIVE_STRING_IS_UNICODE,0) |
| 144 | |
| 145 | AC_MSG_RESULT([Setting PJ_ATOMIC_VALUE_TYPE to long]) |
| 146 | AC_DEFINE(PJ_ATOMIC_VALUE_TYPE,long) |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 147 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 148 | dnl # Determine if inet_aton() is available |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 149 | AC_MSG_CHECKING([if inet_aton is available]) |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 150 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <arpa/inet.h>]], |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 151 | [inet_aton(0, 0);])], |
| 152 | [AC_DEFINE(PJ_SOCK_HAS_INET_ATON,1) |
| 153 | AC_MSG_RESULT(yes)], |
| 154 | [AC_MSG_RESULT(no)]) |
| 155 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 156 | dnl # Determine if sockaddr_in has sin_len member |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 157 | AC_MSG_CHECKING([if sockaddr_in has sin_len member]) |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 158 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
| 159 | #include <sys/socket.h> |
| 160 | #include <netinet/in.h> |
| 161 | #include <arpa/inet.h>]], |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 162 | [struct sockaddr_in a; a.sin_len=0;])], |
| 163 | [AC_DEFINE(PJ_SOCKADDR_HAS_LEN,1) |
| 164 | AC_MSG_RESULT(yes)], |
| 165 | AC_MSG_RESULT(no)) |
| 166 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 167 | dnl # Determine if socklen_t is available |
Benny Prijono | 30f85c6 | 2006-09-09 20:05:33 +0000 | [diff] [blame] | 168 | AC_MSG_CHECKING([if socklen_t is available]) |
Benny Prijono | 1d97162 | 2006-09-10 22:27:40 +0000 | [diff] [blame] | 169 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], |
Benny Prijono | 30f85c6 | 2006-09-09 20:05:33 +0000 | [diff] [blame] | 170 | [socklen_t xxx = 0;])], |
| 171 | [AC_DEFINE(PJ_HAS_SOCKLEN_T,1) |
| 172 | AC_MSG_RESULT(yes)], |
| 173 | AC_MSG_RESULT(no)) |
| 174 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 175 | dnl # Determine if SO_ERROR is available |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 176 | AC_MSG_CHECKING([if SO_ERROR is available]) |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 177 | case $target in |
| 178 | *mingw* | *cygw* | *win32* | *w32* ) |
| 179 | AC_DEFINE(PJ_HAS_SO_ERROR,1) |
| 180 | AC_MSG_RESULT(yes) |
| 181 | ;; |
| 182 | *) |
| 183 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
| 184 | #include <sys/socket.h> |
| 185 | #include <netinet/in.h> |
| 186 | #include <arpa/inet.h>]], |
| 187 | [int i=SO_ERROR;])], |
| 188 | [AC_DEFINE(PJ_HAS_SO_ERROR,1) |
| 189 | AC_MSG_RESULT(yes)], |
| 190 | AC_MSG_RESULT(no)) |
| 191 | ;; |
| 192 | esac |
| 193 | |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 194 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 195 | dnl # Determine if RW-mutex is available |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 196 | AC_MSG_CHECKING([if pthread_rwlock_t is available]) |
| 197 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>], |
| 198 | [pthread_rwlock_t *x;])], |
| 199 | [AC_DEFINE(PJ_EMULATE_RWMUTEX,0) |
| 200 | AC_MSG_RESULT(yes)], |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 201 | [AC_DEFINE(PJ_EMULATE_RWMUTEX,1) |
| 202 | AC_MSG_RESULT(no)]) |
| 203 | |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 204 | AC_SUBST(ac_os_objs) |
| 205 | case $target in |
| 206 | *mingw* | *cygw* | *win32* | *w32* ) |
| 207 | ac_os_objs="os_core_win32.o os_error_win32.o os_time_win32.o os_timestamp_win32.o guid_win32.o ioqueue_select.o" |
| 208 | ;; |
| 209 | *) |
| 210 | ac_os_objs="os_core_unix.o os_error_unix.o os_time_unix.o os_timestamp_posix.o guid_simple.o ioqueue_select.o" |
| 211 | ;; |
| 212 | esac |
| 213 | |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 214 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 215 | dnl ########################################## |
| 216 | dnl # |
| 217 | dnl # PJMEDIA |
| 218 | dnl # |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 219 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 220 | dnl # Sound device backend selection |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 221 | AC_SUBST(ac_pjmedia_snd) |
Benny Prijono | 1d97162 | 2006-09-10 22:27:40 +0000 | [diff] [blame] | 222 | AC_ARG_ENABLE(sound, |
| 223 | AC_HELP_STRING([--disable-sound], |
| 224 | [Exclude sound (i.e. use null sound)]), |
| 225 | [if test "$enable_sound" = "no"; then |
| 226 | [ac_pjmedia_snd=null] |
| 227 | AC_MSG_RESULT([Checking if sound is disabled... yes]) |
| 228 | fi] |
| 229 | ) |
| 230 | |
| 231 | if test "$enable_sound" = "no"; then |
| 232 | true; |
| 233 | else |
| 234 | case $target in |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 235 | *darwin*) |
| 236 | ac_pjmedia_snd=pa_darwinos |
| 237 | AC_MSG_RESULT([Checking sound device backend... coreaudio]) |
| 238 | LIBS="$LIBS -framework CoreAudio" |
| 239 | ;; |
| 240 | *cygwin* | *mingw*) |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 241 | ac_pjmedia_snd=pa_win32 |
| 242 | AC_MSG_RESULT([Checking sound device backend... win32 sound]) |
| 243 | ;; |
| 244 | *rtems*) |
| 245 | ac_pjmedia_snd=null |
| 246 | AC_MSG_RESULT([Checking sound device backend... null sound]) |
| 247 | ;; |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 248 | *) |
| 249 | ac_pjmedia_snd=pa_unix |
| 250 | AC_CHECK_HEADER(alsa/version.h, |
| 251 | [AC_SUBST(ac_pa_use_alsa,1) |
| 252 | LIBS="$LIBS -lasound" |
| 253 | ], |
| 254 | [AC_SUBST(ac_pa_use_alsa,0)]) |
| 255 | AC_MSG_RESULT([Checking sound device backend... unix]) |
| 256 | ;; |
Benny Prijono | 1d97162 | 2006-09-10 22:27:40 +0000 | [diff] [blame] | 257 | esac |
| 258 | fi |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 259 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 260 | dnl # Include resampling small filter |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 261 | AC_SUBST(ac_no_small_filter) |
| 262 | AC_ARG_ENABLE(small-filter, |
| 263 | AC_HELP_STRING([--disable-small-filter], |
| 264 | [Exclude small filter in resampling]), |
| 265 | [if test "$enable_small_filter" = "no"; then |
| 266 | [ac_no_small_filter='-DPJMEDIA_HAS_SMALL_FILTER=0'] |
| 267 | AC_MSG_RESULT([Checking if small filter is disabled... yes]) |
| 268 | fi], |
| 269 | AC_MSG_RESULT([Checking if small filter is disabled... no])) |
| 270 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 271 | dnl # Include resampling large filter |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 272 | AC_SUBST(ac_no_large_filter) |
| 273 | AC_ARG_ENABLE(large-filter, |
| 274 | AC_HELP_STRING([--disable-large-filter], |
| 275 | [Exclude large filter in resampling]), |
| 276 | [if test "$enable_large_filter" = "no"; then |
| 277 | [ac_no_large_filter='-DPJMEDIA_HAS_LARGE_FILTER=0'] |
| 278 | AC_MSG_RESULT([Checking if large filter is disabled... yes]) |
| 279 | fi], |
| 280 | AC_MSG_RESULT([Checking if large filter is disabled... no])) |
| 281 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 282 | dnl # Include G.711 Annex A PLC |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 283 | AC_SUBST(ac_no_g711_plc) |
| 284 | AC_ARG_ENABLE(g711-plc, |
| 285 | AC_HELP_STRING([--disable-g711-plc], |
| 286 | [Exclude G.711 Annex A PLC]), |
| 287 | [if test "$enable_g711_plc" = "no"; then |
| 288 | [ac_no_g711_plc='-DPJMEDIA_HAS_G711_PLC=0'] |
| 289 | AC_MSG_RESULT([Checking if G.711 Annex A PLC is disabled...yes]) |
| 290 | fi], |
| 291 | AC_MSG_RESULT([Checking if G.711 Annex A PLC is disabled...no])) |
| 292 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 293 | dnl # Include Speex AEC |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 294 | AC_SUBST(ac_no_speex_aec) |
| 295 | AC_ARG_ENABLE(speex-aec, |
| 296 | AC_HELP_STRING([--disable-speex-aec], |
| 297 | [Exclude Speex Acoustic Echo Canceller/AEC]), |
| 298 | [if test "$enable_speex_aec" = "no"; then |
| 299 | [ac_no_speex_aec='-DPJMEDIA_HAS_SPEEX_AEC=0'] |
| 300 | AC_MSG_RESULT([Checking if Speex AEC is disabled...yes]) |
| 301 | fi], |
| 302 | AC_MSG_RESULT([Checking if Speex AEC is disabled...no])) |
| 303 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 304 | dnl # Include G711 codec |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 305 | AC_SUBST(ac_no_g711_codec) |
| 306 | AC_ARG_ENABLE(g711-codec, |
| 307 | AC_HELP_STRING([--disable-g711-codec], |
| 308 | [Exclude G.711 codecs from the build]), |
| 309 | [if test "$enable_g711_codec" = "no"; then |
| 310 | [ac_no_g711_codec=1] |
| 311 | AC_MSG_RESULT([Checking if G.711 codec is disabled...yes]) |
| 312 | fi], |
| 313 | AC_MSG_RESULT([Checking if G.711 codec is disabled...no])) |
| 314 | |
| 315 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 316 | dnl # Include L16 codec |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 317 | AC_SUBST(ac_no_l16_codec) |
| 318 | AC_ARG_ENABLE(l16-codec, |
| 319 | AC_HELP_STRING([--disable-l16-codec], |
| 320 | [Exclude Linear/L16 codec family from the build]), |
| 321 | [if test "$enable_l16_codec" = "no"; then |
| 322 | [ac_no_l16_codec=1] |
| 323 | AC_MSG_RESULT([Checking if L16 codecs are disabled...yes]) |
| 324 | fi], |
| 325 | AC_MSG_RESULT([Checking if G.711 codec is disabled...no])) |
| 326 | |
| 327 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 328 | dnl # Include GSM codec |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 329 | AC_SUBST(ac_no_gsm_codec) |
| 330 | AC_ARG_ENABLE(gsm-codec, |
| 331 | AC_HELP_STRING([--disable-gsm-codec], |
| 332 | [Exclude GSM codec in the build]), |
| 333 | [if test "$enable_gsm_codec" = "no"; then |
| 334 | [ac_no_gsm_codec=1] |
| 335 | AC_MSG_RESULT([Checking if GSM codec is disabled...yes]) |
| 336 | fi], |
| 337 | AC_MSG_RESULT([Checking if GSM codec is disabled...no])) |
| 338 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 339 | dnl # Include Speex codec |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 340 | AC_SUBST(ac_no_speex_codec) |
| 341 | AC_ARG_ENABLE(speex-codec, |
| 342 | AC_HELP_STRING([--disable-speex-codec], |
| 343 | [Exclude Speex codecs in the build]), |
| 344 | [if test "$enable_speex_codec" = "no"; then |
| 345 | [ac_no_speex_codec=1] |
| 346 | AC_MSG_RESULT([Checking if Speex codec is disabled...yes]) |
| 347 | fi], |
| 348 | AC_MSG_RESULT([Checking if Speex codec is disabled...no])) |
| 349 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 350 | dnl # Include iLBC codec |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 351 | AC_SUBST(ac_no_ilbc_codec) |
| 352 | AC_ARG_ENABLE(ilbc-codec, |
| 353 | AC_HELP_STRING([--disable-ilbc-codec], |
| 354 | [Exclude iLBC codec in the build]), |
| 355 | [if test "$enable_ilbc_codec" = "no"; then |
| 356 | [ac_no_ilbc_codec=1] |
| 357 | AC_MSG_RESULT([Checking if iLBC codec is disabled...yes]) |
| 358 | fi], |
| 359 | AC_MSG_RESULT([Checking if iLBC codec is disabled...no])) |
| 360 | |
| 361 | |
| 362 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 363 | dnl ########################################## |
| 364 | dnl # |
| 365 | dnl # MANUAL CONFIG |
| 366 | dnl # |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 367 | |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 368 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 369 | dnl # Determine if select() requires nfds to be filled up with |
| 370 | dnl # correct value (max_fd+1). If zero, nfds will be filled up with |
| 371 | dnl # PJ_FD_SETSIZE |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 372 | AC_MSG_CHECKING([if select() needs correct nfds]) |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 373 | case $target in |
| 374 | *rtems*) AC_DEFINE(PJ_SELECT_NEEDS_NFDS,1) |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 375 | AC_MSG_RESULT(yes) |
| 376 | ;; |
| 377 | *) AC_DEFINE(PJ_SELECT_NEEDS_NFDS,0) |
| 378 | AC_MSG_RESULT([no (default)]) |
| 379 | AC_MSG_RESULT([** Decided that select() doesn't need correct nfds (please check)]) |
| 380 | ;; |
| 381 | esac |
| 382 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 383 | dnl # Determine if pj_thread_create() should enforce thread stack size when |
| 384 | dnl # creating thread. Default is zero, to allow OS to allocate appropriate |
| 385 | dnl # thread's stack size. |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 386 | AC_MSG_CHECKING([if pj_thread_create() should enforce stack size]) |
| 387 | case $target in |
| 388 | *rtems*) AC_DEFINE(PJ_THREAD_SET_STACK_SIZE,1) |
| 389 | AC_MSG_RESULT(yes) |
| 390 | ;; |
| 391 | *) AC_DEFINE(PJ_THREAD_SET_STACK_SIZE,0) |
| 392 | AC_MSG_RESULT([no (default)]) |
| 393 | ;; |
| 394 | esac |
| 395 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 396 | dnl # Determine if pj_thread_create() should allocate thread's stack from |
| 397 | dnl # the pool. Default is zero, to let OS allocate thread's stack. |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 398 | AC_MSG_CHECKING([if pj_thread_create() should allocate stack]) |
| 399 | case $target in |
| 400 | *rtems*) AC_DEFINE(PJ_THREAD_ALLOCATE_STACK,1) |
| 401 | AC_MSG_RESULT(yes) |
| 402 | ;; |
| 403 | *) AC_DEFINE(PJ_THREAD_ALLOCATE_STACK,0) |
| 404 | AC_MSG_RESULT([no (default)]) |
| 405 | ;; |
| 406 | esac |
| 407 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 408 | dnl # This value specifies the value set in errno by the OS when a non-blocking |
| 409 | dnl # socket recv() can not return immediate data. |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 410 | case $target in |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 411 | *mingw* | *cygw* | *win32* | *w32* ) |
| 412 | AC_DEFINE(PJ_BLOCKING_ERROR_VAL,WSAEWOULDBLOCK) |
| 413 | ;; |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 414 | *) AC_DEFINE(PJ_BLOCKING_ERROR_VAL,EAGAIN) |
| 415 | AC_MSG_RESULT([** Setting non-blocking recv() retval to EAGAIN (please check)]) |
| 416 | ;; |
| 417 | esac |
| 418 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 419 | dnl # This value specifies the value set in errno by the OS when a non-blocking |
| 420 | dnl # socket connect() can not get connected immediately. |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 421 | case $target in |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 422 | *mingw* | *cygw* | *win32* | *w32* ) |
| 423 | AC_DEFINE(PJ_BLOCKING_CONNECT_ERROR_VAL,WSAEWOULDBLOCK) |
| 424 | ;; |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 425 | *) AC_DEFINE(PJ_BLOCKING_CONNECT_ERROR_VAL,EINPROGRESS) |
| 426 | AC_MSG_RESULT([** Setting non-blocking connect() retval to EINPROGRESS (please check)]) |
| 427 | ;; |
| 428 | esac |
| 429 | |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 430 | |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 431 | AC_SUBST(target) |
| 432 | AC_SUBST(ac_cross_compile) |
| 433 | if test "$build" = "$host"; then |
| 434 | ac_cross_compile= |
| 435 | else |
| 436 | ac_cross_compile=${host}- |
| 437 | fi |
| 438 | AC_SUBST(ac_linux_poll,select) |
| 439 | AC_SUBST(ac_host,unix) |
| 440 | AC_SUBST(ac_main_obj) |
| 441 | case $target in |
| 442 | *rtems*) |
| 443 | ac_main_obj=main_rtems.o |
| 444 | ;; |
| 445 | *) |
| 446 | ac_main_obj=main.o |
| 447 | ;; |
| 448 | esac |
| 449 | AC_SUBST(CC) |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 450 | AC_OUTPUT() |
| 451 | |