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)]) |
Benny Prijono | e3e6580 | 2011-02-28 07:44:19 +0000 | [diff] [blame] | 188 | AC_CHECK_HEADER(limits.h,[AC_DEFINE(PJ_HAS_LIMITS_H,1)]) |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 189 | AC_CHECK_HEADER(malloc.h,[AC_DEFINE(PJ_HAS_MALLOC_H,1)]) |
| 190 | AC_CHECK_HEADER(netdb.h,[AC_DEFINE(PJ_HAS_NETDB_H,1)]) |
Benny Prijono | 37fc9de | 2008-08-04 14:45:02 +0000 | [diff] [blame] | 191 | 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] | 192 | 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] | 193 | 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] | 194 | [#if PJ_HAS_SYS_TYPES_H |
| 195 | # include <sys/types.h> |
| 196 | #endif |
| 197 | #if PJ_HAS_NETINET_IN_SYSTM_H |
Benny Prijono | 37fc9de | 2008-08-04 14:45:02 +0000 | [diff] [blame] | 198 | # include <netinet/in_systm.h> |
| 199 | #endif |
Benny Prijono | d523370 | 2010-01-13 13:09:45 +0000 | [diff] [blame] | 200 | #if PJ_HAS_NETINET_IN_H |
| 201 | # include <netinet/in.h> |
| 202 | #endif |
Benny Prijono | 37fc9de | 2008-08-04 14:45:02 +0000 | [diff] [blame] | 203 | ]) |
Benny Prijono | 1d61ba5 | 2009-10-24 00:00:40 +0000 | [diff] [blame] | 204 | 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] | 205 | AC_CHECK_HEADER(ifaddrs.h, |
| 206 | [AC_CHECK_FUNC(getifaddrs,[AC_DEFINE(PJ_HAS_IFADDRS_H,1)])]) |
Benny Prijono | 1c5f4e4 | 2008-02-07 13:11:39 +0000 | [diff] [blame] | 207 | AC_CHECK_HEADER(semaphore.h,[AC_DEFINE(PJ_HAS_SEMAPHORE_H,1)]) |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 208 | AC_CHECK_HEADER(setjmp.h,[AC_DEFINE(PJ_HAS_SETJMP_H,1)]) |
| 209 | AC_CHECK_HEADER(stdarg.h,[AC_DEFINE(PJ_HAS_STDARG_H,1)]) |
| 210 | AC_CHECK_HEADER(stddef.h,[AC_DEFINE(PJ_HAS_STDDEF_H,1)]) |
| 211 | AC_CHECK_HEADER(stdio.h,[AC_DEFINE(PJ_HAS_STDIO_H,1)]) |
Benny Prijono | fdafd40 | 2008-01-23 14:34:46 +0000 | [diff] [blame] | 212 | AC_CHECK_HEADER(stdint.h,[AC_DEFINE(PJ_HAS_STDINT_H,1)]) |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 213 | AC_CHECK_HEADER(stdlib.h,[AC_DEFINE(PJ_HAS_STDLIB_H,1)]) |
| 214 | AC_CHECK_HEADER(string.h,[AC_DEFINE(PJ_HAS_STRING_H,1)]) |
| 215 | AC_CHECK_HEADER(sys/ioctl.h,[AC_DEFINE(PJ_HAS_SYS_IOCTL_H,1)]) |
| 216 | AC_CHECK_HEADER(sys/select.h,[AC_DEFINE(PJ_HAS_SYS_SELECT_H,1)]) |
| 217 | AC_CHECK_HEADER(sys/socket.h,[AC_DEFINE(PJ_HAS_SYS_SOCKET_H,1)]) |
| 218 | AC_CHECK_HEADER(sys/time.h,[AC_DEFINE(PJ_HAS_SYS_TIME_H,1)]) |
| 219 | AC_CHECK_HEADER(sys/timeb.h,[AC_DEFINE(PJ_HAS_SYS_TIMEB_H,1)]) |
| 220 | 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] | 221 | AC_CHECK_HEADER(sys/filio.h,[AC_DEFINE(PJ_HAS_SYS_FILIO_H,1)]) |
| 222 | AC_CHECK_HEADER(sys/sockio.h,[AC_DEFINE(PJ_HAS_SYS_SOCKIO_H,1)]) |
Benny Prijono | e3e6580 | 2011-02-28 07:44:19 +0000 | [diff] [blame] | 223 | AC_CHECK_HEADER(sys/utsname.h,[AC_DEFINE(PJ_HAS_SYS_UTSNAME_H,1)]) |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 224 | AC_CHECK_HEADER(time.h,[AC_DEFINE(PJ_HAS_TIME_H,1)]) |
| 225 | AC_CHECK_HEADER(unistd.h,[AC_DEFINE(PJ_HAS_UNISTD_H,1)]) |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 226 | AC_CHECK_HEADER(winsock.h,[AC_DEFINE(PJ_HAS_WINSOCK_H,1)]) |
| 227 | AC_CHECK_HEADER(winsock2.h,[AC_DEFINE(PJ_HAS_WINSOCK2_H,1)]) |
Benny Prijono | a9948e6 | 2008-03-25 14:03:01 +0000 | [diff] [blame] | 228 | AC_CHECK_HEADER(mswsock.h,[AC_DEFINE(PJ_HAS_MSWSOCK_H,1)],[], |
| 229 | [#if PJ_HAS_WINSOCK2_H |
| 230 | # include <winsock2.h> |
| 231 | #elif PJ_HAS_WINSOCK_H |
| 232 | # include <winsock.h> |
| 233 | #endif |
| 234 | ]) |
Benny Prijono | e274613 | 2008-09-27 13:16:35 +0000 | [diff] [blame] | 235 | AC_CHECK_HEADER(ws2tcpip.h,[AC_DEFINE(PJ_HAS_WS2TCPIP_H,1)]) |
Benny Prijono | 4e48b51 | 2007-05-16 13:41:00 +0000 | [diff] [blame] | 236 | AC_CHECK_HEADER(uuid/uuid.h,[ac_has_uuid_h=1]) |
Benny Prijono | a9948e6 | 2008-03-25 14:03:01 +0000 | [diff] [blame] | 237 | 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] | 238 | [#if PJ_HAS_SYS_TYPES_H |
| 239 | # include <sys/types.h> |
| 240 | #endif |
| 241 | #if PJ_HAS_SYS_SOCKET_H |
| 242 | |
Benny Prijono | 188ba7e | 2008-03-25 13:53:16 +0000 | [diff] [blame] | 243 | # include <sys/socket.h> |
| 244 | #endif |
| 245 | ]) |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 246 | AC_MSG_RESULT([Setting PJ_OS_NAME to $target]) |
| 247 | AC_DEFINE_UNQUOTED(PJ_OS_NAME,["$target"]) |
| 248 | |
| 249 | AC_MSG_RESULT([Setting PJ_HAS_ERRNO_VAR to 1]) |
| 250 | AC_DEFINE(PJ_HAS_ERRNO_VAR,1) |
| 251 | |
| 252 | AC_MSG_RESULT([Setting PJ_HAS_HIGH_RES_TIMER to 1]) |
| 253 | AC_DEFINE(PJ_HAS_HIGH_RES_TIMER,1) |
| 254 | |
| 255 | AC_MSG_RESULT([Setting PJ_HAS_MALLOC to 1]) |
| 256 | AC_DEFINE(PJ_HAS_MALLOC,1) |
| 257 | |
| 258 | AC_MSG_RESULT([Setting PJ_NATIVE_STRING_IS_UNICODE to 0]) |
| 259 | AC_DEFINE(PJ_NATIVE_STRING_IS_UNICODE,0) |
| 260 | |
| 261 | AC_MSG_RESULT([Setting PJ_ATOMIC_VALUE_TYPE to long]) |
| 262 | AC_DEFINE(PJ_ATOMIC_VALUE_TYPE,long) |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 263 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 264 | dnl # Determine if inet_aton() is available |
Benny Prijono | c16c6e3 | 2007-11-18 14:53:47 +0000 | [diff] [blame] | 265 | AC_MSG_CHECKING([if inet_aton() is available]) |
| 266 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
| 267 | #include <sys/socket.h> |
| 268 | #include <arpa/inet.h>]], |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 269 | [inet_aton(0, 0);])], |
| 270 | [AC_DEFINE(PJ_SOCK_HAS_INET_ATON,1) |
| 271 | AC_MSG_RESULT(yes)], |
| 272 | [AC_MSG_RESULT(no)]) |
| 273 | |
Benny Prijono | c16c6e3 | 2007-11-18 14:53:47 +0000 | [diff] [blame] | 274 | dnl # Determine if inet_pton() is available |
| 275 | AC_MSG_CHECKING([if inet_pton() is available]) |
| 276 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
| 277 | #include <sys/socket.h> |
| 278 | #include <arpa/inet.h>]], |
| 279 | [inet_pton(0, 0, 0);])], |
| 280 | [AC_DEFINE(PJ_SOCK_HAS_INET_PTON,1) |
| 281 | AC_MSG_RESULT(yes)], |
| 282 | [AC_MSG_RESULT(no)]) |
| 283 | |
| 284 | dnl # Determine if inet_ntop() is available |
| 285 | AC_MSG_CHECKING([if inet_ntop() is available]) |
| 286 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
| 287 | #include <sys/socket.h> |
| 288 | #include <arpa/inet.h>]], |
| 289 | [inet_ntop(0, 0, 0, 0);])], |
| 290 | [AC_DEFINE(PJ_SOCK_HAS_INET_NTOP,1) |
| 291 | AC_MSG_RESULT(yes)], |
| 292 | [AC_MSG_RESULT(no)]) |
| 293 | |
| 294 | dnl # Determine if getaddrinfo() is available |
| 295 | AC_MSG_CHECKING([if getaddrinfo() is available]) |
| 296 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
| 297 | #include <sys/socket.h> |
| 298 | #include <netdb.h>]], |
| 299 | [getaddrinfo(0, 0, 0, 0);])], |
| 300 | [AC_DEFINE(PJ_SOCK_HAS_GETADDRINFO,1) |
| 301 | AC_MSG_RESULT(yes)], |
| 302 | [AC_MSG_RESULT(no)]) |
| 303 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 304 | dnl # Determine if sockaddr_in has sin_len member |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 305 | AC_MSG_CHECKING([if sockaddr_in has sin_len member]) |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 306 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
| 307 | #include <sys/socket.h> |
| 308 | #include <netinet/in.h> |
| 309 | #include <arpa/inet.h>]], |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 310 | [struct sockaddr_in a; a.sin_len=0;])], |
| 311 | [AC_DEFINE(PJ_SOCKADDR_HAS_LEN,1) |
| 312 | AC_MSG_RESULT(yes)], |
| 313 | AC_MSG_RESULT(no)) |
| 314 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 315 | dnl # Determine if socklen_t is available |
Benny Prijono | 30f85c6 | 2006-09-09 20:05:33 +0000 | [diff] [blame] | 316 | AC_MSG_CHECKING([if socklen_t is available]) |
Benny Prijono | d523370 | 2010-01-13 13:09:45 +0000 | [diff] [blame] | 317 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
| 318 | #include <sys/socket.h>]], |
Benny Prijono | 30f85c6 | 2006-09-09 20:05:33 +0000 | [diff] [blame] | 319 | [socklen_t xxx = 0;])], |
| 320 | [AC_DEFINE(PJ_HAS_SOCKLEN_T,1) |
| 321 | AC_MSG_RESULT(yes)], |
| 322 | AC_MSG_RESULT(no)) |
| 323 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 324 | dnl # Determine if SO_ERROR is available |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 325 | AC_MSG_CHECKING([if SO_ERROR is available]) |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 326 | case $target in |
| 327 | *mingw* | *cygw* | *win32* | *w32* ) |
| 328 | AC_DEFINE(PJ_HAS_SO_ERROR,1) |
| 329 | AC_MSG_RESULT(yes) |
| 330 | ;; |
| 331 | *) |
| 332 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
| 333 | #include <sys/socket.h> |
| 334 | #include <netinet/in.h> |
| 335 | #include <arpa/inet.h>]], |
| 336 | [int i=SO_ERROR;])], |
| 337 | [AC_DEFINE(PJ_HAS_SO_ERROR,1) |
| 338 | AC_MSG_RESULT(yes)], |
| 339 | AC_MSG_RESULT(no)) |
| 340 | ;; |
| 341 | esac |
| 342 | |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 343 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 344 | dnl # Determine if RW-mutex is available |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 345 | AC_MSG_CHECKING([if pthread_rwlock_t is available]) |
| 346 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>], |
| 347 | [pthread_rwlock_t *x;])], |
| 348 | [AC_DEFINE(PJ_EMULATE_RWMUTEX,0) |
Benny Prijono | 1c5f4e4 | 2008-02-07 13:11:39 +0000 | [diff] [blame] | 349 | ac_rwmutex="yes" |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 350 | AC_MSG_RESULT(yes)], |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 351 | [AC_DEFINE(PJ_EMULATE_RWMUTEX,1) |
Benny Prijono | 1c5f4e4 | 2008-02-07 13:11:39 +0000 | [diff] [blame] | 352 | ac_rwmutex="no" |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 353 | AC_MSG_RESULT(no)]) |
| 354 | |
Benny Prijono | 1c5f4e4 | 2008-02-07 13:11:39 +0000 | [diff] [blame] | 355 | dnl # If rwmutex is not detected, check again but this time |
| 356 | dnl # with _POSIX_READER_WRITER_LOCKS defined (newlib needs this) |
| 357 | if test "$ac_rwmutex" = "no"; then |
| 358 | AC_MSG_CHECKING([if pthread_rwlock_t is available with _POSIX_READER_WRITER_LOCKS]) |
| 359 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _POSIX_READER_WRITER_LOCKS |
| 360 | #include <pthread.h>]], |
| 361 | [pthread_rwlock_t *x;])], |
| 362 | [AC_DEFINE(PJ_EMULATE_RWMUTEX,0) |
| 363 | CFLAGS="$CFLAGS -D_POSIX_THREADS -D_POSIX_READER_WRITER_LOCKS" |
| 364 | AC_MSG_RESULT(yes)], |
| 365 | [AC_DEFINE(PJ_EMULATE_RWMUTEX,1) |
| 366 | AC_MSG_RESULT(no)]) |
| 367 | fi |
| 368 | |
| 369 | dnl # Do we have pthread_mutexattr_settype()? |
| 370 | AC_MSG_CHECKING([if pthread_mutexattr_settype() is available]) |
| 371 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>], |
| 372 | [pthread_mutexattr_settype(0,PTHREAD_MUTEX_FAST_NP);])], |
| 373 | [AC_DEFINE(PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE,1) |
| 374 | AC_MSG_RESULT(yes)], |
| 375 | [AC_MSG_RESULT(no)]) |
| 376 | |
| 377 | dnl # Does pthread_mutexattr_t has "recursive" member? |
| 378 | AC_MSG_CHECKING([if pthread_mutexattr_t has recursive member]) |
| 379 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>], |
| 380 | [[pthread_mutexattr_t attr; |
| 381 | attr.recursive=1;]])], |
| 382 | [AC_DEFINE(PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE,1) |
| 383 | AC_MSG_RESULT(yes)], |
| 384 | [AC_MSG_RESULT(no)]) |
| 385 | |
Benny Prijono | 99eec38 | 2008-09-18 21:22:16 +0000 | [diff] [blame] | 386 | dnl ###################### |
| 387 | dnl # ioqueue selection |
| 388 | dnl # |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 389 | AC_SUBST(ac_os_objs) |
Benny Prijono | 99eec38 | 2008-09-18 21:22:16 +0000 | [diff] [blame] | 390 | AC_MSG_CHECKING([ioqueue backend]) |
| 391 | AC_ARG_ENABLE(epoll, |
| 392 | AC_HELP_STRING([--enable-epoll], |
Benny Prijono | 9489e7a | 2008-09-19 22:18:50 +0000 | [diff] [blame] | 393 | [Use /dev/epoll ioqueue on Linux (experimental)]), |
Benny Prijono | 99eec38 | 2008-09-18 21:22:16 +0000 | [diff] [blame] | 394 | [ |
| 395 | ac_os_objs=ioqueue_epoll.o |
| 396 | AC_MSG_RESULT([/dev/epoll]) |
| 397 | ], |
| 398 | [ |
| 399 | ac_os_objs=ioqueue_select.o |
| 400 | AC_MSG_RESULT([select()]) |
| 401 | ]) |
| 402 | |
| 403 | |
| 404 | dnl ###################### |
| 405 | dnl # OS specific files |
| 406 | dnl # |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 407 | case $target in |
| 408 | *mingw* | *cygw* | *win32* | *w32* ) |
Benny Prijono | 99eec38 | 2008-09-18 21:22:16 +0000 | [diff] [blame] | 409 | 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] | 410 | ;; |
| 411 | *) |
Benny Prijono | 99eec38 | 2008-09-18 21:22:16 +0000 | [diff] [blame] | 412 | 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" |
Sauw Ming | 6a970a3 | 2011-03-01 05:25:27 +0000 | [diff] [blame] | 413 | case $target in |
| 414 | arm-apple-darwin*) |
| 415 | ac_os_objs="$ac_os_objs os_info_iphone.o" |
| 416 | ;; |
| 417 | esac |
Benny Prijono | 4e48b51 | 2007-05-16 13:41:00 +0000 | [diff] [blame] | 418 | # UUID |
| 419 | if test "$ac_has_uuid_lib" = "1" -a "$ac_has_uuid_h" = "1"; then |
| 420 | ac_os_objs="$ac_os_objs guid_uuid.o" |
| 421 | else |
| 422 | ac_os_objs="$ac_os_objs guid_simple.o" |
| 423 | fi |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 424 | ;; |
| 425 | esac |
| 426 | |
Sauw Ming | 68c1457 | 2011-07-20 03:00:48 +0000 | [diff] [blame] | 427 | case $target in |
| 428 | *darwin*) |
| 429 | ac_os_objs="$ac_os_objs os_core_darwin.o" |
| 430 | ;; |
| 431 | esac |
Benny Prijono | 4e48b51 | 2007-05-16 13:41:00 +0000 | [diff] [blame] | 432 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 433 | dnl ########################################## |
| 434 | dnl # |
| 435 | dnl # PJMEDIA |
| 436 | dnl # |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 437 | |
Benny Prijono | 8a9b3b2 | 2010-01-14 14:46:54 +0000 | [diff] [blame] | 438 | dnl # Use external Speex installation |
| 439 | AC_SUBST(ac_external_speex,0) |
| 440 | AC_ARG_WITH(external-speex, |
| 441 | AC_HELP_STRING([--with-external-speex], |
| 442 | [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)]), |
| 443 | [ |
| 444 | if test "x$with_external_speex" != "xno"; then |
| 445 | # Test Speex installation |
| 446 | AC_MSG_CHECKING([if external Speex devkit is installed]) |
| 447 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <speex/speex.h> |
| 448 | #include <speex/speex_echo.h> |
| 449 | ]], |
| 450 | [speex_echo_state_init(0, 0); speex_encoder_init(0); ])], |
| 451 | [AC_MSG_RESULT(yes!!) |
| 452 | AC_DEFINE(PJMEDIA_EXTERNAL_SPEEX_CODEC, 1) |
| 453 | ac_external_speex="1" |
| 454 | ], |
| 455 | [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])]) |
| 456 | fi |
| 457 | ] |
| 458 | ) |
| 459 | |
| 460 | dnl # Use external GSM codec library installation |
| 461 | AC_SUBST(ac_external_gsm,0) |
| 462 | AC_ARG_WITH(external-gsm, |
| 463 | AC_HELP_STRING([--with-external-gsm], |
| 464 | [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)]), |
| 465 | [ |
| 466 | if test "x$with_external_gsm" != "xno"; then |
Benny Prijono | d430643 | 2010-05-01 22:05:41 +0000 | [diff] [blame] | 467 | # Test GSM library installation |
| 468 | AC_MSG_CHECKING([if external GSM devkit is installed as gsm/gsm.h]) |
| 469 | AC_COMPILE_IFELSE( |
| 470 | [AC_LANG_PROGRAM([[#include <gsm/gsm.h> ]], [gsm_create(); ]) ], |
| 471 | [AC_MSG_RESULT(yes!!) |
| 472 | AC_DEFINE(PJMEDIA_EXTERNAL_GSM_CODEC, 1) |
| 473 | AC_DEFINE(PJMEDIA_EXTERNAL_GSM_GSM_H, 1) |
| 474 | ac_external_gsm="1" |
| 475 | ], |
| 476 | [ |
| 477 | AC_MSG_RESULT(no) |
| 478 | AC_MSG_CHECKING([if external GSM devkit is installed as gsm.h]) |
| 479 | AC_COMPILE_IFELSE( |
| 480 | [AC_LANG_PROGRAM([[#include <gsm.h> ]], [gsm_create(); ]) ], |
| 481 | [AC_MSG_RESULT(yes!!) |
| 482 | AC_DEFINE(PJMEDIA_EXTERNAL_GSM_CODEC, 1) |
| 483 | AC_DEFINE(PJMEDIA_EXTERNAL_GSM_H, 1) |
| 484 | ac_external_gsm="1" |
| 485 | ], |
| 486 | [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]) |
| 487 | ] |
| 488 | ) |
| 489 | ] |
| 490 | ) |
Benny Prijono | 8a9b3b2 | 2010-01-14 14:46:54 +0000 | [diff] [blame] | 491 | fi |
| 492 | ] |
| 493 | ) |
| 494 | |
| 495 | |
| 496 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 497 | dnl # Sound device backend selection |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 498 | AC_SUBST(ac_pjmedia_snd) |
Benny Prijono | 1d97162 | 2006-09-10 22:27:40 +0000 | [diff] [blame] | 499 | AC_ARG_ENABLE(sound, |
| 500 | AC_HELP_STRING([--disable-sound], |
| 501 | [Exclude sound (i.e. use null sound)]), |
| 502 | [if test "$enable_sound" = "no"; then |
| 503 | [ac_pjmedia_snd=null] |
| 504 | AC_MSG_RESULT([Checking if sound is disabled... yes]) |
| 505 | fi] |
| 506 | ) |
| 507 | |
Benny Prijono | 8a9b3b2 | 2010-01-14 14:46:54 +0000 | [diff] [blame] | 508 | dnl # Use external PortAudio installation |
| 509 | AC_SUBST(ac_external_pa,0) |
| 510 | AC_ARG_WITH(external-pa, |
| 511 | AC_HELP_STRING([--with-external-pa], |
| 512 | [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] | 513 | [ |
Benny Prijono | 8a9b3b2 | 2010-01-14 14:46:54 +0000 | [diff] [blame] | 514 | if test "x$with_external_pa" != "xno"; then |
| 515 | # Test PortAudio installation |
| 516 | AC_MSG_CHECKING([if external PortAudio devkit is installed]) |
| 517 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <portaudio.h> |
| 518 | ]], |
| 519 | [Pa_Initialize();])], |
| 520 | [AC_MSG_RESULT(yes!!) |
| 521 | ac_external_pa="1" |
| 522 | ], |
| 523 | [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] | 524 | fi |
| 525 | ] |
| 526 | ) |
| 527 | |
Benny Prijono | 39ae2da | 2006-10-13 17:57:42 +0000 | [diff] [blame] | 528 | AC_SUBST(ac_pa_cflags) |
Benny Prijono | 27c9872 | 2007-04-09 21:28:15 +0000 | [diff] [blame] | 529 | AC_CHECK_HEADER(sys/soundcard.h, |
| 530 | [ac_pa_cflags="$ac_pa_cflags -DHAVE_SYS_SOUNDCARD_H"]) |
| 531 | AC_CHECK_HEADER(linux/soundcard.h, |
| 532 | [ac_pa_cflags="$ac_pa_cflags -DHAVE_LINUX_SOUNDCARD_H"]) |
| 533 | AC_CHECK_HEADER(machine/soundcard.h, |
| 534 | [ac_pa_cflags="$ac_pa_cflags -DHAVE_MACHINE_SOUNDCARD_H"]) |
| 535 | |
Benny Prijono | 3e09167 | 2008-01-09 15:43:02 +0000 | [diff] [blame] | 536 | if test "x$ac_cv_c_bigendian" = "xyes"; then |
| 537 | ac_pa_cflags="$ac_pa_cflags -DPA_BIG_ENDIAN" |
| 538 | else |
| 539 | ac_pa_cflags="$ac_pa_cflags -DPA_LITTLE_ENDIAN" |
| 540 | fi |
| 541 | |
Benny Prijono | 1d97162 | 2006-09-10 22:27:40 +0000 | [diff] [blame] | 542 | if test "$enable_sound" = "no"; then |
| 543 | true; |
| 544 | else |
| 545 | case $target in |
Benny Prijono | 8ec5eae | 2010-05-12 10:59:20 +0000 | [diff] [blame] | 546 | arm-apple-darwin*) |
Sauw Ming | 6a970a3 | 2011-03-01 05:25:27 +0000 | [diff] [blame] | 547 | LIBS="$LIBS -framework CoreAudio -framework CoreFoundation -framework AudioToolbox -framework CFNetwork -framework UIKit" |
Benny Prijono | 8ec5eae | 2010-05-12 10:59:20 +0000 | [diff] [blame] | 548 | AC_MSG_RESULT([Checking sound device backend... AudioUnit]) |
| 549 | ;; |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 550 | *darwin*) |
Benny Prijono | 39ae2da | 2006-10-13 17:57:42 +0000 | [diff] [blame] | 551 | LIBS="$LIBS -framework CoreAudio -framework CoreServices -framework AudioUnit -framework AudioToolbox" |
| 552 | if test "`uname -r`" = "6.8"; then |
Benny Prijono | 27c9872 | 2007-04-09 21:28:15 +0000 | [diff] [blame] | 553 | #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] | 554 | #AC_MSG_RESULT([Setting additional PortAudio CFLAGS.. -DPA_OLD_CORE_AUDIO -DMOSX_USE_NON_ATOMIC_FLAG_BITS]) |
| 555 | ac_pjmedia_snd=pa_old_darwinos |
| 556 | AC_MSG_RESULT([Checking sound device backend... old coreaudio]) |
| 557 | else |
| 558 | ac_pjmedia_snd=pa_darwinos |
| 559 | AC_MSG_RESULT([Checking sound device backend... coreaudio]) |
| 560 | fi |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 561 | ;; |
| 562 | *cygwin* | *mingw*) |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 563 | ac_pjmedia_snd=pa_win32 |
| 564 | AC_MSG_RESULT([Checking sound device backend... win32 sound]) |
| 565 | ;; |
| 566 | *rtems*) |
| 567 | ac_pjmedia_snd=null |
| 568 | AC_MSG_RESULT([Checking sound device backend... null sound]) |
| 569 | ;; |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 570 | *) |
Benny Prijono | 0b46232 | 2008-03-12 22:44:24 +0000 | [diff] [blame] | 571 | dnl # Check if ALSA is available |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 572 | ac_pjmedia_snd=pa_unix |
| 573 | AC_CHECK_HEADER(alsa/version.h, |
| 574 | [AC_SUBST(ac_pa_use_alsa,1) |
| 575 | LIBS="$LIBS -lasound" |
| 576 | ], |
| 577 | [AC_SUBST(ac_pa_use_alsa,0)]) |
| 578 | AC_MSG_RESULT([Checking sound device backend... unix]) |
Benny Prijono | 0b46232 | 2008-03-12 22:44:24 +0000 | [diff] [blame] | 579 | |
| 580 | dnl # Check if OSS is disabled |
| 581 | AC_SUBST(ac_pa_use_oss,1) |
| 582 | AC_ARG_ENABLE(oss, |
| 583 | AC_HELP_STRING([--disable-oss], |
Benny Prijono | c45d951 | 2010-12-10 11:04:30 +0000 | [diff] [blame] | 584 | [Disable OSS audio (default: not disabled)]), |
Benny Prijono | 0b46232 | 2008-03-12 22:44:24 +0000 | [diff] [blame] | 585 | [ |
| 586 | if test "$enable_oss" = "no"; then |
| 587 | [ac_pa_use_oss=0] |
| 588 | AC_MSG_RESULT([Checking if OSS audio is disabled... yes]) |
| 589 | fi |
| 590 | ]) |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 591 | ;; |
Benny Prijono | 1d97162 | 2006-09-10 22:27:40 +0000 | [diff] [blame] | 592 | esac |
| 593 | fi |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 594 | |
Sauw Ming | 6e6c215 | 2010-12-14 13:03:10 +0000 | [diff] [blame] | 595 | AC_SUBST(ac_pjmedia_video) |
| 596 | if test "$enable_video" = "no"; then |
| 597 | true; |
| 598 | else |
| 599 | case $target in |
| 600 | arm-apple-darwin*) |
| 601 | ac_pjmedia_video=iphone_os |
Sauw Ming | 24c39a3 | 2011-08-16 05:44:46 +0000 | [diff] [blame^] | 602 | AC_SUBST(ac_pjmedia_video_has_ios) |
Sauw Ming | 6e6c215 | 2010-12-14 13:03:10 +0000 | [diff] [blame] | 603 | AC_SUBST(ac_ios_cflags) |
Sauw Ming | 24c39a3 | 2011-08-16 05:44:46 +0000 | [diff] [blame^] | 604 | SAVED_LIBS="$LIBS" |
| 605 | LIBS="-framework AVFoundation -framework UIKit -framework CoreGraphics -framework QuartzCore -framework CoreVideo -framework CoreMedia" |
| 606 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[ac_pjmedia_video_has_ios=yes],[ac_pjmedia_video_has_ios=no]) |
| 607 | LIBS="$SAVED_LIBS" |
| 608 | if test "$ac_pjmedia_video_has_ios" = "yes"; then |
| 609 | ac_ios_cflags="-DPJMEDIA_VIDEO_DEV_HAS_IOS=1" |
| 610 | LIBS="$LIBS -framework AVFoundation -framework UIKit -framework CoreGraphics -framework QuartzCore -framework CoreVideo -framework CoreMedia" |
| 611 | AC_MSG_RESULT([Checking if AVFoundation framework is available... yes]) |
| 612 | else |
| 613 | AC_MSG_RESULT([Checking if AVFoundation framework is available... no]) |
| 614 | fi |
Sauw Ming | 6e6c215 | 2010-12-14 13:03:10 +0000 | [diff] [blame] | 615 | ;; |
| 616 | *darwin*) |
| 617 | ac_pjmedia_video=mac_os |
| 618 | AC_SUBST(ac_pjmedia_video_has_qt) |
| 619 | AC_SUBST(ac_qt_cflags) |
| 620 | SAVED_LIBS="$LIBS" |
| 621 | LIBS="-framework QTKit" |
| 622 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[ac_pjmedia_video_has_qt=yes],[ac_pjmedia_video_has_qt=no]) |
| 623 | LIBS="$SAVED_LIBS" |
| 624 | if test "$ac_pjmedia_video_has_qt" = "yes"; then |
| 625 | ac_qt_cflags="-DPJMEDIA_VIDEO_DEV_HAS_QT=1" |
Sauw Ming | 21bd3fd | 2011-04-06 11:30:18 +0000 | [diff] [blame] | 626 | LIBS="$LIBS -framework QTKit -framework Foundation -framework AppKit -framework QuartzCore -framework OpenGL" |
Sauw Ming | 6e6c215 | 2010-12-14 13:03:10 +0000 | [diff] [blame] | 627 | AC_MSG_RESULT([Checking if QTKit framework is available... yes]) |
| 628 | else |
| 629 | AC_MSG_RESULT([Checking if QTKit framework is available... no]) |
| 630 | fi |
| 631 | ;; |
| 632 | esac |
| 633 | fi |
| 634 | |
Benny Prijono | ebb2c33 | 2008-07-28 23:40:58 +0000 | [diff] [blame] | 635 | AC_ARG_ENABLE(ext_sound, |
| 636 | AC_HELP_STRING([--enable-ext-sound], |
| 637 | [PJMEDIA will not provide any sound device backend]), |
| 638 | [if test "$enable_ext_sound" = "yes"; then |
| 639 | [ac_pjmedia_snd=external] |
| 640 | AC_MSG_RESULT([Checking if external sound is set... yes]) |
| 641 | fi] |
| 642 | ) |
| 643 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 644 | dnl # Include resampling small filter |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 645 | AC_SUBST(ac_no_small_filter) |
| 646 | AC_ARG_ENABLE(small-filter, |
| 647 | AC_HELP_STRING([--disable-small-filter], |
| 648 | [Exclude small filter in resampling]), |
| 649 | [if test "$enable_small_filter" = "no"; then |
| 650 | [ac_no_small_filter='-DPJMEDIA_HAS_SMALL_FILTER=0'] |
| 651 | AC_MSG_RESULT([Checking if small filter is disabled... yes]) |
| 652 | fi], |
| 653 | AC_MSG_RESULT([Checking if small filter is disabled... no])) |
| 654 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 655 | dnl # Include resampling large filter |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 656 | AC_SUBST(ac_no_large_filter) |
| 657 | AC_ARG_ENABLE(large-filter, |
| 658 | AC_HELP_STRING([--disable-large-filter], |
| 659 | [Exclude large filter in resampling]), |
| 660 | [if test "$enable_large_filter" = "no"; then |
| 661 | [ac_no_large_filter='-DPJMEDIA_HAS_LARGE_FILTER=0'] |
| 662 | AC_MSG_RESULT([Checking if large filter is disabled... yes]) |
| 663 | fi], |
| 664 | AC_MSG_RESULT([Checking if large filter is disabled... no])) |
| 665 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 666 | dnl # Include Speex AEC |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 667 | AC_SUBST(ac_no_speex_aec) |
| 668 | AC_ARG_ENABLE(speex-aec, |
| 669 | AC_HELP_STRING([--disable-speex-aec], |
| 670 | [Exclude Speex Acoustic Echo Canceller/AEC]), |
| 671 | [if test "$enable_speex_aec" = "no"; then |
| 672 | [ac_no_speex_aec='-DPJMEDIA_HAS_SPEEX_AEC=0'] |
| 673 | AC_MSG_RESULT([Checking if Speex AEC is disabled...yes]) |
| 674 | fi], |
| 675 | AC_MSG_RESULT([Checking if Speex AEC is disabled...no])) |
| 676 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 677 | dnl # Include G711 codec |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 678 | AC_SUBST(ac_no_g711_codec) |
| 679 | AC_ARG_ENABLE(g711-codec, |
| 680 | AC_HELP_STRING([--disable-g711-codec], |
| 681 | [Exclude G.711 codecs from the build]), |
| 682 | [if test "$enable_g711_codec" = "no"; then |
| 683 | [ac_no_g711_codec=1] |
Benny Prijono | fe9bffd | 2007-01-27 17:44:13 +0000 | [diff] [blame] | 684 | AC_DEFINE(PJMEDIA_HAS_G711_CODEC,0) |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 685 | AC_MSG_RESULT([Checking if G.711 codec is disabled...yes]) |
| 686 | fi], |
| 687 | AC_MSG_RESULT([Checking if G.711 codec is disabled...no])) |
| 688 | |
| 689 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 690 | dnl # Include L16 codec |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 691 | AC_SUBST(ac_no_l16_codec) |
| 692 | AC_ARG_ENABLE(l16-codec, |
| 693 | AC_HELP_STRING([--disable-l16-codec], |
| 694 | [Exclude Linear/L16 codec family from the build]), |
| 695 | [if test "$enable_l16_codec" = "no"; then |
| 696 | [ac_no_l16_codec=1] |
Benny Prijono | fe9bffd | 2007-01-27 17:44:13 +0000 | [diff] [blame] | 697 | AC_DEFINE(PJMEDIA_HAS_L16_CODEC,0) |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 698 | AC_MSG_RESULT([Checking if L16 codecs are disabled...yes]) |
| 699 | fi], |
Benny Prijono | c1fe23d | 2006-09-13 09:38:06 +0000 | [diff] [blame] | 700 | AC_MSG_RESULT([Checking if L16 codec is disabled...no])) |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 701 | |
| 702 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 703 | dnl # Include GSM codec |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 704 | AC_SUBST(ac_no_gsm_codec) |
| 705 | AC_ARG_ENABLE(gsm-codec, |
| 706 | AC_HELP_STRING([--disable-gsm-codec], |
| 707 | [Exclude GSM codec in the build]), |
| 708 | [if test "$enable_gsm_codec" = "no"; then |
| 709 | [ac_no_gsm_codec=1] |
Benny Prijono | fe9bffd | 2007-01-27 17:44:13 +0000 | [diff] [blame] | 710 | AC_DEFINE(PJMEDIA_HAS_GSM_CODEC,0) |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 711 | AC_MSG_RESULT([Checking if GSM codec is disabled...yes]) |
| 712 | fi], |
| 713 | AC_MSG_RESULT([Checking if GSM codec is disabled...no])) |
| 714 | |
Benny Prijono | 71f657d | 2008-03-17 14:24:21 +0000 | [diff] [blame] | 715 | dnl # Include G.722 codec |
| 716 | AC_SUBST(ac_no_g722_codec) |
| 717 | AC_ARG_ENABLE(g722-codec, |
| 718 | AC_HELP_STRING([--disable-g722-codec], |
| 719 | [Exclude G.722 codec in the build]), |
| 720 | [if test "$enable_g722_codec" = "no"; then |
| 721 | [ac_no_g722_codec=1] |
| 722 | AC_DEFINE(PJMEDIA_HAS_G722_CODEC,0) |
| 723 | AC_MSG_RESULT([Checking if G.722 codec is disabled...yes]) |
| 724 | fi], |
| 725 | AC_MSG_RESULT([Checking if G.722 codec is disabled...no])) |
| 726 | |
Nanang Izzuddin | 56e380a | 2009-04-15 14:45:41 +0000 | [diff] [blame] | 727 | dnl # Include G722.1 codec |
| 728 | AC_SUBST(ac_no_g7221_codec) |
| 729 | AC_ARG_ENABLE(g7221-codec, |
| 730 | AC_HELP_STRING([--disable-g7221-codec], |
| 731 | [Exclude G.7221 codec in the build]), |
| 732 | [if test "$enable_g7221_codec" = "no"; then |
| 733 | [ac_no_g7221_codec=1] |
| 734 | AC_DEFINE(PJMEDIA_HAS_G7221_CODEC,0) |
| 735 | AC_MSG_RESULT([Checking if G.722.1 codec is disabled...yes]) |
| 736 | fi], |
| 737 | AC_MSG_RESULT([Checking if G.722.1 codec is disabled...no])) |
| 738 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 739 | dnl # Include Speex codec |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 740 | AC_SUBST(ac_no_speex_codec) |
| 741 | AC_ARG_ENABLE(speex-codec, |
| 742 | AC_HELP_STRING([--disable-speex-codec], |
| 743 | [Exclude Speex codecs in the build]), |
| 744 | [if test "$enable_speex_codec" = "no"; then |
| 745 | [ac_no_speex_codec=1] |
Benny Prijono | fe9bffd | 2007-01-27 17:44:13 +0000 | [diff] [blame] | 746 | AC_DEFINE(PJMEDIA_HAS_SPEEX_CODEC,0) |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 747 | AC_MSG_RESULT([Checking if Speex codec is disabled...yes]) |
| 748 | fi], |
| 749 | AC_MSG_RESULT([Checking if Speex codec is disabled...no])) |
| 750 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 751 | dnl # Include iLBC codec |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 752 | AC_SUBST(ac_no_ilbc_codec) |
| 753 | AC_ARG_ENABLE(ilbc-codec, |
| 754 | AC_HELP_STRING([--disable-ilbc-codec], |
| 755 | [Exclude iLBC codec in the build]), |
| 756 | [if test "$enable_ilbc_codec" = "no"; then |
| 757 | [ac_no_ilbc_codec=1] |
Benny Prijono | fe9bffd | 2007-01-27 17:44:13 +0000 | [diff] [blame] | 758 | AC_DEFINE(PJMEDIA_HAS_ILBC_CODEC,0) |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 759 | AC_MSG_RESULT([Checking if iLBC codec is disabled...yes]) |
| 760 | fi], |
| 761 | AC_MSG_RESULT([Checking if iLBC codec is disabled...no])) |
| 762 | |
Benny Prijono | 550a1a6 | 2007-10-16 08:54:00 +0000 | [diff] [blame] | 763 | dnl # Include libsamplerate |
| 764 | AC_ARG_ENABLE(libsamplerate, |
| 765 | AC_HELP_STRING([--enable-libsamplerate], |
| 766 | [Link with libsamplerate when available. Note that PJMEDIA_RESAMPLE_IMP must also be configured]), |
| 767 | [ AC_CHECK_LIB(samplerate,src_new) ], |
| 768 | AC_MSG_RESULT([Skipping libsamplerate detection]) |
| 769 | ) |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 770 | |
Benny Prijono | 5b0af63 | 2011-07-20 03:16:25 +0000 | [diff] [blame] | 771 | dnl # SDL alt prefix |
| 772 | AC_ARG_WITH(sdl, |
| 773 | AC_HELP_STRING([--with-sdl=DIR], |
| 774 | [Specify alternate libSDL prefix]), |
| 775 | [], |
| 776 | [with_sdl=no] |
| 777 | ) |
| 778 | |
Benny Prijono | c45d951 | 2010-12-10 11:04:30 +0000 | [diff] [blame] | 779 | dnl # SDL |
| 780 | AC_ARG_ENABLE(sdl, |
| 781 | AC_HELP_STRING([--disable-sdl], |
| 782 | [Disable SDL (default: not disabled)]), |
| 783 | [ |
| 784 | if test "$enable_sdl" = "no"; then |
| 785 | AC_MSG_RESULT([Checking if SDL is disabled... yes]) |
| 786 | fi |
| 787 | ], |
| 788 | [ |
Benny Prijono | 5b0af63 | 2011-07-20 03:16:25 +0000 | [diff] [blame] | 789 | SDL_CONFIG="sdl-config" |
| 790 | if test "x$with_sdl" != "xno" -a "x$with_sdl" != "x"; then |
| 791 | SDL_CONFIG=$with_sdl/bin/sdl-config |
| 792 | AC_MSG_RESULT([Using SDL prefix... $with_sdl]) |
| 793 | fi |
| 794 | |
Benny Prijono | c45d951 | 2010-12-10 11:04:30 +0000 | [diff] [blame] | 795 | AC_MSG_CHECKING([SDL availability..]) |
Benny Prijono | 5b0af63 | 2011-07-20 03:16:25 +0000 | [diff] [blame] | 796 | if $SDL_CONFIG --version; then |
| 797 | AC_SUBST(ac_sdl_cflags) |
Benny Prijono | c45d951 | 2010-12-10 11:04:30 +0000 | [diff] [blame] | 798 | AC_SUBST(ac_sdl_ldflags) |
Benny Prijono | 5b0af63 | 2011-07-20 03:16:25 +0000 | [diff] [blame] | 799 | ac_sdl_cflags=`$SDL_CONFIG --cflags` |
Benny Prijono | c45d951 | 2010-12-10 11:04:30 +0000 | [diff] [blame] | 800 | ac_sdl_cflags="-DPJMEDIA_VIDEO_DEV_HAS_SDL=1 $ac_sdl_cflags" |
Benny Prijono | 5b0af63 | 2011-07-20 03:16:25 +0000 | [diff] [blame] | 801 | ac_sdl_ldflags=`$SDL_CONFIG --libs` |
Benny Prijono | 69b1f82 | 2010-12-10 11:33:01 +0000 | [diff] [blame] | 802 | LIBS="$LIBS $ac_sdl_ldflags" |
Benny Prijono | c45d951 | 2010-12-10 11:04:30 +0000 | [diff] [blame] | 803 | fi |
| 804 | ]) |
| 805 | |
| 806 | |
| 807 | dnl # FFMPEG stuffs |
| 808 | AC_ARG_ENABLE(ffmpeg, |
| 809 | AC_HELP_STRING([--disable-ffmpeg], |
| 810 | [Disable ffmpeg (default: not disabled)]), |
| 811 | [ |
| 812 | AC_SUBST(ac_has_ffmpeg,0) |
| 813 | if test "$enable_ffmpeg" = "no"; then |
| 814 | AC_MSG_RESULT([Checking if ffmpeg is disabled... yes]) |
| 815 | fi |
| 816 | ], |
| 817 | [ |
| 818 | AC_SUBST(ac_ffmpeg_cflags) |
| 819 | AC_SUBST(ac_ffmpeg_ldflags) |
| 820 | |
Benny Prijono | c8ef0ac | 2011-04-13 19:13:56 +0000 | [diff] [blame] | 821 | FFMPEG_PREFIX="" |
| 822 | if test "x$with_ffmpeg" != "xno" -a "x$with_ffmpeg" != "x"; then |
| 823 | FFMPEG_PREFIX=$with_ffmpeg |
| 824 | AC_MSG_RESULT([Using ffmpeg prefix... $FFMPEG_PREFIX]) |
| 825 | LIBS="-L$FFMPEG_PREFIX/lib $LIBS" |
| 826 | LDFLAGS="-L$FFMPEG_PREFIX/lib $LDFLAGS" |
| 827 | CFLAGS="-I$FFMPEG_PREFIX/include $CFLAGS" |
| 828 | fi |
| 829 | |
Benny Prijono | c45d951 | 2010-12-10 11:04:30 +0000 | [diff] [blame] | 830 | AC_CHECK_LIB(avdevice, |
| 831 | avdevice_version, |
| 832 | [ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVDEVICE=1" |
| 833 | ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lavdevice" |
| 834 | ] |
| 835 | ) |
| 836 | AC_CHECK_LIB(avformat, |
| 837 | av_register_all, |
| 838 | [ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVFORMAT=1" |
| 839 | ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lavformat" |
Sauw Ming | d8aa67c | 2011-08-09 04:31:41 +0000 | [diff] [blame] | 840 | ], |
| 841 | [], |
| 842 | [-lavcodec -lavutil] |
Benny Prijono | c45d951 | 2010-12-10 11:04:30 +0000 | [diff] [blame] | 843 | ) |
| 844 | AC_CHECK_LIB(avcodec, |
| 845 | avcodec_init, |
| 846 | [ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVCODEC=1" |
| 847 | ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lavcodec" |
Sauw Ming | d8aa67c | 2011-08-09 04:31:41 +0000 | [diff] [blame] | 848 | ], |
| 849 | [], |
| 850 | [-lavutil] |
Benny Prijono | c45d951 | 2010-12-10 11:04:30 +0000 | [diff] [blame] | 851 | ) |
| 852 | AC_CHECK_LIB(swscale, |
| 853 | sws_scale, |
| 854 | [ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBSWSCALE=1" |
| 855 | ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lswscale" |
Sauw Ming | d8aa67c | 2011-08-09 04:31:41 +0000 | [diff] [blame] | 856 | ], |
| 857 | [], |
| 858 | [-lavutil] |
Benny Prijono | c45d951 | 2010-12-10 11:04:30 +0000 | [diff] [blame] | 859 | ) |
| 860 | AC_CHECK_LIB(avutil, |
| 861 | av_malloc, |
| 862 | [ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVUTIL=1" |
| 863 | ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lavutil" |
| 864 | ] |
| 865 | ) |
| 866 | AC_CHECK_LIB(avcore, |
| 867 | avcore_version, |
| 868 | [ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVCORE=1" |
| 869 | ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lavcore" |
| 870 | ] |
| 871 | ) |
Benny Prijono | 69b1f82 | 2010-12-10 11:33:01 +0000 | [diff] [blame] | 872 | LIBS="$LIBS $ac_ffmpeg_ldflags" |
Benny Prijono | c45d951 | 2010-12-10 11:04:30 +0000 | [diff] [blame] | 873 | ] |
| 874 | ) |
| 875 | |
Benny Prijono | c8ef0ac | 2011-04-13 19:13:56 +0000 | [diff] [blame] | 876 | AC_ARG_WITH(ffmpeg, |
| 877 | AC_HELP_STRING([--with-ffmpeg=DIR], |
| 878 | [Specify alternate FFMPEG prefix]), |
| 879 | [], |
| 880 | [with_ffmpeg=no] |
| 881 | ) |
| 882 | |
| 883 | |
Benny Prijono | c45d951 | 2010-12-10 11:04:30 +0000 | [diff] [blame] | 884 | dnl # Video for Linux 2 |
| 885 | AC_ARG_ENABLE(v4l2, |
| 886 | AC_HELP_STRING([--disable-v4l2], |
| 887 | [Disable Video4Linux2 (default: not disabled)]), |
| 888 | [ |
| 889 | if test "$enable_v4l2" = "no"; then |
| 890 | AC_MSG_RESULT([Checking if V4L2 is disabled... yes]) |
| 891 | fi |
| 892 | ], |
| 893 | [ |
| 894 | AC_SUBST(ac_v4l2_cflags) |
| 895 | AC_SUBST(ac_v4l2_ldflags) |
| 896 | AC_CHECK_LIB(v4l2, |
| 897 | v4l2_open, |
| 898 | [ac_v4l2_cflags="-DPJMEDIA_VIDEO_DEV_HAS_V4L2=1" |
| 899 | ac_v4l2_ldflags="-lv4l2" |
Benny Prijono | 69b1f82 | 2010-12-10 11:33:01 +0000 | [diff] [blame] | 900 | LIBS="$LIBS -lv4l2" |
Benny Prijono | c45d951 | 2010-12-10 11:04:30 +0000 | [diff] [blame] | 901 | ] |
| 902 | ) |
| 903 | ]) |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 904 | |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 905 | dnl ######################################################## |
| 906 | dnl # Intel IPP support |
| 907 | dnl # |
| 908 | AC_ARG_ENABLE(ipp, |
| 909 | AC_HELP_STRING([--enable-ipp], |
| 910 | [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]), |
| 911 | [], |
| 912 | [enable_ipp=no] |
| 913 | ) |
| 914 | |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 915 | AC_ARG_WITH(ipp, |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 916 | AC_HELP_STRING([--with-ipp=DIR], |
| 917 | [Specify the Intel IPP location]), |
| 918 | [], |
| 919 | [with_ipp=no] |
| 920 | ) |
| 921 | |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 922 | AC_ARG_WITH(ipp-samples, |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 923 | AC_HELP_STRING([--with-ipp-samples=DIR], |
| 924 | [Specify the Intel IPP samples location]), |
| 925 | [], |
| 926 | [with_ipp_samples=no] |
| 927 | ) |
| 928 | |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 929 | AC_ARG_WITH(ipp-arch, |
| 930 | AC_HELP_STRING([--with-ipp-arch=ARCH], |
| 931 | [Specify the Intel IPP ARCH suffix, e.g. "64" or "em64t. Default is blank for IA32"]), |
| 932 | [], |
| 933 | [with_ipp_arch=no] |
| 934 | ) |
| 935 | |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 936 | if test "x$enable_ipp" != "xno"; then |
| 937 | dnl # |
| 938 | dnl # Verifying Intel IPP path |
| 939 | dnl # |
| 940 | AC_MSG_CHECKING([Intel IPP location]) |
| 941 | |
| 942 | if test "x$with_ipp" != "xno" -a "x$with_ipp" != "x"; then |
| 943 | AC_MSG_RESULT([$with_ipp]) |
| 944 | IPPROOT=$with_ipp |
| 945 | elif test "x$IPPROOT" = "x"; then |
| 946 | if test -d /opt/intel/ipp; then |
| 947 | IPPROOT=`ls -d /opt/intel/ipp/*/* | head -1` |
| 948 | AC_MSG_RESULT([autodetected in $IPPROOT]) |
| 949 | fi |
| 950 | else |
| 951 | AC_MSG_RESULT([$IPPROOT]) |
| 952 | fi |
| 953 | |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 954 | if test "x$with_ipp_arch" != "xno"; then |
Benny Prijono | 896be29 | 2010-08-17 12:16:46 +0000 | [diff] [blame] | 955 | IPP_SUFFIX=$with_ipp_arch |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 956 | AC_MSG_RESULT([IPP arch suffix is set to $IPP_SUFFIX]) |
| 957 | else |
| 958 | IPP_SUFFIX="" |
| 959 | AC_MSG_RESULT([IPP arch suffix is set to empty]) |
| 960 | fi |
| 961 | |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 962 | if test x$IPPROOT = x; then |
| 963 | AC_MSG_ERROR([the location is neither specified nor can be guessed. Please specify with IPPROOT env var or with --with-ipp option]) |
| 964 | elif test ! -d $IPPROOT; then |
| 965 | AC_MSG_ERROR([not found]) |
| 966 | elif test ! -d $IPPROOT/include; then |
| 967 | AC_MSG_ERROR([directory doesn't seem to be valid]) |
| 968 | else |
| 969 | # IPP directory looks okay. |
| 970 | # Remove trailing backslash |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 971 | IPPROOT=`echo $IPPROOT | sed 's/\/$//'` |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 972 | |
| 973 | SAVED_CFLAGS="$CFLAGS" |
| 974 | SAVED_LDFLAGS="$LDFLAGS" |
| 975 | SAVED_LIBS="$LIBS" |
| 976 | |
| 977 | IPP_CFLAGS="-I$IPPROOT/include" |
Benny Prijono | cd62c4e | 2011-03-18 08:33:29 +0000 | [diff] [blame] | 978 | IPP_LIBS="-lippsc${IPP_SUFFIX} -lipps${IPP_SUFFIX} -lippcore${IPP_SUFFIX}" |
Benny Prijono | 46bd084 | 2010-02-12 14:12:41 +0000 | [diff] [blame] | 979 | |
Benny Prijono | cd62c4e | 2011-03-18 08:33:29 +0000 | [diff] [blame] | 980 | # |
Benny Prijono | 46bd084 | 2010-02-12 14:12:41 +0000 | [diff] [blame] | 981 | # Some differences between Mac OS X and Linux |
| 982 | case $target in |
| 983 | *darwin* ) |
| 984 | IPP_LDFLAGS="-L$IPPROOT/Libraries -L$IPPROOT/lib" |
| 985 | ;; |
| 986 | *) |
Benny Prijono | cd62c4e | 2011-03-18 08:33:29 +0000 | [diff] [blame] | 987 | # Find out where the libraries live. |
| 988 | IPP7_ARCH="" |
| 989 | if test -d $IPPROOT/lib/intel64; then |
| 990 | IPP7_ARCH="intel64" |
| 991 | elif test -d $IPPROOT/lib/ia32; then |
| 992 | IPP7_ARCH="ia32" |
| 993 | elif test -d $IPPROOT/lib/mic; then |
| 994 | IPP7_ARCH="mic" |
| 995 | fi |
| 996 | |
| 997 | if test -z "$IPP7_ARCH"; then |
| 998 | # IPP6 (and possibly below) |
| 999 | IPP_LDFLAGS="-L$IPPROOT/sharedlib" |
| 1000 | IPP_LIBS="$IPP_LIBS -lippsr${IPP_SUFFIX} -lguide" |
| 1001 | else |
| 1002 | # IPP7 |
| 1003 | if ! test -d $IPPROOT/../compiler; then |
| 1004 | AC_MSG_ERROR([Cannot find $IPPROOT/../compiler directory. Please set IPPROOT variable correctly]) |
| 1005 | fi |
| 1006 | IPP_CFLAGS="$IPP_CFLAGS" |
| 1007 | IPP_LDFLAGS="-L$IPPROOT/lib/intel64 -L$IPPROOT/../compiler/lib/$IPP7_ARCH" |
| 1008 | IPP_LIBS="$IPP_LIBS -liomp5" |
| 1009 | fi |
Benny Prijono | 46bd084 | 2010-02-12 14:12:41 +0000 | [diff] [blame] | 1010 | ;; |
| 1011 | esac |
| 1012 | |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 1013 | #IPP_LDFLAGS="-L$IPPROOT/sharedlib" |
Benny Prijono | 46bd084 | 2010-02-12 14:12:41 +0000 | [diff] [blame] | 1014 | #Static: |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 1015 | #IPP_LIBS="-lippscmerged -lippsrmerged -lippsmerged -lippcore" |
| 1016 | |
| 1017 | CFLAGS="$CFLAGS $IPP_CFLAGS" |
| 1018 | LDFLAGS="$LDFLAGS $IPP_LDFLAGS" |
| 1019 | LIBS="$IPP_LIBS $LIBS" |
| 1020 | |
| 1021 | |
| 1022 | AC_MSG_CHECKING([Intel IPP usability]) |
| 1023 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ippcore.h> |
| 1024 | ]], |
| 1025 | [ippStaticInit();])], |
| 1026 | [AC_MSG_RESULT(ok)], |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 1027 | [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] | 1028 | |
| 1029 | CFLAGS="$SAVED_CFLAGS" |
| 1030 | LDFLAGS="$SAVED_LDFLAGS" |
| 1031 | LIBS="$SAVED_LIBS" |
| 1032 | fi |
| 1033 | |
| 1034 | dnl # |
| 1035 | dnl # Verifying Intel IPP samples path |
| 1036 | dnl # |
| 1037 | AC_MSG_CHECKING([Intel IPP samples location]) |
| 1038 | |
| 1039 | if test "x$with_ipp_samples" != "xno" -a "x$with_ipp_samples" != "x"; then |
| 1040 | AC_MSG_RESULT([$with_ipp_samples]) |
| 1041 | IPPSAMPLES=$with_ipp_samples |
| 1042 | elif test "x$IPPSAMPLES" = "x"; then |
| 1043 | if test -d /opt/intel/ipp-samples; then |
| 1044 | IPPSAMPLES=/opt/intel/ipp-samples |
| 1045 | AC_MSG_RESULT([autodetected in $IPPSAMPLES]) |
| 1046 | fi |
| 1047 | else |
| 1048 | AC_MSG_RESULT([$IPPSAMPLES]) |
| 1049 | fi |
| 1050 | |
| 1051 | if test x$IPPSAMPLES = x; then |
| 1052 | AC_MSG_ERROR([the location is neither specified nor can be guessed. Please specify with IPPSAMPLES env var or with --with-ipp-samples option]) |
| 1053 | elif test ! -d $IPPSAMPLES; then |
| 1054 | AC_MSG_ERROR([not found]) |
| 1055 | elif test ! -d $IPPSAMPLES/speech-codecs; then |
| 1056 | AC_MSG_ERROR([directory doesn't seem to be valid]) |
| 1057 | else |
| 1058 | # Remove trailing backslash |
| 1059 | IPPSAMPLES=`echo $IPPSAMPLES | sed 's/\/$//'` |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 1060 | |
| 1061 | # Guess the libusc.a/libspeech.a build location |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 1062 | AC_MSG_CHECKING([Intel IPP USC build location]) |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 1063 | if test -d $IPPSAMPLES/speech-codecs/bin; then |
| 1064 | IPPVER=5 |
| 1065 | IPPSAMP_DIR=`ls -d $IPPSAMPLES/speech-codecs/bin/*gcc*/lib | head -1` |
| 1066 | elif test -d $IPPSAMPLES/speech-codecs/_bin; then |
| 1067 | IPPVER=6 |
Benny Prijono | 46bd084 | 2010-02-12 14:12:41 +0000 | [diff] [blame] | 1068 | if test -d $IPPSAMPLES/speech-codecs/_bin/*gcc*; then |
| 1069 | # gcc compiler |
| 1070 | IPPSAMP_DIR=`ls -d $IPPSAMPLES/speech-codecs/_bin/*gcc*/lib | head -1` |
| 1071 | elif test -d $IPPSAMPLES/speech-codecs/_bin/*icc*; then |
| 1072 | # icc compiler |
| 1073 | IPPSAMP_DIR=`ls -d $IPPSAMPLES/speech-codecs/_bin/*icc*/lib | head -1` |
| 1074 | else |
| 1075 | AC_MSG_FAILURE([Unable to find to find built binaries under $IPPSAMPLES/speech-codecs/{bin,_bin}. Have you built the IPP samples?]) |
| 1076 | fi |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 1077 | else |
| 1078 | 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] | 1079 | fi |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 1080 | |
| 1081 | # Test the directory |
| 1082 | if test ! -d $IPPSAMP_DIR; then |
| 1083 | AC_MSG_FAILURE([There's something wrong with this script, directory $IPPSAMP_DIR does not exist]) |
| 1084 | exit 1; |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 1085 | fi |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 1086 | |
| 1087 | if test "x$IPPVER" = "x5"; then |
| 1088 | IPPSAMP_LIBS="libusc.a" |
| 1089 | IPPSAMP_LDLIBS="-lusc" |
| 1090 | elif test "x$IPPVER" = "x6"; then |
| 1091 | IPPSAMP_LIBS="libspeech.a" |
| 1092 | IPPSAMP_LDLIBS="-lspeech" |
| 1093 | else |
| 1094 | AC_MSG_FAILURE([bug in this script: unsupported IPP version]) |
| 1095 | fi |
| 1096 | |
| 1097 | if test ! -f $IPPSAMP_DIR/$IPPSAMP_LIBS; then |
| 1098 | AC_MSG_FAILURE([$IPPSAMP_LIBS doesn't exist in $IPPSAMP_DIR]) |
| 1099 | fi |
| 1100 | |
| 1101 | AC_MSG_RESULT([$IPPSAMP_DIR]) |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 1102 | |
| 1103 | SAVED_CFLAGS="$CFLAGS" |
| 1104 | SAVED_LDFLAGS="$LDFLAGS" |
| 1105 | SAVED_LIBS="$LIBS" |
| 1106 | |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 1107 | IPPSAMP_INC="-I$IPPSAMPLES/speech-codecs/core/usc/include" |
| 1108 | CFLAGS="$CFLAGS $IPPSAMP_INC" |
| 1109 | LDFLAGS="$LDFLAGS -L$IPPSAMP_DIR" |
| 1110 | LIBS="$IPPSAMP_LDLIBS $LIBS" |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 1111 | |
| 1112 | AC_MSG_CHECKING([Intel IPP USC usability]) |
| 1113 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <usc.h> |
| 1114 | ]], |
| 1115 | [extern USC_Fxns USC_G729AFP_Fxns;])], |
| 1116 | [AC_MSG_RESULT(ok)], |
| 1117 | [AC_MSG_FAILURE(failed)]) |
| 1118 | |
| 1119 | CFLAGS="$SAVED_CFLAGS" |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 1120 | LDFLAGS="$IPP_LDFLAGS $SAVED_LDFLAGS" |
| 1121 | LIBS="$IPP_LIBS $SAVED_LIBS" |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 1122 | |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 1123 | IPP_CFLAGS="$IPP_CFLAGS $IPPSAMP_INC" |
| 1124 | IPP_LDFLAGS="$IPP_LDFLAGS -L$IPPSAMP_DIR" |
| 1125 | IPP_LIBS="$IPPSAMP_LDLIBS $IPP_LIBS" |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 1126 | fi |
| 1127 | |
Benny Prijono | 3965f19 | 2010-02-10 18:46:05 +0000 | [diff] [blame] | 1128 | CFLAGS="$CFLAGS $IPP_CFLAGS" |
| 1129 | LDFLAGS="$LDFLAGS $IPP_LDFLAGS" |
| 1130 | LIBS="$LIBS $IPP_LIBS" |
| 1131 | |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 1132 | ac_build_mak_vars="$ac_build_mak_vars\n\ |
| 1133 | export IPP_CFLAGS=$IPP_CFLAGS\n\ |
| 1134 | export IPP_LDFLAGS=$IPP_LDFLAGS\n\ |
| 1135 | export IPP_LIBS=$IPP_LIBS" |
| 1136 | else |
| 1137 | AC_MSG_RESULT([Skipping Intel IPP settings (not wanted)]) |
| 1138 | fi |
| 1139 | |
| 1140 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 1141 | dnl ########################################## |
| 1142 | dnl # |
Benny Prijono | 7e0d75f | 2006-12-25 20:34:14 +0000 | [diff] [blame] | 1143 | dnl # PJSIP CONFIG |
| 1144 | dnl # |
| 1145 | |
| 1146 | dnl # Include SSL support |
| 1147 | AC_SUBST(ac_no_ssl) |
| 1148 | AC_ARG_ENABLE(ssl, |
Benny Prijono | ce1db76 | 2007-02-14 02:21:08 +0000 | [diff] [blame] | 1149 | AC_HELP_STRING([--disable-ssl], |
| 1150 | [Exclude SSL support the build (default: autodetect)]) |
| 1151 | , |
Benny Prijono | 7e0d75f | 2006-12-25 20:34:14 +0000 | [diff] [blame] | 1152 | [ |
| 1153 | if test "$enable_ssl" = "no"; then |
| 1154 | [ac_no_ssl=1] |
| 1155 | AC_MSG_RESULT([Checking if SSL support is disabled... yes]) |
| 1156 | fi |
| 1157 | ], |
| 1158 | [ |
| 1159 | AC_MSG_RESULT([checking for OpenSSL installations..]) |
| 1160 | AC_SUBST(openssl_h_present) |
| 1161 | AC_SUBST(libssl_present) |
| 1162 | AC_SUBST(libcrypto_present) |
| 1163 | AC_CHECK_HEADER(openssl/ssl.h,[openssl_h_present=1]) |
Benny Prijono | 7e0d75f | 2006-12-25 20:34:14 +0000 | [diff] [blame] | 1164 | 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] | 1165 | 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] | 1166 | if test "x$openssl_h_present" = "x1" -a "x$libssl_present" = "x1" -a "x$libcrypto_present" = "x1"; then |
| 1167 | AC_MSG_RESULT([OpenSSL library found, SSL support enabled]) |
Nanang Izzuddin | 9c7616f | 2009-10-28 06:09:15 +0000 | [diff] [blame] | 1168 | # PJSIP_HAS_TLS_TRANSPORT setting follows PJ_HAS_SSL_SOCK |
| 1169 | #AC_DEFINE(PJSIP_HAS_TLS_TRANSPORT, 1) |
Nanang Izzuddin | ea6d3c4 | 2009-10-26 15:47:52 +0000 | [diff] [blame] | 1170 | AC_DEFINE(PJ_HAS_SSL_SOCK, 1) |
Benny Prijono | 7e0d75f | 2006-12-25 20:34:14 +0000 | [diff] [blame] | 1171 | else |
| 1172 | AC_MSG_RESULT([** OpenSSL libraries not found, disabling SSL support **]) |
| 1173 | fi |
| 1174 | ]) |
| 1175 | |
| 1176 | |
| 1177 | dnl ########################################## |
| 1178 | dnl # |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 1179 | dnl # MANUAL CONFIG |
| 1180 | dnl # |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 1181 | |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 1182 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 1183 | dnl # Determine if select() requires nfds to be filled up with |
| 1184 | dnl # correct value (max_fd+1). If zero, nfds will be filled up with |
| 1185 | dnl # PJ_FD_SETSIZE |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 1186 | AC_MSG_CHECKING([if select() needs correct nfds]) |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 1187 | case $target in |
| 1188 | *rtems*) AC_DEFINE(PJ_SELECT_NEEDS_NFDS,1) |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 1189 | AC_MSG_RESULT(yes) |
| 1190 | ;; |
| 1191 | *) AC_DEFINE(PJ_SELECT_NEEDS_NFDS,0) |
| 1192 | AC_MSG_RESULT([no (default)]) |
| 1193 | AC_MSG_RESULT([** Decided that select() doesn't need correct nfds (please check)]) |
| 1194 | ;; |
| 1195 | esac |
| 1196 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 1197 | dnl # Determine if pj_thread_create() should enforce thread stack size when |
| 1198 | dnl # creating thread. Default is zero, to allow OS to allocate appropriate |
| 1199 | dnl # thread's stack size. |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 1200 | AC_MSG_CHECKING([if pj_thread_create() should enforce stack size]) |
| 1201 | case $target in |
| 1202 | *rtems*) AC_DEFINE(PJ_THREAD_SET_STACK_SIZE,1) |
| 1203 | AC_MSG_RESULT(yes) |
| 1204 | ;; |
| 1205 | *) AC_DEFINE(PJ_THREAD_SET_STACK_SIZE,0) |
| 1206 | AC_MSG_RESULT([no (default)]) |
| 1207 | ;; |
| 1208 | esac |
| 1209 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 1210 | dnl # Determine if pj_thread_create() should allocate thread's stack from |
| 1211 | 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] | 1212 | AC_MSG_CHECKING([if pj_thread_create() should allocate stack]) |
| 1213 | case $target in |
| 1214 | *rtems*) AC_DEFINE(PJ_THREAD_ALLOCATE_STACK,1) |
| 1215 | AC_MSG_RESULT(yes) |
| 1216 | ;; |
| 1217 | *) AC_DEFINE(PJ_THREAD_ALLOCATE_STACK,0) |
| 1218 | AC_MSG_RESULT([no (default)]) |
| 1219 | ;; |
| 1220 | esac |
| 1221 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 1222 | dnl # This value specifies the value set in errno by the OS when a non-blocking |
| 1223 | dnl # socket recv() can not return immediate data. |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 1224 | case $target in |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 1225 | *mingw* | *cygw* | *win32* | *w32* ) |
| 1226 | AC_DEFINE(PJ_BLOCKING_ERROR_VAL,WSAEWOULDBLOCK) |
| 1227 | ;; |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 1228 | *) AC_DEFINE(PJ_BLOCKING_ERROR_VAL,EAGAIN) |
| 1229 | AC_MSG_RESULT([** Setting non-blocking recv() retval to EAGAIN (please check)]) |
| 1230 | ;; |
| 1231 | esac |
| 1232 | |
Benny Prijono | b466e23 | 2006-09-10 08:53:59 +0000 | [diff] [blame] | 1233 | dnl # This value specifies the value set in errno by the OS when a non-blocking |
| 1234 | dnl # socket connect() can not get connected immediately. |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 1235 | case $target in |
Benny Prijono | c5b6dbf | 2006-09-10 16:33:48 +0000 | [diff] [blame] | 1236 | *mingw* | *cygw* | *win32* | *w32* ) |
| 1237 | AC_DEFINE(PJ_BLOCKING_CONNECT_ERROR_VAL,WSAEWOULDBLOCK) |
| 1238 | ;; |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 1239 | *) AC_DEFINE(PJ_BLOCKING_CONNECT_ERROR_VAL,EINPROGRESS) |
| 1240 | AC_MSG_RESULT([** Setting non-blocking connect() retval to EINPROGRESS (please check)]) |
| 1241 | ;; |
| 1242 | esac |
| 1243 | |
Benny Prijono | a9b372a | 2006-07-24 02:07:11 +0000 | [diff] [blame] | 1244 | |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 1245 | AC_SUBST(target) |
| 1246 | AC_SUBST(ac_cross_compile) |
| 1247 | if test "$build" = "$host"; then |
| 1248 | ac_cross_compile= |
| 1249 | else |
Benny Prijono | 5b818b2 | 2006-09-17 22:58:51 +0000 | [diff] [blame] | 1250 | ac_cross_compile=${host_orig}- |
Benny Prijono | c4c61d0 | 2006-08-20 20:47:34 +0000 | [diff] [blame] | 1251 | fi |
| 1252 | AC_SUBST(ac_linux_poll,select) |
| 1253 | AC_SUBST(ac_host,unix) |
| 1254 | AC_SUBST(ac_main_obj) |
| 1255 | case $target in |
| 1256 | *rtems*) |
| 1257 | ac_main_obj=main_rtems.o |
| 1258 | ;; |
| 1259 | *) |
| 1260 | ac_main_obj=main.o |
| 1261 | ;; |
| 1262 | esac |
| 1263 | AC_SUBST(CC) |
Benny Prijono | 0822c19 | 2008-08-21 20:59:58 +0000 | [diff] [blame] | 1264 | |
| 1265 | 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] | 1266 | AC_OUTPUT() |
| 1267 | |
Benny Prijono | d962784 | 2007-04-18 09:24:31 +0000 | [diff] [blame] | 1268 | |
| 1269 | AC_MSG_RESULT([ |
| 1270 | |
Benny Prijono | c16c6e3 | 2007-11-18 14:53:47 +0000 | [diff] [blame] | 1271 | 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] | 1272 | |
Benny Prijono | c16c6e3 | 2007-11-18 14:53:47 +0000 | [diff] [blame] | 1273 | Further customizations can be put in: |
Benny Prijono | d962784 | 2007-04-18 09:24:31 +0000 | [diff] [blame] | 1274 | - 'user.mak' |
| 1275 | - 'pjlib/include/pj/config_site.h' |
| 1276 | |
| 1277 | The next step now is to run 'make dep' and 'make'. |
| 1278 | ]) |
| 1279 | |