Benny Prijono | 8a9b3b2 | 2010-01-14 14:46:54 +0000 | [diff] [blame] | 1 | AC_INIT(pjproject,1.x) |
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 |
Benny Prijono | fe9bffd | 2007-01-27 17:44:13 +0000 | [diff] [blame] | 10 | pjmedia/include/pjmedia/config_auto.h |
| 11 | pjmedia/include/pjmedia-codec/config_auto.h |
Benny Prijono | 7e0d75f | 2006-12-25 20:34:14 +0000 | [diff] [blame] | 12 | pjsip/include/pjsip/sip_autoconf.h |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 13 | ]) |
| 14 | AC_CONFIG_FILES([build.mak |
| 15 | build/os-auto.mak |
Benny Prijono | 8a9b3b2 | 2010-01-14 14:46:54 +0000 | [diff] [blame] | 16 | pjlib/build/os-auto.mak |
| 17 | pjlib-util/build/os-auto.mak |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 18 | pjmedia/build/os-auto.mak |
| 19 | pjsip/build/os-auto.mak |
Benny Prijono | d962784 | 2007-04-18 09:24:31 +0000 | [diff] [blame] | 20 | third_party/build/os-auto.mak |
Benny Prijono | 8a9b3b2 | 2010-01-14 14:46:54 +0000 | [diff] [blame] | 21 | third_party/build/portaudio/os-auto.mak |
| 22 | ]) |
Benny Prijono | c1fe23d | 2006-09-13 09:38:06 +0000 | [diff] [blame] | 23 | |
Benny Prijono | 1248311 | 2007-03-12 10:44:38 +0000 | [diff] [blame] | 24 | |
Benny Prijono | c1fe23d | 2006-09-13 09:38:06 +0000 | [diff] [blame] | 25 | dnl |
| 26 | dnl Setup default CFLAGS |
| 27 | dnl |
| 28 | if test "$CFLAGS" = ""; then |
Benny Prijono | d145982 | 2006-10-04 20:56:39 +0000 | [diff] [blame] | 29 | CFLAGS="-O2" |
Benny Prijono | c1fe23d | 2006-09-13 09:38:06 +0000 | [diff] [blame] | 30 | else |
| 31 | CFLAGS="$CFLAGS" |
| 32 | fi |
| 33 | |
| 34 | CXXFLAGS="$CFLAGS $CXXFLAGS" |
| 35 | |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 36 | AC_PROG_CC |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 37 | AC_PROG_CXX |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 38 | AC_LANG_C |
| 39 | |
Benny Prijono | 1248311 | 2007-03-12 10:44:38 +0000 | [diff] [blame] | 40 | AC_SUBST(ac_pjdir) |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 41 | AC_SUBST(ac_build_mak_vars) |
Benny Prijono | 53847a3 | 2007-09-24 16:10:13 +0000 | [diff] [blame] | 42 | case $target in |
| 43 | *mingw* | *cygw* | *win32* | *w32* ) |
| 44 | ac_pjdir=`pwd -W` |
| 45 | ;; |
| 46 | *) |
| 47 | ac_pjdir=`pwd` |
| 48 | ;; |
| 49 | esac |
Benny Prijono | 1248311 | 2007-03-12 10:44:38 +0000 | [diff] [blame] | 50 | |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 51 | AC_CHECK_LIB(pthread,pthread_create) |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 52 | AC_CHECK_LIB(wsock32,puts) |
| 53 | AC_CHECK_LIB(ws2_32,puts) |
| 54 | AC_CHECK_LIB(ole32,puts) |
| 55 | AC_CHECK_LIB(winmm,puts) |
| 56 | AC_CHECK_LIB(socket,puts) |
| 57 | AC_CHECK_LIB(rt,puts) |
| 58 | AC_CHECK_LIB(nsl,puts) |
Benny Prijono | 4e48b51 | 2007-05-16 13:41:00 +0000 | [diff] [blame] | 59 | AC_CHECK_LIB(uuid,uuid_generate) |
| 60 | AC_CHECK_LIB(uuid,uuid_generate,[ac_has_uuid_lib=1]) |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 61 | |
| 62 | AC_MSG_RESULT([Setting PJ_M_NAME to $target_cpu]) |
| 63 | AC_DEFINE_UNQUOTED(PJ_M_NAME,["$target_cpu"]) |
| 64 | |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 65 | dnl |
Benny Prijono | 1d97162 | 2006-09-10 22:27:40 +0000 | [diff] [blame] | 66 | dnl Memory alignment detection |
| 67 | dnl |
| 68 | AC_MSG_CHECKING([memory alignment]) |
| 69 | case $target in |
| 70 | ia64-* | x86_64-* ) |
| 71 | AC_DEFINE(PJ_POOL_ALIGNMENT, 8) |
| 72 | AC_MSG_RESULT([8 bytes]) |
| 73 | ;; |
| 74 | * ) |
| 75 | AC_DEFINE(PJ_POOL_ALIGNMENT, 4) |
| 76 | AC_MSG_RESULT([4 bytes (default)]) |
| 77 | ;; |
| 78 | esac |
| 79 | |
| 80 | |
| 81 | dnl |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 82 | dnl Endianness detection |
| 83 | dnl |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 84 | AC_C_BIGENDIAN |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 85 | |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 86 | dnl |
| 87 | dnl Legacy macros |
| 88 | dnl |
| 89 | case $target in |
| 90 | *mingw* | *cygw* | *win32* | *w32* ) |
| 91 | AC_DEFINE(PJ_WIN32,1) |
| 92 | AC_DEFINE(PJ_WIN32_WINNT,0x0400) |
| 93 | AC_DEFINE(WIN32_LEAN_AND_MEAN) |
| 94 | ;; |
| 95 | *darwin*) |
| 96 | AC_DEFINE(PJ_DARWINOS,1) |
| 97 | ;; |
| 98 | *linux*) |
| 99 | AC_DEFINE(PJ_LINUX,1) |
| 100 | ;; |
| 101 | *rtems*) |
| 102 | AC_DEFINE(PJ_RTEMS,1) |
| 103 | ;; |
| 104 | *sunos* | *solaris* ) |
| 105 | AC_DEFINE(PJ_SUNOS,1) |
| 106 | ;; |
| 107 | *) |
| 108 | ;; |
| 109 | esac |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 114 | dnl # --disable-floating-point option |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 115 | AC_ARG_ENABLE(floating-point, |
| 116 | AC_HELP_STRING([--disable-floating-point], |
| 117 | [Disable floating point where possible]), |
| 118 | [if test "$enable_floating_point" = "no"; then |
| 119 | AC_DEFINE(PJ_HAS_FLOATING_POINT,0) |
| 120 | AC_MSG_RESULT([Checking if floating point is disabled... yes]) |
| 121 | fi], |
| 122 | [ |
| 123 | AC_DEFINE(PJ_HAS_FLOATING_POINT,1) |
| 124 | AC_MSG_RESULT([Checking if floating point is disabled... no]) |
| 125 | AC_CHECK_LIB(m,fmod) |
| 126 | ]) |
| 127 | |
| 128 | |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 129 | AC_CHECK_HEADER(arpa/inet.h,[AC_DEFINE(PJ_HAS_ARPA_INET_H,1)]) |
| 130 | AC_CHECK_HEADER(assert.h,[AC_DEFINE(PJ_HAS_ASSERT_H,1)]) |
| 131 | AC_CHECK_HEADER(ctype.h,[AC_DEFINE(PJ_HAS_CTYPE_H,1)]) |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 132 | |
| 133 | case $target in |
| 134 | *mingw* | *cygw* | *win32* | *w32* ) |
| 135 | AC_DEFINE(PJ_HAS_ERRNO_H,0) |
| 136 | ;; |
| 137 | *) |
| 138 | AC_CHECK_HEADER(errno.h,[AC_DEFINE(PJ_HAS_ERRNO_H,1)]) |
| 139 | ;; |
| 140 | esac |
| 141 | |
Benny Prijono | 1d481ab | 2008-01-24 15:27:30 +0000 | [diff] [blame] | 142 | AC_CHECK_HEADER(fcntl.h,[AC_DEFINE(PJ_HAS_FCNTL_H,1)]) |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 143 | AC_CHECK_HEADER(linux/socket.h,[AC_DEFINE(PJ_HAS_LINUX_SOCKET_H,1)]) |
| 144 | AC_CHECK_HEADER(malloc.h,[AC_DEFINE(PJ_HAS_MALLOC_H,1)]) |
| 145 | AC_CHECK_HEADER(netdb.h,[AC_DEFINE(PJ_HAS_NETDB_H,1)]) |
Benny Prijono | 37fc9de | 2008-08-04 14:45:02 +0000 | [diff] [blame] | 146 | AC_CHECK_HEADER(netinet/in_systm.h,[AC_DEFINE(PJ_HAS_NETINET_IN_SYSTM_H,1)]) |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 147 | AC_CHECK_HEADER(netinet/in.h,[AC_DEFINE(PJ_HAS_NETINET_IN_H,1)]) |
Benny Prijono | 37fc9de | 2008-08-04 14:45:02 +0000 | [diff] [blame] | 148 | AC_CHECK_HEADER(netinet/ip.h,[AC_DEFINE(PJ_HAS_NETINET_IP_H,1)],[], |
Benny Prijono | d523370 | 2010-01-13 13:09:45 +0000 | [diff] [blame] | 149 | [#if PJ_HAS_SYS_TYPES_H |
| 150 | # include <sys/types.h> |
| 151 | #endif |
| 152 | #if PJ_HAS_NETINET_IN_SYSTM_H |
Benny Prijono | 37fc9de | 2008-08-04 14:45:02 +0000 | [diff] [blame] | 153 | # include <netinet/in_systm.h> |
| 154 | #endif |
Benny Prijono | d523370 | 2010-01-13 13:09:45 +0000 | [diff] [blame] | 155 | #if PJ_HAS_NETINET_IN_H |
| 156 | # include <netinet/in.h> |
| 157 | #endif |
Benny Prijono | 37fc9de | 2008-08-04 14:45:02 +0000 | [diff] [blame] | 158 | ]) |
Benny Prijono | 1d61ba5 | 2009-10-24 00:00:40 +0000 | [diff] [blame] | 159 | AC_CHECK_HEADER(netinet/tcp.h,[AC_DEFINE(PJ_HAS_NETINET_TCP_H,1)]) |
Benny Prijono | 1d65f70 | 2007-12-03 04:03:17 +0000 | [diff] [blame] | 160 | AC_CHECK_HEADER(ifaddrs.h,[AC_DEFINE(PJ_HAS_IFADDRS_H,1)]) |
Benny Prijono | 1c5f4e4 | 2008-02-07 13:11:39 +0000 | [diff] [blame] | 161 | AC_CHECK_HEADER(semaphore.h,[AC_DEFINE(PJ_HAS_SEMAPHORE_H,1)]) |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 162 | AC_CHECK_HEADER(setjmp.h,[AC_DEFINE(PJ_HAS_SETJMP_H,1)]) |
| 163 | AC_CHECK_HEADER(stdarg.h,[AC_DEFINE(PJ_HAS_STDARG_H,1)]) |
| 164 | AC_CHECK_HEADER(stddef.h,[AC_DEFINE(PJ_HAS_STDDEF_H,1)]) |
| 165 | AC_CHECK_HEADER(stdio.h,[AC_DEFINE(PJ_HAS_STDIO_H,1)]) |
Benny Prijono | fdafd40 | 2008-01-23 14:34:46 +0000 | [diff] [blame] | 166 | AC_CHECK_HEADER(stdint.h,[AC_DEFINE(PJ_HAS_STDINT_H,1)]) |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 167 | AC_CHECK_HEADER(stdlib.h,[AC_DEFINE(PJ_HAS_STDLIB_H,1)]) |
| 168 | AC_CHECK_HEADER(string.h,[AC_DEFINE(PJ_HAS_STRING_H,1)]) |
| 169 | AC_CHECK_HEADER(sys/ioctl.h,[AC_DEFINE(PJ_HAS_SYS_IOCTL_H,1)]) |
| 170 | AC_CHECK_HEADER(sys/select.h,[AC_DEFINE(PJ_HAS_SYS_SELECT_H,1)]) |
| 171 | AC_CHECK_HEADER(sys/socket.h,[AC_DEFINE(PJ_HAS_SYS_SOCKET_H,1)]) |
| 172 | AC_CHECK_HEADER(sys/time.h,[AC_DEFINE(PJ_HAS_SYS_TIME_H,1)]) |
| 173 | AC_CHECK_HEADER(sys/timeb.h,[AC_DEFINE(PJ_HAS_SYS_TIMEB_H,1)]) |
| 174 | AC_CHECK_HEADER(sys/types.h,[AC_DEFINE(PJ_HAS_SYS_TYPES_H,1)]) |
Benny Prijono | a1aec0e | 2010-01-13 21:28:06 +0000 | [diff] [blame] | 175 | AC_CHECK_HEADER(sys/filio.h,[AC_DEFINE(PJ_HAS_SYS_FILIO_H,1)]) |
| 176 | AC_CHECK_HEADER(sys/sockio.h,[AC_DEFINE(PJ_HAS_SYS_SOCKIO_H,1)]) |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 177 | AC_CHECK_HEADER(time.h,[AC_DEFINE(PJ_HAS_TIME_H,1)]) |
| 178 | AC_CHECK_HEADER(unistd.h,[AC_DEFINE(PJ_HAS_UNISTD_H,1)]) |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 179 | AC_CHECK_HEADER(winsock.h,[AC_DEFINE(PJ_HAS_WINSOCK_H,1)]) |
| 180 | AC_CHECK_HEADER(winsock2.h,[AC_DEFINE(PJ_HAS_WINSOCK2_H,1)]) |
Benny Prijono | a9948e6 | 2008-03-25 14:03:01 +0000 | [diff] [blame] | 181 | AC_CHECK_HEADER(mswsock.h,[AC_DEFINE(PJ_HAS_MSWSOCK_H,1)],[], |
| 182 | [#if PJ_HAS_WINSOCK2_H |
| 183 | # include <winsock2.h> |
| 184 | #elif PJ_HAS_WINSOCK_H |
| 185 | # include <winsock.h> |
| 186 | #endif |
| 187 | ]) |
Benny Prijono | e274613 | 2008-09-27 13:16:35 +0000 | [diff] [blame] | 188 | AC_CHECK_HEADER(ws2tcpip.h,[AC_DEFINE(PJ_HAS_WS2TCPIP_H,1)]) |
Benny Prijono | 4e48b51 | 2007-05-16 13:41:00 +0000 | [diff] [blame] | 189 | AC_CHECK_HEADER(uuid/uuid.h,[ac_has_uuid_h=1]) |
Benny Prijono | a9948e6 | 2008-03-25 14:03:01 +0000 | [diff] [blame] | 190 | AC_CHECK_HEADER(net/if.h,[AC_DEFINE(PJ_HAS_NET_IF_H,1)],[], |
Benny Prijono | d523370 | 2010-01-13 13:09:45 +0000 | [diff] [blame] | 191 | [#if PJ_HAS_SYS_TYPES_H |
| 192 | # include <sys/types.h> |
| 193 | #endif |
| 194 | #if PJ_HAS_SYS_SOCKET_H |
| 195 | |
Benny Prijono | 188ba7e | 2008-03-25 13:53:16 +0000 | [diff] [blame] | 196 | # include <sys/socket.h> |
| 197 | #endif |
| 198 | ]) |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 199 | AC_MSG_RESULT([Setting PJ_OS_NAME to $target]) |
| 200 | AC_DEFINE_UNQUOTED(PJ_OS_NAME,["$target"]) |
| 201 | |
| 202 | AC_MSG_RESULT([Setting PJ_HAS_ERRNO_VAR to 1]) |
| 203 | AC_DEFINE(PJ_HAS_ERRNO_VAR,1) |
| 204 | |
| 205 | AC_MSG_RESULT([Setting PJ_HAS_HIGH_RES_TIMER to 1]) |
| 206 | AC_DEFINE(PJ_HAS_HIGH_RES_TIMER,1) |
| 207 | |
| 208 | AC_MSG_RESULT([Setting PJ_HAS_MALLOC to 1]) |
| 209 | AC_DEFINE(PJ_HAS_MALLOC,1) |
| 210 | |
| 211 | AC_MSG_RESULT([Setting PJ_NATIVE_STRING_IS_UNICODE to 0]) |
| 212 | AC_DEFINE(PJ_NATIVE_STRING_IS_UNICODE,0) |
| 213 | |
| 214 | AC_MSG_RESULT([Setting PJ_ATOMIC_VALUE_TYPE to long]) |
| 215 | AC_DEFINE(PJ_ATOMIC_VALUE_TYPE,long) |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 216 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 217 | dnl # Determine if inet_aton() is available |
Benny Prijono | c16c6e3 | 2007-11-18 14:53:47 +0000 | [diff] [blame] | 218 | AC_MSG_CHECKING([if inet_aton() is available]) |
| 219 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
| 220 | #include <sys/socket.h> |
| 221 | #include <arpa/inet.h>]], |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 222 | [inet_aton(0, 0);])], |
| 223 | [AC_DEFINE(PJ_SOCK_HAS_INET_ATON,1) |
| 224 | AC_MSG_RESULT(yes)], |
| 225 | [AC_MSG_RESULT(no)]) |
| 226 | |
Benny Prijono | c16c6e3 | 2007-11-18 14:53:47 +0000 | [diff] [blame] | 227 | dnl # Determine if inet_pton() is available |
| 228 | AC_MSG_CHECKING([if inet_pton() is available]) |
| 229 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
| 230 | #include <sys/socket.h> |
| 231 | #include <arpa/inet.h>]], |
| 232 | [inet_pton(0, 0, 0);])], |
| 233 | [AC_DEFINE(PJ_SOCK_HAS_INET_PTON,1) |
| 234 | AC_MSG_RESULT(yes)], |
| 235 | [AC_MSG_RESULT(no)]) |
| 236 | |
| 237 | dnl # Determine if inet_ntop() is available |
| 238 | AC_MSG_CHECKING([if inet_ntop() is available]) |
| 239 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
| 240 | #include <sys/socket.h> |
| 241 | #include <arpa/inet.h>]], |
| 242 | [inet_ntop(0, 0, 0, 0);])], |
| 243 | [AC_DEFINE(PJ_SOCK_HAS_INET_NTOP,1) |
| 244 | AC_MSG_RESULT(yes)], |
| 245 | [AC_MSG_RESULT(no)]) |
| 246 | |
| 247 | dnl # Determine if getaddrinfo() is available |
| 248 | AC_MSG_CHECKING([if getaddrinfo() is available]) |
| 249 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
| 250 | #include <sys/socket.h> |
| 251 | #include <netdb.h>]], |
| 252 | [getaddrinfo(0, 0, 0, 0);])], |
| 253 | [AC_DEFINE(PJ_SOCK_HAS_GETADDRINFO,1) |
| 254 | AC_MSG_RESULT(yes)], |
| 255 | [AC_MSG_RESULT(no)]) |
| 256 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 257 | dnl # Determine if sockaddr_in has sin_len member |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 258 | AC_MSG_CHECKING([if sockaddr_in has sin_len member]) |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 259 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
| 260 | #include <sys/socket.h> |
| 261 | #include <netinet/in.h> |
| 262 | #include <arpa/inet.h>]], |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 263 | [struct sockaddr_in a; a.sin_len=0;])], |
| 264 | [AC_DEFINE(PJ_SOCKADDR_HAS_LEN,1) |
| 265 | AC_MSG_RESULT(yes)], |
| 266 | AC_MSG_RESULT(no)) |
| 267 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 268 | dnl # Determine if socklen_t is available |
Benny Prijono | 30f85c6 | 2006-09-09 20:05:33 +0000 | [diff] [blame] | 269 | AC_MSG_CHECKING([if socklen_t is available]) |
Benny Prijono | d523370 | 2010-01-13 13:09:45 +0000 | [diff] [blame] | 270 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
| 271 | #include <sys/socket.h>]], |
Benny Prijono | 30f85c6 | 2006-09-09 20:05:33 +0000 | [diff] [blame] | 272 | [socklen_t xxx = 0;])], |
| 273 | [AC_DEFINE(PJ_HAS_SOCKLEN_T,1) |
| 274 | AC_MSG_RESULT(yes)], |
| 275 | AC_MSG_RESULT(no)) |
| 276 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 277 | dnl # Determine if SO_ERROR is available |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 278 | AC_MSG_CHECKING([if SO_ERROR is available]) |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 279 | case $target in |
| 280 | *mingw* | *cygw* | *win32* | *w32* ) |
| 281 | AC_DEFINE(PJ_HAS_SO_ERROR,1) |
| 282 | AC_MSG_RESULT(yes) |
| 283 | ;; |
| 284 | *) |
| 285 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
| 286 | #include <sys/socket.h> |
| 287 | #include <netinet/in.h> |
| 288 | #include <arpa/inet.h>]], |
| 289 | [int i=SO_ERROR;])], |
| 290 | [AC_DEFINE(PJ_HAS_SO_ERROR,1) |
| 291 | AC_MSG_RESULT(yes)], |
| 292 | AC_MSG_RESULT(no)) |
| 293 | ;; |
| 294 | esac |
| 295 | |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 296 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 297 | dnl # Determine if RW-mutex is available |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 298 | AC_MSG_CHECKING([if pthread_rwlock_t is available]) |
| 299 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>], |
| 300 | [pthread_rwlock_t *x;])], |
| 301 | [AC_DEFINE(PJ_EMULATE_RWMUTEX,0) |
Benny Prijono | 1c5f4e4 | 2008-02-07 13:11:39 +0000 | [diff] [blame] | 302 | ac_rwmutex="yes" |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 303 | AC_MSG_RESULT(yes)], |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 304 | [AC_DEFINE(PJ_EMULATE_RWMUTEX,1) |
Benny Prijono | 1c5f4e4 | 2008-02-07 13:11:39 +0000 | [diff] [blame] | 305 | ac_rwmutex="no" |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 306 | AC_MSG_RESULT(no)]) |
| 307 | |
Benny Prijono | 1c5f4e4 | 2008-02-07 13:11:39 +0000 | [diff] [blame] | 308 | dnl # If rwmutex is not detected, check again but this time |
| 309 | dnl # with _POSIX_READER_WRITER_LOCKS defined (newlib needs this) |
| 310 | if test "$ac_rwmutex" = "no"; then |
| 311 | AC_MSG_CHECKING([if pthread_rwlock_t is available with _POSIX_READER_WRITER_LOCKS]) |
| 312 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _POSIX_READER_WRITER_LOCKS |
| 313 | #include <pthread.h>]], |
| 314 | [pthread_rwlock_t *x;])], |
| 315 | [AC_DEFINE(PJ_EMULATE_RWMUTEX,0) |
| 316 | CFLAGS="$CFLAGS -D_POSIX_THREADS -D_POSIX_READER_WRITER_LOCKS" |
| 317 | AC_MSG_RESULT(yes)], |
| 318 | [AC_DEFINE(PJ_EMULATE_RWMUTEX,1) |
| 319 | AC_MSG_RESULT(no)]) |
| 320 | fi |
| 321 | |
| 322 | dnl # Do we have pthread_mutexattr_settype()? |
| 323 | AC_MSG_CHECKING([if pthread_mutexattr_settype() is available]) |
| 324 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>], |
| 325 | [pthread_mutexattr_settype(0,PTHREAD_MUTEX_FAST_NP);])], |
| 326 | [AC_DEFINE(PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE,1) |
| 327 | AC_MSG_RESULT(yes)], |
| 328 | [AC_MSG_RESULT(no)]) |
| 329 | |
| 330 | dnl # Does pthread_mutexattr_t has "recursive" member? |
| 331 | AC_MSG_CHECKING([if pthread_mutexattr_t has recursive member]) |
| 332 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>], |
| 333 | [[pthread_mutexattr_t attr; |
| 334 | attr.recursive=1;]])], |
| 335 | [AC_DEFINE(PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE,1) |
| 336 | AC_MSG_RESULT(yes)], |
| 337 | [AC_MSG_RESULT(no)]) |
| 338 | |
Benny Prijono | 99eec38 | 2008-09-18 21:22:16 +0000 | [diff] [blame] | 339 | dnl ###################### |
| 340 | dnl # ioqueue selection |
| 341 | dnl # |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 342 | AC_SUBST(ac_os_objs) |
Benny Prijono | 99eec38 | 2008-09-18 21:22:16 +0000 | [diff] [blame] | 343 | AC_MSG_CHECKING([ioqueue backend]) |
| 344 | AC_ARG_ENABLE(epoll, |
| 345 | AC_HELP_STRING([--enable-epoll], |
Benny Prijono | 9489e7a | 2008-09-19 22:18:50 +0000 | [diff] [blame] | 346 | [Use /dev/epoll ioqueue on Linux (experimental)]), |
Benny Prijono | 99eec38 | 2008-09-18 21:22:16 +0000 | [diff] [blame] | 347 | [ |
| 348 | ac_os_objs=ioqueue_epoll.o |
| 349 | AC_MSG_RESULT([/dev/epoll]) |
| 350 | ], |
| 351 | [ |
| 352 | ac_os_objs=ioqueue_select.o |
| 353 | AC_MSG_RESULT([select()]) |
| 354 | ]) |
| 355 | |
| 356 | |
| 357 | dnl ###################### |
| 358 | dnl # OS specific files |
| 359 | dnl # |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 360 | case $target in |
| 361 | *mingw* | *cygw* | *win32* | *w32* ) |
Benny Prijono | 99eec38 | 2008-09-18 21:22:16 +0000 | [diff] [blame] | 362 | ac_os_objs="$ac_os_objs file_access_win32.o file_io_win32.o os_core_win32.o os_error_win32.o os_time_win32.o os_timestamp_win32.o guid_win32.o" |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 363 | ;; |
| 364 | *) |
Benny Prijono | 99eec38 | 2008-09-18 21:22:16 +0000 | [diff] [blame] | 365 | ac_os_objs="$ac_os_objs file_access_unistd.o file_io_ansi.o os_core_unix.o os_error_unix.o os_time_unix.o os_timestamp_posix.o" |
Benny Prijono | 4e48b51 | 2007-05-16 13:41:00 +0000 | [diff] [blame] | 366 | # UUID |
| 367 | if test "$ac_has_uuid_lib" = "1" -a "$ac_has_uuid_h" = "1"; then |
| 368 | ac_os_objs="$ac_os_objs guid_uuid.o" |
| 369 | else |
| 370 | ac_os_objs="$ac_os_objs guid_simple.o" |
| 371 | fi |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 372 | ;; |
| 373 | esac |
| 374 | |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 375 | |
Benny Prijono | 4e48b51 | 2007-05-16 13:41:00 +0000 | [diff] [blame] | 376 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 377 | dnl ########################################## |
| 378 | dnl # |
| 379 | dnl # PJMEDIA |
| 380 | dnl # |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 381 | |
Benny Prijono | 8a9b3b2 | 2010-01-14 14:46:54 +0000 | [diff] [blame] | 382 | dnl # Use external Speex installation |
| 383 | AC_SUBST(ac_external_speex,0) |
| 384 | AC_ARG_WITH(external-speex, |
| 385 | AC_HELP_STRING([--with-external-speex], |
| 386 | [Use external Speex development files, not the one in "third_party" directory. When this option is set, make sure that Speex is accessible to use (hint: use CFLAGS and LDFLAGS env var to set the include/lib paths)]), |
| 387 | [ |
| 388 | if test "x$with_external_speex" != "xno"; then |
| 389 | # Test Speex installation |
| 390 | AC_MSG_CHECKING([if external Speex devkit is installed]) |
| 391 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <speex/speex.h> |
| 392 | #include <speex/speex_echo.h> |
| 393 | ]], |
| 394 | [speex_echo_state_init(0, 0); speex_encoder_init(0); ])], |
| 395 | [AC_MSG_RESULT(yes!!) |
| 396 | AC_DEFINE(PJMEDIA_EXTERNAL_SPEEX_CODEC, 1) |
| 397 | ac_external_speex="1" |
| 398 | ], |
| 399 | [AC_MSG_ERROR([Unable to use external Speex library. If Speex development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths])]) |
| 400 | fi |
| 401 | ] |
| 402 | ) |
| 403 | |
| 404 | dnl # Use external GSM codec library installation |
| 405 | AC_SUBST(ac_external_gsm,0) |
| 406 | AC_ARG_WITH(external-gsm, |
| 407 | AC_HELP_STRING([--with-external-gsm], |
| 408 | [Use external GSM codec library, not the one in "third_party" directory. When this option is set, make sure that the GSM include/lib files are accessible to use (hint: use CFLAGS and LDFLAGS env var to set the include/lib paths)]), |
| 409 | [ |
| 410 | if test "x$with_external_gsm" != "xno"; then |
| 411 | # Test GSM library installation |
| 412 | AC_MSG_CHECKING([if external GSM devkit is installed]) |
| 413 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <gsm/gsm.h> |
| 414 | ]], |
| 415 | [gsm_create(); ]) |
| 416 | ], |
| 417 | [AC_MSG_RESULT(yes!!) |
| 418 | AC_DEFINE(PJMEDIA_EXTERNAL_GSM_CODEC, 1) |
| 419 | ac_external_gsm="1" |
| 420 | ], |
| 421 | [AC_MSG_ERROR([Unable to use external GSM library. If GSM development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths])]) |
| 422 | fi |
| 423 | ] |
| 424 | ) |
| 425 | |
| 426 | |
| 427 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 428 | dnl # Sound device backend selection |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 429 | AC_SUBST(ac_pjmedia_snd) |
Benny Prijono | 1d97162 | 2006-09-10 22:27:40 +0000 | [diff] [blame] | 430 | AC_ARG_ENABLE(sound, |
| 431 | AC_HELP_STRING([--disable-sound], |
| 432 | [Exclude sound (i.e. use null sound)]), |
| 433 | [if test "$enable_sound" = "no"; then |
| 434 | [ac_pjmedia_snd=null] |
| 435 | AC_MSG_RESULT([Checking if sound is disabled... yes]) |
| 436 | fi] |
| 437 | ) |
| 438 | |
Benny Prijono | 8a9b3b2 | 2010-01-14 14:46:54 +0000 | [diff] [blame] | 439 | dnl # Use external PortAudio installation |
| 440 | AC_SUBST(ac_external_pa,0) |
| 441 | AC_ARG_WITH(external-pa, |
| 442 | AC_HELP_STRING([--with-external-pa], |
| 443 | [Use external PortAudio development files, not the one in "third_party" directory. When this option is set, make sure that PortAudio is accessible to use (hint: use CFLAGS and LDFLAGS env var to set the include/lib paths)]), |
Benny Prijono | fe0c127 | 2010-01-13 16:28:15 +0000 | [diff] [blame] | 444 | [ |
Benny Prijono | 8a9b3b2 | 2010-01-14 14:46:54 +0000 | [diff] [blame] | 445 | if test "x$with_external_pa" != "xno"; then |
| 446 | # Test PortAudio installation |
| 447 | AC_MSG_CHECKING([if external PortAudio devkit is installed]) |
| 448 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <portaudio.h> |
| 449 | ]], |
| 450 | [Pa_Initialize();])], |
| 451 | [AC_MSG_RESULT(yes!!) |
| 452 | ac_external_pa="1" |
| 453 | ], |
| 454 | [AC_MSG_ERROR([Unable to use PortAudio. If PortAudio development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths])]) |
Benny Prijono | fe0c127 | 2010-01-13 16:28:15 +0000 | [diff] [blame] | 455 | fi |
| 456 | ] |
| 457 | ) |
| 458 | |
Benny Prijono | 39ae2da | 2006-10-13 17:57:42 +0000 | [diff] [blame] | 459 | AC_SUBST(ac_pa_cflags) |
Benny Prijono | 27c9872 | 2007-04-09 21:28:15 +0000 | [diff] [blame] | 460 | AC_CHECK_HEADER(sys/soundcard.h, |
| 461 | [ac_pa_cflags="$ac_pa_cflags -DHAVE_SYS_SOUNDCARD_H"]) |
| 462 | AC_CHECK_HEADER(linux/soundcard.h, |
| 463 | [ac_pa_cflags="$ac_pa_cflags -DHAVE_LINUX_SOUNDCARD_H"]) |
| 464 | AC_CHECK_HEADER(machine/soundcard.h, |
| 465 | [ac_pa_cflags="$ac_pa_cflags -DHAVE_MACHINE_SOUNDCARD_H"]) |
| 466 | |
Benny Prijono | 3e09167 | 2008-01-09 15:43:02 +0000 | [diff] [blame] | 467 | if test "x$ac_cv_c_bigendian" = "xyes"; then |
| 468 | ac_pa_cflags="$ac_pa_cflags -DPA_BIG_ENDIAN" |
| 469 | else |
| 470 | ac_pa_cflags="$ac_pa_cflags -DPA_LITTLE_ENDIAN" |
| 471 | fi |
| 472 | |
Benny Prijono | 1d97162 | 2006-09-10 22:27:40 +0000 | [diff] [blame] | 473 | if test "$enable_sound" = "no"; then |
| 474 | true; |
| 475 | else |
| 476 | case $target in |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 477 | *darwin*) |
Benny Prijono | 39ae2da | 2006-10-13 17:57:42 +0000 | [diff] [blame] | 478 | LIBS="$LIBS -framework CoreAudio -framework CoreServices -framework AudioUnit -framework AudioToolbox" |
| 479 | if test "`uname -r`" = "6.8"; then |
Benny Prijono | 27c9872 | 2007-04-09 21:28:15 +0000 | [diff] [blame] | 480 | #ac_pa_cflags="$ac_pa_cflags -DPA_OLD_CORE_AUDIO -DMOSX_USE_NON_ATOMIC_FLAG_BITS" |
Benny Prijono | 39ae2da | 2006-10-13 17:57:42 +0000 | [diff] [blame] | 481 | #AC_MSG_RESULT([Setting additional PortAudio CFLAGS.. -DPA_OLD_CORE_AUDIO -DMOSX_USE_NON_ATOMIC_FLAG_BITS]) |
| 482 | ac_pjmedia_snd=pa_old_darwinos |
| 483 | AC_MSG_RESULT([Checking sound device backend... old coreaudio]) |
| 484 | else |
| 485 | ac_pjmedia_snd=pa_darwinos |
| 486 | AC_MSG_RESULT([Checking sound device backend... coreaudio]) |
| 487 | fi |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 488 | ;; |
| 489 | *cygwin* | *mingw*) |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 490 | ac_pjmedia_snd=pa_win32 |
| 491 | AC_MSG_RESULT([Checking sound device backend... win32 sound]) |
| 492 | ;; |
| 493 | *rtems*) |
| 494 | ac_pjmedia_snd=null |
| 495 | AC_MSG_RESULT([Checking sound device backend... null sound]) |
| 496 | ;; |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 497 | *) |
Benny Prijono | 0b46232 | 2008-03-12 22:44:24 +0000 | [diff] [blame] | 498 | dnl # Check if ALSA is available |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 499 | ac_pjmedia_snd=pa_unix |
| 500 | AC_CHECK_HEADER(alsa/version.h, |
| 501 | [AC_SUBST(ac_pa_use_alsa,1) |
| 502 | LIBS="$LIBS -lasound" |
| 503 | ], |
| 504 | [AC_SUBST(ac_pa_use_alsa,0)]) |
| 505 | AC_MSG_RESULT([Checking sound device backend... unix]) |
Benny Prijono | 0b46232 | 2008-03-12 22:44:24 +0000 | [diff] [blame] | 506 | |
| 507 | dnl # Check if OSS is disabled |
| 508 | AC_SUBST(ac_pa_use_oss,1) |
| 509 | AC_ARG_ENABLE(oss, |
| 510 | AC_HELP_STRING([--disable-oss], |
| 511 | [Disable OSS audio (default: not disabled)]) |
| 512 | , |
| 513 | [ |
| 514 | if test "$enable_oss" = "no"; then |
| 515 | [ac_pa_use_oss=0] |
| 516 | AC_MSG_RESULT([Checking if OSS audio is disabled... yes]) |
| 517 | fi |
| 518 | ]) |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 519 | ;; |
Benny Prijono | 1d97162 | 2006-09-10 22:27:40 +0000 | [diff] [blame] | 520 | esac |
| 521 | fi |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 522 | |
Benny Prijono | ebb2c33 | 2008-07-28 23:40:58 +0000 | [diff] [blame] | 523 | AC_ARG_ENABLE(ext_sound, |
| 524 | AC_HELP_STRING([--enable-ext-sound], |
| 525 | [PJMEDIA will not provide any sound device backend]), |
| 526 | [if test "$enable_ext_sound" = "yes"; then |
| 527 | [ac_pjmedia_snd=external] |
| 528 | AC_MSG_RESULT([Checking if external sound is set... yes]) |
| 529 | fi] |
| 530 | ) |
| 531 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 532 | dnl # Include resampling small filter |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 533 | AC_SUBST(ac_no_small_filter) |
| 534 | AC_ARG_ENABLE(small-filter, |
| 535 | AC_HELP_STRING([--disable-small-filter], |
| 536 | [Exclude small filter in resampling]), |
| 537 | [if test "$enable_small_filter" = "no"; then |
| 538 | [ac_no_small_filter='-DPJMEDIA_HAS_SMALL_FILTER=0'] |
| 539 | AC_MSG_RESULT([Checking if small filter is disabled... yes]) |
| 540 | fi], |
| 541 | AC_MSG_RESULT([Checking if small filter is disabled... no])) |
| 542 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 543 | dnl # Include resampling large filter |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 544 | AC_SUBST(ac_no_large_filter) |
| 545 | AC_ARG_ENABLE(large-filter, |
| 546 | AC_HELP_STRING([--disable-large-filter], |
| 547 | [Exclude large filter in resampling]), |
| 548 | [if test "$enable_large_filter" = "no"; then |
| 549 | [ac_no_large_filter='-DPJMEDIA_HAS_LARGE_FILTER=0'] |
| 550 | AC_MSG_RESULT([Checking if large filter is disabled... yes]) |
| 551 | fi], |
| 552 | AC_MSG_RESULT([Checking if large filter is disabled... no])) |
| 553 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 554 | dnl # Include Speex AEC |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 555 | AC_SUBST(ac_no_speex_aec) |
| 556 | AC_ARG_ENABLE(speex-aec, |
| 557 | AC_HELP_STRING([--disable-speex-aec], |
| 558 | [Exclude Speex Acoustic Echo Canceller/AEC]), |
| 559 | [if test "$enable_speex_aec" = "no"; then |
| 560 | [ac_no_speex_aec='-DPJMEDIA_HAS_SPEEX_AEC=0'] |
| 561 | AC_MSG_RESULT([Checking if Speex AEC is disabled...yes]) |
| 562 | fi], |
| 563 | AC_MSG_RESULT([Checking if Speex AEC is disabled...no])) |
| 564 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 565 | dnl # Include G711 codec |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 566 | AC_SUBST(ac_no_g711_codec) |
| 567 | AC_ARG_ENABLE(g711-codec, |
| 568 | AC_HELP_STRING([--disable-g711-codec], |
| 569 | [Exclude G.711 codecs from the build]), |
| 570 | [if test "$enable_g711_codec" = "no"; then |
| 571 | [ac_no_g711_codec=1] |
Benny Prijono | fe9bffd | 2007-01-27 17:44:13 +0000 | [diff] [blame] | 572 | AC_DEFINE(PJMEDIA_HAS_G711_CODEC,0) |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 573 | AC_MSG_RESULT([Checking if G.711 codec is disabled...yes]) |
| 574 | fi], |
| 575 | AC_MSG_RESULT([Checking if G.711 codec is disabled...no])) |
| 576 | |
| 577 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 578 | dnl # Include L16 codec |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 579 | AC_SUBST(ac_no_l16_codec) |
| 580 | AC_ARG_ENABLE(l16-codec, |
| 581 | AC_HELP_STRING([--disable-l16-codec], |
| 582 | [Exclude Linear/L16 codec family from the build]), |
| 583 | [if test "$enable_l16_codec" = "no"; then |
| 584 | [ac_no_l16_codec=1] |
Benny Prijono | fe9bffd | 2007-01-27 17:44:13 +0000 | [diff] [blame] | 585 | AC_DEFINE(PJMEDIA_HAS_L16_CODEC,0) |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 586 | AC_MSG_RESULT([Checking if L16 codecs are disabled...yes]) |
| 587 | fi], |
Benny Prijono | c1fe23d | 2006-09-13 09:38:06 +0000 | [diff] [blame] | 588 | AC_MSG_RESULT([Checking if L16 codec is disabled...no])) |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 589 | |
| 590 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 591 | dnl # Include GSM codec |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 592 | AC_SUBST(ac_no_gsm_codec) |
| 593 | AC_ARG_ENABLE(gsm-codec, |
| 594 | AC_HELP_STRING([--disable-gsm-codec], |
| 595 | [Exclude GSM codec in the build]), |
| 596 | [if test "$enable_gsm_codec" = "no"; then |
| 597 | [ac_no_gsm_codec=1] |
Benny Prijono | fe9bffd | 2007-01-27 17:44:13 +0000 | [diff] [blame] | 598 | AC_DEFINE(PJMEDIA_HAS_GSM_CODEC,0) |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 599 | AC_MSG_RESULT([Checking if GSM codec is disabled...yes]) |
| 600 | fi], |
| 601 | AC_MSG_RESULT([Checking if GSM codec is disabled...no])) |
| 602 | |
Benny Prijono | 71f657d | 2008-03-17 14:24:21 +0000 | [diff] [blame] | 603 | dnl # Include G.722 codec |
| 604 | AC_SUBST(ac_no_g722_codec) |
| 605 | AC_ARG_ENABLE(g722-codec, |
| 606 | AC_HELP_STRING([--disable-g722-codec], |
| 607 | [Exclude G.722 codec in the build]), |
| 608 | [if test "$enable_g722_codec" = "no"; then |
| 609 | [ac_no_g722_codec=1] |
| 610 | AC_DEFINE(PJMEDIA_HAS_G722_CODEC,0) |
| 611 | AC_MSG_RESULT([Checking if G.722 codec is disabled...yes]) |
| 612 | fi], |
| 613 | AC_MSG_RESULT([Checking if G.722 codec is disabled...no])) |
| 614 | |
Nanang Izzuddin | 56e380a | 2009-04-15 14:45:41 +0000 | [diff] [blame] | 615 | dnl # Include G722.1 codec |
| 616 | AC_SUBST(ac_no_g7221_codec) |
| 617 | AC_ARG_ENABLE(g7221-codec, |
| 618 | AC_HELP_STRING([--disable-g7221-codec], |
| 619 | [Exclude G.7221 codec in the build]), |
| 620 | [if test "$enable_g7221_codec" = "no"; then |
| 621 | [ac_no_g7221_codec=1] |
| 622 | AC_DEFINE(PJMEDIA_HAS_G7221_CODEC,0) |
| 623 | AC_MSG_RESULT([Checking if G.722.1 codec is disabled...yes]) |
| 624 | fi], |
| 625 | AC_MSG_RESULT([Checking if G.722.1 codec is disabled...no])) |
| 626 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 627 | dnl # Include Speex codec |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 628 | AC_SUBST(ac_no_speex_codec) |
| 629 | AC_ARG_ENABLE(speex-codec, |
| 630 | AC_HELP_STRING([--disable-speex-codec], |
| 631 | [Exclude Speex codecs in the build]), |
| 632 | [if test "$enable_speex_codec" = "no"; then |
| 633 | [ac_no_speex_codec=1] |
Benny Prijono | fe9bffd | 2007-01-27 17:44:13 +0000 | [diff] [blame] | 634 | AC_DEFINE(PJMEDIA_HAS_SPEEX_CODEC,0) |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 635 | AC_MSG_RESULT([Checking if Speex codec is disabled...yes]) |
| 636 | fi], |
| 637 | AC_MSG_RESULT([Checking if Speex codec is disabled...no])) |
| 638 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 639 | dnl # Include iLBC codec |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 640 | AC_SUBST(ac_no_ilbc_codec) |
| 641 | AC_ARG_ENABLE(ilbc-codec, |
| 642 | AC_HELP_STRING([--disable-ilbc-codec], |
| 643 | [Exclude iLBC codec in the build]), |
| 644 | [if test "$enable_ilbc_codec" = "no"; then |
| 645 | [ac_no_ilbc_codec=1] |
Benny Prijono | fe9bffd | 2007-01-27 17:44:13 +0000 | [diff] [blame] | 646 | AC_DEFINE(PJMEDIA_HAS_ILBC_CODEC,0) |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 647 | AC_MSG_RESULT([Checking if iLBC codec is disabled...yes]) |
| 648 | fi], |
| 649 | AC_MSG_RESULT([Checking if iLBC codec is disabled...no])) |
| 650 | |
Benny Prijono | 550a1a6 | 2007-10-16 08:54:00 +0000 | [diff] [blame] | 651 | dnl # Include libsamplerate |
| 652 | AC_ARG_ENABLE(libsamplerate, |
| 653 | AC_HELP_STRING([--enable-libsamplerate], |
| 654 | [Link with libsamplerate when available. Note that PJMEDIA_RESAMPLE_IMP must also be configured]), |
| 655 | [ AC_CHECK_LIB(samplerate,src_new) ], |
| 656 | AC_MSG_RESULT([Skipping libsamplerate detection]) |
| 657 | ) |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 658 | |
| 659 | |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 660 | dnl ######################################################## |
| 661 | dnl # Intel IPP support |
| 662 | dnl # |
| 663 | AC_ARG_ENABLE(ipp, |
| 664 | AC_HELP_STRING([--enable-ipp], |
| 665 | [Enable Intel IPP support. Specify the Intel IPP package and samples location using IPPROOT and IPPSAMPLES env var or with --with-ipp and --with-ipp-samples options]), |
| 666 | [], |
| 667 | [enable_ipp=no] |
| 668 | ) |
| 669 | |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 670 | AC_ARG_WITH(ipp, |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 671 | AC_HELP_STRING([--with-ipp=DIR], |
| 672 | [Specify the Intel IPP location]), |
| 673 | [], |
| 674 | [with_ipp=no] |
| 675 | ) |
| 676 | |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 677 | AC_ARG_WITH(ipp-samples, |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 678 | AC_HELP_STRING([--with-ipp-samples=DIR], |
| 679 | [Specify the Intel IPP samples location]), |
| 680 | [], |
| 681 | [with_ipp_samples=no] |
| 682 | ) |
| 683 | |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 684 | AC_ARG_WITH(ipp-arch, |
| 685 | AC_HELP_STRING([--with-ipp-arch=ARCH], |
| 686 | [Specify the Intel IPP ARCH suffix, e.g. "64" or "em64t. Default is blank for IA32"]), |
| 687 | [], |
| 688 | [with_ipp_arch=no] |
| 689 | ) |
| 690 | |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 691 | if test "x$enable_ipp" != "xno"; then |
| 692 | dnl # |
| 693 | dnl # Verifying Intel IPP path |
| 694 | dnl # |
| 695 | AC_MSG_CHECKING([Intel IPP location]) |
| 696 | |
| 697 | if test "x$with_ipp" != "xno" -a "x$with_ipp" != "x"; then |
| 698 | AC_MSG_RESULT([$with_ipp]) |
| 699 | IPPROOT=$with_ipp |
| 700 | elif test "x$IPPROOT" = "x"; then |
| 701 | if test -d /opt/intel/ipp; then |
| 702 | IPPROOT=`ls -d /opt/intel/ipp/*/* | head -1` |
| 703 | AC_MSG_RESULT([autodetected in $IPPROOT]) |
| 704 | fi |
| 705 | else |
| 706 | AC_MSG_RESULT([$IPPROOT]) |
| 707 | fi |
| 708 | |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 709 | if test "x$with_ipp_arch" != "xno"; then |
| 710 | IPP_SUFFIX="em64t" |
| 711 | AC_MSG_RESULT([IPP arch suffix is set to $IPP_SUFFIX]) |
| 712 | else |
| 713 | IPP_SUFFIX="" |
| 714 | AC_MSG_RESULT([IPP arch suffix is set to empty]) |
| 715 | fi |
| 716 | |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 717 | if test x$IPPROOT = x; then |
| 718 | AC_MSG_ERROR([the location is neither specified nor can be guessed. Please specify with IPPROOT env var or with --with-ipp option]) |
| 719 | elif test ! -d $IPPROOT; then |
| 720 | AC_MSG_ERROR([not found]) |
| 721 | elif test ! -d $IPPROOT/include; then |
| 722 | AC_MSG_ERROR([directory doesn't seem to be valid]) |
| 723 | else |
| 724 | # IPP directory looks okay. |
| 725 | # Remove trailing backslash |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 726 | IPPROOT=`echo $IPPROOT | sed 's/\/$//'` |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 727 | |
| 728 | SAVED_CFLAGS="$CFLAGS" |
| 729 | SAVED_LDFLAGS="$LDFLAGS" |
| 730 | SAVED_LIBS="$LIBS" |
| 731 | |
| 732 | IPP_CFLAGS="-I$IPPROOT/include" |
Benny Prijono | 46bd084 | 2010-02-12 14:12:41 +0000 | [diff] [blame] | 733 | IPP_LIBS="-lippsc${IPP_SUFFIX} -lipps${IPP_SUFFIX} -lippsr${IPP_SUFFIX} -lippcore${IPP_SUFFIX}" |
| 734 | |
| 735 | # Some differences between Mac OS X and Linux |
| 736 | case $target in |
| 737 | *darwin* ) |
| 738 | IPP_LDFLAGS="-L$IPPROOT/Libraries -L$IPPROOT/lib" |
| 739 | ;; |
| 740 | *) |
| 741 | IPP_LDFLAGS="-L$IPPROOT/sharedlib" |
| 742 | IPP_LIBS="$IPP_LIBS -lguide" |
| 743 | ;; |
| 744 | esac |
| 745 | |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 746 | #IPP_LDFLAGS="-L$IPPROOT/sharedlib" |
Benny Prijono | 46bd084 | 2010-02-12 14:12:41 +0000 | [diff] [blame] | 747 | #Static: |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 748 | #IPP_LIBS="-lippscmerged -lippsrmerged -lippsmerged -lippcore" |
| 749 | |
| 750 | CFLAGS="$CFLAGS $IPP_CFLAGS" |
| 751 | LDFLAGS="$LDFLAGS $IPP_LDFLAGS" |
| 752 | LIBS="$IPP_LIBS $LIBS" |
| 753 | |
| 754 | |
| 755 | AC_MSG_CHECKING([Intel IPP usability]) |
| 756 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ippcore.h> |
| 757 | ]], |
| 758 | [ippStaticInit();])], |
| 759 | [AC_MSG_RESULT(ok)], |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 760 | [AC_MSG_FAILURE(Error: unable to recognize your IPP installation. Make sure the paths and ARCH suffix are set correctly, run with --help for more info)]) |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 761 | |
| 762 | CFLAGS="$SAVED_CFLAGS" |
| 763 | LDFLAGS="$SAVED_LDFLAGS" |
| 764 | LIBS="$SAVED_LIBS" |
| 765 | fi |
| 766 | |
| 767 | dnl # |
| 768 | dnl # Verifying Intel IPP samples path |
| 769 | dnl # |
| 770 | AC_MSG_CHECKING([Intel IPP samples location]) |
| 771 | |
| 772 | if test "x$with_ipp_samples" != "xno" -a "x$with_ipp_samples" != "x"; then |
| 773 | AC_MSG_RESULT([$with_ipp_samples]) |
| 774 | IPPSAMPLES=$with_ipp_samples |
| 775 | elif test "x$IPPSAMPLES" = "x"; then |
| 776 | if test -d /opt/intel/ipp-samples; then |
| 777 | IPPSAMPLES=/opt/intel/ipp-samples |
| 778 | AC_MSG_RESULT([autodetected in $IPPSAMPLES]) |
| 779 | fi |
| 780 | else |
| 781 | AC_MSG_RESULT([$IPPSAMPLES]) |
| 782 | fi |
| 783 | |
| 784 | if test x$IPPSAMPLES = x; then |
| 785 | AC_MSG_ERROR([the location is neither specified nor can be guessed. Please specify with IPPSAMPLES env var or with --with-ipp-samples option]) |
| 786 | elif test ! -d $IPPSAMPLES; then |
| 787 | AC_MSG_ERROR([not found]) |
| 788 | elif test ! -d $IPPSAMPLES/speech-codecs; then |
| 789 | AC_MSG_ERROR([directory doesn't seem to be valid]) |
| 790 | else |
| 791 | # Remove trailing backslash |
| 792 | IPPSAMPLES=`echo $IPPSAMPLES | sed 's/\/$//'` |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 793 | |
| 794 | # Guess the libusc.a/libspeech.a build location |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 795 | AC_MSG_CHECKING([Intel IPP USC build location]) |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 796 | if test -d $IPPSAMPLES/speech-codecs/bin; then |
| 797 | IPPVER=5 |
| 798 | IPPSAMP_DIR=`ls -d $IPPSAMPLES/speech-codecs/bin/*gcc*/lib | head -1` |
| 799 | elif test -d $IPPSAMPLES/speech-codecs/_bin; then |
| 800 | IPPVER=6 |
Benny Prijono | 46bd084 | 2010-02-12 14:12:41 +0000 | [diff] [blame] | 801 | if test -d $IPPSAMPLES/speech-codecs/_bin/*gcc*; then |
| 802 | # gcc compiler |
| 803 | IPPSAMP_DIR=`ls -d $IPPSAMPLES/speech-codecs/_bin/*gcc*/lib | head -1` |
| 804 | elif test -d $IPPSAMPLES/speech-codecs/_bin/*icc*; then |
| 805 | # icc compiler |
| 806 | IPPSAMP_DIR=`ls -d $IPPSAMPLES/speech-codecs/_bin/*icc*/lib | head -1` |
| 807 | else |
| 808 | AC_MSG_FAILURE([Unable to find to find built binaries under $IPPSAMPLES/speech-codecs/{bin,_bin}. Have you built the IPP samples?]) |
| 809 | fi |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 810 | else |
| 811 | AC_MSG_FAILURE([unable to find $IPPSAMPLES/speech-codecs/bin/*gcc*/lib or $IPPSAMPLES/speech-codecs/_bin/*gcc*/lib directory. Have you built the samples?]) |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 812 | fi |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 813 | |
| 814 | # Test the directory |
| 815 | if test ! -d $IPPSAMP_DIR; then |
| 816 | AC_MSG_FAILURE([There's something wrong with this script, directory $IPPSAMP_DIR does not exist]) |
| 817 | exit 1; |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 818 | fi |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 819 | |
| 820 | if test "x$IPPVER" = "x5"; then |
| 821 | IPPSAMP_LIBS="libusc.a" |
| 822 | IPPSAMP_LDLIBS="-lusc" |
| 823 | elif test "x$IPPVER" = "x6"; then |
| 824 | IPPSAMP_LIBS="libspeech.a" |
| 825 | IPPSAMP_LDLIBS="-lspeech" |
| 826 | else |
| 827 | AC_MSG_FAILURE([bug in this script: unsupported IPP version]) |
| 828 | fi |
| 829 | |
| 830 | if test ! -f $IPPSAMP_DIR/$IPPSAMP_LIBS; then |
| 831 | AC_MSG_FAILURE([$IPPSAMP_LIBS doesn't exist in $IPPSAMP_DIR]) |
| 832 | fi |
| 833 | |
| 834 | AC_MSG_RESULT([$IPPSAMP_DIR]) |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 835 | |
| 836 | SAVED_CFLAGS="$CFLAGS" |
| 837 | SAVED_LDFLAGS="$LDFLAGS" |
| 838 | SAVED_LIBS="$LIBS" |
| 839 | |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 840 | IPPSAMP_INC="-I$IPPSAMPLES/speech-codecs/core/usc/include" |
| 841 | CFLAGS="$CFLAGS $IPPSAMP_INC" |
| 842 | LDFLAGS="$LDFLAGS -L$IPPSAMP_DIR" |
| 843 | LIBS="$IPPSAMP_LDLIBS $LIBS" |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 844 | |
| 845 | AC_MSG_CHECKING([Intel IPP USC usability]) |
| 846 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <usc.h> |
| 847 | ]], |
| 848 | [extern USC_Fxns USC_G729AFP_Fxns;])], |
| 849 | [AC_MSG_RESULT(ok)], |
| 850 | [AC_MSG_FAILURE(failed)]) |
| 851 | |
| 852 | CFLAGS="$SAVED_CFLAGS" |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 853 | LDFLAGS="$IPP_LDFLAGS $SAVED_LDFLAGS" |
| 854 | LIBS="$IPP_LIBS $SAVED_LIBS" |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 855 | |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 856 | IPP_CFLAGS="$IPP_CFLAGS $IPPSAMP_INC" |
| 857 | IPP_LDFLAGS="$IPP_LDFLAGS -L$IPPSAMP_DIR" |
| 858 | IPP_LIBS="$IPPSAMP_LDLIBS $IPP_LIBS" |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 859 | fi |
| 860 | |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 861 | CFLAGS="$CFLAGS $IPP_CFLAGS" |
| 862 | LDFLAGS="$LDFLAGS $IPP_LDFLAGS" |
| 863 | LIBS="$LIBS $IPP_LIBS" |
| 864 | |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 865 | ac_build_mak_vars="$ac_build_mak_vars\n\ |
| 866 | export IPP_CFLAGS=$IPP_CFLAGS\n\ |
| 867 | export IPP_LDFLAGS=$IPP_LDFLAGS\n\ |
| 868 | export IPP_LIBS=$IPP_LIBS" |
| 869 | else |
| 870 | AC_MSG_RESULT([Skipping Intel IPP settings (not wanted)]) |
| 871 | fi |
| 872 | |
| 873 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 874 | dnl ########################################## |
| 875 | dnl # |
Benny Prijono | 7e0d75f | 2006-12-25 20:34:14 +0000 | [diff] [blame] | 876 | dnl # PJSIP CONFIG |
| 877 | dnl # |
| 878 | |
| 879 | dnl # Include SSL support |
| 880 | AC_SUBST(ac_no_ssl) |
| 881 | AC_ARG_ENABLE(ssl, |
Benny Prijono | ce1db76 | 2007-02-14 02:21:08 +0000 | [diff] [blame] | 882 | AC_HELP_STRING([--disable-ssl], |
| 883 | [Exclude SSL support the build (default: autodetect)]) |
| 884 | , |
Benny Prijono | 7e0d75f | 2006-12-25 20:34:14 +0000 | [diff] [blame] | 885 | [ |
| 886 | if test "$enable_ssl" = "no"; then |
| 887 | [ac_no_ssl=1] |
| 888 | AC_MSG_RESULT([Checking if SSL support is disabled... yes]) |
| 889 | fi |
| 890 | ], |
| 891 | [ |
| 892 | AC_MSG_RESULT([checking for OpenSSL installations..]) |
| 893 | AC_SUBST(openssl_h_present) |
| 894 | AC_SUBST(libssl_present) |
| 895 | AC_SUBST(libcrypto_present) |
| 896 | AC_CHECK_HEADER(openssl/ssl.h,[openssl_h_present=1]) |
Benny Prijono | 7e0d75f | 2006-12-25 20:34:14 +0000 | [diff] [blame] | 897 | AC_CHECK_LIB(crypto,ERR_load_BIO_strings,[libcrypto_present=1 && LIBS="$LIBS -lcrypto"]) |
Benny Prijono | d523370 | 2010-01-13 13:09:45 +0000 | [diff] [blame] | 898 | AC_CHECK_LIB(ssl,SSL_library_init,[libssl_present=1 && LIBS="$LIBS -lssl"]) |
Benny Prijono | 7e0d75f | 2006-12-25 20:34:14 +0000 | [diff] [blame] | 899 | if test "x$openssl_h_present" = "x1" -a "x$libssl_present" = "x1" -a "x$libcrypto_present" = "x1"; then |
| 900 | AC_MSG_RESULT([OpenSSL library found, SSL support enabled]) |
Nanang Izzuddin | 9c7616f | 2009-10-28 06:09:15 +0000 | [diff] [blame] | 901 | # PJSIP_HAS_TLS_TRANSPORT setting follows PJ_HAS_SSL_SOCK |
| 902 | #AC_DEFINE(PJSIP_HAS_TLS_TRANSPORT, 1) |
Nanang Izzuddin | ea6d3c4 | 2009-10-26 15:47:52 +0000 | [diff] [blame] | 903 | AC_DEFINE(PJ_HAS_SSL_SOCK, 1) |
Benny Prijono | 7e0d75f | 2006-12-25 20:34:14 +0000 | [diff] [blame] | 904 | else |
| 905 | AC_MSG_RESULT([** OpenSSL libraries not found, disabling SSL support **]) |
| 906 | fi |
| 907 | ]) |
| 908 | |
| 909 | |
| 910 | dnl ########################################## |
| 911 | dnl # |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 912 | dnl # MANUAL CONFIG |
| 913 | dnl # |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 914 | |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 915 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 916 | dnl # Determine if select() requires nfds to be filled up with |
| 917 | dnl # correct value (max_fd+1). If zero, nfds will be filled up with |
| 918 | dnl # PJ_FD_SETSIZE |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 919 | AC_MSG_CHECKING([if select() needs correct nfds]) |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 920 | case $target in |
| 921 | *rtems*) AC_DEFINE(PJ_SELECT_NEEDS_NFDS,1) |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 922 | AC_MSG_RESULT(yes) |
| 923 | ;; |
| 924 | *) AC_DEFINE(PJ_SELECT_NEEDS_NFDS,0) |
| 925 | AC_MSG_RESULT([no (default)]) |
| 926 | AC_MSG_RESULT([** Decided that select() doesn't need correct nfds (please check)]) |
| 927 | ;; |
| 928 | esac |
| 929 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 930 | dnl # Determine if pj_thread_create() should enforce thread stack size when |
| 931 | dnl # creating thread. Default is zero, to allow OS to allocate appropriate |
| 932 | dnl # thread's stack size. |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 933 | AC_MSG_CHECKING([if pj_thread_create() should enforce stack size]) |
| 934 | case $target in |
| 935 | *rtems*) AC_DEFINE(PJ_THREAD_SET_STACK_SIZE,1) |
| 936 | AC_MSG_RESULT(yes) |
| 937 | ;; |
| 938 | *) AC_DEFINE(PJ_THREAD_SET_STACK_SIZE,0) |
| 939 | AC_MSG_RESULT([no (default)]) |
| 940 | ;; |
| 941 | esac |
| 942 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 943 | dnl # Determine if pj_thread_create() should allocate thread's stack from |
| 944 | 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] | 945 | AC_MSG_CHECKING([if pj_thread_create() should allocate stack]) |
| 946 | case $target in |
| 947 | *rtems*) AC_DEFINE(PJ_THREAD_ALLOCATE_STACK,1) |
| 948 | AC_MSG_RESULT(yes) |
| 949 | ;; |
| 950 | *) AC_DEFINE(PJ_THREAD_ALLOCATE_STACK,0) |
| 951 | AC_MSG_RESULT([no (default)]) |
| 952 | ;; |
| 953 | esac |
| 954 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 955 | dnl # This value specifies the value set in errno by the OS when a non-blocking |
| 956 | dnl # socket recv() can not return immediate data. |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 957 | case $target in |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 958 | *mingw* | *cygw* | *win32* | *w32* ) |
| 959 | AC_DEFINE(PJ_BLOCKING_ERROR_VAL,WSAEWOULDBLOCK) |
| 960 | ;; |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 961 | *) AC_DEFINE(PJ_BLOCKING_ERROR_VAL,EAGAIN) |
| 962 | AC_MSG_RESULT([** Setting non-blocking recv() retval to EAGAIN (please check)]) |
| 963 | ;; |
| 964 | esac |
| 965 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 966 | dnl # This value specifies the value set in errno by the OS when a non-blocking |
| 967 | dnl # socket connect() can not get connected immediately. |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 968 | case $target in |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 969 | *mingw* | *cygw* | *win32* | *w32* ) |
| 970 | AC_DEFINE(PJ_BLOCKING_CONNECT_ERROR_VAL,WSAEWOULDBLOCK) |
| 971 | ;; |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 972 | *) AC_DEFINE(PJ_BLOCKING_CONNECT_ERROR_VAL,EINPROGRESS) |
| 973 | AC_MSG_RESULT([** Setting non-blocking connect() retval to EINPROGRESS (please check)]) |
| 974 | ;; |
| 975 | esac |
| 976 | |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 977 | |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 978 | AC_SUBST(target) |
| 979 | AC_SUBST(ac_cross_compile) |
| 980 | if test "$build" = "$host"; then |
| 981 | ac_cross_compile= |
| 982 | else |
Benny Prijono | 5b818b2 | 2006-09-17 22:58:51 +0000 | [diff] [blame] | 983 | ac_cross_compile=${host_orig}- |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 984 | fi |
| 985 | AC_SUBST(ac_linux_poll,select) |
| 986 | AC_SUBST(ac_host,unix) |
| 987 | AC_SUBST(ac_main_obj) |
| 988 | case $target in |
| 989 | *rtems*) |
| 990 | ac_main_obj=main_rtems.o |
| 991 | ;; |
| 992 | *) |
| 993 | ac_main_obj=main.o |
| 994 | ;; |
| 995 | esac |
| 996 | AC_SUBST(CC) |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 997 | |
| 998 | ac_build_mak_vars=`echo $ac_build_mak_vars | sed 's/\\\\n/\n/g'` |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 999 | AC_OUTPUT() |
| 1000 | |
Benny Prijono | d962784 | 2007-04-18 09:24:31 +0000 | [diff] [blame] | 1001 | |
| 1002 | AC_MSG_RESULT([ |
| 1003 | |
Benny Prijono | c16c6e3 | 2007-11-18 14:53:47 +0000 | [diff] [blame] | 1004 | Configurations for current target have been written to 'build.mak', and 'os-auto.mak' in various build directories, and pjlib/include/pj/compat/os_auto.h. |
Benny Prijono | d962784 | 2007-04-18 09:24:31 +0000 | [diff] [blame] | 1005 | |
Benny Prijono | c16c6e3 | 2007-11-18 14:53:47 +0000 | [diff] [blame] | 1006 | Further customizations can be put in: |
Benny Prijono | d962784 | 2007-04-18 09:24:31 +0000 | [diff] [blame] | 1007 | - 'user.mak' |
| 1008 | - 'pjlib/include/pj/config_site.h' |
| 1009 | |
| 1010 | The next step now is to run 'make dep' and 'make'. |
| 1011 | ]) |
| 1012 | |