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