1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716 |
- AC_INIT([pjproject],[2.x])
- host_orig="$host"
- AC_CANONICAL_BUILD
- AC_CANONICAL_HOST
- AC_CANONICAL_TARGET
- AC_CONFIG_HEADERS([pjlib/include/pj/compat/os_auto.h
- pjlib/include/pj/compat/m_auto.h
- pjmedia/include/pjmedia/config_auto.h
- pjmedia/include/pjmedia-codec/config_auto.h
- pjsip/include/pjsip/sip_autoconf.h
- ])
- AC_CONFIG_FILES([build.mak
- build/os-auto.mak
- build/cc-auto.mak
- pjlib/build/os-auto.mak
- pjlib-util/build/os-auto.mak
- pjmedia/build/os-auto.mak
- pjsip/build/os-auto.mak
- third_party/build/os-auto.mak
- ])
- dnl
- dnl Setup default CFLAGS
- dnl
- if test "$CFLAGS" = ""; then
- CFLAGS="-O2"
- fi
- dnl
- dnl
- dnl
- AC_PROG_CC
- AC_PROG_CXX
- AC_LANG([C])
- dnl Make sure C++ compiler works
- AC_LANG_PUSH([C++])
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[AC_MSG_ERROR(C++ compiler does not work)])
- AC_LANG_POP([C++])
- AC_PROG_RANLIB
- AC_CHECK_TOOLS([AR], [ar gar], :)
- if test "$AR_FLAGS" = ""; then AR_FLAGS="rv"; fi
- AC_SUBST(AR_FLAGS)
- if test "$LD" = ""; then LD="$CXX"; fi
- AC_SUBST(LD)
- if test "$LDOUT" = ""; then LDOUT="-o "; fi
- AC_SUBST(LDOUT)
- if test "$OBJEXT" = ""; then OBJEXT='o'; fi
- AC_SUBST(OBJEXT)
- if test "$LIBEXT" = ""; then LIBEXT='a'; fi
- AC_SUBST(LIBEXT)
- if test "$LIBEXT2" = ""; then LIBEXT2=""; fi
- AC_SUBST(LIBEXT2)
- if test "$CC_OUT" = ""; then CC_OUT="-c -o "; fi
- AC_SUBST(CC_OUT)
- if test "$CC_INC" = ""; then CC_INC="-I"; fi
- AC_SUBST(CC_INC)
- if test "$CC_DEF" = ""; then CC_DEF="-D"; fi
- AC_SUBST(CC_DEF)
- if test "$CC_OPTIMIZE" = ""; then CC_OPTIMIZE="-O2"; fi
- AC_SUBST(CC_OPTIMIZE)
- if test "$CC_CFLAGS" = ""; then CC_CFLAGS="-Wall"; fi
- AC_SUBST(CC_CFLAGS)
- AC_SUBST(ac_pjdir)
- AC_SUBST(ac_build_mak_vars)
- AC_SUBST(ac_cflags)
- case $host in
- *mingw* | *cygw* | *win32* | *w32* )
- if pwd -W 2&> /dev/null; then
- ac_pjdir=`pwd -W`
- else
-
- ac_pjdir=`pwd`
- fi
- ;;
- *)
- ac_pjdir=`pwd`
- ;;
- esac
- AC_SUBST(ac_shlib_suffix)
- case $target in
- *mingw* | *cygw* | *win32* | *w32* )
- ac_shlib_suffix=dll
- ;;
- *darwin*)
- ac_shlib_suffix=dylib
- ;;
- *)
- ac_shlib_suffix=so
- ;;
- esac
- AC_SUBST(ac_cross_compile)
- if test "$build" = "$host"; then
- ac_cross_compile=
- else
- ac_cross_compile=${host_orig}-
- fi
- AC_CHECK_LIB(pthread,pthread_create)
- AC_CHECK_LIB(wsock32,puts)
- AC_CHECK_LIB(ws2_32,puts)
- AC_CHECK_LIB(ole32,puts)
- AC_CHECK_LIB(winmm,puts)
- AC_CHECK_LIB(socket,puts)
- AC_CHECK_LIB(rt,puts)
- AC_CHECK_LIB(m,sin)
- dnl
- dnl libuuid
- dnl
- AC_ARG_ENABLE(libuuid,
- AS_HELP_STRING([--disable-libuuid],
- [Exclude libuuid(default: autodetect)]),
- [if test "$enable_libuuid" = "no"; then
- AC_MSG_RESULT([Checking if libuuid disabled... yes])
- ac_has_uuid_lib=0
- fi],
- [
- AC_CHECK_LIB(uuid,uuid_generate)
- AC_CHECK_LIB(uuid,uuid_generate,[ac_has_uuid_lib=1])
- ])
- AC_SEARCH_LIBS(gethostbyname,nsl)
- AC_MSG_RESULT([Setting PJ_M_NAME to $target_cpu])
- AC_DEFINE_UNQUOTED(PJ_M_NAME,["$target_cpu"])
- dnl
- dnl Memory alignment detection
- dnl
- AC_MSG_CHECKING([memory alignment])
- case $target in
- sparc64-* | ia64-* | x86_64-* | arm64-* | aarch64-* | mips64* )
- AC_DEFINE(PJ_POOL_ALIGNMENT, 8)
- AC_MSG_RESULT([8 bytes])
- ;;
- * )
- AC_DEFINE(PJ_POOL_ALIGNMENT, 4)
- AC_MSG_RESULT([4 bytes (default)])
- ;;
- esac
- dnl
- dnl Endianness detection
- dnl
- AC_C_BIGENDIAN
- if test "x$ac_cv_c_bigendian" = "xyes"; then
- CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0"
- ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0"
- else
- CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1"
- ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1"
- fi
- dnl
- dnl Legacy macros
- dnl
- AC_SUBST(ac_target_arch)
- AC_SUBST(ac_std_cpp_lib)
- case $target in
- *android*)
- AC_DEFINE(PJ_ANDROID,1)
- ac_target_arch=$TARGET_ABI
- ac_std_cpp_lib=$STD_CPP_LIB
- ;;
- *mingw* | *cygw* | *win32* | *w32* )
- AC_DEFINE(PJ_WIN32,1)
- AC_DEFINE(PJ_WIN32_WINNT,0x0400)
- AC_DEFINE(WIN32_LEAN_AND_MEAN)
- case $target in
- *_64-w64-mingw* )
- AC_DEFINE(PJ_WIN64,1)
- ;;
- esac
- ;;
- *darwin*)
- AC_DEFINE(PJ_DARWINOS,1)
- ac_target_arch=$ARCH_VAL
- ;;
- *linux*)
- AC_DEFINE(PJ_LINUX,1)
- ;;
- *bsd*)
- AC_DEFINE(PJ_BSD,1)
- ;;
- *rtems*)
- AC_DEFINE(PJ_RTEMS,1)
- ;;
- *sunos* | *solaris* )
- AC_DEFINE(PJ_SUNOS,1)
- ;;
- *)
- ;;
- esac
- dnl
- AC_ARG_ENABLE(floating-point,
- AS_HELP_STRING([--disable-floating-point],
- [Disable floating point where possible]),
- [if test "$enable_floating_point" = "no"; then
- AC_DEFINE(PJ_HAS_FLOATING_POINT,0)
- AC_MSG_RESULT([Checking if floating point is disabled... yes])
- fi],
- [
- AC_DEFINE(PJ_HAS_FLOATING_POINT,1)
- AC_MSG_RESULT([Checking if floating point is disabled... no])
- ])
- AC_CHECK_HEADER(arpa/inet.h,[AC_DEFINE(PJ_HAS_ARPA_INET_H,1)])
- AC_CHECK_HEADER(assert.h,[AC_DEFINE(PJ_HAS_ASSERT_H,1)])
- AC_CHECK_HEADER(ctype.h,[AC_DEFINE(PJ_HAS_CTYPE_H,1)])
- case $target in
- *mingw* | *cygw* | *win32* | *w32* )
- AC_DEFINE(PJ_HAS_ERRNO_H,0)
- ;;
- *)
- AC_CHECK_HEADER(errno.h,[AC_DEFINE(PJ_HAS_ERRNO_H,1)])
- ;;
- esac
- AC_CHECK_HEADER(fcntl.h,[AC_DEFINE(PJ_HAS_FCNTL_H,1)])
- AC_CHECK_HEADER(linux/socket.h,[AC_DEFINE(PJ_HAS_LINUX_SOCKET_H,1)])
- AC_CHECK_HEADER(limits.h,[AC_DEFINE(PJ_HAS_LIMITS_H,1)])
- AC_CHECK_HEADER(malloc.h,[AC_DEFINE(PJ_HAS_MALLOC_H,1)])
- AC_CHECK_HEADER(netdb.h,[AC_DEFINE(PJ_HAS_NETDB_H,1)])
- AC_CHECK_HEADER(netinet/in_systm.h,[AC_DEFINE(PJ_HAS_NETINET_IN_SYSTM_H,1)])
- AC_CHECK_HEADER(netinet/in.h,[AC_DEFINE(PJ_HAS_NETINET_IN_H,1)])
- AC_CHECK_HEADER(netinet/ip.h,[AC_DEFINE(PJ_HAS_NETINET_IP_H,1)],[],
- [
-
-
-
-
-
-
-
-
- ])
- AC_CHECK_HEADER(netinet/tcp.h,[AC_DEFINE(PJ_HAS_NETINET_TCP_H,1)])
- AC_CHECK_HEADER(ifaddrs.h,
- [AC_CHECK_FUNC(getifaddrs,[AC_DEFINE(PJ_HAS_IFADDRS_H,1)])])
- AC_CHECK_HEADER(semaphore.h,[AC_DEFINE(PJ_HAS_SEMAPHORE_H,1)])
- AC_CHECK_HEADER(setjmp.h,[AC_DEFINE(PJ_HAS_SETJMP_H,1)])
- AC_CHECK_HEADER(stdarg.h,[AC_DEFINE(PJ_HAS_STDARG_H,1)])
- AC_CHECK_HEADER(stddef.h,[AC_DEFINE(PJ_HAS_STDDEF_H,1)])
- AC_CHECK_HEADER(stdio.h,[AC_DEFINE(PJ_HAS_STDIO_H,1)])
- AC_CHECK_HEADER(stdint.h,[AC_DEFINE(PJ_HAS_STDINT_H,1)])
- AC_CHECK_HEADER(stdlib.h,[AC_DEFINE(PJ_HAS_STDLIB_H,1)])
- AC_CHECK_HEADER(string.h,[AC_DEFINE(PJ_HAS_STRING_H,1)])
- AC_CHECK_HEADER(inttypes.h,[AC_DEFINE(PJ_HAS_INTTYPES_H,1)])
- AC_CHECK_HEADER(sys/ioctl.h,[AC_DEFINE(PJ_HAS_SYS_IOCTL_H,1)])
- AC_CHECK_HEADER(sys/select.h,[AC_DEFINE(PJ_HAS_SYS_SELECT_H,1)])
- AC_CHECK_HEADER(sys/socket.h,[AC_DEFINE(PJ_HAS_SYS_SOCKET_H,1)])
- AC_CHECK_HEADER(sys/time.h,[AC_DEFINE(PJ_HAS_SYS_TIME_H,1)])
- AC_CHECK_HEADER(sys/timeb.h,[AC_DEFINE(PJ_HAS_SYS_TIMEB_H,1)])
- AC_CHECK_HEADER(sys/types.h,[AC_DEFINE(PJ_HAS_SYS_TYPES_H,1)])
- AC_CHECK_HEADER(sys/filio.h,[AC_DEFINE(PJ_HAS_SYS_FILIO_H,1)])
- AC_CHECK_HEADER(sys/sockio.h,[AC_DEFINE(PJ_HAS_SYS_SOCKIO_H,1)])
- AC_CHECK_HEADER(sys/utsname.h,[AC_DEFINE(PJ_HAS_SYS_UTSNAME_H,1)])
- AC_CHECK_HEADER(time.h,[AC_DEFINE(PJ_HAS_TIME_H,1)])
- AC_CHECK_HEADER(unistd.h,[AC_DEFINE(PJ_HAS_UNISTD_H,1)])
- AC_CHECK_HEADER(execinfo.h,[AC_DEFINE(PJ_HAS_EXECINFO_H,1)])
- AC_CHECK_HEADER(winsock.h,[AC_DEFINE(PJ_HAS_WINSOCK_H,1)])
- AC_CHECK_HEADER(winsock2.h,[AC_DEFINE(PJ_HAS_WINSOCK2_H,1)])
- AC_CHECK_HEADER(mswsock.h,[AC_DEFINE(PJ_HAS_MSWSOCK_H,1)],[],
- [
-
-
-
-
- ])
- AC_CHECK_HEADER(ws2tcpip.h,[AC_DEFINE(PJ_HAS_WS2TCPIP_H,1)])
- AC_CHECK_HEADER(uuid/uuid.h,[ac_has_uuid_h=1])
- AC_CHECK_HEADER(net/if.h,[AC_DEFINE(PJ_HAS_NET_IF_H,1)],[],
- [
-
-
-
-
-
- ])
- case $target in
- *android*)
- AC_CHECK_HEADER(linux/android_alarm.h,[AC_DEFINE(PJ_HAS_ANDROID_ALARM_H,1)])
- ;;
- esac
- AC_CHECK_FUNC(localtime_r,[AC_DEFINE(PJ_HAS_LOCALTIME_R,1)])
- AC_MSG_RESULT([Setting PJ_OS_NAME to $target])
- AC_DEFINE_UNQUOTED(PJ_OS_NAME,["$target"])
- AC_MSG_RESULT([Setting PJ_HAS_ERRNO_VAR to 1])
- AC_DEFINE(PJ_HAS_ERRNO_VAR,1)
- AC_MSG_RESULT([Setting PJ_HAS_HIGH_RES_TIMER to 1])
- AC_DEFINE(PJ_HAS_HIGH_RES_TIMER,1)
- AC_MSG_RESULT([Setting PJ_HAS_MALLOC to 1])
- AC_DEFINE(PJ_HAS_MALLOC,1)
- AC_MSG_RESULT([Setting PJ_NATIVE_STRING_IS_UNICODE to 0])
- AC_DEFINE(PJ_NATIVE_STRING_IS_UNICODE,0)
- AC_MSG_RESULT([Setting PJ_ATOMIC_VALUE_TYPE to long])
- AC_DEFINE(PJ_ATOMIC_VALUE_TYPE,long)
- dnl
- AC_MSG_CHECKING([if inet_aton() is available])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-
-
- [inet_aton(0, 0);])],
- [AC_DEFINE(PJ_SOCK_HAS_INET_ATON,1)
- AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)])
- dnl
- AC_MSG_CHECKING([if inet_pton() is available])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-
-
- [inet_pton(0, 0, 0);])],
- [AC_DEFINE(PJ_SOCK_HAS_INET_PTON,1)
- AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)])
- dnl
- AC_MSG_CHECKING([if inet_ntop() is available])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-
-
- [inet_ntop(0, 0, 0, 0);])],
- [AC_DEFINE(PJ_SOCK_HAS_INET_NTOP,1)
- AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)])
- dnl
- AC_MSG_CHECKING([if getaddrinfo() is available])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-
-
- [getaddrinfo(0, 0, 0, 0);])],
- [AC_DEFINE(PJ_SOCK_HAS_GETADDRINFO,1)
- AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)])
- dnl
- AC_MSG_CHECKING([if socketpair() is available])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-
- [socketpair(0, 0, 0, 0);])],
- [AC_DEFINE(PJ_SOCK_HAS_SOCKETPAIR,1)
- AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)])
- dnl
- AC_MSG_CHECKING([if sockaddr_in has sin_len member])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-
-
-
- [struct sockaddr_in a; a.sin_len=0;])],
- [AC_DEFINE(PJ_SOCKADDR_HAS_LEN,1)
- AC_MSG_RESULT(yes)],
- AC_MSG_RESULT(no))
- dnl
- AC_MSG_CHECKING([if socklen_t is available])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-
- [socklen_t xxx = 0;])],
- [AC_DEFINE(PJ_HAS_SOCKLEN_T,1)
- AC_MSG_RESULT(yes)],
- AC_MSG_RESULT(no))
- dnl
- AC_MSG_CHECKING([if IPV6_V6ONLY is available])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-
- [int opt = IPV6_V6ONLY;])],
- [AC_DEFINE(PJ_SOCK_HAS_IPV6_V6ONLY,1)
- AC_MSG_RESULT(yes)],
- AC_MSG_RESULT(no))
- dnl
- AC_MSG_CHECKING([if SO_ERROR is available])
- case $target in
- *mingw* | *cygw* | *win32* | *w32* )
- AC_DEFINE(PJ_HAS_SO_ERROR,1)
- AC_MSG_RESULT(yes)
- ;;
- *)
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-
-
-
- [int i=SO_ERROR;])],
- [AC_DEFINE(PJ_HAS_SO_ERROR,1)
- AC_MSG_RESULT(yes)],
- AC_MSG_RESULT(no))
- ;;
- esac
- dnl
- AC_MSG_CHECKING([if pthread_rwlock_t is available])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
- [pthread_rwlock_t *x;])],
- [AC_DEFINE(PJ_EMULATE_RWMUTEX,0)
- ac_rwmutex="yes"
- AC_MSG_RESULT(yes)],
- [AC_DEFINE(PJ_EMULATE_RWMUTEX,1)
- ac_rwmutex="no"
- AC_MSG_RESULT(no)])
- dnl
- dnl
- if test "$ac_rwmutex" = "no"; then
- AC_MSG_CHECKING([if pthread_rwlock_t is available with _POSIX_READER_WRITER_LOCKS])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-
- [pthread_rwlock_t *x;])],
- [AC_DEFINE(PJ_EMULATE_RWMUTEX,0)
- CFLAGS="$CFLAGS -D_POSIX_THREADS -D_POSIX_READER_WRITER_LOCKS"
- AC_MSG_RESULT(yes)],
- [AC_DEFINE(PJ_EMULATE_RWMUTEX,1)
- AC_MSG_RESULT(no)])
- fi
- dnl
- AC_MSG_CHECKING([if pthread_mutexattr_settype() is available])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
- [pthread_mutexattr_settype(0,PTHREAD_MUTEX_FAST_NP);])],
- [AC_DEFINE(PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE,1)
- AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)])
- dnl
- AC_MSG_CHECKING([if pthread_mutexattr_t has recursive member])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
- [[pthread_mutexattr_t attr;
- attr.recursive=1;]])],
- [AC_DEFINE(PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE,1)
- AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)])
- dnl
- dnl
- dnl
- AC_SUBST(ac_os_objs)
- AC_SUBST(ac_linux_poll)
- AC_MSG_CHECKING([ioqueue backend])
- ac_os_objs=ioqueue_select.o
- ac_linux_poll=select
- case $target in
- *darwin* | *bsd*)
- AC_ARG_ENABLE(kqueue,
- AS_HELP_STRING([--enable-kqueue],
- [Use kqueue ioqueue on macos/BSD (experimental)]),
- [
- if test "$enable_kqueue" = "yes"; then
- ac_os_objs=ioqueue_kqueue.o
- AC_MSG_RESULT([kqueue()])
- else
- AC_MSG_RESULT([select()])
- fi
- ],
- [
- AC_MSG_RESULT([select()])
- ])
- ;;
- *)
- AC_ARG_ENABLE(epoll,
- AS_HELP_STRING([--enable-epoll],
- [Use /dev/epoll ioqueue on Linux (experimental)]),
- [
- if test "$enable_epoll" = "yes"; then
- ac_os_objs=ioqueue_epoll.o
- AC_MSG_RESULT([/dev/epoll])
- AC_DEFINE(PJ_HAS_LINUX_EPOLL,1)
- ac_linux_poll=epoll
- else
- AC_MSG_RESULT([select()])
- fi
- ],
- [
- AC_MSG_RESULT([select()])
- ])
- ;;
- esac
- AC_SUBST(ac_shared_libraries)
- AC_ARG_ENABLE(shared,
- AS_HELP_STRING([--enable-shared],
- [Build shared libraries]),
- [if test "$enable_shared" = "yes"; then
- [ac_shared_libraries=1]
- CFLAGS="$CFLAGS -fPIC"
- AC_MSG_RESULT([Building shared libraries... yes])
- fi],
- AC_MSG_RESULT([Building shared libraries... no])
- )
- AC_SUBST(ac_no_pjsua2)
- AC_ARG_ENABLE(pjsua2,
- AS_HELP_STRING([--disable-pjsua2],
- [Exclude pjsua2 library and application from the build]),
- [if test "$enable_pjsua2" = "no"; then
- [ac_no_pjsua2=1]
- AC_MSG_RESULT([Building pjsua2 library and application... no])
- fi],
- AC_MSG_RESULT([Building pjsua2 library and application... yes])
- )
- dnl
- dnl
- dnl
- case $target in
- *mingw* | *cygw* | *win32* | *w32* )
- 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 sock_qos_bsd.o unicode_win32.o"
- ;;
- *)
- 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"
- case $target in
- *-apple-darwin_ios*)
- ac_os_objs="$ac_os_objs os_info_iphone.o os_core_darwin.o"
- ;;
- *darwin*)
- ac_os_objs="$ac_os_objs os_core_darwin.o"
- ;;
- esac
-
- case $target in
- *darwin*)
- ac_os_objs="$ac_os_objs sock_qos_darwin.o sock_qos_bsd.o"
- ;;
- *)
- ac_os_objs="$ac_os_objs sock_qos_bsd.o"
- ;;
- esac
-
- case $target in
- *darwin*)
- ac_os_objs="$ac_os_objs ssl_sock_apple.o"
- ;;
- esac
-
- case $target in
- *android*)
- ac_os_objs="$ac_os_objs guid_android.o"
- ;;
- *darwin*)
- ac_os_objs="$ac_os_objs guid_darwin.o"
- ;;
- *bsd*)
- ac_os_objs="$ac_os_objs guid_bsd.o"
- ;;
- *)
- if test "$ac_has_uuid_lib" = "1" -a "$ac_has_uuid_h" = "1"; then
- ac_os_objs="$ac_os_objs guid_uuid.o"
- else
- ac_os_objs="$ac_os_objs guid_simple.o"
- fi
- ;;
- esac
- ;;
- esac
- dnl
- dnl
- dnl
- dnl
- AC_ARG_WITH(upnp,
- AS_HELP_STRING([--with-upnp=DIR],
- [Specify alternate libupnp prefix]),
- [],
- [with_upnp=no]
- )
- dnl
- if test "x$ac_cross_compile" != "x" -a "x$with_upnp" = "xno"; then
- enable_upnp=no
- fi
- dnl
- AC_ARG_ENABLE(upnp,
- AS_HELP_STRING([--disable-upnp],
- [Disable UPnP (default: not disabled)]),
- [
- if test "$enable_upnp" = "no"; then
- AC_MSG_RESULT([Checking if UPnP is disabled... yes])
- fi
- ],
- [
- if test "x$with_upnp" != "xno" -a "x$with_upnp" != "x"; then
- UPNP_PREFIX=$with_upnp
- UPNP_CFLAGS="-I$UPNP_PREFIX/upnp/inc -I$UPNP_PREFIX/ixml/inc"
- UPNP_LDFLAGS="-L$UPNP_PREFIX/upnp/.libs -L$UPNP_PREFIX/imxl/.libs"
- AC_MSG_RESULT([Using UPnP prefix... $with_upnp])
- else
- UPNP_CFLAGS=""
- UPNP_LDFLAGS=""
- fi
- AC_MSG_CHECKING([UPnP usability])
- UPNP_LIBS="-lupnp -lixml"
-
- SAVED_LIBS="$LIBS"
- SAVED_LDFLAGS="$LDFLAGS"
- SAVED_CFLAGS="$CFLAGS"
-
- LIBS="$UPNP_LIBS $LIBS"
- LDFLAGS="$UPNP_LDFLAGS $LDFLAGS"
- CFLAGS="$UPNP_CFLAGS $CFLAGS"
-
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
- [UpnpInit2(NULL, 0);]
- )],
- [ CFLAGS="$CFLAGS -DPJNATH_HAS_UPNP=1 $UPNP_CFLAGS"
- LDFLAGS="$LDFLAGS $UPNP_LDFLAGS $UPNP_LIBS"
- AC_MSG_RESULT(yes)
- ],
- [
- LIBS="$SAVED_LIBS"
- LDFLAGS="$SAVED_LDFLAGS"
- CFLAGS="$SAVED_CFLAGS"
- AC_MSG_RESULT(no)
- ])
- ])
- dnl
- dnl
- dnl
- dnl
- dnl
- AC_SUBST(ac_external_speex,0)
- AC_ARG_WITH(external-speex,
- AS_HELP_STRING([--with-external-speex],
- [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)]),
- [
- if test "x$with_external_speex" != "xno"; then
-
- AC_MSG_CHECKING([if external Speex devkit is installed])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-
- ]],
- [speex_echo_state_init(0, 0); speex_encoder_init(0); ])],
- [AC_MSG_RESULT(yes!!)
- AC_DEFINE(PJMEDIA_EXTERNAL_SPEEX_CODEC, 1)
- ac_external_speex="1"
- ],
- [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])])
- fi
- ]
- )
- dnl
- AC_SUBST(ac_external_gsm,0)
- AC_ARG_WITH(external-gsm,
- AS_HELP_STRING([--with-external-gsm],
- [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)]),
- [
- if test "x$with_external_gsm" != "xno"; then
-
- AC_MSG_CHECKING([if external GSM devkit is installed as gsm/gsm.h])
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[
- [AC_MSG_RESULT(yes!!)
- AC_DEFINE(PJMEDIA_EXTERNAL_GSM_CODEC, 1)
- AC_DEFINE(PJMEDIA_EXTERNAL_GSM_GSM_H, 1)
- ac_external_gsm="1"
- ],
- [
- AC_MSG_RESULT(no)
- AC_MSG_CHECKING([if external GSM devkit is installed as gsm.h])
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[
- [AC_MSG_RESULT(yes!!)
- AC_DEFINE(PJMEDIA_EXTERNAL_GSM_CODEC, 1)
- AC_DEFINE(PJMEDIA_EXTERNAL_GSM_H, 1)
- ac_external_gsm="1"
- ],
- [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])
- ]
- )
- ]
- )
- fi
- ]
- )
- dnl
- AC_SUBST(ac_external_srtp,0)
- AC_SUBST(ac_external_srtp_lib)
- AC_ARG_WITH(external-srtp,
- AS_HELP_STRING([--with-external-srtp],
- [Use external SRTP development files, not the one in "third_party" directory. When this option is set, make sure that SRTP is accessible to use (hint: use CFLAGS and LDFLAGS env var to set the include/lib paths)]),
- [
- if test "x$with_external_srtp" != "xno"; then
-
- AC_MSG_CHECKING([if external SRTP devkit is installed])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
- ]],
- [srtp_init();])],
- [AC_MSG_RESULT(yes: version 2.x)
- ac_external_srtp="2"
- ac_external_srtp_lib="srtp2"
- ],
- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
- ]],
- [srtp_init();])],
- [AC_MSG_RESULT(yes: version 1.x)
- ac_external_srtp="1"
- ac_external_srtp_lib="srtp"
- ],
- [AC_MSG_ERROR([Unable to use SRTP. If SRTP development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths])])])
- fi
- ]
- )
- dnl
- if test "x$ac_external_srtp" != "x0"; then
- AC_SUBST(ac_srtp_deinit_present,0)
- AC_SUBST(ac_srtp_shutdown_present,0)
- AC_CHECK_LIB($ac_external_srtp_lib,srtp_deinit,[ac_srtp_deinit_present=1])
- if test "x$ac_srtp_deinit_present" != "x1"; then
- AC_CHECK_LIB($ac_external_srtp_lib,srtp_shutdown,[ac_srtp_shutdown_present=1])
- fi
- fi
- dnl
- AC_SUBST(ac_external_yuv,0)
- AC_ARG_WITH(external-yuv,
- AS_HELP_STRING([--with-external-yuv],
- [Use external libyuv development files, not the one in "third_party" directory. When this option is set, make sure that libyuv is accessible to use (hint: use CFLAGS and LDFLAGS env var to set the include/lib paths)]),
- [
- if test "x$with_external_yuv" != "xno"; then
-
- AC_MSG_CHECKING([if external libyuv devkit is installed])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
- [RGB24ToI420(0,0,0,0,0,0,0,0,0,0);])],
- [AC_MSG_RESULT(yes!!)
- ac_external_yuv="1"
- ],
- [AC_MSG_ERROR([Unable to use external libyuv. If libyuv development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths])])
- fi
- ]
- )
- dnl
- AC_SUBST(ac_external_webrtc,0)
- AC_ARG_WITH(external-webrtc,
- AS_HELP_STRING([--with-external-webrtc],
- [Use external webrtc development files, not the one in "third_party" directory. When this option is set, make sure that webrtc is accessible to use (hint: use CFLAGS and LDFLAGS env var to set the include/lib paths)]),
- [
- if test "x$with_external_webrtc" != "xno"; then
-
- AC_MSG_CHECKING([if external webrtc devkit is installed])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-
- ]],
- [WebRtcAec_Create();])],
- [AC_MSG_RESULT(yes!!)
- ac_external_webrtc="1"
- ],
- [AC_MSG_ERROR([Unable to use external webrtc. If webrtc development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths])])
- fi
- ]
- )
- dnl
- AC_SUBST(ac_external_webrtc_aec3,0)
- AC_ARG_WITH(external-webrtc-aec3,
- AS_HELP_STRING([--with-external-webrtc-aec3],
- [Use external webrtc AEC3 development files, not the one in "third_party" directory. When this option is set, make sure that webrtc is accessible to use (hint: use CFLAGS and LDFLAGS env var to set the include/lib paths)]),
- [
- if test "x$with_external_webrtc_aec3" != "xno"; then
-
- AC_MSG_CHECKING([if external webrtc AEC3 is installed])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
- ]],
- [EchoCanceller3 ec(EchoCanceller3Config(), 16000, 1, 1);])],
- [AC_MSG_RESULT(yes!!)
- ac_external_webrtc_aec3="1"
- ],
- [AC_MSG_ERROR([Unable to use external webrtc AEC3. If webrtc development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths])])
- fi
- ]
- )
- dnl
- AC_SUBST(ac_pjmedia_resample,libresample)
- AC_ARG_ENABLE(resample,
- AS_HELP_STRING([--disable-resample],
- [Disable resampling implementations]),
- [if test "$enable_resample" = "no"; then
- [ac_pjmedia_resample=none]
- AC_MSG_RESULT([Checking if resampling is disabled...yes])
- fi]
- )
- dnl
- AC_SUBST(ac_pjmedia_snd)
- AC_ARG_ENABLE(sound,
- AS_HELP_STRING([--disable-sound],
- [Exclude sound (i.e. use null sound)]),
- [if test "$enable_sound" = "no"; then
- [ac_pjmedia_snd=null]
- AC_MSG_RESULT([Checking if sound is disabled... yes])
- fi]
- )
- dnl
- AC_SUBST(ac_external_pa,0)
- AC_ARG_WITH(external-pa,
- AS_HELP_STRING([--with-external-pa],
- [Use external PortAudio development files. 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)]),
- [
- if test "x$with_external_pa" != "xno"; then
-
- AC_MSG_CHECKING([if external PortAudio devkit is installed])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
- ]],
- [Pa_Initialize();])],
- [AC_MSG_RESULT(yes!!)
- ac_external_pa="1"
- ],
- [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])])
- fi
- ]
- )
- AC_SUBST(ac_pa_cflags)
- AC_CHECK_HEADER(sys/soundcard.h,
- [ac_pa_cflags="$ac_pa_cflags -DHAVE_SYS_SOUNDCARD_H"])
- AC_CHECK_HEADER(linux/soundcard.h,
- [ac_pa_cflags="$ac_pa_cflags -DHAVE_LINUX_SOUNDCARD_H"])
- AC_CHECK_HEADER(machine/soundcard.h,
- [ac_pa_cflags="$ac_pa_cflags -DHAVE_MACHINE_SOUNDCARD_H"])
- if test "x$ac_cv_c_bigendian" = "xyes"; then
- ac_pa_cflags="$ac_pa_cflags -DPA_BIG_ENDIAN"
- else
- ac_pa_cflags="$ac_pa_cflags -DPA_LITTLE_ENDIAN"
- fi
- dnl
- AC_SUBST(ac_oboe_cflags)
- AC_SUBST(ac_oboe_ldflags)
- AC_ARG_WITH(oboe,
- AS_HELP_STRING([--with-oboe],
- [Enable Android Oboe audio device backend.]),
- [
- if test "x$with_oboe" != "xno" -a "x$with_oboe" != "x"; then
- OBOE_PREFIX=$with_oboe
- OBOE_CFLAGS="-I$OBOE_PREFIX/prefab/modules/oboe/include"
- OBOE_LDFLAGS="-L$OBOE_PREFIX/prefab/modules/oboe/libs/android.$TARGET_ABI"
- AC_MSG_RESULT([Using Oboe prefix... $with_oboe])
- else
- OBOE_CFLAGS=""
- OBOE_LDFLAGS=""
- fi
- AC_MSG_CHECKING([Oboe usability])
- OBOE_LIBS="-loboe -lOpenSLES -llog"
- SAVED_LIBS="$LIBS"
- SAVED_LDFLAGS="$LDFLAGS"
- SAVED_CXXFLAGS="$CXXFLAGS"
- LIBS="$OBOE_LIBS $LIBS"
- LDFLAGS="$OBOE_LDFLAGS $LDFLAGS"
- CXXFLAGS="$OBOE_CFLAGS $CXXFLAGS"
- AC_LANG_PUSH([C++])
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
- [oboe::AudioStreamBuilder sb; sb.setDeviceId(0);]
- )],
- [ ac_oboe_cflags="-DPJMEDIA_AUDIO_DEV_HAS_OBOE=1 $OBOE_CFLAGS"
- ac_oboe_ldflags="$OBOE_LDFLAGS $OBOE_LIBS"
- AC_MSG_RESULT(yes)
- ],
- [
- LIBS="$SAVED_LIBS"
- LDFLAGS="$SAVED_LDFLAGS"
- AC_MSG_RESULT(no)
- ])
- AC_LANG_POP([C++])
-
- CXXFLAGS="$SAVED_CFLAGS"
- ]
- )
- if test "$enable_sound" = "no"; then
- true;
- else
- AC_SUBST(ac_pjmedia_audiodev_objs)
- case $target in
- *android*)
- if test "x$ac_oboe_cflags" != "x"; then
- AC_MSG_RESULT([Checking sound device backend... Oboe])
- else
- LIBS="$LIBS -lOpenSLES"
- AC_MSG_RESULT([Checking sound device backend... Android])
- fi
- ;;
- *-apple-darwin_ios*)
- LIBS="$LIBS -framework CoreAudio -framework CoreFoundation -framework AudioToolbox -framework CFNetwork -framework UIKit -framework AVFoundation"
- ac_pjmedia_audiodev_objs="coreaudio_dev.o"
- AC_MSG_RESULT([Checking sound device backend... AudioUnit])
- ;;
- *darwin*)
- LIBS="$LIBS -framework CoreAudio -framework CoreServices -framework AudioUnit -framework AudioToolbox"
- ac_pjmedia_audiodev_objs="coreaudio_dev.o"
- if test "`uname -r`" = "6.8"; then
-
-
-
- AC_MSG_RESULT([Checking sound device backend... old coreaudio])
- else
- ac_pjmedia_snd=coreaudio
- AC_MSG_RESULT([Checking sound device backend... coreaudio])
- fi
- ;;
- *cygwin* | *mingw*)
- ac_pjmedia_snd=win32
- AC_MSG_RESULT([Checking sound device backend... win32 sound])
- ;;
- *rtems*)
- ac_pjmedia_snd=null
- AC_MSG_RESULT([Checking sound device backend... null sound])
- ;;
- *)
- if test "x$ac_external_pa" != "x1"; then
- dnl
- AC_CHECK_HEADER(alsa/version.h,
- [LIBS="$LIBS -lasound"
- ac_pjmedia_snd=alsa])
- if test "x$ac_pjmedia_snd" = "xalsa"; then
- AC_MSG_RESULT([Checking sound device backend... alsa])
- else
- ac_pjmedia_snd=null
- AC_MSG_RESULT([Checking sound device backend... null sound])
- fi
- fi
- ;;
- esac
- fi
- AC_SUBST(ac_pjmedia_video)
- case $target in
- *mingw*)
- if test ! "$enable_video" = "yes"; then
- enable_video="no"
- fi
- ;;
- esac
- dnl
- AC_ARG_ENABLE(video,
- AS_HELP_STRING([--disable-video],
- [Disable video feature]),
- [if test "$enable_video" = "no"; then
-
- AC_MSG_RESULT([Video is disabled])
- enable_sdl="no"
- enable_ffmpeg="no"
- enable_v4l2="no"
- enable_openh264="no"
- enable_libyuv="no"
- enable_vpx="no"
- fi],
- [])
- case $target in
- *android*)
- LIBS="$LIBS -llog"
- ;;
- *-apple-darwin_ios*)
- LIBS="$LIBS -framework UIKit"
- ;;
- *darwin*)
- LIBS="$LIBS -framework Foundation -framework AppKit"
- ;;
- esac
- if test "$enable_video" = "no"; then
- true;
- else
- case $target in
- *android*)
- ac_pjmedia_video=android_os
- AC_SUBST(ac_pjmedia_video_has_android)
- AC_SUBST(ac_android_cflags)
- SAVED_LIBS="$LIBS"
- LIBS="-lGLESv2 -lEGL -landroid -lc"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[ac_pjmedia_video_has_android=yes],[ac_pjmedia_video_has_android=no])
- LIBS="$SAVED_LIBS"
- if test "$ac_pjmedia_video_has_android" = "yes"; then
- ac_android_cflags="-DPJMEDIA_VIDEO_DEV_HAS_ANDROID_OPENGL=1"
- LIBS="$LIBS -lGLESv2 -lEGL -landroid"
- AC_MSG_RESULT([Checking if OpenGL ES 2 is available... yes])
- else
- AC_MSG_RESULT([Checking if OpenGL ES 2 is available... no])
- fi
- ac_android_cflags="$ac_android_cflags -DPJMEDIA_VIDEO_DEV_HAS_ANDROID=1"
- ;;
- *mingw*)
- if test "$enable_video" = "yes"; then
- ac_pjmedia_video=windows_os
- AC_SUBST(ac_pjmedia_video_dev_has_dshow)
- ac_pjmedia_video_dev_has_dshow=yes
- AC_SUBST(ac_dshow_cflags)
- ac_dshow_cflags="-DPJMEDIA_HAS_VIDEO=1 -DPJMEDIA_VIDEO_DEV_HAS_DSHOW=1"
- AC_SUBST(ac_dshow_ldflags)
- ac_dshow_ldflags=" -lstdc++ -lquartz -lole32 -loleaut32 -lrpcrt4 -lwinmm -luuid -lmingwex -lstrmiids "
- LIBS="$LIBS -lstdc++ -lquartz -lole32 -loleaut32 -lrpcrt4 -lwinmm -luuid -lmingwex -lstrmiids "
- fi
- ;;
- *darwin*)
- ac_pjmedia_video=darwin_os
- AC_SUBST(ac_pjmedia_video_has_darwin)
- AC_SUBST(ac_pjmedia_video_has_metal)
- AC_SUBST(ac_pjmedia_video_has_vtoolbox)
- AC_SUBST(ac_pjmedia_video_has_ios_opengl)
- AC_SUBST(ac_darwin_cflags)
- SAVED_LIBS="$LIBS"
- LIBS="-framework AVFoundation -framework CoreGraphics -framework QuartzCore -framework CoreVideo -framework CoreMedia"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],
- [ac_pjmedia_video_has_darwin=yes],
- [ac_pjmedia_video_has_darwin=no])
- LIBS="-framework VideoToolbox"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],
- [ac_pjmedia_video_has_vtoolbox=yes],
- [ac_pjmedia_video_has_vtoolbox=no])
- LIBS="-framework Metal"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],
- [ac_pjmedia_video_has_metal=yes],
- [ac_pjmedia_video_has_metal=no])
- LIBS="-framework OpenGLES"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],
- [ac_pjmedia_video_has_ios_opengl=yes],
- [ac_pjmedia_video_has_ios_opengl=no])
- LIBS="$SAVED_LIBS"
- if test "$ac_pjmedia_video_has_darwin" = "yes"; then
- ac_darwin_cflags="-DPJMEDIA_VIDEO_DEV_HAS_DARWIN=1"
- LIBS="$LIBS -framework AVFoundation -framework CoreGraphics -framework QuartzCore -framework CoreVideo -framework CoreMedia"
- AC_MSG_RESULT([Checking if AVFoundation framework is available... yes])
- else
- AC_MSG_RESULT([Checking if AVFoundation framework is available... no])
- fi
- if test "$ac_pjmedia_video_has_metal" = "yes"; then
- ac_darwin_cflags+=" -DPJMEDIA_VIDEO_DEV_HAS_METAL=1"
- LIBS="$LIBS -framework Metal -framework MetalKit"
- AC_MSG_RESULT([Checking if Metal framework is available... yes])
- else
- AC_MSG_RESULT([Checking if Metal framework is available... no])
- fi
- if test "$ac_pjmedia_video_has_vtoolbox" = "yes"; then
-
- LIBS="$LIBS -framework VideoToolbox"
- AC_MSG_RESULT([Checking if VideoToolbox framework is available... yes])
- else
- AC_MSG_RESULT([Checking if VideoToolbox framework is available... no])
- fi
- if test "$ac_pjmedia_video_has_ios_opengl" = "yes"; then
- ac_darwin_cflags+=" -DPJMEDIA_VIDEO_DEV_HAS_IOS_OPENGL=1"
- LIBS="$LIBS -framework OpenGLES"
- AC_MSG_RESULT([Checking if OpenGLES framework is available... yes])
- else
- AC_MSG_RESULT([Checking if OpenGLES framework is available... no])
- fi
- if false; then
-
- ac_pjmedia_video=mac_os
- AC_SUBST(ac_pjmedia_video_has_qt)
- AC_SUBST(ac_qt_cflags)
- SAVED_LIBS="$LIBS"
- LIBS="-framework QTKit"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[ac_pjmedia_video_has_qt=yes],[ac_pjmedia_video_has_qt=no])
- LIBS="$SAVED_LIBS"
- if test "$ac_pjmedia_video_has_qt" = "yes"; then
- ac_qt_cflags="-DPJMEDIA_VIDEO_DEV_HAS_QT=1"
- LIBS="$LIBS -framework QTKit -framework QuartzCore -framework OpenGL"
- AC_MSG_RESULT([Checking if QTKit framework is available... yes])
- else
- AC_MSG_RESULT([Checking if QTKit framework is available... no])
- fi
- fi
- ;;
- esac
- fi
- AC_ARG_ENABLE(ext_sound,
- AS_HELP_STRING([--enable-ext-sound],
- [PJMEDIA will not provide any sound device backend]),
- [if test "$enable_ext_sound" = "yes"; then
- [ac_pjmedia_snd=external]
- AC_MSG_RESULT([Checking if external sound is set... yes])
- fi]
- )
- dnl
- AC_SUBST(ac_no_small_filter)
- AC_ARG_ENABLE(small-filter,
- AS_HELP_STRING([--disable-small-filter],
- [Exclude small filter in resampling]),
- [if test "$enable_small_filter" = "no"; then
- [ac_no_small_filter='-DPJMEDIA_HAS_SMALL_FILTER=0']
- AC_MSG_RESULT([Checking if small filter is disabled... yes])
- fi],
- AC_MSG_RESULT([Checking if small filter is disabled... no]))
- dnl
- AC_SUBST(ac_no_large_filter)
- AC_ARG_ENABLE(large-filter,
- AS_HELP_STRING([--disable-large-filter],
- [Exclude large filter in resampling]),
- [if test "$enable_large_filter" = "no"; then
- [ac_no_large_filter='-DPJMEDIA_HAS_LARGE_FILTER=0']
- AC_MSG_RESULT([Checking if large filter is disabled... yes])
- fi],
- AC_MSG_RESULT([Checking if large filter is disabled... no]))
- dnl
- AC_SUBST(ac_no_speex_aec)
- AC_ARG_ENABLE(speex-aec,
- AS_HELP_STRING([--disable-speex-aec],
- [Exclude Speex Acoustic Echo Canceller/AEC]),
- [if test "$enable_speex_aec" = "no"; then
- [ac_no_speex_aec='-DPJMEDIA_HAS_SPEEX_AEC=0']
- AC_MSG_RESULT([Checking if Speex AEC is disabled...yes])
- fi],
- AC_MSG_RESULT([Checking if Speex AEC is disabled...no]))
- dnl
- AC_SUBST(ac_no_g711_codec)
- AC_ARG_ENABLE(g711-codec,
- AS_HELP_STRING([--disable-g711-codec],
- [Exclude G.711 codecs from the build]),
- [if test "$enable_g711_codec" = "no"; then
- [ac_no_g711_codec=1]
- AC_DEFINE(PJMEDIA_HAS_G711_CODEC,0)
- AC_MSG_RESULT([Checking if G.711 codec is disabled...yes])
- fi],
- AC_MSG_RESULT([Checking if G.711 codec is disabled...no]))
- dnl
- AC_SUBST(ac_no_l16_codec)
- AC_ARG_ENABLE(l16-codec,
- AS_HELP_STRING([--disable-l16-codec],
- [Exclude Linear/L16 codec family from the build]),
- [if test "$enable_l16_codec" = "no"; then
- [ac_no_l16_codec=1]
- AC_DEFINE(PJMEDIA_HAS_L16_CODEC,0)
- AC_MSG_RESULT([Checking if L16 codecs are disabled...yes])
- fi],
- AC_MSG_RESULT([Checking if L16 codec is disabled...no]))
- dnl
- AC_SUBST(ac_no_gsm_codec)
- AC_ARG_ENABLE(gsm-codec,
- AS_HELP_STRING([--disable-gsm-codec],
- [Exclude GSM codec in the build]),
- [if test "$enable_gsm_codec" = "no"; then
- [ac_no_gsm_codec=1]
- AC_DEFINE(PJMEDIA_HAS_GSM_CODEC,0)
- AC_MSG_RESULT([Checking if GSM codec is disabled...yes])
- fi],
- AC_MSG_RESULT([Checking if GSM codec is disabled...no]))
- dnl
- AC_SUBST(ac_no_g722_codec)
- AC_ARG_ENABLE(g722-codec,
- AS_HELP_STRING([--disable-g722-codec],
- [Exclude G.722 codec in the build]),
- [if test "$enable_g722_codec" = "no"; then
- [ac_no_g722_codec=1]
- AC_DEFINE(PJMEDIA_HAS_G722_CODEC,0)
- AC_MSG_RESULT([Checking if G.722 codec is disabled...yes])
- fi],
- AC_MSG_RESULT([Checking if G.722 codec is disabled...no]))
- dnl
- AC_SUBST(ac_no_g7221_codec)
- AC_ARG_ENABLE(g7221-codec,
- AS_HELP_STRING([--disable-g7221-codec],
- [Exclude G.7221 codec in the build]),
- [if test "$enable_g7221_codec" = "no"; then
- [ac_no_g7221_codec=1]
- AC_DEFINE(PJMEDIA_HAS_G7221_CODEC,0)
- AC_MSG_RESULT([Checking if G.722.1 codec is disabled...yes])
- fi],
- AC_MSG_RESULT([Checking if G.722.1 codec is disabled...no]))
- dnl
- AC_SUBST(ac_no_speex_codec)
- AC_ARG_ENABLE(speex-codec,
- AS_HELP_STRING([--disable-speex-codec],
- [Exclude Speex codecs in the build]),
- [if test "$enable_speex_codec" = "no"; then
- [ac_no_speex_codec=1]
- AC_DEFINE(PJMEDIA_HAS_SPEEX_CODEC,0)
- AC_MSG_RESULT([Checking if Speex codec is disabled...yes])
- fi],
- AC_MSG_RESULT([Checking if Speex codec is disabled...no]))
- dnl
- AC_SUBST(ac_no_ilbc_codec)
- AC_ARG_ENABLE(ilbc-codec,
- AS_HELP_STRING([--disable-ilbc-codec],
- [Exclude iLBC codec in the build]),
- [if test "$enable_ilbc_codec" = "no"; then
- [ac_no_ilbc_codec=1]
- AC_DEFINE(PJMEDIA_HAS_ILBC_CODEC,0)
- AC_MSG_RESULT([Checking if iLBC codec is disabled...yes])
- fi],
- AC_MSG_RESULT([Checking if iLBC codec is disabled...no]))
- dnl
- AC_ARG_ENABLE(libsamplerate,
- AS_HELP_STRING([--enable-libsamplerate],
- [Link with libsamplerate when available.]),
- [
- if test "$enable_libsamplerate" = "yes"; then
- AC_MSG_RESULT([Checking if libsamplerate is enabled...yes])
- AC_CHECK_LIB(samplerate,src_new)
- [ac_pjmedia_resample=libsamplerate]
- else
- AC_MSG_RESULT([Checking if libsamplerate is enabled...no])
- fi
- ], AC_MSG_RESULT([Checking if libsamplerate is enabled...no]))
- AC_SUBST(ac_resample_dll)
- AC_ARG_ENABLE(resample_dll,
- AS_HELP_STRING([--enable-resample-dll],
- [Build libresample as shared library]),
- [if test "$enable_resample_dll" = "yes"; then
- [ac_resample_dll=1]
- AC_MSG_RESULT([Building libresample as shared library... yes])
- fi],
- AC_MSG_RESULT([Building libresample as shared library... no])
- )
- dnl
- AC_ARG_ENABLE(speex-resample,
- AS_HELP_STRING([--enable-speex-resample],
- [Enable Speex resample]),
- [
- if test "$enable_speex_resample" = "yes"; then
- AC_MSG_RESULT([Checking if Speex resample is enabled... yes])
- [ac_pjmedia_resample=speex]
- else
- AC_MSG_RESULT([Checking if Speex resample is enabled... no])
- fi
- ], AC_MSG_RESULT([Checking if Speex resample is enabled... no]))
- dnl
- AC_ARG_WITH(sdl,
- AS_HELP_STRING([--with-sdl=DIR],
- [Specify alternate libSDL prefix]),
- [],
- [with_sdl=no]
- )
- dnl
- if test "x$ac_cross_compile" != "x" -a "x$with_sdl" = "xno"; then
- enable_sdl=no
- fi
- dnl
- AC_ARG_ENABLE(sdl,
- AS_HELP_STRING([--disable-sdl],
- [Disable SDL (default: not disabled)]),
- [
- if test "$enable_sdl" = "no"; then
- AC_MSG_RESULT([Checking if SDL is disabled... yes])
- fi
- ],
- [
- if test "x$with_sdl" != "xno" -a "x$with_sdl" != "x"; then
- AC_MSG_RESULT([Using SDL prefix... $with_sdl])
- AC_PATH_PROGS(SDL_CONFIG,sdl2-config sdl-config,,$with_sdl/bin)
- else
- AC_PATH_PROGS(SDL_CONFIG, sdl2-config sdl-config)
- fi
-
- AC_MSG_CHECKING([SDL availability])
- if test "x$SDL_CONFIG" = "x"; then
- AC_MSG_RESULT([not found])
- elif (sh -c "$SDL_CONFIG --version" | grep -e '^1\.3' -e '^2\.') then
- AC_SUBST(ac_sdl_cflags)
- AC_SUBST(ac_sdl_ldflags)
- ac_sdl_cflags=`$SDL_CONFIG --cflags`
- ac_sdl_cflags="-DPJMEDIA_VIDEO_DEV_HAS_SDL=1 $ac_sdl_cflags"
- ac_sdl_ldflags=`$SDL_CONFIG --libs`
- ac_sdl_ldflags=`echo "${ac_sdl_ldflags}" | sed -e 's/-mwindows//g'`
- LIBS="$LIBS $ac_sdl_ldflags"
- else
- AC_MSG_RESULT([Unsupported SDL version])
- fi
- ])
- AC_ARG_WITH(ffmpeg,
- AS_HELP_STRING([--with-ffmpeg=DIR],
- [Specify alternate FFMPEG prefix]),
- [],
- [with_ffmpeg=no]
- )
- dnl
- if test "x$ac_cross_compile" != "x" -a "x$with_ffmpeg" = "xno"; then
- enable_ffmpeg=no
- fi
- dnl
- AC_ARG_ENABLE(ffmpeg,
- AS_HELP_STRING([--disable-ffmpeg],
- [Disable ffmpeg (default: not disabled)]),
- [
- AC_SUBST(ac_has_ffmpeg,0)
- if test "$enable_ffmpeg" = "no"; then
- AC_MSG_RESULT([Checking if ffmpeg is disabled... yes])
- fi
- ],
- [
- AC_SUBST(ac_ffmpeg_cflags)
- AC_SUBST(ac_ffmpeg_ldflags)
- FFMPEG_PREFIX=""
- AC_SUBST(SAVED_PKG_CONFIG_PATH)
- SAVED_PKG_CONFIG_PATH=$PKG_CONFIG_PATH
- if test "x$with_ffmpeg" != "xno" -a "x$with_ffmpeg" != "x"; then
- FFMPEG_PREFIX=$with_ffmpeg
- AC_MSG_RESULT([Using ffmpeg prefix... $FFMPEG_PREFIX])
- export PKG_CONFIG_PATH=$FFMPEG_PREFIX/lib/pkgconfig
- fi
- AC_CHECK_PROGS(PKG_CONFIG,pkg-config "python pkgconfig.py",none)
- if test "$PKG_CONFIG" != "none"; then
- AC_MSG_CHECKING([ffmpeg packages])
- av_pkg=""
- if $PKG_CONFIG --exists libavdevice; then
- ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVDEVICE=1"
- av_pkg="$av_pkg libavdevice"
- fi
- if $PKG_CONFIG --exists libavformat; then
- ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVFORMAT=1"
- av_pkg="$av_pkg libavformat"
- fi
- if $PKG_CONFIG --exists libavcodec; then
- ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVCODEC=1"
- av_pkg="$av_pkg libavcodec"
- fi
- if $PKG_CONFIG --exists libswscale; then
- ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBSWSCALE=1"
- av_pkg="$av_pkg libswscale"
- fi
- if $PKG_CONFIG --exists libavutil; then
- ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVUTIL=1"
- av_pkg="$av_pkg libavutil"
- fi
-
- if test "x$av_pkg" = "x"; then
- AC_MSG_RESULT([none detected (check the prefix)! **])
- else
- AC_MSG_RESULT([$av_pkg])
- fi
-
- ac_ffmpeg_cflags="$ac_ffmpeg_cflags `$PKG_CONFIG --cflags $av_pkg`"
- ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags `$PKG_CONFIG --libs $av_pkg`"
- else
- dnl
- dnl
- dnl
-
- AC_MSG_RESULT([*** Warning: neither pkg-config nor python is available, ffmpeg dependency cannot be calculated. If ffmpeg libraries are not detected, you need to specify the correct CFLAGS and LDFLAGS settings for ffmpeg prior to invoking configure ***])
-
- LIBS="-L$FFMPEG_PREFIX/lib $LIBS"
- LDFLAGS="-L$FFMPEG_PREFIX/lib $LDFLAGS"
- CFLAGS="-I$FFMPEG_PREFIX/include $CFLAGS"
-
- AC_CHECK_LIB(avdevice,
- avdevice_version,
- [ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVDEVICE=1"
- ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lavdevice"
- ]
- )
- AC_CHECK_LIB(avutil,
- av_malloc,
- [ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVUTIL=1"
- ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lavutil"
- ]
- )
- AC_CHECK_LIB(avcodec,
- avcodec_init,
- [ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVCODEC=1"
- ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lavcodec"
- ],
- [],
- [-lavutil]
- )
- AC_CHECK_LIB(avformat,
- av_register_all,
- [ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVFORMAT=1"
- ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lavformat"
- ],
- [],
- [-lavcodec -lavutil]
- )
- AC_CHECK_LIB(swscale,
- sws_scale,
- [ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBSWSCALE=1"
- ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lswscale"
- ],
- [],
- [-lavutil]
- )
- AC_CHECK_LIB(avcore,
- avcore_version,
- [ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVCORE=1"
- ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lavcore"
- ]
- )
-
- fi
-
- AC_CHECK_TYPES(enum AVPixelFormat,
- [],
- [ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_USE_OLD_FFMPEG=1"],
- [[
- )
-
- LIBS="$LIBS $ac_ffmpeg_ldflags"
- export PKG_CONFIG_PATH=$SAVED_PKG_CONFIG_PATH
- ]
- )
- dnl
- AC_ARG_ENABLE(v4l2,
- AS_HELP_STRING([--disable-v4l2],
- [Disable Video4Linux2 (default: not disabled)]),
- [
- if test "$enable_v4l2" = "no"; then
- AC_MSG_RESULT([Checking if V4L2 is disabled... yes])
- fi
- ],
- [
- AC_SUBST(ac_v4l2_cflags)
- AC_SUBST(ac_v4l2_ldflags)
- AC_CHECK_LIB(v4l2,
- v4l2_open,
- [ac_v4l2_cflags="-DPJMEDIA_VIDEO_DEV_HAS_V4L2=1"
- ac_v4l2_ldflags="-lv4l2"
- LIBS="$LIBS -lv4l2"
- ]
- )
- ])
- dnl
- AC_ARG_WITH(openh264,
- AS_HELP_STRING([--with-openh264=DIR],
- [Specify alternate OpenH264 prefix]),
- [],
- [with_openh264=no]
- )
- dnl
- if test "x$ac_cross_compile" != "x" -a "x$with_openh264" = "xno"; then
- enable_openh264=no
- fi
- dnl
- AC_SUBST(ac_openh264_cflags)
- AC_SUBST(ac_openh264_ldflags)
- AC_ARG_ENABLE(openh264,
- AS_HELP_STRING([--disable-openh264],
- [Disable OpenH264 (default: not disabled)]),
- [
- if test "$enable_openh264" = "no"; then
- AC_MSG_RESULT([Checking if OpenH264 is disabled... yes])
- fi
- ],
- [
- if test "x$with_openh264" != "xno" -a "x$with_openh264" != "x"; then
- OPENH264_PREFIX=$with_openh264
- OPENH264_CFLAGS="-I$OPENH264_PREFIX/include"
- OPENH264_LDFLAGS="-L$OPENH264_PREFIX/lib"
- AC_MSG_RESULT([Using OpenH264 prefix... $with_openh264])
- else
- OPENH264_CFLAGS=""
- OPENH264_LDFLAGS=""
- fi
- AC_MSG_CHECKING([OpenH264 usability])
- OPENH264_LIBS="-lopenh264 -lstdc++"
-
- SAVED_LIBS="$LIBS"
- SAVED_LDFLAGS="$LDFLAGS"
- SAVED_CFLAGS="$CFLAGS"
-
- LIBS="$OPENH264_LIBS $LIBS"
- LDFLAGS="$OPENH264_LDFLAGS $LDFLAGS"
- CFLAGS="$OPENH264_CFLAGS $CFLAGS"
-
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-
- ]],
- [WelsCreateSVCEncoder(0);]
- )],
- [ ac_openh264_cflags="-DPJMEDIA_HAS_OPENH264_CODEC=1 $OPENH264_CFLAGS"
- ac_openh264_ldflags="$OPENH264_LDFLAGS $OPENH264_LIBS"
- AC_MSG_RESULT(yes)
- ],
- [
- LIBS="$SAVED_LIBS"
- LDFLAGS="$SAVED_LDFLAGS"
- CFLAGS="$SAVED_CFLAGS"
- AC_MSG_RESULT(no)
- ])
- ])
- dnl
- AC_ARG_WITH(vpx,
- AS_HELP_STRING([--with-vpx=DIR],
- [Specify alternate VPX prefix]),
- [],
- [with_vpx=no]
- )
- dnl
- if test "x$ac_cross_compile" != "x" -a "x$with_vpx" = "xno"; then
- enable_vpx=no
- fi
- dnl
- AC_SUBST(ac_vpx_cflags)
- AC_SUBST(ac_vpx_ldflags)
- AC_ARG_ENABLE(vpx,
- AS_HELP_STRING([--disable-vpx],
- [Disable VPX (default: not disabled)]),
- [
- if test "$enable_vpx" = "no"; then
- AC_MSG_RESULT([Checking if VPX is disabled... yes])
- fi
- ],
- [
- if test "x$with_vpx" != "xno" -a "x$with_vpx" != "x"; then
- VPX_PREFIX=$with_vpx
- VPX_CFLAGS="-I$VPX_PREFIX/include"
- VPX_LDFLAGS="-L$VPX_PREFIX/lib"
- AC_MSG_RESULT([Using VPX prefix... $with_vpx])
- else
- VPX_CFLAGS=""
- VPX_LDFLAGS=""
- fi
- AC_MSG_CHECKING([VPX usability])
- VPX_LIBS="-lvpx"
-
- SAVED_LIBS="$LIBS"
- SAVED_LDFLAGS="$LDFLAGS"
- SAVED_CFLAGS="$CFLAGS"
-
- LIBS="$VPX_LIBS $LIBS"
- LDFLAGS="$VPX_LDFLAGS $LDFLAGS"
- CFLAGS="$VPX_CFLAGS $CFLAGS"
-
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-
- ]],
- [vpx_codec_iface_t *(*enc_if)() = &vpx_codec_vp8_cx;]
- )],
- [ ac_vpx_cflags="-DPJMEDIA_HAS_VPX_CODEC=1 $VPX_CFLAGS"
- ac_vpx_ldflags="$VPX_LDFLAGS $VPX_LIBS"
- AC_MSG_RESULT(yes)
- ],
- [
- LIBS="$SAVED_LIBS"
- LDFLAGS="$SAVED_LDFLAGS"
- CFLAGS="$SAVED_CFLAGS"
- AC_MSG_RESULT(no)
- ])
- ])
- dnl
- dnl
- dnl
- AC_ARG_ENABLE(ipp,
- AS_HELP_STRING([--enable-ipp],
- [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]),
- [],
- [enable_ipp=no]
- )
- AC_ARG_WITH(ipp,
- AS_HELP_STRING([--with-ipp=DIR],
- [Specify the Intel IPP location]),
- [],
- [with_ipp=no]
- )
- AC_ARG_WITH(ipp-samples,
- AS_HELP_STRING([--with-ipp-samples=DIR],
- [Specify the Intel IPP samples location]),
- [],
- [with_ipp_samples=no]
- )
- AC_ARG_WITH(ipp-arch,
- AS_HELP_STRING([--with-ipp-arch=ARCH],
- [Specify the Intel IPP ARCH suffix, e.g. "64" or "em64t. Default is blank for IA32"]),
- [],
- [with_ipp_arch=no]
- )
- if test "x$enable_ipp" != "xno"; then
- dnl
- dnl
- dnl
- AC_MSG_CHECKING([Intel IPP location])
- if test "x$with_ipp" != "xno" -a "x$with_ipp" != "x"; then
- AC_MSG_RESULT([$with_ipp])
- IPPROOT=$with_ipp
- elif test "x$IPPROOT" = "x"; then
- if test -d /opt/intel/ipp; then
- IPPROOT=`ls -d /opt/intel/ipp/*/* | head -1`
- AC_MSG_RESULT([autodetected in $IPPROOT])
- fi
- else
- AC_MSG_RESULT([$IPPROOT])
- fi
- if test "x$with_ipp_arch" != "xno"; then
- IPP_SUFFIX=$with_ipp_arch
- AC_MSG_RESULT([IPP arch suffix is set to $IPP_SUFFIX])
- else
- IPP_SUFFIX=""
- AC_MSG_RESULT([IPP arch suffix is set to empty])
- fi
- if test x$IPPROOT = x; then
- AC_MSG_ERROR([the location is neither specified nor can be guessed. Please specify with IPPROOT env var or with --with-ipp option])
- elif test ! -d $IPPROOT; then
- AC_MSG_ERROR([not found])
- elif test ! -d $IPPROOT/include; then
- AC_MSG_ERROR([directory doesn't seem to be valid])
- else
- # IPP directory looks okay.
- # Remove trailing backslash
- IPPROOT=`echo $IPPROOT | sed 's/\/$//'`
- SAVED_CFLAGS="$CFLAGS"
- SAVED_LDFLAGS="$LDFLAGS"
- SAVED_LIBS="$LIBS"
- IPP_CFLAGS="-I$IPPROOT/include"
- IPP_LIBS="-lippsc${IPP_SUFFIX} -lipps${IPP_SUFFIX} -lippcore${IPP_SUFFIX}"
- #
- # Some differences between Mac OS X and Linux
- case $target in
- *darwin* )
- IPP_LDFLAGS="-L$IPPROOT/Libraries -L$IPPROOT/lib"
- ;;
- *)
- # Find out where the libraries live.
- IPP7_ARCH=""
- if test -d $IPPROOT/lib/intel64; then
- IPP7_ARCH="intel64"
- elif test -d $IPPROOT/lib/ia32; then
- IPP7_ARCH="ia32"
- elif test -d $IPPROOT/lib/mic; then
- IPP7_ARCH="mic"
- fi
- if test -z "$IPP7_ARCH"; then
- # IPP6 (and possibly below)
- IPP_LDFLAGS="-L$IPPROOT/sharedlib"
- IPP_LIBS="$IPP_LIBS -lippsr${IPP_SUFFIX} -lguide"
- else
- # IPP7
- if ! test -d $IPPROOT/../compiler; then
- AC_MSG_ERROR([Cannot find $IPPROOT/../compiler directory. Please set IPPROOT variable correctly])
- fi
- IPP_CFLAGS="$IPP_CFLAGS"
- IPP_LDFLAGS="-L$IPPROOT/lib/intel64 -L$IPPROOT/../compiler/lib/$IPP7_ARCH"
- IPP_LIBS="$IPP_LIBS -liomp5"
- fi
- ;;
- esac
- #IPP_LDFLAGS="-L$IPPROOT/sharedlib"
- #Static:
- #IPP_LIBS="-lippscmerged -lippsrmerged -lippsmerged -lippcore"
- CFLAGS="$CFLAGS $IPP_CFLAGS"
- LDFLAGS="$LDFLAGS $IPP_LDFLAGS"
- LIBS="$IPP_LIBS $LIBS"
- AC_MSG_CHECKING([Intel IPP usability])
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ippcore.h>
- ]],
- [ippStaticInit();])],
- [AC_MSG_RESULT(yes)],
- [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])])
- CFLAGS="$SAVED_CFLAGS"
- LDFLAGS="$SAVED_LDFLAGS"
- LIBS="$SAVED_LIBS"
- fi
- dnl #
- dnl # Verifying Intel IPP samples path
- dnl #
- AC_MSG_CHECKING([Intel IPP samples location])
- if test "x$with_ipp_samples" != "xno" -a "x$with_ipp_samples" != "x"; then
- AC_MSG_RESULT([$with_ipp_samples])
- IPPSAMPLES=$with_ipp_samples
- elif test "x$IPPSAMPLES" = "x"; then
- if test -d /opt/intel/ipp-samples; then
- IPPSAMPLES=/opt/intel/ipp-samples
- AC_MSG_RESULT([autodetected in $IPPSAMPLES])
- fi
- else
- AC_MSG_RESULT([$IPPSAMPLES])
- fi
- if test x$IPPSAMPLES = x; then
- AC_MSG_ERROR([the location is neither specified nor can be guessed. Please specify with IPPSAMPLES env var or with --with-ipp-samples option])
- elif test ! -d $IPPSAMPLES; then
- AC_MSG_ERROR([not found])
- elif test ! -d $IPPSAMPLES/speech-codecs; then
- AC_MSG_ERROR([directory doesn't seem to be valid])
- else
-
- IPPSAMPLES=`echo $IPPSAMPLES | sed 's/\/$//'`
-
-
- AC_MSG_CHECKING([Intel IPP USC build location])
- if test -d $IPPSAMPLES/speech-codecs/bin; then
- IPPVER=5
- IPPSAMP_DIR=`ls -d $IPPSAMPLES/speech-codecs/bin/*gcc*/lib | head -1`
- elif test -d $IPPSAMPLES/speech-codecs/_bin; then
- IPPVER=6
- if test -d $IPPSAMPLES/speech-codecs/_bin/*gcc*; then
-
- IPPSAMP_DIR=`ls -d $IPPSAMPLES/speech-codecs/_bin/*gcc*/lib | head -1`
- elif test -d $IPPSAMPLES/speech-codecs/_bin/*icc*; then
-
- IPPSAMP_DIR=`ls -d $IPPSAMPLES/speech-codecs/_bin/*icc*/lib | head -1`
- else
- AC_MSG_FAILURE([Unable to find to find built binaries under $IPPSAMPLES/speech-codecs/{bin,_bin}. Have you built the IPP samples?])
- fi
- else
- 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?])
- fi
-
- if test ! -d $IPPSAMP_DIR; then
- AC_MSG_FAILURE([There's something wrong with this script, directory $IPPSAMP_DIR does not exist])
- exit 1;
- fi
- if test "x$IPPVER" = "x5"; then
- IPPSAMP_LIBS="libusc.a"
- IPPSAMP_LDLIBS="-lusc"
- elif test "x$IPPVER" = "x6"; then
- IPPSAMP_LIBS="libspeech.a"
- IPPSAMP_LDLIBS="-lspeech"
- else
- AC_MSG_FAILURE([bug in this script: unsupported IPP version])
- fi
- if test ! -f $IPPSAMP_DIR/$IPPSAMP_LIBS; then
- AC_MSG_FAILURE([$IPPSAMP_LIBS doesn't exist in $IPPSAMP_DIR])
- fi
- AC_MSG_RESULT([$IPPSAMP_DIR])
- SAVED_CFLAGS="$CFLAGS"
- SAVED_LDFLAGS="$LDFLAGS"
- SAVED_LIBS="$LIBS"
- IPPSAMP_INC="-I$IPPSAMPLES/speech-codecs/core/usc/include"
- CFLAGS="$CFLAGS $IPPSAMP_INC"
- LDFLAGS="$LDFLAGS -L$IPPSAMP_DIR"
- LIBS="$IPPSAMP_LDLIBS $LIBS"
- AC_MSG_CHECKING([Intel IPP USC usability])
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
- ]],
- [extern USC_Fxns USC_G729AFP_Fxns;])],
- [AC_MSG_RESULT(yes)],
- [AC_MSG_FAILURE(no)])
- CFLAGS="$SAVED_CFLAGS"
- LDFLAGS="$IPP_LDFLAGS $SAVED_LDFLAGS"
- LIBS="$IPP_LIBS $SAVED_LIBS"
- IPP_CFLAGS="$IPP_CFLAGS $IPPSAMP_INC"
- IPP_LDFLAGS="$IPP_LDFLAGS -L$IPPSAMP_DIR"
- IPP_LIBS="$IPPSAMP_LDLIBS $IPP_LIBS"
- fi
- CFLAGS="$CFLAGS $IPP_CFLAGS"
- LDFLAGS="$LDFLAGS $IPP_LDFLAGS"
- LIBS="$LIBS $IPP_LIBS"
- ac_build_mak_vars="$ac_build_mak_vars\n\
- export IPP_CFLAGS=$IPP_CFLAGS\n\
- export IPP_LDFLAGS=$IPP_LDFLAGS\n\
- export IPP_LIBS=$IPP_LIBS"
- else
- AC_MSG_RESULT([Skipping Intel IPP settings (not wanted)])
- fi
- dnl
- AC_SUBST(ac_no_mediacodec)
- AC_ARG_ENABLE(android-mediacodec,
- AS_HELP_STRING([--disable-android-mediacodec],
- [Exclude Android MediaCodec (default: autodetect)]),
- [if test "$enable_android_mediacodec" = "no"; then
- [ac_no_mediacodec=1]
- AC_MSG_RESULT([Checking if Android MediaCodec support is disabled... yes])
- fi],
- [
- case $target in
- *android*)
- AC_CHECK_LIB(mediandk,AMediaCodec_createDecoderByType,[ac_pjmedia_has_amediacodec=1 && LIBS="-lmediandk $LIBS"])
- if test "x$ac_pjmedia_has_amediacodec" = "x1"; then
- AC_MSG_RESULT([Checking if Android AMediaCodec library is available... yes])
- AC_DEFINE(PJMEDIA_HAS_ANDROID_MEDIACODEC, 1)
- else
- AC_MSG_RESULT([Checking if Android AMediaCodec library is available... no])
- fi
- ;;
- esac
- ])
- dnl
- dnl
- dnl
- dnl
- dnl
- AC_ARG_WITH(ssl,
- AS_HELP_STRING([--with-ssl=DIR],
- [Specify alternate SSL library prefix. This option will try
- to find OpenSSL first, then if not found, GnuTLS. To skip
- OpenSSL finding, use --with-gnutls option instead.]),
- [],
- [with_ssl=no]
- )
- dnl
- AC_ARG_WITH(gnutls,
- AS_HELP_STRING([--with-gnutls=DIR],
- [Specify alternate GnuTLS prefix]),
- [],
- [with_gnutls=no]
- )
- dnl
- if test "x$ac_cross_compile" != "x" -a "x$with_ssl" = "xno" -a "x$with_gnutls" = "xno"; then
- enable_ssl=no
- fi
- dnl
- AC_SUBST(ac_no_ssl)
- AC_SUBST(ac_ssl_has_aes_gcm,0)
- AC_SUBST(ac_ssl_backend)
- AC_ARG_ENABLE(darwin-ssl,
- AS_HELP_STRING([--disable-darwin-ssl],
- [Exclude Darwin SSL (default: autodetect)]),
- [if test "$enable_darwin_ssl" = "no"; then
- AC_MSG_RESULT([Checking if Darwin SSL support is disabled... yes])
- fi],
- [
- case $target in
- *darwin*)
- SAVED_CFLAGS="$CFLAGS"
- CFLAGS="-Werror"
- SAVED_LIBS="$LIBS"
- LIBS="-framework Security"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
- [if (__builtin_available(macOS 10.12, iOS 10.0, *)) {
- SSLContextRef ssl_ctx;
- SSLReHandshake(ssl_ctx);
- }])],
- [ac_ssl_backend=darwin],)
- CFLAGS="$SAVED_CFLAGS"
- LIBS="$SAVED_LIBS"
- if test "x$ac_ssl_backend" = "xdarwin"; then
- AC_DEFINE(PJ_HAS_SSL_SOCK, 1)
- AC_DEFINE(PJ_SSL_SOCK_IMP, PJ_SSL_SOCK_IMP_DARWIN)
- LIBS="$LIBS -framework Security"
- AC_MSG_RESULT([Checking if Darwin SSL is available... yes])
- else
- AC_MSG_RESULT([Checking if Darwin SSL is available... no])
- fi
- ;;
- esac
- ])
- AC_ARG_ENABLE(ssl,
- AS_HELP_STRING([--disable-ssl],
- [Exclude SSL support the build (default: autodetect)])
- ,
- [
- if test "$enable_ssl" = "no"; then
- [ac_no_ssl=1]
- AC_MSG_RESULT([Checking if SSL support is disabled... yes])
- fi
- ],
- [
- if test "x$with_ssl" != "xno" -a "x$with_ssl" != "x"; then
- CFLAGS="$CFLAGS -I$with_ssl/include"
- CPPFLAGS="$CPPFLAGS -I$with_ssl/include"
- LDFLAGS="$LDFLAGS -L$with_ssl/lib"
- AC_MSG_RESULT([Using SSL prefix... $with_ssl])
- fi
- if test "x$with_gnutls" = "xno"; then
-
-
- AC_MSG_RESULT([checking for OpenSSL installations..])
- AC_SUBST(openssl_h_present)
- AC_SUBST(libssl_present)
- AC_SUBST(libcrypto_present)
- AC_CHECK_HEADER(openssl/ssl.h,[openssl_h_present=1])
- AC_CHECK_LIB(crypto,ERR_load_BIO_strings,[libcrypto_present=1 && LIBS="-lcrypto $LIBS"], [AC_CHECK_LIB(crypto,ERR_get_error,[libcrypto_present=1 && LIBS="-lcrypto $LIBS"])])
- AC_CHECK_LIB(ssl,SSL_CTX_new,[libssl_present=1 && LIBS="-lssl $LIBS"])
- if test "x$openssl_h_present" = "x1" -a "x$libssl_present" = "x1" -a "x$libcrypto_present" = "x1"; then
- AC_MSG_RESULT([OpenSSL library found, SSL support enabled])
-
-
-
-
-
-
-
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
- [EVP_CIPHER_CTX *ctx;EVP_aes_128_gcm();])],
- [AC_CHECK_LIB(crypto,EVP_aes_128_gcm,[ac_ssl_has_aes_gcm=1])])
- if test "x$ac_ssl_has_aes_gcm" = "x1"; then
- AC_MSG_RESULT([OpenSSL has AES GCM support, SRTP will use OpenSSL])
- else
- AC_MSG_RESULT([OpenSSL AES GCM support not found, SRTP will only support AES CM cryptos])
- fi
- if test "x$ac_ssl_backend" = "x"; then
-
-
- AC_DEFINE(PJ_HAS_SSL_SOCK, 1)
- AC_DEFINE(PJ_SSL_SOCK_IMP, PJ_SSL_SOCK_IMP_OPENSSL)
- ac_ssl_backend="openssl"
- fi
- else
- AC_MSG_RESULT([** OpenSSL libraries not found **])
- fi
-
- fi
-
- if test "x$ac_ssl_backend" = "x"; then
- if test "x$with_gnutls" != "xno" -a "x$with_gnutls" != "x"; then
- CFLAGS="$CFLAGS -I$with_gnutls/include"
- LDFLAGS="$LDFLAGS -L$with_gnutls/lib"
- AC_MSG_RESULT([Using GnuTLS prefix... $with_gnutls])
- fi
- AC_CHECK_PROGS(PKG_CONFIG,
- $host-pkg-config pkg-config "python pkgconfig.py",
- none)
- AC_MSG_RESULT([checking for GnuTLS installations..])
- AC_SUBST(gnutls_h_present)
- AC_SUBST(libgnutls_present)
- AC_CHECK_HEADER(gnutls/gnutls.h, [gnutls_h_present=1])
- if test "$PKG_CONFIG" != "none"; then
- if $PKG_CONFIG --exists gnutls; then
- LIBS="$LIBS `$PKG_CONFIG --libs gnutls`"
- libgnutls_present=1
- else
- AC_CHECK_LIB(gnutls,
- gnutls_certificate_set_x509_system_trust,
- [libgnutls_present=1 &&
- LIBS="$LIBS -lgnutls"])
- fi
- else
- AC_MSG_RESULT([*** Warning: neither pkg-config nor python is available, disabling gnutls. ***])
- fi
- if test "x$gnutls_h_present" = "x1" -a "x$libgnutls_present" = "x1"; then
- AC_MSG_RESULT([GnuTLS library found, SSL support enabled])
- AC_DEFINE(PJ_HAS_SSL_SOCK, 1)
- AC_DEFINE(PJ_SSL_SOCK_IMP, PJ_SSL_SOCK_IMP_GNUTLS)
- ac_ssl_backend="gnutls"
- else
- AC_MSG_RESULT([** No GnuTLS libraries found, disabling SSL support **])
- fi
-
- fi
- ])
- dnl
- AC_ARG_WITH(opencore-amrnb,
- AS_HELP_STRING([--with-opencore-amrnb=DIR],
- [This option is obsolete and replaced by --with-opencore-amr=DIR]),
- [AC_MSG_ERROR(This option is obsolete and replaced by --with-opencore-amr=DIR)],
- [true;]
- )
- dnl
- AC_ARG_WITH(opencore-amr,
- AS_HELP_STRING([--with-opencore-amr=DIR],
- [Specify alternate libopencore-amr prefix]),
- [],
- [with_opencore_amr=no]
- )
- dnl
- if test "x$ac_cross_compile" != "x" -a "x$with_opencore_amr" = "xno"; then
- enable_opencore_amr=no
- fi
- dnl
- AC_ARG_WITH(opencore-amrwbenc,
- AS_HELP_STRING([--with-opencore-amrwbenc=DIR],
- [Specify alternate libvo-amrwbenc prefix]),
- [],
- [with_opencore_amrwbenc=no]
- )
- dnl
- if test "x$ac_cross_compile" != "x" -a "x$with_opencore_amrwbenc" = "xno"; then
- enable_opencore_amrwbenc=no
- fi
- dnl
- AC_SUBST(ac_no_opencore_amrnb)
- AC_SUBST(ac_no_opencore_amrwb)
- AC_ARG_ENABLE(opencore_amr,
- AS_HELP_STRING([--disable-opencore-amr],
- [Exclude OpenCORE AMR support from the build (default: autodetect)])
- ,
- [
- if test "$enable_opencore_amr" = "no"; then
- [ac_no_opencore_amrnb=1]
- [ac_no_opencore_amrwb=1]
- AC_DEFINE(PJMEDIA_HAS_OPENCORE_AMRNB_CODEC,0)
- AC_DEFINE(PJMEDIA_HAS_OPENCORE_AMRWB_CODEC,0)
- AC_MSG_RESULT([Checking if OpenCORE AMR support is disabled... yes])
- fi
- ],
- [
- AC_MSG_RESULT([checking for OpenCORE AMR installations..])
- if test "x$with_opencore_amr" != "xno" -a "x$with_opencore_amr" != "x"; then
- CFLAGS="$CFLAGS -I$with_opencore_amr/include"
- CPPFLAGS="$CPPFLAGS -I$with_opencore_amr/include"
- LDFLAGS="$LDFLAGS -L$with_opencore_amr/lib"
- AC_MSG_RESULT([Using OpenCORE AMR prefix... $with_opencore_amr])
- fi
- if test "x$with_opencore_amrwbenc" != "xno" -a "x$with_opencore_amrwbenc" != "x"; then
- CFLAGS="$CFLAGS -I$with_opencore_amrwbenc/include"
- CPPFLAGS="$CPPFLAGS -I$with_opencore_amrwbenc/include"
- LDFLAGS="$LDFLAGS -L$with_opencore_amrwbenc/lib"
- AC_MSG_RESULT([Using OpenCORE AMRWB-enc prefix... $with_opencore_amrwbenc])
- fi
- AC_SUBST(opencore_amrnb_h_present)
- AC_SUBST(opencore_amrnb_present)
- AC_CHECK_HEADER(opencore-amrnb/interf_enc.h,[opencore_amrnb_h_present=1])
- AC_CHECK_LIB(opencore-amrnb,Encoder_Interface_init,[opencore_amrnb_present=1 && LIBS="$LIBS -lopencore-amrnb"])
- if test "x$opencore_amrnb_h_present" = "x1" -a "x$opencore_amrnb_present" = "x1"; then
- AC_MSG_RESULT([OpenCORE AMR-NB library found, AMR-NB support enabled])
- AC_DEFINE(PJMEDIA_HAS_OPENCORE_AMRNB_CODEC,1)
- else
- [ac_no_opencore_amrnb=1]
- AC_DEFINE(PJMEDIA_HAS_OPENCORE_AMRNB_CODEC,0)
- fi
- AC_SUBST(opencore_amrwb_enc_h_present)
- AC_SUBST(opencore_amrwb_enc_present)
- AC_SUBST(opencore_amrwb_dec_h_present)
- AC_SUBST(opencore_amrwb_dec_present)
- AC_CHECK_HEADER(vo-amrwbenc/enc_if.h,[opencore_amrwb_enc_h_present=1])
- AC_CHECK_HEADER(opencore-amrwb/dec_if.h,[opencore_amrwb_dec_h_present=1])
- AC_CHECK_LIB(opencore-amrwb,D_IF_init,[opencore_amrwb_dec_present=1 && LIBS="$LIBS -lopencore-amrwb"])
- AC_CHECK_LIB(vo-amrwbenc,E_IF_init,[opencore_amrwb_enc_present=1 && LIBS="$LIBS -lvo-amrwbenc"])
- if test "x$opencore_amrwb_enc_h_present" = "x1" -a "x$opencore_amrwb_dec_h_present" = "x1" -a "x$opencore_amrwb_enc_present" = "x1" -a "x$opencore_amrwb_dec_present" = "x1"; then
- AC_MSG_RESULT([OpenCORE AMR-WB library found, AMR-WB support enabled])
- AC_DEFINE(PJMEDIA_HAS_OPENCORE_AMRWB_CODEC,1)
- else
- [ac_no_opencore_amrwb=1]
- AC_DEFINE(PJMEDIA_HAS_OPENCORE_AMRWB_CODEC,0)
- fi
- ])
- dnl
- AC_ARG_WITH(silk,
- AS_HELP_STRING([--with-silk=DIR],
- [Specify alternate SILK prefix]),
- [],
- [with_silk=no]
- )
- dnl
- if test "x$ac_cross_compile" != "x" -a "x$with_silk" = "xno"; then
- enable_silk=no
- fi
- dnl
- AC_SUBST(ac_no_silk)
- AC_ARG_ENABLE(silk,
- AS_HELP_STRING([--disable-silk],
- [Exclude SILK support from the build (default: autodetect)])
- ,
- [
- if test "$enable_silk" = "no"; then
- [ac_no_silk=1]
- AC_DEFINE(PJMEDIA_HAS_SILK_CODEC,0)
- AC_MSG_RESULT([Checking if SILK support is disabled... yes])
- fi
- ],
- [
- AC_MSG_RESULT([checking for SILK installations..])
- if test "x$with_silk" != "xno" -a "x$with_silk" != "x"; then
- CFLAGS="$CFLAGS -I$with_silk/interface"
- CPPFLAGS="$CPPFLAGS -I$with_silk/interface"
- LDFLAGS="$LDFLAGS -L$with_silk"
- AC_MSG_RESULT([Using SILK prefix... $with_silk])
- fi
- AC_SUBST(silk_h_present)
- AC_SUBST(silk_present)
- AC_CHECK_HEADER(SKP_Silk_SDK_API.h,[silk_h_present=1])
- AC_CHECK_LIB(SKP_SILK_SDK,SKP_Silk_SDK_get_version,[silk_present=1 && LIBS="$LIBS -lSKP_SILK_SDK"])
- if test "x$silk_h_present" = "x1" -a "x$silk_present" = "x1"; then
- AC_MSG_RESULT([SILK library found, SILK support enabled])
- AC_DEFINE(PJMEDIA_HAS_SILK_CODEC,1)
- else
- [ac_no_silk=1]
- AC_DEFINE(PJMEDIA_HAS_SILK_CODEC,0)
- fi
- ])
- dnl
- if test "x$ac_cross_compile" != "x" -a "x$with_opus" = "xno"; then
- enable_opus=no
- fi
- dnl
- AC_ARG_WITH(opus,
- AS_HELP_STRING([--with-opus=DIR],
- [Specify alternate OPUS prefix]),
- [],
- [with_opus=no]
- )
- dnl
- AC_SUBST(ac_no_opus)
- AC_ARG_ENABLE(opus,
- AS_HELP_STRING([--disable-opus],
- [Exclude OPUS support from the build (default: autodetect)])
- ,
- [
- if test "$enable_opus" = "no"; then
- [ac_no_opus=1]
- AC_DEFINE(PJMEDIA_HAS_OPUS_CODEC,0)
- AC_MSG_RESULT([Checking if OPUS support is disabled... yes])
- fi
- ],
- [
- AC_MSG_RESULT([checking for OPUS installations..])
- if test "x$with_opus" != "xno" -a "x$with_opus" != "x"; then
- CFLAGS="$CFLAGS -I$with_opus/include"
- CPPFLAGS="$CPPFLAGS -I$with_opus/include"
- LDFLAGS="$LDFLAGS -L$with_opus/lib"
- AC_MSG_RESULT([Using OPUS prefix... $with_opus])
- fi
- AC_SUBST(opus_h_present)
- AC_SUBST(opus_present)
- AC_CHECK_HEADER(opus/opus.h,[opus_h_present=1])
- AC_CHECK_LIB(opus,opus_repacketizer_get_size,[opus_present=1 && LIBS="-lopus $LIBS"])
- if test "x$opus_h_present" = "x1" -a "x$opus_present" = "x1"; then
- AC_MSG_RESULT([OPUS library found, OPUS support enabled])
- AC_DEFINE(PJMEDIA_HAS_OPUS_CODEC,1)
- else
- [ac_no_opus=1]
- AC_MSG_RESULT([OPUS library not found, OPUS support disabled])
- AC_DEFINE(PJMEDIA_HAS_OPUS_CODEC,0)
- fi
- ])
- dnl
- AC_ARG_WITH(bcg729,
- AS_HELP_STRING([--with-bcg729=DIR],
- [Specify alternate bcg729 prefix]),
- [],
- [with_bcg729=no]
- )
- dnl
- if test "x$ac_cross_compile" != "x" -a "x$with_bcg729" = "xno"; then
- enable_bcg729=no
- fi
- dnl
- AC_SUBST(ac_no_bcg729)
- AC_ARG_ENABLE(bcg729,
- AS_HELP_STRING([--disable-bcg729],
- [Disable bcg729 (default: not disabled)]),
- [
- if test "$enable_bcg729" = "no"; then
- [ac_no_bcg729=1]
- AC_DEFINE(PJMEDIA_HAS_BCG729,0)
- AC_MSG_RESULT([Checking if bcg729 is disabled... yes])
- fi
- ],
- [
- if test "x$with_bcg729" != "xno" -a "x$with_bcg729" != "x"; then
- BCG729_PREFIX=$with_bcg729
- BCG729_CFLAGS="-I$BCG729_PREFIX/include"
- BCG729_LDFLAGS="-L$BCG729_PREFIX/lib"
- AC_MSG_RESULT([Using bcg729 prefix... $with_bcg729])
- else
- BCG729_CFLAGS=""
- BCG729_LDFLAGS=""
- fi
- AC_MSG_CHECKING([bcg729 usability])
- BCG729_LIBS="-lbcg729"
-
- SAVED_LIBS="$LIBS"
- SAVED_LDFLAGS="$LDFLAGS"
- SAVED_CFLAGS="$CFLAGS"
-
- LIBS="$BCG729_LIBS $LIBS"
- LDFLAGS="$BCG729_LDFLAGS $LDFLAGS"
- CFLAGS="$BCG729_CFLAGS $CFLAGS"
-
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-
- ]],
- [initBcg729EncoderChannel(0);]
- )],
- [
- AC_DEFINE(PJMEDIA_HAS_BCG729,1)
- AC_MSG_RESULT(yes)
- ],
- [
- [ac_no_bcg729=1]
- AC_DEFINE(PJMEDIA_HAS_BCG729,0)
- LIBS="$SAVED_LIBS"
- LDFLAGS="$SAVED_LDFLAGS"
- CFLAGS="$SAVED_CFLAGS"
- AC_MSG_RESULT(no)
- ])
- ])
-
- dnl
- AC_ARG_WITH(lyra,
- AS_HELP_STRING([--with-lyra=DIR],
- [Specify alternate lyra prefix]),
- [],
- [with_lyra=no]
- )
- dnl
- if test "x$ac_cross_compile" != "x" -a "x$with_lyra" = "xno"; then
- enable_lyra=no
- fi
- dnl
- AC_SUBST(ac_no_lyra_codec)
- AC_SUBST(ac_lyra_model_path)
- AC_ARG_ENABLE(lyra,
- AS_HELP_STRING([--disable-lyra],
- [Disable lyra (default: not disabled)]),
- [
- if test "$enable_lyra" = "no"; then
- [ac_no_lyra_codec=1]
- AC_DEFINE(PJMEDIA_HAS_LYRA_CODEC,0)
- AC_MSG_RESULT([Checking if lyra is disabled... yes])
- fi
- ],
- [
- if test "x$with_lyra" != "xno" -a "x$with_lyra" != "x"; then
- LYRA_PREFIX=$with_lyra
- dnl
- LYRA_CPPFLAGS="-DGLOG_DEPRECATED=__attribute__((deprecated)) -DGLOG_EXPORT=__attribute__((visibility(\"default\"))) -DGLOG_NO_EXPORT=__attribute__((visibility(\"default\")))"
- LYRA_CXXFLAGS="-std=c++17 -Wno-deprecated-builtins -I$LYRA_PREFIX/include/com_google_absl -I$LYRA_PREFIX/include/gulrak_filesystem -I$LYRA_PREFIX/include/com_google_glog/src -I$LYRA_PREFIX"
- LYRA_LDFLAGS="-L$LYRA_PREFIX/lib"
- AC_MSG_RESULT([Using lyra prefix... $with_lyra])
- else
- LYRA_CXXFLAGS=""
- LYRA_LDFLAGS=""
- fi
- AC_MSG_CHECKING([lyra usability])
- LYRA_LIBS="-llyra"
- SAVED_LIBS="$LIBS"
- SAVED_LDFLAGS="$LDFLAGS"
- SAVED_CXXFLAGS="$CXXFLAGS"
- SAVED_CPPFLAGS="$CPPFLAGS"
- LIBS="$LYRA_LIBS $LIBS"
- LDFLAGS="$LYRA_LDFLAGS $LDFLAGS"
- CXXFLAGS="$LYRA_CXXFLAGS $CXXFLAGS"
- CPPFLAGS="$LYRA_CPPFLAGS $CPPFLAGS"
- AC_LANG_PUSH([C++])
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
- ]],
- [std::unique_ptr<chromemedia::codec::LyraDecoder> dec = chromemedia::codec::LyraDecoder::Create(8000,1,"");]
- )],
- [
- [ac_lyra_model_path="$LYRA_PREFIX/model_coeffs"]
- AC_DEFINE(PJMEDIA_HAS_LYRA_CODEC,1)
- dnl
- LYRA_CPPFLAGS="'-DGLOG_DEPRECATED=__attribute__((deprecated))' '-DGLOG_EXPORT=__attribute__((visibility(\"default\")))' '-DGLOG_NO_EXPORT=__attribute__((visibility(\"default\")))'"
- CXXFLAGS="$LYRA_CPPFLAGS $CXXFLAGS"
- AC_MSG_RESULT(yes)
- ],
- [
- [ac_no_lyra_codec=1]
- LIBS="$SAVED_LIBS"
- LDFLAGS="$SAVED_LDFLAGS"
- CXXFLAGS="$SAVED_CXXFLAGS"
- AC_MSG_RESULT(no)
- ])
- AC_LANG_POP([C++])
- CPPFLAGS="$SAVED_CPPFLAGS"
- ])
- dnl
- AC_SUBST(ac_no_srtp)
- AC_ARG_ENABLE(libsrtp,
- AS_HELP_STRING([--disable-libsrtp],
- [Exclude libsrtp in the build]),
- [if test "$enable_libsrtp" = "no"; then
- [ac_no_srtp=1]
- CFLAGS="$CFLAGS -DPJMEDIA_HAS_SRTP=0"
- AC_MSG_RESULT([Checking if libsrtp is disabled...yes])
- fi],
- AC_MSG_RESULT([Checking if libsrtp is disabled...no]))
- dnl
- AC_SUBST(ac_no_yuv)
- AC_ARG_ENABLE(libyuv,
- AS_HELP_STRING([--disable-libyuv],
- [Exclude libyuv in the build]),
- [if test "$enable_libyuv" = "no"; then
- [ac_no_yuv=1]
- AC_DEFINE(PJMEDIA_HAS_LIBYUV,0)
- AC_MSG_RESULT([Checking if libyuv is disabled...yes])
- fi],
- AC_MSG_RESULT([Checking if libyuv is disabled...no]))
- dnl
- AC_SUBST(ac_no_webrtc)
- AC_SUBST(ac_webrtc_instset)
- AC_SUBST(ac_webrtc_cflags)
- AC_SUBST(ac_webrtc_ldflags)
- AC_ARG_ENABLE(libwebrtc,
- AS_HELP_STRING([--disable-libwebrtc],
- [Exclude libwebrtc in the build]),
- [if test "$enable_libwebrtc" = "no"; then
- [ac_no_webrtc=1]
- AC_DEFINE(PJMEDIA_HAS_LIBWEBRTC,0)
- AC_MSG_RESULT([Checking if libwebrtc is disabled...yes])
- fi],
- [
- AC_MSG_RESULT([Checking if libwebrtc is disabled...no])
- case $target in
- *-apple-darwin_ios*)
- case $target in
- arm64*)
- ac_webrtc_instset=neon
- ac_webrtc_cflags="-DWEBRTC_ARCH_ARM64"
- ;;
- *arm*)
- ac_webrtc_instset=neon
- ;;
- *)
- ac_webrtc_instset=sse2
- ;;
- esac
- ;;
- *android*)
- case $TARGET_ABI in
- armeabi-v7a)
- ac_webrtc_instset=neon
- ac_webrtc_cflags="-mfloat-abi=softfp -mfpu=neon"
- ;;
- armeabi)
- ac_webrtc_instset=neon
- ac_webrtc_cflags="-mthumb -mfloat-abi=softfp -mfpu=neon -march=armv7"
- ;;
- arm64*)
- ac_webrtc_instset=neon
- ac_webrtc_cflags="-DWEBRTC_ARCH_ARM64"
- ;;
- mips64*)
- ac_webrtc_instset=generic
- ;;
- mips*)
- ac_webrtc_instset=mips
- ;;
- x86*)
- ac_webrtc_instset=sse2
- ;;
- *)
- ac_webrtc_instset=generic
- ;;
- esac
- ;;
- *mingw* | *cygw*)
- ac_webrtc_instset=sse2
- ac_webrtc_cflags="-msse2"
- ;;
- *win32* | *w32* | *darwin* | *linux*)
- case $target in
- armv7l*gnueabihf)
- ac_webrtc_instset=neon
- ac_webrtc_cflags="-DWEBRTC_ARCH_ARM_V7 -mfloat-abi=hard -mfpu=neon"
- ;;
- arm-apple-darwin* | aarch64*)
- ac_webrtc_instset=neon
- ac_webrtc_cflags="-DWEBRTC_ARCH_ARM64"
- ;;
- *)
- ac_webrtc_instset=sse2
- ;;
- esac
- ;;
- *)
- ;;
- esac
- ])
- dnl
- AC_SUBST(ac_no_webrtc_aec3)
- AC_SUBST(ac_webrtc_aec3_instset)
- AC_SUBST(ac_webrtc_aec3_cflags)
- AC_SUBST(ac_webrtc_aec3_ldflags)
- AC_ARG_ENABLE(libwebrtc_aec3,
- AS_HELP_STRING([--enable-libwebrtc-aec3],
- [Build libwebrtc-aec3 that's included in PJSIP]),
- [
- if test "$enable_libwebrtc_aec3" = "yes"; then
- # Test if we can build WebRtc AEC3
- AC_MSG_CHECKING([if WebRtc AEC3 can be compiled with C++17])
-
- SAVED_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -std=c++17"
-
- AC_LANG_PUSH([C++])
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],
- [AC_MSG_RESULT(yes)
- LD="$CXX"],
- [AC_MSG_RESULT(no)
- CXXFLAGS="$SAVED_CXXFLAGS"
- ac_no_webrtc_aec3=1
- AC_DEFINE(PJMEDIA_HAS_LIBWEBRTC_AEC3,0)])
- AC_LANG_POP([C++])
- case $target in
- *-apple-darwin_ios*)
- case $target in
- arm64*)
- ac_webrtc_aec3_instset=neon
- ac_webrtc_aec3_cflags="-DWEBRTC_ARCH_ARM64"
- ;;
- *arm*)
- ac_webrtc_aec3_instset=neon
- ;;
- *)
- ac_webrtc_aec3_instset=sse2
- ;;
- esac
- ac_webrtc_aec3_cflags+=" -DWEBRTC_IOS=1"
- ;;
- *android*)
- case $TARGET_ABI in
- armeabi-v7a)
- ac_webrtc_aec3_instset=neon
- ac_webrtc_aec3_cflags="-mfloat-abi=softfp -mfpu=neon"
- ;;
- armeabi)
- ac_webrtc_aec3_instset=neon
- ac_webrtc_aec3_cflags="-mthumb -mfloat-abi=softfp -mfpu=neon -march=armv7"
- ;;
- arm64*)
- ac_webrtc_aec3_instset=neon
- ac_webrtc_aec3_cflags="-DWEBRTC_ARCH_ARM64"
- ;;
- x86*)
- ac_webrtc_aec3_instset=sse2
- ;;
- esac
- ac_webrtc_aec3_cflags+=" -DWEBRTC_ANDROID=1"
- ;;
- *mingw* | *cygw*)
- ac_webrtc_aec3_instset=sse2
- ac_webrtc_aec3_cflags="-msse2"
- ;;
- *win32* | *w32* | *darwin* | *linux*)
- case $target in
- armv7l*gnueabihf)
- ac_webrtc_aec3_instset=neon
- ac_webrtc_aec3_cflags="-DWEBRTC_ARCH_ARM_V7 -mfloat-abi=hard -mfpu=neon"
- ;;
- arm-apple-darwin* | aarch64*)
- ac_webrtc_aec3_instset=neon
- ac_webrtc_aec3_cflags="-DWEBRTC_ARCH_ARM64"
- ;;
- *)
- ac_webrtc_aec3_instset=sse2
- ;;
- esac
- case $target in
- *darwin*)
- ac_webrtc_aec3_cflags+=" -DWEBRTC_MAC=1"
- ;;
- *linux*)
- ac_webrtc_aec3_cflags+=" -DWEBRTC_LINUX=1"
- ;;
- esac
- ;;
- *)
- ;;
- esac
- ac_webrtc_aec3_cflags+=" -DWEBRTC_APM_DEBUG_DUMP=0 -DWEBRTC_POSIX=1"
- else
- ac_no_webrtc_aec3=1
- AC_DEFINE(PJMEDIA_HAS_LIBWEBRTC_AEC3,0)
- AC_MSG_RESULT([Checking if libwebrtc-aec3 is enabled...no])
- fi
- ],
- [ac_no_webrtc_aec3=1
- AC_DEFINE(PJMEDIA_HAS_LIBWEBRTC_AEC3,0)
- AC_MSG_RESULT([Checking if libwebrtc-aec3 is enabled...no])
- ])
- dnl ##########################################
- dnl #
- dnl # MANUAL CONFIG
- dnl #
- dnl # Determine if select() requires nfds to be filled up with
- dnl # correct value (max_fd+1). If zero, nfds will be filled up with
- dnl # PJ_FD_SETSIZE
- AC_MSG_CHECKING([if select() needs correct nfds])
- case $target in
- *rtems*) AC_DEFINE(PJ_SELECT_NEEDS_NFDS,1)
- AC_MSG_RESULT(yes)
- ;;
- *) AC_DEFINE(PJ_SELECT_NEEDS_NFDS,0)
- AC_MSG_RESULT([no (default)])
- AC_MSG_RESULT([** Decided that select() doesn't need correct nfds (please check)])
- ;;
- esac
- dnl
- dnl
- dnl
- AC_MSG_CHECKING([if pj_thread_create() should enforce stack size])
- case $target in
- *rtems*) AC_DEFINE(PJ_THREAD_SET_STACK_SIZE,1)
- AC_MSG_RESULT(yes)
- ;;
- *) AC_DEFINE(PJ_THREAD_SET_STACK_SIZE,0)
- AC_MSG_RESULT([no (default)])
- ;;
- esac
- dnl
- dnl
- AC_MSG_CHECKING([if pj_thread_create() should allocate stack])
- case $target in
- *rtems*) AC_DEFINE(PJ_THREAD_ALLOCATE_STACK,1)
- AC_MSG_RESULT(yes)
- ;;
- *) AC_DEFINE(PJ_THREAD_ALLOCATE_STACK,0)
- AC_MSG_RESULT([no (default)])
- ;;
- esac
- dnl
- dnl
- case $target in
- *mingw* | *cygw* | *win32* | *w32* )
- AC_DEFINE(PJ_BLOCKING_ERROR_VAL,WSAEWOULDBLOCK)
- ;;
- *) AC_DEFINE(PJ_BLOCKING_ERROR_VAL,EAGAIN)
- AC_MSG_RESULT([** Setting non-blocking recv() retval to EAGAIN (please check)])
- ;;
- esac
- dnl
- dnl
- case $target in
- *mingw* | *cygw* | *win32* | *w32* )
- AC_DEFINE(PJ_BLOCKING_CONNECT_ERROR_VAL,WSAEWOULDBLOCK)
- ;;
- *) AC_DEFINE(PJ_BLOCKING_CONNECT_ERROR_VAL,EINPROGRESS)
- AC_MSG_RESULT([** Setting non-blocking connect() retval to EINPROGRESS (please check)])
- ;;
- esac
- dnl
- dnl
- dnl
- dnl
- dnl
- case $target in
- *linux* | *darwin* | *bsd*)
- AC_CHECK_HEADER(pthread_np.h,[AC_DEFINE(PJ_HAS_PTHREAD_NP_H,1)])
- AC_CHECK_FUNC(pthread_setname_np,[AC_DEFINE(PJ_HAS_PTHREAD_SETNAME_NP,1)])
- AC_CHECK_FUNC(pthread_set_name_np,[AC_DEFINE(PJ_HAS_PTHREAD_SET_NAME_NP,1)])
- ;;
- esac
- AC_SUBST(target)
- AC_SUBST(ac_host,unix)
- AC_SUBST(ac_main_obj)
- case $target in
- *rtems*)
- ac_main_obj=main_rtems.o
- ;;
- *)
- ac_main_obj=main.o
- ;;
- esac
- AC_SUBST(CC)
- ac_build_mak_vars=`echo $ac_build_mak_vars | sed 's/\\\\n/\n/g'`
- AC_OUTPUT
- AC_MSG_RESULT([
- 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.
- Further customizations can be put in:
- - 'user.mak'
- - 'pjlib/include/pj/config_site.h'
- The next step now is to run 'make dep' and 'make'.
- ])
|