configure.ac 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084
  1. #
  2. # Copyright (C) 2010-2015 Mamadou DIOP
  3. # Copyright (C) 2011-2015 Doubango Telecom <http://www.doubango.org>
  4. # License: GPLv3 or commercial
  5. # This file is part of Doubango VoIP framework <https://code.google.com/p/doubango/>
  6. #
  7. AC_PREREQ([2.0])
  8. AC_INIT(libdoubango, 2.0.1316, doubango(at)googlegroups(dot)com)
  9. AC_CANONICAL_SYSTEM
  10. AM_INIT_AUTOMAKE([subdir-objects])
  11. AC_CONFIG_MACRO_DIR([m4])
  12. AC_CONFIG_HEADERS([config.h])
  13. AC_CONFIG_SRCDIR([tinySAK/src/tsk.c])
  14. ### HOST FOR CROSS-COMPILING
  15. target_os=`uname -s`
  16. android_cpu=unknown
  17. case "$host" in
  18. arm-*-linux-androideabi)
  19. target_os=android
  20. android_cpu=armv5te
  21. ;;
  22. i686-*-linux-android)
  23. target_os=android
  24. android_cpu=x86
  25. ;;
  26. *)
  27. AC_MSG_NOTICE(["Using host as target os: $host"])
  28. ;;
  29. esac
  30. ### ANDROID-CPU
  31. AC_ARG_WITH(android-cpu,
  32. [ --with-android-cpu[=cpu] set android CPU type [[default=armv5te]]
  33. armv5te: ARMv5TE
  34. armv7-a: ARMv7-a *without* NEON
  35. armv7-a-neon: ARMv7-a *with* NEON
  36. x86: X86],
  37. [ android_cpu=$withval ])
  38. ### ANDROID-TOOLCHAIN (http://www.kandroid.org/ndk/docs/STANDALONE-TOOLCHAIN.html)
  39. if test "$target_os" = "android"; then
  40. case "$android_cpu" in
  41. x86)
  42. export SYSROOT=$NDK/platforms/android-23/arch-x86
  43. export ANDROID_PREFIX=i686-linux-android
  44. export ANDROID_TOOLCHAIN=$(pwd)/my-android-toolchain-android-x86
  45. $NDK/build/tools/make-standalone-toolchain.sh --platform=android-23 --arch=x86 --install-dir=$ANDROID_TOOLCHAIN
  46. AC_SUBST(TARGET_ARCH, "x86")
  47. ;;
  48. armv7-a)
  49. export ANDROID_PREFIX=arm-linux-androideabi
  50. export SYSROOT=$NDK/platforms/android-23/arch-arm
  51. export ANDROID_TOOLCHAIN=$(pwd)/my-android-toolchain-android-armv7-a
  52. $NDK/build/tools/make-standalone-toolchain.sh --platform=android-23 --arch=arm --install-dir=$ANDROID_TOOLCHAIN
  53. export CFLAGS='-march=armv7-a -mfloat-abi=softfp'
  54. export LDFLAGS='-Wl,--fix-cortex-a8'
  55. AC_SUBST(TARGET_ARCH, "arm")
  56. ;;
  57. armv7-a-neon)
  58. export ANDROID_PREFIX=arm-linux-androideabi
  59. export SYSROOT=$NDK/platforms/android-23/arch-arm
  60. export ANDROID_TOOLCHAIN=$(pwd)/my-android-toolchain-android-armv7-a-neon
  61. $NDK/build/tools/make-standalone-toolchain.sh --platform=android-23 --arch=arm --install-dir=$ANDROID_TOOLCHAIN
  62. export CFLAGS='-march=armv7-a -mfloat-abi=softfp -mfpu=neon'
  63. export LDFLAGS='-Wl,--fix-cortex-a8'
  64. AC_SUBST(TARGET_ARCH, "arm")
  65. ;;
  66. *)
  67. export ANDROID_PREFIX=arm-linux-androideabi
  68. export SYSROOT=$NDK/platforms/android-23/arch-arm
  69. export ANDROID_TOOLCHAIN=$(pwd)/my-android-toolchain-armv5te
  70. $NDK/build/tools/make-standalone-toolchain.sh --platform=android-23 --arch=arm --install-dir=$ANDROID_TOOLCHAIN
  71. AC_SUBST(TARGET_ARCH, "arm")
  72. ;;
  73. esac
  74. AC_SUBST(NDK, $NDK)
  75. export CFLAGS="${CFLAGS} -DANDROID=1 -fsigned-char"
  76. export CPPFLAGS=$CFLAGS
  77. export LDFLAGS="${LDFLAGS} -lc -lm -lgcc"
  78. export PATH=$ANDROID_TOOLCHAIN/bin:$PATH
  79. export CC=$ANDROID_TOOLCHAIN/bin/$ANDROID_PREFIX-gcc
  80. export AR=$ANDROID_TOOLCHAIN/bin/$ANDROID_PREFIX-ar
  81. export CXX=$ANDROID_TOOLCHAIN/bin/$ANDROID_PREFIX-g++
  82. export AS=$ANDROID_TOOLCHAIN/bin/$ANDROID_PREFIX-as
  83. export RANLIB=$ANDROID_TOOLCHAIN/bin/$ANDROID_PREFIX-ranlib
  84. export STRIP=$ANDROID_TOOLCHAIN/bin/$ANDROID_PREFIX-strip
  85. fi
  86. dnl find suitable C and C++ compilers
  87. AC_PROG_CC
  88. AC_PROG_CXX
  89. AC_PROG_INSTALL
  90. AC_PROG_LIBTOOL
  91. AC_LIBTOOL_WIN32_DLL
  92. AC_PROG_SED
  93. AC_PROG_MAKE_SET
  94. PKG_PROG_PKG_CONFIG
  95. ### Set Target OS
  96. AM_CONDITIONAL([TARGET_OS_IS_ANDROID], [test "x$target_os" = xandroid])
  97. ### CROSS COMPILATION?
  98. AM_CONDITIONAL([CROSS_COMPILING], [test "x$cross_compiling" = xyes])
  99. ### ENABLE GPL CODE
  100. AC_ARG_ENABLE(gpl,
  101. [ AS_HELP_STRING([--disable-gpl], [Disable GPL code]) ], [ ],[])
  102. test "x$enable_gpl" = "x" && enable_gpl=yes
  103. ### ENABLE NONFREE CODE
  104. AC_ARG_ENABLE(nonfree,
  105. [ AS_HELP_STRING([--disable-nonfree], [Disable NONFREE code]) ], [ ],[])
  106. test "x$enable_nonfree" = "x" && enable_nonfree=yes
  107. ### ENABLE-DEBUG
  108. AC_MSG_CHECKING(whether to enable debugging)
  109. debug_default="no"
  110. AC_ARG_ENABLE(debug,
  111. [ --enable-debug[=no/yes] turn on/off debugging
  112. [[default=$debug_default]]],
  113. [ if test "x$enableval" = "xyes" ; then
  114. AC_DEFINE(DEBUG_LEVEL, DEBUG_LEVEL_INFO, [])
  115. else
  116. AC_DEFINE(DEBUG_LEVEL, DEBUG_LEVEL_ERROR, [])
  117. fi
  118. ],
  119. [])
  120. test "x$enable_debug" = "x" && enable_debug=no
  121. AM_CONDITIONAL(USE_DEBUG, test x"$enable_debug" = x"yes")
  122. if test "$enable_debug" = "yes"; then
  123. CFLAGS="${CFLAGS} -O0 -g3 -DDEBUG"
  124. CPPFLAGS=$CFLAGS
  125. CXXFLAGS=$CFLAGS
  126. else
  127. if test "$target_os" = "android"; then
  128. CFLAGS="${CFLAGS} -Os -s"
  129. else
  130. CFLAGS="${CFLAGS} -O3 -DNDEBUG"
  131. fi
  132. CPPFLAGS=$CFLAGS
  133. CXXFLAGS=$CFLAGS
  134. fi
  135. ### DEBUG-LEVEL
  136. debug_level=error
  137. AC_ARG_WITH(debug-level,
  138. [ --with-debug-level[=level] Set debug-level to level [[default=error]]
  139. info: informational
  140. warn: warnings
  141. error [default]: errors
  142. fatal: fatal],
  143. [ if test "x$withval" = "xinfo" ; then
  144. AC_DEFINE(DEBUG_LEVEL, DEBUG_LEVEL_INFO, [info debug])
  145. AC_MSG_RESULT(info)
  146. elif test "x$withval" = "xwarn" ; then
  147. AC_DEFINE(DEBUG_LEVEL, DEBUG_LEVEL_INFO, [warn debug])
  148. AC_MSG_RESULT(warn)
  149. elif test "x$withval" = "xerror" ; then
  150. AC_DEFINE(DEBUG_LEVEL, DEBUG_LEVEL_ERROR, [error debug])
  151. AC_MSG_RESULT(error)
  152. elif test "x$withval" = "xfatal" ; then
  153. AC_DEFINE(DEBUG_LEVEL, DEBUG_LEVEL_FATAL, [fatal debug])
  154. AC_MSG_RESULT(fatal)
  155. fi
  156. debug_level=$withval
  157. ])
  158. ### BUILD-TYPE
  159. build_type=doubango
  160. AC_ARG_WITH(build-type,
  161. [ --with-build-type[=bt] Set build-type to bt [[default=doubango]]
  162. doubango [default]: Doubango Telecom
  163. ge: General Electric
  164. tiscali: Tiscali
  165. tch: Technicolor],
  166. [ if test "x$withval" = "xtch" ; then
  167. AC_DEFINE(BUILD_TYPE_TCH, 1, [Technicolor])
  168. elif test "x$withval" = "xge" ; then
  169. AC_DEFINE(BUILD_TYPE_GE, 1, [General Electric])
  170. elif test "x$withval" = "xtiscali" ; then
  171. AC_DEFINE(BUILD_TYPE_TISCALI, 1, [Tiscali])
  172. fi
  173. build_type="$withval"
  174. ])
  175. ### CFLAGS && LDFLAGS
  176. if test "$target_os" = "android"; then
  177. home_dir=`pwd`
  178. CFLAGS="${CFLAGS} -I${home_dir}/thirdparties/android/${android_cpu}/include -I${home_dir}/thirdparties/android/common/include -I${home_dir}/thirdparties/common/include -I${home_dir}/thirdparties/common/include/libyuv"
  179. CPPFLAGS=$CFLAGS
  180. LDFLAGS="${LDFLAGS} -L${home_dir}/thirdparties/android/${android_cpu}/lib/dist"
  181. if test "$enable_gpl" = yes; then
  182. LDFLAGS="${LDFLAGS} -L${home_dir}/thirdparties/android/${android_cpu}/lib/dist/gpl"
  183. else
  184. LDFLAGS="${LDFLAGS} -L${home_dir}/thirdparties/android/${android_cpu}/lib/dist/lgpl"
  185. fi
  186. AC_SUBST(CFLAGS)
  187. AC_SUBST(LDFLAGS)
  188. fi
  189. AC_CHECK_FUNCS([stricmp strnicmp strtok_r strtok_s])
  190. AC_TRY_COMPILE([#include <pthread.h>],
  191. [static int k = PTHREAD_MUTEX_RECURSIVE;],
  192. [AC_DEFINE(TSK_RECURSIVE_MUTEXATTR, PTHREAD_MUTEX_RECURSIVE,
  193. [Check whether PTHREAD_MUTEX_RECURSIVE is defined])],
  194. [AC_TRY_COMPILE([#include <pthread.h>],
  195. [static int k = PTHREAD_MUTEX_RECURSIVE_NP;],
  196. [AC_DEFINE(TSK_RECURSIVE_MUTEXATTR, PTHREAD_MUTEX_RECURSIVE_NP,
  197. [Check whether PTHREAD_MUTEX_RECURSIVE_NP is defined])])])
  198. AC_TRY_COMPILE([#include <stdlib.h>],
  199. [static int a = 0; __sync_fetch_and_add(&a, 1);],
  200. [AC_DEFINE(HAVE___SYNC_FETCH_AND_ADD, 1,
  201. [Check whether __sync_fetch_and_add is defined])],[])
  202. AC_TRY_COMPILE([#include <stdlib.h>],
  203. [static int a = 0; __sync_fetch_and_sub(&a, 1);],
  204. [AC_DEFINE(HAVE___SYNC_FETCH_AND_SUB, 1,
  205. [Check whether __sync_fetch_and_sub is defined])],[])
  206. AC_DEFINE(USE_POLL, 1, [Setting USE_POLL to 1 for backward compatibility])
  207. AC_CHECK_FUNCS([inet_pton inet_ntop poll getdtablesize opendir closedir getpid])
  208. AC_CHECK_HEADERS([arpa/inet.h net/if_types.h net/if_dl.h poll.h unistd.h dirent.h fcntl.h sys/param.h sys/resource.h linux/videodev2.h])
  209. AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS, 1 ,[Define to 1 if you have the 'getifaddrs' function]))
  210. AH_TEMPLATE([HAVE_IFADDRS_H], [Define if <ifaddrs.h> header exist])
  211. AC_CHECK_HEADER([ifaddrs.h], AC_DEFINE(HAVE_IFADDRS_H, 1), AC_DEFINE(HAVE_IFADDRS_H, 0), [])
  212. AH_TEMPLATE([HAVE_NET_IF_DL_H], [Define if <net/if_dl.h> header exist])
  213. AC_CHECK_HEADER([net/if_dl.h], AC_DEFINE(HAVE_NET_IF_DL_H, 1), AC_DEFINE(HAVE_NET_IF_DL_H, 0), [])
  214. AH_TEMPLATE([HAVE_NET_IF_TYPES_H], [Define if <net/if_types> header exist])
  215. AC_CHECK_HEADER([net/if_types.h], AC_DEFINE(HAVE_NET_IF_TYPES_H, 1), AC_DEFINE(HAVE_NET_IF_TYPES_H, 0), [])
  216. AH_TEMPLATE([HAVE_NETPACKET_PACKET_H], [Define if <netpacket/packet.h> header exist])
  217. AC_CHECK_HEADER([netpacket/packet.h], AC_DEFINE(HAVE_NETPACKET_PACKET_H, 1), AC_DEFINE(HAVE_NETPACKET_PACKET_H, 0), [])
  218. AH_TEMPLATE([HAVE_NET_ROUTE_H], [Define if <net/route.h> header exist])
  219. AC_CHECK_HEADER([net/route.h], AC_DEFINE(HAVE_NET_ROUTE_H, 1), AC_DEFINE(HAVE_NET_ROUTE_H, 0), [])
  220. AC_CHECK_TYPES([struct rt_metrics], [], [],
  221. [
  222. #if HAVE_NET_ROUTE_H
  223. # include <net/route.h>
  224. #endif
  225. ])
  226. AC_CHECK_TYPES([struct sockaddr_dl], [], [],
  227. [
  228. #if HAVE_NET_IF_DL_H
  229. # include <net/if_dl.h>
  230. #endif
  231. ])
  232. AC_CHECK_TYPES([struct rlimit], [AC_CHECK_FUNCS([getrlimit setrlimit])], [],
  233. [
  234. #if HAVE_SYS_RESOURCE_H
  235. # include <sys/resource.h>
  236. #endif
  237. ])
  238. AC_CHECK_TYPES([struct dirent], [], [],
  239. [
  240. #if HAVE_DIRENT_H
  241. # include <dirent.h>
  242. #endif
  243. ])
  244. have_resolv=no
  245. AH_TEMPLATE([HAVE_DNS_H], [Define if <dns.h> header exist])
  246. AM_CONDITIONAL(USE_RESOLV, false)
  247. AC_CHECK_LIB([resolv], [dns_search],
  248. AC_SUBST(LIBRESOLV_LIBADD, "-lresolv")
  249. AM_CONDITIONAL(USE_RESOLV, true)
  250. [have_resolv=yes],
  251. AC_SUBST(LIBRESOLV_LIBADD, "")
  252. )
  253. # check for <dns.h> only if libresolv exist
  254. test $have_resolv = yes &&
  255. AC_CHECK_HEADER([dns.h], AC_DEFINE(HAVE_DNS_H, 1), AC_DEFINE(HAVE_DNS_H, 0), [])
  256. AM_CONDITIONAL(USE_RT, false)
  257. have_rt=no
  258. AC_CHECK_LIB([rt], [clock_gettime],
  259. AC_SUBST(LIBRT_LIBADD, "-lrt")
  260. AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define to 1 if we have the `clock_gettime' function.])
  261. AM_CONDITIONAL(USE_RT, true)
  262. [have_rt=yes],
  263. AC_SUBST(LIBRT_LIBADD, "")
  264. )
  265. have_alsa=no
  266. AH_TEMPLATE([HAVE_ALSA_ASOUNDLIB_H], [Define if <alsa/asoundlib.h> header exist])
  267. AM_CONDITIONAL(USE_ALSA, false)
  268. AC_CHECK_LIB([asound], [snd_pcm_open],
  269. AC_SUBST(LIBASOUND_LIBADD, "-lasound")
  270. AM_CONDITIONAL(USE_ALSA, true)
  271. [have_alsa=yes],
  272. AC_SUBST(LIBASOUND_LIBADD, "")
  273. )
  274. # check for <alsa/asoundlib.h> only if libasound exist
  275. test $have_alsa = yes &&
  276. AC_CHECK_HEADER([alsa/asoundlib.h], AC_DEFINE(HAVE_ALSA_ASOUNDLIB_H, 1), AC_DEFINE(HAVE_ALSA_ASOUNDLIB_H, 0) [have_alsa=no], [])
  277. have_oss=no
  278. AH_TEMPLATE([HAVE_LINUX_SOUNDCARD_H], [Define if <linux/soundcard.h> header exist])
  279. AC_CHECK_HEADER([linux/soundcard.h], AC_DEFINE(HAVE_LINUX_SOUNDCARD_H, 1) [have_oss=yes], AC_DEFINE(HAVE_LINUX_SOUNDCARD_H, 0), [])
  280. have_v4l2=no
  281. AH_TEMPLATE([HAVE_LINUX_VIDEODEV2_H], [Define if <linux/videodev2.h> header exist])
  282. AC_CHECK_HEADER([linux/videodev2.h], AC_DEFINE(HAVE_LINUX_VIDEODEV2_H, 1) [have_v4l2=yes], AC_DEFINE(HAVE_LINUX_VIDEODEV2_H, 0), [])
  283. AH_TEMPLATE([TNET_HAVE_SS_LEN], [Define if sockaddr_storage.ss_len exists])
  284. AC_CHECK_MEMBER([struct sockaddr_storage.ss_len], AC_DEFINE(TNET_HAVE_SS_LEN, 1), AC_DEFINE(TNET_HAVE_SS_LEN,0), [#include <sys/socket.h>])
  285. AH_TEMPLATE([TNET_HAVE_SA_LEN], [Define if sockaddr.sa_len exists])
  286. AC_CHECK_MEMBER([struct sockaddr.sa_len], AC_DEFINE(TNET_HAVE_SA_LEN, 1), AC_DEFINE(TNET_HAVE_SA_LEN, 0), [#include <netinet/in.h>])
  287. ########################################################
  288. # SRTP
  289. # --with-srtp / --without-srtp as argument to configure
  290. ########################################################
  291. AH_TEMPLATE([HAVE_APPEND_SALT_TO_KEY], [Checks if the installed libsrtp version support append_salt_to_key() function])
  292. AH_TEMPLATE([HAVE_SRTP_PROFILE_GET_MASTER_KEY_LENGTH], [Checks if the installed libsrtp version support srtp_profile_get_master_key_length() function])
  293. AH_TEMPLATE([HAVE_SRTP_PROFILE_GET_MASTER_SALT_LENGTH], [Checks if the installed libsrtp version support srtp_profile_get_master_salt_length() function])
  294. have_srtp=no
  295. want_srtp=check
  296. path_srtp=undef
  297. AC_SUBST(LIBSRTP_LIBADD, "")
  298. AC_ARG_WITH(srtp,
  299. [ --with-srtp=PATH Build with SRTP (requires libsrtp). PATH is optional.],
  300. if test "x$withval" = "xyes"; then
  301. want_srtp=yes
  302. path_srtp=undef
  303. elif test "x$withval" = "xno"; then
  304. want_srtp=no
  305. path_srtp=undef
  306. elif test "$withval"; then
  307. want_srtp=yes
  308. path_srtp=$withval
  309. fi,
  310. )
  311. # only if --without-srtp not used
  312. if test $want_srtp != no; then
  313. # check for lib and headers
  314. AC_CHECK_HEADERS(srtp/srtp.h,
  315. AC_CHECK_LIB(srtp, srtp_create, AC_DEFINE_UNQUOTED(HAVE_SRTP, 1, HAVE_SRTP) [have_srtp=yes] LIBSRTP_LIBADD="-lsrtp"
  316. AC_CHECK_LIB(srtp, append_salt_to_key, AC_DEFINE(HAVE_APPEND_SALT_TO_KEY, 1), AC_DEFINE(HAVE_APPEND_SALT_TO_KEY, 0))
  317. AC_CHECK_LIB(srtp, srtp_profile_get_master_key_length, AC_DEFINE(HAVE_SRTP_PROFILE_GET_MASTER_KEY_LENGTH, 1), AC_DEFINE(HAVE_SRTP_PROFILE_GET_MASTER_KEY_LENGTH, 0))
  318. AC_CHECK_LIB(srtp, srtp_profile_get_master_salt_length, AC_DEFINE(HAVE_SRTP_PROFILE_GET_MASTER_SALT_LENGTH, 1), AC_DEFINE(HAVE_SRTP_PROFILE_GET_MASTER_SALT_LENGTH, 0))
  319. ,
  320. AC_DEFINE_UNQUOTED(HAVE_SRTP, 0, HAVE_SRTP) [have_srtp=no]
  321. ))
  322. # if srtp not found and requested then, die.
  323. test $have_srtp:$want_srtp = no:yes &&
  324. AC_MSG_ERROR([You requested SRTP (requires libsrtp) but not found...die])
  325. fi
  326. AM_CONDITIONAL([USE_SRTP], [test $have_srtp = yes])
  327. ########################################################
  328. # SSL
  329. # --with-ssl / --without-ssl as argument to configure
  330. ########################################################
  331. have_ssl=no
  332. have_dtls_srtp=no
  333. have_dtls=no
  334. want_ssl=check
  335. path_ssl=undef
  336. AC_SUBST(LIBSSL_LIBADD, "")
  337. AC_ARG_WITH(ssl,
  338. [ --with-ssl=PATH Build with SSL (requires OpenSSL). PATH is optional.],
  339. if test "x$withval" = "xyes"; then
  340. want_ssl=yes
  341. path_ssl=undef
  342. elif test "x$withval" = "xno"; then
  343. want_ssl=no
  344. path_ssl=undef
  345. elif test "$withval"; then
  346. want_ssl=yes
  347. path_ssl=$withval
  348. fi,
  349. )
  350. # only if --without-ssl not used
  351. if test $want_ssl != no; then
  352. # check for lib and headers
  353. AC_CHECK_HEADERS(openssl/ssl.h,
  354. AC_CHECK_LIB(ssl, SSL_library_init, AC_DEFINE_UNQUOTED(HAVE_OPENSSL, 1, HAVE_OPENSSL) [have_ssl=yes] LIBSSL_LIBADD="${LIBSSL_LIBADD} -lssl",
  355. AC_DEFINE_UNQUOTED(HAVE_OPENSSL, 0, HAVE_OPENSSL) [have_ssl=no], [-lcrypto]
  356. ))
  357. AC_CHECK_LIB(crypto, BN_init,
  358. LIBSSL_LIBADD="${LIBSSL_LIBADD} -lcrypto"
  359. AC_CHECK_LIB(ssl, SSL_CTX_set_tlsext_use_srtp, AC_DEFINE_UNQUOTED(HAVE_OPENSSL_DTLS_SRTP, 1, HAVE_OPENSSL_DTLS_SRTP) [have_dtls_srtp=yes],[],[-lcrypto])
  360. AC_CHECK_LIB(ssl, DTLSv1_method, AC_DEFINE_UNQUOTED(HAVE_OPENSSL_DTLS, 1, HAVE_OPENSSL_DTLS) [have_dtls=yes],[],[-lcrypto])
  361. )
  362. # if ssl not found and requested then, die.
  363. test $have_ssl:$want_ssl = no:yes &&
  364. AC_MSG_ERROR([You requested SSL (requires OpenSSL) but not found...die])
  365. fi
  366. AM_CONDITIONAL([USE_SSL], [test $have_ssl = yes])
  367. ########################################################
  368. # FFmpeg
  369. # --with-ffmpeg / --without-ffmpeg as argument to configure
  370. ########################################################
  371. have_ffmpeg=no
  372. want_ffmpeg=check
  373. path_ffmpeg=undef
  374. AC_SUBST(LIBFFMPEG_LIBADD, "")
  375. AC_ARG_WITH(ffmpeg,
  376. [ --with-ffmpeg=PATH Build with FFmpeg (h264, h263, theora, mp4v-es). PATH is optional.],
  377. if test "x$withval" = "xyes"; then
  378. want_ffmpeg=yes
  379. path_ffmpeg=undef
  380. elif test "x$withval" = "xno"; then
  381. want_ffmpeg=no
  382. path_ffmpeg=undef
  383. elif test "$withval"; then
  384. want_ffmpeg=yes
  385. path_ffmpeg=$withval
  386. fi,
  387. )
  388. # only if --without-opus not used
  389. if test $want_ffmpeg != no; then
  390. have_avutil=check
  391. AC_CHECK_HEADERS(libavutil/avutil.h,
  392. AC_CHECK_LIB(avutil, av_gettime, [have_avutil=yes] LIBFFMPEG_LIBADD="-lavutil ${LIBFFMPEG_LIBADD}", [have_avutil=no])
  393. )
  394. have_swscale=check
  395. AC_CHECK_HEADERS(libswscale/swscale.h,
  396. AC_CHECK_LIB(swscale, sws_scale, [have_swscale=yes] LIBFFMPEG_LIBADD="-lswscale ${LIBFFMPEG_LIBADD}", [have_swscale=no], [-lavutil])
  397. )
  398. have_avcodec=check
  399. AC_CHECK_HEADERS(libavcodec/avcodec.h,
  400. AC_CHECK_LIB(avcodec, avcodec_alloc_frame, [have_avcodec=yes] LIBFFMPEG_LIBADD="-lavcodec ${LIBFFMPEG_LIBADD}", [have_avcodec=no], [-lavutil])
  401. )
  402. test $have_avutil:$have_swscale:$have_avcodec = yes:yes:yes &&
  403. have_ffmpeg=yes && AC_DEFINE_UNQUOTED(HAVE_FFMPEG, 1, HAVE_FFMPEG)
  404. # if ffmpeg not found and requested then, die.
  405. test $have_ffmpeg:$want_ffmpeg = no:yes &&
  406. AC_MSG_ERROR([You requested FFmpeg (h264, h263, theora, mp4v-es) but not found...die])
  407. fi
  408. AM_CONDITIONAL([USE_FFMPEG], [test $have_ffmpeg = yes])
  409. ########################################################
  410. # X264
  411. ########################################################
  412. AM_CONDITIONAL(USE_X264, [test $target_os:$enable_gpl = android:yes]) # X264 is always there for Android and statically linked
  413. AC_SUBST(LIBX264_LIBADD, "-lx264")
  414. AC_ARG_WITH(x264, [ --with-x264 IMPORTANT: deprecated to be removed ],[], [])
  415. ########################################################
  416. # OpenH264
  417. # --with-openh264 / --without-openh264 as argument to configure
  418. ########################################################
  419. have_openh264=no
  420. want_openh264=check
  421. path_openh264=undef
  422. AC_SUBST(LIBOPENH264_LIBADD, "")
  423. AC_ARG_WITH(openh264,
  424. [ --with-openh264=PATH Build with OpenH264 video codecs. PATH is optional.],
  425. if test "x$withval" = "xyes"; then
  426. want_openh264=yes
  427. path_openh264=undef
  428. elif test "x$withval" = "xno"; then
  429. want_openh264=no
  430. path_openh264=undef
  431. elif test "$withval"; then
  432. want_openh264=yes
  433. path_openh264=$withval
  434. fi,
  435. )
  436. # only if --without-openh264 not used
  437. if test $want_openh264 != no; then
  438. # check for lib and headers
  439. AC_LANG_PUSH([C++])
  440. AC_CHECK_HEADERS(wels/codec_api.h wels/codec_app_def.h,
  441. AC_CHECK_LIB(openh264, WelsCreateSVCEncoder,
  442. AC_CHECK_LIB(openh264, WelsCreateDecoder, AC_DEFINE_UNQUOTED(HAVE_OPENH264, 1, HAVE_OPENH264) [have_openh264=yes] LIBOPENH264_LIBADD="-lopenh264",
  443. AC_DEFINE_UNQUOTED(HAVE_OPENH264, 0, HAVE_OPENH264) [have_openh264=no]
  444. )))
  445. AC_LANG_POP([C++])
  446. # if opus not found and requested then, die.
  447. test $have_openh264:$want_openh264 = no:yes &&
  448. AC_MSG_ERROR([You requested OpenH264 video codec but not found...die])
  449. fi
  450. AM_CONDITIONAL([USE_OPENH264], [test $have_openh264 = yes])
  451. ########################################################
  452. # VPX (VP8, VP9)
  453. # --with-vpx / --without-vpx as argument to configure
  454. ########################################################
  455. have_vpx=no
  456. want_vpx=check
  457. path_vpx=undef
  458. AC_SUBST(LIBVPX_LIBADD, "")
  459. AC_ARG_WITH(vpx,
  460. [ --with-vpx=PATH Build with VPX(VP8, VP9) video codecs. PATH is optional.],
  461. if test "x$withval" = "xyes"; then
  462. want_vpx=yes
  463. path_vpx=undef
  464. elif test "x$withval" = "xno"; then
  465. want_vpx=no
  466. path_vpx=undef
  467. elif test "$withval"; then
  468. want_vpx=yes
  469. path_vpx=$withval
  470. fi,
  471. )
  472. # only if --without-vpx not used
  473. if test $want_vpx != no; then
  474. # check for lib and headers
  475. AC_CHECK_HEADERS(vpx/vpx_encoder.h vpx/vpx_decoder.h,
  476. AC_CHECK_LIB(vpx, vpx_codec_encode, AC_DEFINE_UNQUOTED(HAVE_LIBVPX, 1, HAVE_LIBVPX) [have_vpx=yes] LIBVPX_LIBADD="-lvpx",
  477. AC_DEFINE_UNQUOTED(HAVE_LIBVPX, 0, HAVE_LIBVPX) [have_vpx=no]
  478. ))
  479. # if opus not found and requested then, die.
  480. test $have_vpx:$want_vpx = no:yes &&
  481. AC_MSG_ERROR([You requested VPX(VP8, VP9) video codecs but not found...die])
  482. fi
  483. AM_CONDITIONAL([USE_VPX], [test $have_vpx = yes])
  484. ########################################################
  485. # YUV
  486. # --with-yuv / --without-yuv as argument to configure
  487. ########################################################
  488. have_yuv=no
  489. want_yuv=check
  490. path_yuv=undef
  491. AC_SUBST(LIBYUV_LIBADD, "")
  492. AC_SUBST(LIBYUV_INCLUDE, "")
  493. AC_SUBST(LIBYUV_LIB, "")
  494. AC_ARG_WITH(yuv,
  495. [ --with-yuv=PATH Build with LIBYUV. PATH is optional.],
  496. if test "x$withval" = "xyes"; then
  497. want_yuv=yes
  498. path_yuv=undef
  499. elif test "x$withval" = "xno"; then
  500. want_yuv=no
  501. path_yuv=undef
  502. elif test "$withval"; then
  503. want_yuv=yes
  504. path_yuv=$withval
  505. fi,
  506. )
  507. # only if --without-yuv not used
  508. if test $want_yuv != no; then
  509. if test "x$path_yuv" = xundef; then
  510. if test "$target_os" != "android"; then
  511. LIBYUV_INCLUDE="-I/usr/local/include -I/usr/local/include/libyuv"
  512. LIBYUV_LIB="-L/usr/local/lib"
  513. fi
  514. else
  515. LIBYUV_INCLUDE="-I${path_yuv}/include -I${path_yuv}/include/libyuv"
  516. LIBYUV_LIB="-L${path_yuv}/lib"
  517. fi
  518. AC_LANG_PUSH([C++])
  519. CFLAGS_SAVED=$CFLAGS
  520. CPPFLAGS_SAVED=$CPPFLAGS
  521. CFLAGS="${CFLAGS} ${LIBYUV_INCLUDE}"
  522. CPPFLAGS="${CPPFLAGS} ${LIBYUV_INCLUDE}"
  523. # check for lib and headers
  524. AC_CHECK_HEADERS(libyuv/libyuv.h,
  525. AC_CHECK_LIB(yuv, I420Scale, AC_DEFINE_UNQUOTED(HAVE_LIBYUV, 1, HAVE_LIBYUV) [have_yuv=yes] AC_SUBST(LIBYUV_LIBADD, "-lyuv"),
  526. AC_DEFINE_UNQUOTED(HAVE_LIBYUV, 0, HAVE_LIBYUV) [have_yuv=no]
  527. ))
  528. test $have_yuv = yes && LIBYUV_LIB="${LIBYUV_LIB}"
  529. # if opus not found and requested then, die.
  530. test $have_yuv:$want_yuv = no:yes &&
  531. AC_MSG_ERROR([You requested LIBYUV but not found...die])
  532. CFLAGS=$CFLAGS_SAVED
  533. CPPFLAGS=$CPPFLAGS_SAVED
  534. AC_LANG_POP([C++])
  535. fi
  536. AM_CONDITIONAL([USE_YUV], [test $have_yuv = yes])
  537. ########################################################
  538. # JPEG
  539. # --with-jpeg / --without-jpeg as argument to configure
  540. ########################################################
  541. have_jpeg=no
  542. want_jpeg=check
  543. path_jpeg=undef
  544. AC_SUBST(LIBJPEG_LIBADD, "")
  545. AC_ARG_WITH(jpeg,
  546. [ --with-jpeg=PATH Build with JPEG compression (requires libjpeg[-turbo] library). PATH is optional.],
  547. if test "x$withval" = "xyes"; then
  548. want_jpeg=yes
  549. path_jpeg=undef
  550. elif test "x$withval" = "xno"; then
  551. want_jpeg=no
  552. path_jpeg=undef
  553. elif test "$withval"; then
  554. want_jpeg=yes
  555. path_jpeg=$withval
  556. fi,
  557. )
  558. # only if --without-jpeg not used
  559. if test $want_jpeg != no; then
  560. # check for lib and headers
  561. AC_CHECK_HEADERS(jpeglib.h jerror.h,
  562. AC_CHECK_LIB(jpeg, jpeg_CreateDecompress, [have_jpeg=yes] LIBJPEG_LIBADD="-ljpeg", [have_jpeg=no]
  563. ))
  564. # if jpeg not found and requested then, die.
  565. test $have_jpeg:$want_jpeg = no:yes &&
  566. AC_MSG_ERROR([You requested JPEG library but not found...die])
  567. # define HAVE_LIBJPEG 1
  568. test $have_jpeg:$enable_nonfree = yes:yes &&
  569. AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, HAVE_LIBJPEG)
  570. fi
  571. AM_CONDITIONAL([USE_JPEG], [test $have_jpeg:$enable_nonfree = yes:yes])
  572. ########################################################
  573. # AMR
  574. # --with-amr / --without-amr as argument to configure
  575. ########################################################
  576. have_amr=no
  577. want_amr=check
  578. path_amr=undef
  579. AC_SUBST(LIBAMR_LIBADD, "")
  580. AC_ARG_WITH(amr,
  581. [ --with-amr=PATH Build with AMR audio codec (requires opencore-amr library). PATH is optional.],
  582. if test "x$withval" = "xyes"; then
  583. want_amr=yes
  584. path_amr=undef
  585. elif test "x$withval" = "xno"; then
  586. want_amr=no
  587. path_amr=undef
  588. elif test "$withval"; then
  589. want_amr=yes
  590. path_amr=$withval
  591. fi,
  592. )
  593. # only if --without-amr not used
  594. if test $want_amr != no; then
  595. # check for lib and headers
  596. AC_CHECK_HEADERS(opencore-amrnb/interf_dec.h opencore-amrnb/interf_enc.h,
  597. AC_CHECK_LIB(opencore-amrnb, Encoder_Interface_init, [have_amr=yes] LIBAMR_LIBADD="-lopencore-amrnb", [have_amr=no]
  598. ))
  599. # if amr not found and requested then, die.
  600. test $have_amr:$want_amr = no:yes &&
  601. AC_MSG_ERROR([You requested AMR audio codec but not found...die])
  602. # define HAVE_OPENCORE_AMR 1
  603. test $have_amr:$enable_nonfree = yes:yes &&
  604. AC_DEFINE_UNQUOTED(HAVE_OPENCORE_AMR, 1, HAVE_OPENCORE_AMR)
  605. fi
  606. AM_CONDITIONAL([USE_AMR], [test $have_amr:$enable_nonfree = yes:yes])
  607. ########################################################
  608. # OPUS
  609. # --with-opus / --without-opus as argument to configure
  610. ########################################################
  611. have_opus=no
  612. want_opus=check
  613. path_opus=undef
  614. AC_SUBST(LIBOPUS_LIBADD, "")
  615. AC_ARG_WITH(opus,
  616. [ --with-opus=PATH Build with OPUS audio codec. PATH is optional.],
  617. if test "x$withval" = "xyes"; then
  618. want_opus=yes
  619. path_opus=undef
  620. elif test "x$withval" = "xno"; then
  621. want_opus=no
  622. path_opus=undef
  623. elif test "$withval"; then
  624. want_opus=yes
  625. path_opus=$withval
  626. fi,
  627. )
  628. # only if --without-opus not used
  629. if test $want_opus != no; then
  630. # check for lib and headers
  631. AC_CHECK_HEADERS(opus/opus.h,
  632. AC_CHECK_LIB(opus, opus_decoder_create, AC_DEFINE_UNQUOTED(HAVE_LIBOPUS, 1, HAVE_LIBOPUS) [have_opus=yes] LIBOPUS_LIBADD="-lopus",
  633. AC_DEFINE_UNQUOTED(HAVE_LIBOPUS, 0, HAVE_LIBOPUS) [have_opus=no]
  634. ))
  635. # if opus not found and requested then, die.
  636. test $have_opus:$want_opus = no:yes &&
  637. AC_MSG_ERROR([You requested OPUS audio codec but not found...die])
  638. fi
  639. AM_CONDITIONAL([USE_OPUS], [test $have_opus = yes])
  640. ########################################################
  641. # SPEEX
  642. # --with-speex / --without-speex as argument to configure
  643. ########################################################
  644. have_speex=no
  645. want_speex=check
  646. path_speex=undef
  647. AC_SUBST(LIBSPEEX_LIBADD, "")
  648. AC_ARG_WITH(speex,
  649. [ --with-speex=PATH Build with SPEEX audio codec. PATH is optional.],
  650. if test "x$withval" = "xyes"; then
  651. want_speex=yes
  652. path_speex=undef
  653. elif test "x$withval" = "xno"; then
  654. want_speex=no
  655. path_speex=undef
  656. elif test "$withval"; then
  657. want_speex=yes
  658. path_speex=$withval
  659. fi,
  660. )
  661. # only if --without-speex not used
  662. if test $want_speex != no; then
  663. # check lib and headers
  664. AC_CHECK_HEADERS(speex/speex.h,
  665. AC_CHECK_LIB(speex, speex_decode_int, AC_DEFINE_UNQUOTED(HAVE_LIB_SPEEX, 1, HAVE_LIB_SPEEX) [have_speex=yes] LIBSPEEX_LIBADD="-lspeex",
  666. AC_DEFINE_UNQUOTED(HAVE_LIB_SPEEX, 0, HAVE_LIB_SPEEX) [have_speex=no]
  667. ))
  668. # if speex not found and requested then, die.
  669. test $have_speex:$want_speex = no:yes &&
  670. AC_MSG_ERROR([You requested SPEEX audio codec but not found...die])
  671. fi
  672. AM_CONDITIONAL([USE_SPEEX], [test $have_speex = yes])
  673. ########################################################
  674. # SPEEXDSP
  675. # --with-speexdsp / --without-speexdsp as argument to configure
  676. ########################################################
  677. have_speexdsp=no
  678. want_speexdsp=check
  679. path_speexdsp=undef
  680. AC_SUBST(LIBSPEEXDSP_LIBADD, "")
  681. AC_ARG_WITH(speexdsp,
  682. [ --with-speexdsp=PATH Build with SPEEX DSP (audio resampler, jitter buffer...). PATH is optional.],
  683. if test "x$withval" = "xyes"; then
  684. want_speexdsp=yes
  685. path_speexdsp=undef
  686. elif test "x$withval" = "xno"; then
  687. want_speexdsp=no
  688. path_speexdsp=undef
  689. elif test "$withval"; then
  690. want_speexdsp=yes
  691. path_speexdsp=$withval
  692. fi,
  693. )
  694. # only if --without-speexdsp not used
  695. if test $want_speexdsp != no; then
  696. # check main lib
  697. AC_CHECK_HEADERS(speex/speex_preprocess.h,
  698. AC_CHECK_LIB(speexdsp, speex_preprocess_state_init, AC_DEFINE_UNQUOTED(HAVE_SPEEX_DSP, 1, HAVE_SPEEX_DSP) [have_speexdsp=yes] LIBSPEEXDSP_LIBADD="-lspeexdsp",
  699. AC_DEFINE_UNQUOTED(HAVE_SPEEX_DSP, 0, HAVE_SPEEX_DSP) [have_speexdsp=no])
  700. )
  701. # check for jitter buffer
  702. AC_CHECK_HEADERS(speex/speex_jitter.h,
  703. AC_CHECK_LIB(speexdsp, jitter_buffer_init, AC_DEFINE_UNQUOTED(HAVE_SPEEX_JB, 1, HAVE_SPEEX_JB),
  704. AC_DEFINE_UNQUOTED(HAVE_SPEEX_JB, 0, HAVE_SPEEX_JB))
  705. )
  706. # check for resampler
  707. AC_CHECK_HEADERS(speex/speex_resampler.h,
  708. AC_CHECK_LIB(speexdsp, speex_resampler_init, AC_DEFINE_UNQUOTED(HAVE_SPEEX_RESAMPLER, 1, HAVE_SPEEX_RESAMPLER),
  709. AC_DEFINE_UNQUOTED(HAVE_SPEEX_RESAMPLER, 0, HAVE_SPEEX_RESAMPLER))
  710. )
  711. # check for denoiser and echo canceler
  712. AC_CHECK_HEADERS(speex/speex_echo.h,
  713. AC_CHECK_LIB(speexdsp, speex_echo_playback, AC_DEFINE_UNQUOTED(HAVE_SPEEX_DENOISE, 1, HAVE_SPEEX_DENOISE),
  714. AC_DEFINE_UNQUOTED(HAVE_SPEEX_DENOISE, 0, HAVE_SPEEX_DENOISE))
  715. )
  716. # if speex not found and requested then, die.
  717. test $have_speexdsp:$want_speexdsp = no:yes &&
  718. AC_MSG_ERROR([You requested SPEEX DSP but not found...die])
  719. fi
  720. AM_CONDITIONAL([USE_SPEEXDSP], [test $have_speexdsp = yes])
  721. # Deprecated options: to be removed
  722. AC_ARG_ENABLE(speexresampler, [ --enable-speexresampler IMPORTANT: deprecated to be removed], , )
  723. AC_ARG_ENABLE(speexdenoiser, [ --enable-speexdenoiser IMPORTANT: deprecated to be removed], , )
  724. AC_ARG_ENABLE(speexjb, [ --enable-speexjb IMPORTANT: deprecated to be removed], , )
  725. ########################################################
  726. # GSM
  727. # --with-gsm / --without-gsm as argument to configure
  728. ########################################################
  729. have_gsm=no
  730. want_gsm=check
  731. path_gsm=undef
  732. AC_SUBST(LIBGSM_LIBADD, "")
  733. AC_ARG_WITH(gsm,
  734. [ --with-gsm=PATH Build with GSM audio codec. PATH is optional.],
  735. if test "x$withval" = "xyes"; then
  736. want_gsm=yes
  737. path_gsm=undef
  738. elif test "x$withval" = "xno"; then
  739. want_gsm=no
  740. path_gsm=undef
  741. elif test "$withval"; then
  742. want_gsm=yes
  743. path_gsm=$withval
  744. fi,
  745. )
  746. # only if --without-gsm not used
  747. if test $want_gsm != no; then
  748. # check lib and headers
  749. AC_CHECK_HEADERS(gsm.h,
  750. AC_CHECK_LIB(gsm, gsm_create, AC_DEFINE_UNQUOTED(HAVE_LIBGSM, 1, HAVE_LIBGSM) [have_gsm=yes] LIBGSM_LIBADD="-lgsm",
  751. AC_DEFINE_UNQUOTED(HAVE_LIBGSM, 0, HAVE_LIBGSM) [have_gsm=no]
  752. ))
  753. # if gsm not found and requested then, die.
  754. test $have_gsm:$want_gsm = no:yes &&
  755. AC_MSG_ERROR([You requested GSM audio codec but not found...die])
  756. fi
  757. AM_CONDITIONAL([USE_GSM], [test $have_gsm = yes])
  758. ########################################################
  759. # G729
  760. # --with-g729 / --without-g729 as argument to configure
  761. ########################################################
  762. have_g729=no
  763. want_g729=check
  764. path_g729=undef
  765. AC_SUBST(LIBG729_LIBADD, "")
  766. AC_ARG_WITH(g729,
  767. [ --with-g729=PATH Build with G.729 audio codec. PATH is optional.],
  768. if test "x$withval" = "xyes"; then
  769. want_g729=yes
  770. path_g729=undef
  771. elif test "x$withval" = "xno"; then
  772. want_g729=no
  773. path_g729=undef
  774. elif test "$withval"; then
  775. want_g729=yes
  776. path_g729=$withval
  777. fi,
  778. )
  779. # only if --without-g729 not used
  780. if test $want_g729 != no; then
  781. # check lib and headers
  782. AC_CHECK_HEADERS(g729b/typedef.h g729b/ld8a.h,
  783. AC_CHECK_LIB(g729b, Init_Decod_ld8a, [have_g729=yes] LIBG729_LIBADD="-lg729b",
  784. [have_g729=no]), [],
  785. [[#ifdef HAVE_G729B_TYPEDEF_H
  786. # include <g729b/typedef.h>
  787. #endif
  788. ]])
  789. # if g729 not found and requested then, die.
  790. test $have_g729:$want_g729 = no:yes &&
  791. AC_MSG_ERROR([You requested G729 audio codec but not found...die])
  792. #define HAVE_G729 1
  793. test $have_g729:$enable_nonfree = yes:yes &&
  794. AC_DEFINE_UNQUOTED(HAVE_G729, 1, HAVE_G729)
  795. fi
  796. AM_CONDITIONAL([USE_G729], [test $have_g729:$enable_nonfree = yes:yes])
  797. ########################################################
  798. # ILBC
  799. # --with-ilbc / --without-ilbc as argument to configure
  800. ########################################################
  801. have_ilbc=no
  802. want_ilbc=check
  803. path_ilbc=undef
  804. AC_SUBST(LIBILBC_LIBADD, "")
  805. AC_ARG_WITH(ilbc,
  806. [ --with-ilbc=PATH Build with ILBC audio codec. PATH is optional.],
  807. if test "x$withval" = "xyes"; then
  808. want_ilbc=yes
  809. path_ilbc=undef
  810. elif test "x$withval" = "xno"; then
  811. want_ilbc=no
  812. path_ilbc=undef
  813. elif test "$withval"; then
  814. want_ilbc=yes
  815. path_ilbc=$withval
  816. fi,
  817. )
  818. # only if --without-ilbc not used
  819. if test $want_ilbc != no; then
  820. # check lib and headers
  821. AC_CHECK_HEADERS(ilbc/iLBC_define.h ilbc/iLBC_encode.h ilbc/iLBC_decode.h,
  822. AC_CHECK_LIB(iLBC, initDecode, AC_DEFINE_UNQUOTED(HAVE_ILBC, 1, HAVE_ILBC) [have_ilbc=yes] LIBILBC_LIBADD="-liLBC",
  823. AC_DEFINE_UNQUOTED(HAVE_ILBC, 0, HAVE_ILBC) [have_ilbc=no], [-lm]
  824. ))
  825. # if gsm not found and requested then, die.
  826. test $have_ilbc:$want_ilbc = no:yes &&
  827. AC_MSG_ERROR([You requested ILBC audio codec but not found...die])
  828. fi
  829. AM_CONDITIONAL([USE_ILBC], [test $have_ilbc = yes])
  830. ########################################################
  831. # WEBRTC
  832. # --with-webrtc / --without-webrtc as argument to configure
  833. ########################################################
  834. have_webrtc=no
  835. want_webrtc=check
  836. path_webrtc=undef
  837. AC_SUBST(LIBWEBRTC_LIBADD, "")
  838. AC_ARG_WITH(webrtc,
  839. [ --with-webrtc=PATH Build with WebRTC audio processing features (AEC, VAD, Noise supp...). PATH is optional.],
  840. if test "x$withval" = "xyes"; then
  841. want_webrtc=yes
  842. path_webrtc=undef
  843. elif test "x$withval" = "xno"; then
  844. want_webrtc=no
  845. path_webrtc=undef
  846. elif test "$withval"; then
  847. want_webrtc=yes
  848. path_webrtc=$withval
  849. fi,
  850. )
  851. # only if --without-webrtc not used
  852. if test $want_webrtc != no; then
  853. # WebRTC AEC
  854. have_webrtc_aec=no
  855. if test "$target_os" = "android"; then
  856. AC_CHECK_HEADERS(webrtc/echo_control_mobile.h,
  857. AC_CHECK_LIB(audio_processing, WebRtcAecm_Create, [have_webrtc_aec=yes], [], [-lsystem_wrappers -lcommon_audio])
  858. )
  859. else
  860. AC_CHECK_HEADERS(webrtc/echo_cancellation.h,
  861. AC_CHECK_LIB(audio_processing, WebRtcAec_Create, [have_webrtc_aec=yes], [], [-lsystem_wrappers -lcommon_audio])
  862. )
  863. fi
  864. # WebRTC NS
  865. have_webrtc_ns=no
  866. if test "$target_os" = "android"; then
  867. AC_CHECK_HEADERS(webrtc/noise_suppression_x.h,
  868. AC_CHECK_LIB(audio_processing, WebRtcNsx_Process, [have_webrtc_ns=yes] [], [], [-lsystem_wrappers -lcommon_audio])
  869. )
  870. else
  871. AC_CHECK_HEADERS(webrtc/noise_suppression.h,
  872. AC_CHECK_LIB(audio_processing, WebRtcNs_Process, [have_webrtc_ns=yes] [], [], [-lsystem_wrappers -lcommon_audio])
  873. )
  874. fi
  875. if test $have_webrtc_aec:$have_webrtc_ns = yes:yes; then
  876. have_webrtc=yes
  877. AC_DEFINE_UNQUOTED(HAVE_WEBRTC, 1, HAVE_WEBRTC)
  878. AC_DEFINE_UNQUOTED(HAVE_WEBRTC_DENOISE, 1, HAVE_WEBRTC_DENOISE)
  879. LIBWEBRTC_LIBADD="-laudio_processing -lcommon_audio -lsystem_wrappers"
  880. fi
  881. test $have_webrtc:$want_webrtc = no:yes &&
  882. AC_MSG_ERROR([You requested WebRTC (audio processing features) but not found...die])
  883. fi
  884. AM_CONDITIONAL([USE_WEBRTC], [test $have_webrtc = yes])
  885. AC_CONFIG_FILES(
  886. Makefile
  887. doubango.pc
  888. tinySAK/Makefile
  889. tinySAK/tinySAK.pc
  890. tinyNET/Makefile
  891. tinyNET/tinyNET.pc
  892. tinyHTTP/Makefile
  893. tinyHTTP/tinyHTTP.pc
  894. tinyXCAP/Makefile
  895. tinyXCAP/tinyXCAP.pc
  896. tinyIPSec/Makefile
  897. tinyIPSec/tinyIPSec.pc
  898. tinySMS/Makefile
  899. tinySMS/tinySMS.pc
  900. tinySIGCOMP/Makefile
  901. tinySIGCOMP/tinySIGCOMP.pc
  902. tinySDP/Makefile
  903. tinySDP/tinySDP.pc
  904. tinyBFCP/Makefile
  905. tinyBFCP/tinyBFCP.pc
  906. tinyRTP/Makefile
  907. tinyRTP/tinyRTP.pc
  908. tinyMSRP/Makefile
  909. tinyMSRP/tinyMSRP.pc
  910. tinyMEDIA/Makefile
  911. tinyMEDIA/tinyMEDIA.pc
  912. tinyDAV/Makefile
  913. tinyDAV/tinyDAV.pc
  914. tinySIP/Makefile
  915. tinySIP/tinySIP.pc
  916. bindings/Makefile
  917. bindings/tinyWRAP.pc
  918. plugins/audio_opensles/Makefile
  919. plugins/audio_opensles/plugin_audio_opensles.pc
  920. )
  921. AC_OUTPUT
  922. AC_MSG_NOTICE([
  923. **************************************************************************
  924. * CONGRATULATIONS
  925. **************************************************************************
  926. Cross Compilation: ${cross_compiling}
  927. Target OS: ${target_os}
  928. Host setup: ${host}
  929. Install prefix: ${prefix}
  930. Compiler: ${CC}
  931. Build Type: ${build_type}
  932. Enable GPL: $enable_gpl
  933. Enable Non Free: $enable_nonfree
  934. FFmpeg: $have_ffmpeg
  935. VP8 video codec: $have_vpx
  936. OpenH264 video codec: $have_openh264
  937. OPUS audio codec: $have_opus
  938. ILBC audio codec: $have_ilbc
  939. G.729 audio codec: $have_g729 -> $enable_nonfree
  940. GSM audio codec: $have_gsm
  941. AMR audio codec: $have_amr -> $enable_nonfree
  942. SPEEX audio codec: $have_speex
  943. G.722 audio codec: yes
  944. G.711 audio codec: yes
  945. YUV: $have_yuv
  946. JPEG: $have_jpeg
  947. SPEEX DSP: $have_speexdsp
  948. SSL: $have_ssl
  949. DTLS-SRTP: $have_dtls_srtp
  950. DTLS: $have_dtls
  951. SRTP: $have_srtp
  952. WebRTC: Enabled($have_webrtc): AEC($have_webrtc_aec), NS($have_webrtc_ns)
  953. Monotonic timers: $have_rt
  954. RESOLV: $have_resolv
  955. ALSA (audio): $have_alsa
  956. OSS (audio): $have_oss
  957. V4L2 (video): $have_v4l2
  958. DEBUG: $enable_debug
  959. DEBUG_LEVEL: $debug_level
  960. Report any issue at https://groups.google.com/group/doubango
  961. ])
  962. if test "$target_os" = "android"; then
  963. AC_MSG_NOTICE([
  964. --------------------------------------------------------------------------
  965. - ANDRDOID
  966. --------------------------------------------------------------------------
  967. CPU: ${android_cpu}
  968. ])
  969. fi