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