configure.ac 85 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602
  1. # Process this file with autoconf to produce a configure script.
  2. #
  3. # Make sure we use autoconf 2.60 to generate the "configure" script,
  4. # in case we want to commit it. Other than that, version 2.59 is
  5. # perfectly fine for our purposes, so people who want to modify
  6. # this file just have to remember to set the AC_PREREQ argument
  7. # to something that suits their needs.
  8. AC_PREREQ(2.60)
  9. AC_INIT([asterisk], [trunk], [https://issues.asterisk.org])
  10. # cross-compile macros
  11. AC_CANONICAL_BUILD
  12. AC_CANONICAL_HOST
  13. # check existence of the package
  14. AC_CONFIG_SRCDIR([main/asterisk.c])
  15. AC_CONFIG_AUX_DIR(`pwd`)
  16. AC_COPYRIGHT("Asterisk")
  17. AC_REVISION($Revision$)
  18. # preserve any CFLAGS or LDFLAGS that may be set
  19. # NOTE: This must be done before calling any macros that end up
  20. # calling AC_PROG_CC or the like, since they will set a default
  21. # set of CFLAGS ("-g -O2") if the user did not supply any, and
  22. # we don't want those default flags to be carried over into the
  23. # rest of the build system since we have other means of controlling
  24. # debugging symbol generation and optimization.
  25. CONFIG_CFLAGS="${CFLAGS}"
  26. CONFIG_LDFLAGS="${LDFLAGS}"
  27. AC_SUBST(CONFIG_CFLAGS)
  28. AC_SUBST(CONFIG_LDFLAGS)
  29. # specify output header file
  30. AC_CONFIG_HEADER(include/asterisk/autoconfig.h)
  31. # Note: AC_PROG_CC *must* be specified before AC_USE_SYSTEM_EXTENSIONS or any
  32. # other macro that uses the C compiler, or the default order will be used.
  33. AC_PROG_CC([gcc cc])
  34. AC_USE_SYSTEM_EXTENSIONS dnl note- does not work on FreeBSD
  35. # System default paths
  36. AC_SUBST([astsbindir], ['${sbindir}'])dnl
  37. AC_SUBST([astetcdir], ['${sysconfdir}/asterisk'])dnl
  38. AC_SUBST([astheaderdir], ['${includedir}/asterisk'])dnl
  39. AC_SUBST([astlibdir], ['${libdir}'])dnl
  40. AC_SUBST([astmoddir], ['${libdir}/asterisk/modules'])dnl
  41. AC_SUBST([astmandir], ['${mandir}'])dnl
  42. AC_SUBST([astvarlibdir], ['${localstatedir}/lib/asterisk'])dnl
  43. AC_SUBST([astdatadir], ['${astvarlibdir}'])dnl
  44. AC_SUBST([astdbdir], ['${astvarlibdir}'])dnl
  45. AC_SUBST([astkeydir], ['${astvarlibdir}'])dnl
  46. AC_SUBST([astspooldir], ['${localstatedir}/spool/asterisk'])dnl
  47. AC_SUBST([astlogdir], ['${localstatedir}/log/asterisk'])dnl
  48. AC_SUBST([astvarrundir], ['${localstatedir}/run/asterisk'])dnl
  49. case "${host_os}" in
  50. *bsd*)
  51. if test ${prefix} = 'NONE'; then
  52. astvarlibdir='${prefix}/share/asterisk'
  53. astdbdir='${localstatedir}/db/asterisk'
  54. fi
  55. ;;
  56. darwin*)
  57. if test ${prefix} = 'NONE'; then
  58. astvarrundir='/Library/Application Support/Asterisk/Run'
  59. fi
  60. ;;
  61. esac
  62. case "${host_os}" in
  63. freebsd*)
  64. ac_default_prefix=/usr/local
  65. CPPFLAGS=-I/usr/local/include
  66. LDFLAGS=-L/usr/local/lib
  67. ;;
  68. openbsd*)
  69. ac_default_prefix=/usr/local
  70. if test ${prefix} = '/usr/local' || test ${prefix} = 'NONE'; then
  71. if test ${sysconfdir} = '${prefix}/etc'; then
  72. astetcdir=/etc/asterisk
  73. fi
  74. if test ${mandir} = '${prefix}/man'; then
  75. astmandir=/usr/share/man
  76. fi
  77. fi
  78. CPPFLAGS=-I/usr/local/include
  79. LDFLAGS=-L/usr/local/lib
  80. ;;
  81. darwin*)
  82. ac_default_prefix=/usr/local
  83. if test ${prefix} = 'NONE'; then
  84. astmoddir='/Library/Application Support/Asterisk/Modules'
  85. astvarlibdir='/Library/Application Support/Asterisk'
  86. astlogdir=/Library/Logs/Asterisk
  87. astvarrundir='/Library/Application Support/Asterisk/Run'
  88. fi
  89. AC_DEFINE([AST_POLL_COMPAT], 1, [Define to 1 if internal poll should be used.])
  90. AC_DEFINE([_DARWIN_UNLIMITED_SELECT], 1, [Define to 1 if running on Darwin.])
  91. ;;
  92. solaris*)
  93. if test ${prefix} = 'NONE'; then
  94. astetcdir=/var/etc/asterisk
  95. astsbindir=/opt/asterisk/sbin
  96. astlibdir=/opt/asterisk/lib
  97. astmoddir=/opt/asterisk/lib/modules
  98. astheaderdir=/opt/asterisk/include
  99. astmandir=/opt/asterisk/man
  100. astvarlibdir=/var/opt/asterisk
  101. astspooldir=/var/spool/asterisk
  102. astlogdir=/var/log/asterisk
  103. astvarrundir=/var/run/asterisk
  104. fi
  105. ;;
  106. *)
  107. ac_default_prefix=/usr
  108. if test ${prefix} = '/usr' || test ${prefix} = 'NONE'; then
  109. if test ${sysconfdir} = '${prefix}/etc'; then
  110. sysconfdir=/etc
  111. fi
  112. if test ${mandir} = '${prefix}/man'; then
  113. mandir=/usr/share/man
  114. fi
  115. fi
  116. ;;
  117. esac
  118. if test ${prefix} = ${ac_default_prefix} || test ${prefix} = 'NONE'; then
  119. if test ${localstatedir} = '${prefix}/var'; then
  120. localstatedir=/var
  121. fi
  122. fi
  123. BUILD_PLATFORM=${build}
  124. BUILD_CPU=${build_cpu}
  125. BUILD_VENDOR=${build_vendor}
  126. BUILD_OS=${build_os}
  127. AC_SUBST(BUILD_PLATFORM)
  128. AC_SUBST(BUILD_CPU)
  129. AC_SUBST(BUILD_VENDOR)
  130. AC_SUBST(BUILD_OS)
  131. HOST_PLATFORM=${host}
  132. HOST_CPU=${host_cpu}
  133. HOST_VENDOR=${host_vendor}
  134. HOST_OS=${host_os}
  135. AC_SUBST(HOST_PLATFORM)
  136. AC_SUBST(HOST_CPU)
  137. AC_SUBST(HOST_VENDOR)
  138. AC_SUBST(HOST_OS)
  139. PBX_WINARCH=0
  140. case "${host_os}" in
  141. freebsd*)
  142. OSARCH=FreeBSD
  143. ;;
  144. netbsd*)
  145. OSARCH=NetBSD
  146. ;;
  147. openbsd*)
  148. OSARCH=OpenBSD
  149. ;;
  150. solaris*)
  151. OSARCH=SunOS
  152. ;;
  153. mingw32)
  154. OSARCH=mingw32
  155. PBX_WINARCH=1
  156. ;;
  157. cygwin)
  158. OSARCH=cygwin
  159. PBX_WINARCH=1
  160. ;;
  161. linux-gnueabi* | linux-gnuspe)
  162. OSARCH=linux-gnu
  163. ;;
  164. kfreebsd*-gnu)
  165. OSARCH=kfreebsd-gnu
  166. ;;
  167. *)
  168. OSARCH=${host_os}
  169. ;;
  170. esac
  171. AC_SUBST(OSARCH)
  172. AC_SUBST(PBX_WINARCH)
  173. AC_MSG_CHECKING(whether char is unsigned)
  174. AC_COMPILE_IFELSE(
  175. [
  176. AC_LANG_SOURCE(
  177. #include <limits.h>
  178. #if CHAR_MIN == 0
  179. #error
  180. #endif
  181. )
  182. ],[
  183. AC_MSG_RESULT(no)
  184. CONFIG_SIGNED_CHAR=""
  185. ],[
  186. AC_MSG_RESULT(yes)
  187. CONFIG_SIGNED_CHAR="-fsigned-char"
  188. ]
  189. )
  190. AC_SUBST(CONFIG_SIGNED_CHAR)
  191. # check for uname
  192. AC_PATH_TOOL([UNAME], [uname], No)
  193. if test ! x"${UNAME}" = xNo; then
  194. PBX_OSREV=$(${UNAME} -r)
  195. fi
  196. AC_SUBST(PBX_OSREV)
  197. AH_TOP(
  198. #ifndef ASTERISK_AUTOCONFIG_H
  199. #define ASTERISK_AUTOCONFIG_H
  200. #include "asterisk/buildopts.h"
  201. )
  202. AH_BOTTOM(
  203. #endif
  204. )
  205. # cross-compile checks
  206. if test "${cross_compiling}" = "yes";
  207. then
  208. AC_CHECK_TOOL(CC, gcc, :)
  209. AC_CHECK_TOOL(CXX, g++, :)
  210. AC_CHECK_TOOL(LD, ld, :)
  211. AC_CHECK_TOOL(RANLIB, ranlib, :)
  212. fi
  213. # Checks for programs.
  214. AC_PROG_CXX
  215. AC_PROG_CPP
  216. AC_PROG_CXXCPP
  217. # This macro is just copied into our local acinclude.m4 from libtool.m4 so that
  218. # the developers regenerating the configure script don't have to install libtool.
  219. AST_PROG_LD # note, does not work on FreeBSD
  220. AC_PROG_AWK
  221. AC_PROG_INSTALL
  222. AC_PROG_LN_S
  223. AC_PROG_RANLIB
  224. AST_CHECK_GNU_MAKE
  225. AC_PROG_EGREP
  226. AC_CHECK_TOOLS([STRIP], [strip gstrip], :)
  227. AC_CHECK_TOOLS([AR], [ar gar], :)
  228. GNU_LD=0
  229. if test "x$with_gnu_ld" = "xyes" ; then
  230. GNU_LD=1
  231. fi
  232. AC_SUBST(GNU_LD)
  233. AC_PATH_PROG([BISON], [bison], :)
  234. AC_PATH_PROG([CMP], [cmp], :)
  235. AC_PATH_PROG([FLEX], [flex], :)
  236. AC_PATH_PROG([GREP], [grep], :)
  237. AC_PATH_PROG([PYTHON], [python], :)
  238. AC_PATH_PROG([FIND], [find], :)
  239. AC_PATH_PROG([COMPRESS], [compress], :)
  240. AC_PATH_PROG([BASENAME], [basename], :)
  241. AC_PATH_PROG([DIRNAME], [dirname], :)
  242. AC_PATH_PROG([SHELL], [sh], :)
  243. AC_PATH_PROG([LN], [ln], :)
  244. AC_PATH_PROG([DOXYGEN], [doxygen], :)
  245. AC_PATH_PROG([DOT], [dot], :)
  246. AC_PATH_PROG([WGET], [wget], :)
  247. AC_PATH_PROG([CURL], [curl], :)
  248. AC_PATH_PROG([RUBBER], [rubber], :)
  249. AC_PATH_PROG([CATDVI], [catdvi], :)
  250. AC_PATH_PROG([KPATHSEA], [kpsewhich], :)
  251. AC_PATH_PROG([XMLLINT], [xmllint], :)
  252. AC_PATH_PROG([XMLSTARLET], [xmlstarlet], :)
  253. AC_PATH_PROG([GIT], [git], :)
  254. if test "${WGET}" != ":" ; then
  255. DOWNLOAD=${WGET}
  256. else if test "${CURL}" != ":" ; then
  257. DOWNLOAD="${CURL} -O --progress-bar -w \"%{url_effective}\n\""
  258. else
  259. AC_PATH_PROG([FETCH], [fetch], [:])
  260. DOWNLOAD=${FETCH}
  261. fi
  262. fi
  263. AC_SUBST(DOWNLOAD)
  264. AC_PATH_PROG([LDCONFIG], [ldconfig], :)
  265. AC_PATH_PROG([SHA1SUM], [sha1sum], $ac_aux_dir/build_tools/sha1sum-sh)
  266. AC_PATH_PROG([OPENSSL], [openssl], :)
  267. AC_CACHE_CHECK([for bison that supports parse-param], [ac_cv_path_BISON2], [
  268. if test "x$BISON" != "x:" ; then
  269. # Create a temporary directory $tmp in $TMPDIR (default /tmp).
  270. # Use mktemp if possible; otherwise fall back on mkdir,
  271. # with $RANDOM to make collisions less likely.
  272. : ${TMPDIR=/tmp}
  273. {
  274. tmp=`
  275. (umask 077 && mktemp -d "$TMPDIR/fooXXXXXX") 2>/dev/null
  276. ` &&
  277. test -n "$tmp" && test -d "$tmp"
  278. } || {
  279. tmp=$TMPDIR/foo$$-$RANDOM
  280. (umask 077 && mkdir "$tmp")
  281. } || exit $?
  282. cat >$tmp/test.y <<__EOL__
  283. %parse-param {struct parse_io *parseio}
  284. %%
  285. file : { \$\$ = parseio->pval = 1; }
  286. ;
  287. %%
  288. __EOL__
  289. ${BISON} -o ${tmp}/test.tab.c ${tmp}/test.y >/dev/null 2>&1
  290. if test -e "${tmp}/test.tab.c"; then
  291. ac_cv_path_BISON2=${BISON}
  292. fi
  293. rm -rf ${tmp}
  294. fi
  295. ])
  296. if test "x${ac_cv_path_BISON2}" = "x" ; then
  297. BISON=:
  298. PBX_BISON=0
  299. else
  300. PBX_BISON=1
  301. fi
  302. AC_SUBST(PBX_BISON)
  303. if test "x${FLEX}" = "x:" ; then
  304. PBX_FLEX=0
  305. else
  306. PBX_FLEX=1
  307. fi
  308. AC_SUBST(PBX_FLEX)
  309. AC_CHECK_TOOL([SOXMIX], [soxmix], [:])
  310. if test "${SOXMIX}" != ":" ; then
  311. AC_DEFINE([HAVE_SOXMIX], 1, [Define to 1 if your system has soxmix application.])
  312. fi
  313. AC_CHECK_PROGS([MD5], [md5 md5sum gmd5sum digest])
  314. if test "${MD5}" = "digest" ; then
  315. MD5="${MD5} -a md5"
  316. fi
  317. ACX_PTHREAD
  318. AC_LANG(C)
  319. AC_ARG_ENABLE([dev-mode],
  320. [AS_HELP_STRING([--enable-dev-mode],
  321. [Turn on developer mode])],
  322. [case "${enableval}" in
  323. y|ye|yes) AST_DEVMODE=yes ;;
  324. n|no) AST_DEVMODE=no ;;
  325. noisy)
  326. AST_DEVMODE=yes
  327. NOISY_BUILD=yes
  328. ;;
  329. strict)
  330. AST_DEVMODE=yes
  331. AST_DEVMODE_STRICT=yes
  332. ;;
  333. *) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode) ;;
  334. esac])
  335. AC_SUBST(NOISY_BUILD)
  336. AC_SUBST(AST_DEVMODE)
  337. AC_SUBST(AST_DEVMODE_STRICT)
  338. AST_CODE_COVERAGE=no
  339. AC_ARG_ENABLE([coverage],
  340. [AS_HELP_STRING([--enable-coverage],
  341. [Turn on code coverage tracking (for gcov)])],
  342. [case "${enableval}" in
  343. y|ye|yes) AST_CODE_COVERAGE=yes ;;
  344. n|no) AST_CODE_COVERAGE=no ;;
  345. *) AC_MSG_ERROR(bad value ${enableval} for --enable-coverage) ;;
  346. esac])
  347. AC_SUBST(AST_CODE_COVERAGE)
  348. # AST_EXT_LIB_SETUP is used to tell configure to handle variables for
  349. # various packages.
  350. # $1 is the prefix for the variables in makeopts and autoconfig.h
  351. # $2 is the short comment, $4 is the long comment
  352. # $3 is the name used in --with- or --without- flags for configure.
  353. #
  354. # Package option names should be in alphabetical order
  355. # by the --with option name (the third field),
  356. # to make things easier for the users.
  357. AST_EXT_LIB_SETUP([ALSA], [Advanced Linux Sound Architecture], [asound])
  358. AST_EXT_LIB_SETUP([BFD], [Debug symbol decoding], [bfd])
  359. # BKTR is used for backtrace support on platforms that do not
  360. # have it natively.
  361. AST_EXT_LIB_SETUP([BKTR], [Stack Backtrace], [execinfo])
  362. AST_EXT_LIB_SETUP([BLUETOOTH], [Bluetooth], [bluetooth])
  363. AST_EXT_LIB_SETUP([CAP], [POSIX 1.e capabilities], [cap])
  364. AST_EXT_LIB_SETUP([COROSYNC], [Corosync], [cpg])
  365. AST_EXT_LIB_SETUP_OPTIONAL([COROSYNC_CFG_STATE_TRACK], [A callback only in corosync 1.x], [COROSYNC], [cfg])
  366. AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
  367. AST_EXT_LIB_SETUP([CRYPT], [password and data encryption], [crypt])
  368. AST_EXT_LIB_SETUP([CRYPTO], [OpenSSL Cryptography], [crypto])
  369. AST_EXT_LIB_SETUP_OPTIONAL([OPENSSL_SRTP], [OpenSSL SRTP Extension Support], [CRYPTO], [crypto])
  370. AST_EXT_LIB_SETUP_OPTIONAL([OPENSSL_EC], [OpenSSL Elliptic Curve Support], [CRYPTO], [crypto])
  371. AST_EXT_LIB_SETUP([DAHDI], [DAHDI], [dahdi])
  372. AST_EXT_LIB_SETUP([FFMPEG], [Ffmpeg and avcodec], [avcodec])
  373. AST_EXT_LIB_SETUP([GSM], [External GSM], [gsm], [, use 'internal' GSM otherwise])
  374. AST_EXT_LIB_SETUP([ILBC], [System iLBC], [ilbc], [, use 'internal' iLBC otherwise])
  375. AST_EXT_LIB_SETUP([GTK2], [gtk2], [gtk2])
  376. AST_EXT_LIB_SETUP([GMIME], [GMime], [gmime])
  377. AST_EXT_LIB_SETUP([OPENH323], [OpenH323], [h323])
  378. AST_EXT_LIB_SETUP([HOARD], [Hoard Memory Allocator], [hoard])
  379. AST_EXT_LIB_SETUP([ICAL], [iCal], [ical])
  380. AST_EXT_LIB_SETUP([ICONV], [Iconv], [iconv])
  381. AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber], [iksemel])
  382. AST_EXT_LIB_SETUP([IMAP_TK], [UW IMAP Toolkit], [imap])
  383. AST_EXT_LIB_SETUP([INOTIFY], [inotify support], [inotify])
  384. AST_EXT_LIB_SETUP([IODBC], [iODBC], [iodbc])
  385. AST_EXT_LIB_SETUP([ISDNNET], [ISDN4Linux], [isdnnet])
  386. AST_EXT_LIB_SETUP([JACK], [Jack Audio Connection Kit], [jack])
  387. AST_EXT_LIB_SETUP([JANSSON], [Jansson JSON library], [jansson])
  388. AST_EXT_LIB_SETUP([URIPARSER], [uriparser library], [uriparser])
  389. AST_EXT_LIB_SETUP([KQUEUE], [kqueue support], [kqueue])
  390. AST_EXT_LIB_SETUP([LDAP], [OpenLDAP], [ldap])
  391. AST_LIBCURL_CHECK_CONFIG([], [7.10.1])
  392. AST_EXT_LIB_SETUP([LIBEDIT], [NetBSD Editline library], [libedit], [, use 'internal' Editline otherwise])
  393. AST_EXT_LIB_SETUP([LIBXML2], [LibXML2], [libxml2])
  394. AST_EXT_LIB_SETUP([LIBXSLT], [LibXSLT], [libxslt])
  395. AST_EXT_LIB_SETUP_OPTIONAL([LIBXSLT_CLEANUP], [LibXSLT Library Cleanup Function], [LIBXSLT], [libxslt])
  396. AST_EXT_LIB_SETUP([LTDL], [libtool], [ltdl])
  397. AST_EXT_LIB_SETUP([LUA], [Lua], [lua])
  398. AST_EXT_LIB_SETUP([MISDN], [mISDN user], [misdn])
  399. AST_EXT_LIB_SETUP([MYSQLCLIENT], [MySQL client], [mysqlclient])
  400. AST_EXT_LIB_SETUP([NBS], [Network Broadcast Sound], [nbs])
  401. AST_EXT_LIB_SETUP([NCURSES], [ncurses], [ncurses])
  402. AST_EXT_LIB_SETUP([NEON], [neon], [neon])
  403. AST_EXT_LIB_SETUP([NEON29], [neon29], [neon29])
  404. AST_EXT_LIB_SETUP([NETSNMP], [Net-SNMP], [netsnmp])
  405. AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
  406. AST_EXT_LIB_SETUP([OGG], [OGG], [ogg])
  407. AST_EXT_LIB_SETUP([OPENR2], [MFR2], [openr2])
  408. AST_EXT_LIB_SETUP([OPUS], [Opus], [opus])
  409. AST_EXT_LIB_SETUP([OSPTK], [OSP Toolkit], [osptk])
  410. AST_EXT_LIB_SETUP([OSS], [Open Sound System], [oss])
  411. AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])
  412. AST_EXT_LIB_SETUP([PJPROJECT], [PJPROJECT], [pjproject])
  413. AST_EXT_LIB_SETUP([POPT], [popt], [popt])
  414. AST_EXT_LIB_SETUP_OPTIONAL([PJ_TRANSACTION_GRP_LOCK], [PJSIP Transaction Group Lock Support], [PJPROJECT], [pjsip])
  415. AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_REPLACE_MEDIA_STREAM], [PJSIP Media Stream Replacement Support], [PJPROJECT], [pjsip])
  416. AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_GET_DEST_INFO], [pjsip_get_dest_info support], [PJPROJECT], [pjsip])
  417. AST_EXT_LIB_SETUP_OPTIONAL([PJ_SSL_CERT_LOAD_FROM_FILES2], [pj_ssl_cert_load_from_files2 support], [PJPROJECT], [pjsip])
  418. AST_EXT_LIB_SETUP([PORTAUDIO], [PortAudio], [portaudio])
  419. AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
  420. AST_EXT_LIB_SETUP_OPTIONAL([PRI_SETUP_ACK_INBAND], [ISDN PRI progress inband ie in SETUP ACK], [PRI], [pri])
  421. AST_EXT_LIB_SETUP_OPTIONAL([PRI_L2_PERSISTENCE], [ISDN Layer 2 persistence option], [PRI], [pri])
  422. AST_EXT_LIB_SETUP_OPTIONAL([PRI_DATETIME_SEND], [ISDN PRI Date/time ie send policy], [PRI], [pri])
  423. AST_EXT_LIB_SETUP_OPTIONAL([PRI_MWI_V2], [ISDN PRI Message Waiting Indication (Fixed)], [PRI], [pri])
  424. AST_EXT_LIB_SETUP_OPTIONAL([PRI_DISPLAY_TEXT], [ISDN PRI user display text IE contents during call], [PRI], [pri])
  425. AST_EXT_LIB_SETUP_OPTIONAL([PRI_MWI], [ISDN PRI Message Waiting Indication], [PRI], [pri])
  426. AST_EXT_LIB_SETUP_OPTIONAL([PRI_MCID], [ISDN PRI Malicious Call ID], [PRI], [pri])
  427. AST_EXT_LIB_SETUP_OPTIONAL([PRI_CALL_WAITING], [ISDN PRI call waiting supplementary service], [PRI], [pri])
  428. AST_EXT_LIB_SETUP_OPTIONAL([PRI_AOC_EVENTS], [ISDN PRI advice of charge supplementary service events], [PRI], [pri])
  429. AST_EXT_LIB_SETUP_OPTIONAL([PRI_TRANSFER], [ISDN PRI call transfer supplementary service], [PRI], [pri])
  430. AST_EXT_LIB_SETUP_OPTIONAL([PRI_CCSS], [ISDN PRI call completion supplementary service], [PRI], [pri])
  431. AST_EXT_LIB_SETUP_OPTIONAL([PRI_HANGUP_FIX], [ISDN PRI hangup fix], [PRI], [pri])
  432. AST_EXT_LIB_SETUP_OPTIONAL([PRI_SUBADDR], [ISDN PRI subaddressing], [PRI], [pri])
  433. AST_EXT_LIB_SETUP_OPTIONAL([PRI_CALL_HOLD], [ISDN PRI call hold], [PRI], [pri])
  434. AST_EXT_LIB_SETUP_OPTIONAL([PRI_CALL_REROUTING], [ISDN PRI call rerouting and call deflection], [PRI], [pri])
  435. AST_EXT_LIB_SETUP_OPTIONAL([PRI_SETUP_KEYPAD], [ISDN PRI keypad facility in SETUP], [PRI], [pri])
  436. # ------------------------------------v
  437. # TODO: The code can be changed to always include these features now.
  438. # These features will always be present if pri_connected_line_update is available.
  439. AST_EXT_LIB_SETUP_OPTIONAL([PRI_INBANDDISCONNECT], [ISDN PRI set_inbanddisconnect], [PRI], [pri])
  440. AST_EXT_LIB_SETUP_OPTIONAL([PRI_PROG_W_CAUSE], [ISDN progress with cause], [PRI], [pri])
  441. AST_EXT_LIB_SETUP_OPTIONAL([PRI_SERVICE_MESSAGES], [ISDN service messages], [PRI], [pri])
  442. AST_EXT_LIB_SETUP_OPTIONAL([PRI_REVERSE_CHARGE], [ISDN reverse charge], [PRI], [pri])
  443. # ------------------------------------^
  444. AST_EXT_LIB_SETUP([PWLIB], [PWlib], [pwlib])
  445. AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
  446. AST_EXT_LIB_SETUP([RESAMPLE], [LIBRESAMPLE], [resample])
  447. AST_EXT_LIB_SETUP([SDL], [Sdl], [sdl])
  448. AST_EXT_LIB_SETUP([SDL_IMAGE], [Sdl Image], [SDL_image])
  449. AST_OPTION_ONLY([sounds-cache], [SOUNDS_CACHE_DIR], [cached sound tarfiles], [])
  450. AST_EXT_LIB_SETUP([SPANDSP], [SPANDSP], [spandsp])
  451. AST_EXT_LIB_SETUP([SS7], [ISDN SS7], [ss7])
  452. AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
  453. AST_EXT_LIB_SETUP([SPEEX_PREPROCESS], [Speex preprocess routines], [speex])
  454. AST_EXT_LIB_SETUP([SPEEXDSP], [SpeexDSP], [speexdsp])
  455. AST_EXT_LIB_SETUP_DEPENDENT([SPEEX_PREPROCESS], [speex_preprocess_ctl], [], [speex])
  456. AST_EXT_LIB_SETUP([SQLITE], [SQLite], [sqlite])
  457. AST_EXT_LIB_SETUP([SQLITE3], [SQLite], [sqlite3])
  458. AST_EXT_LIB_SETUP([SRTP], [Secure RTP], [srtp])
  459. AST_EXT_LIB_SETUP_OPTIONAL([SRTP_SHUTDOWN], [SRTP Library Shutdown Function], [SRTP], [srtp])
  460. AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL Secure Sockets Layer], [ssl])
  461. AST_EXT_LIB_SETUP([SUPPSERV], [mISDN Supplemental Services], [suppserv])
  462. AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds])
  463. AST_EXT_LIB_SETUP([TERMCAP], [Termcap], [termcap])
  464. AST_EXT_LIB_SETUP([TIMERFD], [timerfd], [timerfd])
  465. AST_EXT_LIB_SETUP([TINFO], [Term Info], [tinfo])
  466. AST_EXT_LIB_SETUP([TONEZONE], [tonezone], [tonezone])
  467. AST_EXT_LIB_SETUP([UNBOUND], [unbound], [unbound])
  468. AST_EXT_LIB_SETUP([UNIXODBC], [unixODBC], [unixodbc])
  469. AST_EXT_LIB_SETUP([VORBIS], [Vorbis], [vorbis])
  470. AST_EXT_LIB_SETUP([VPB], [Voicetronix API], [vpb])
  471. AST_EXT_LIB_SETUP([X11], [X11], [x11])
  472. AST_EXT_LIB_SETUP([ZLIB], [zlib compression], [z])
  473. # check for basic system features and functionality before
  474. # checking for package libraries
  475. AC_FUNC_ALLOCA
  476. AC_HEADER_DIRENT
  477. AC_HEADER_STDC
  478. AC_HEADER_SYS_WAIT
  479. AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h libintl.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/event.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h termios.h unistd.h utime.h arpa/nameser.h sys/io.h])
  480. # Any one of these packages support a mandatory requirement, so we want to check on them as early as possible.
  481. AST_EXT_LIB_CHECK([TERMCAP], [termcap], [tgetent], [])
  482. AST_EXT_LIB_CHECK([TINFO], [tinfo], [tgetent], [])
  483. AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
  484. AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
  485. EDITLINE_LIB=""
  486. if test "x$TERMCAP_LIB" != "x" ; then
  487. EDITLINE_LIB="$TERMCAP_LIB"
  488. elif test "x$TINFO_LIB" != "x" ; then
  489. EDITLINE_LIB="$TINFO_LIB"
  490. elif test "x$CURSES_LIB" != "x" ; then
  491. EDITLINE_LIB="$CURSES_LIB"
  492. elif test "x$NCURSES_LIB" != "x" ; then
  493. EDITLINE_LIB="$NCURSES_LIB"
  494. else
  495. AC_MSG_ERROR([*** termcap support not found (on modern systems, this typically means the ncurses development package is missing)])
  496. fi
  497. AC_SUBST(EDITLINE_LIB)
  498. # Find required UUID support.
  499. # * -luuid on Linux
  500. # * -le2fs-uuid on OpenBSD
  501. # * in libsystem on OS X
  502. AST_EXT_LIB_CHECK([LIBUUID], [uuid], [uuid_generate_random], [uuid/uuid.h], [])
  503. AST_EXT_LIB_CHECK([E2FSUUID], [e2fs-uuid], [uuid_generate_random], [uuid/uuid.h], [])
  504. AC_CHECK_FUNCS([uuid_generate_random], [SYSUUID=true], [SYSUUID=""])
  505. if test "x$LIBUUID_LIB" != "x" ; then
  506. UUID_INCLUDE="$LIBUUID_INCLUDE"
  507. UUID_LIB="$LIBUUID_LIB"
  508. elif test "x$E2FSUUID_LIB" != "x" ; then
  509. UUID_INCLUDE="$E2FSUUID_INCLUDE"
  510. UUID_LIB="$E2FSUUID_LIB"
  511. elif test "x$SYSUUID" != "x" ; then
  512. UUID_INCLUDE=""
  513. UUID_LIB=""
  514. else
  515. AC_MSG_ERROR([*** uuid support not found (this typically means the uuid development package is missing)])
  516. fi
  517. AC_SUBST(UUID_INCLUDE)
  518. AC_SUBST(UUID_LIB)
  519. # Find required JSON support.
  520. AST_EXT_LIB_CHECK([JANSSON], [jansson], [json_dumps], [jansson.h])
  521. if test "x$JANSSON_LIB" == "x"; then
  522. AC_MSG_ERROR([*** JSON support not found (this typically means the libjansson development package is missing)])
  523. fi
  524. AST_EXT_TOOL_CHECK([LIBXML2], [xml2-config], , ,
  525. [#include <libxml/tree.h>
  526. #include <libxml/parser.h>],
  527. [LIBXML_TEST_VERSION])
  528. if test "${PBX_LIBXML2}" != 1; then
  529. AC_MSG_NOTICE(*** The Asterisk menuselect tool requires the 'libxml2' development package.)
  530. AC_MSG_NOTICE(*** Please install the 'libxml2' development package.)
  531. exit 1
  532. fi
  533. AST_EXT_LIB_CHECK([URIPARSER], [uriparser], [uriParseUriA], [uriparser/Uri.h])
  534. # Another mandatory item (unless it's explicitly disabled)
  535. AC_ARG_ENABLE([xmldoc],
  536. [AS_HELP_STRING([--disable-xmldoc],
  537. [Explicitly disable XML documentation])],
  538. [case "${enableval}" in
  539. y|ye|yes) disable_xmldoc=no ;;
  540. n|no) disable_xmldoc=yes ;;
  541. *) AC_MSG_ERROR(bad value ${enableval} for --disable-xmldoc) ;;
  542. esac], [disable_xmldoc=no])
  543. if test "${disable_xmldoc}" != "yes"; then
  544. AST_EXT_LIB_CHECK([LIBXSLT], [xslt], [xsltLoadStylesheetPI], [libxslt/xsltInternals.h], [${LIBXML2_LIB}], [${LIBXML2_INCLUDE}])
  545. AST_EXT_LIB_CHECK([LIBXSLT_CLEANUP], [xslt], [xsltCleanupGlobals], [libxslt/xsltInternals.h], [${LIBXML2_LIB}], [${LIBXML2_INCLUDE}])
  546. fi
  547. # some embedded systems omit internationalization (locale) support
  548. AC_CHECK_HEADERS([xlocale.h])
  549. AC_CHECK_HEADERS([winsock.h winsock2.h])
  550. AC_CHECK_HEADER([sys/poll.h],
  551. [],
  552. AC_DEFINE([AST_POLL_COMPAT], 1, [Define to 1 if internal poll should be used.]))
  553. AC_SYS_LARGEFILE
  554. # Checks for typedefs, structures, and compiler characteristics.
  555. AC_HEADER_STDBOOL
  556. AC_C_CONST
  557. AC_TYPE_UID_T
  558. AC_C_INLINE
  559. AC_TYPE_LONG_DOUBLE_WIDER
  560. AC_TYPE_MODE_T
  561. AC_TYPE_OFF_T
  562. AC_TYPE_PID_T
  563. AC_TYPE_SIZE_T
  564. AC_CHECK_MEMBERS([struct stat.st_blksize])
  565. AC_CHECK_MEMBERS([struct ucred.uid, struct ucred.cr_uid, struct sockpeercred.uid], [], [], [#include <sys/types.h>
  566. #include <sys/socket.h> ])
  567. AC_CHECK_MEMBERS([struct ifreq.ifr_ifru.ifru_hwaddr], [], [], [#include <net/if.h>])
  568. AC_HEADER_TIME
  569. AC_STRUCT_TM
  570. AC_C_VOLATILE
  571. AC_CHECK_TYPES([ptrdiff_t])
  572. stat_nsec_found=no
  573. AC_CHECK_MEMBERS([struct stat.st_mtim, struct stat.st_mtimensec, struct stat.st_mtimespec], [stat_nsec_found=yes], [], [[#include <sys/stat.h>]])
  574. if test "${stat_nsec_found}" != yes; then
  575. AC_MSG_WARN(Cannot determine nanosecond field of struct stat)
  576. fi
  577. # Checks for library functions.
  578. AC_FUNC_CHOWN
  579. AC_FUNC_CLOSEDIR_VOID
  580. AC_FUNC_ERROR_AT_LINE
  581. AST_FUNC_FORK
  582. AC_FUNC_FSEEKO
  583. AC_PROG_GCC_TRADITIONAL
  584. # XXX: these are commented out until we determine whether it matters if our malloc()
  585. # acts exactly like glibc's or not
  586. # AC_FUNC_MALLOC
  587. # AC_FUNC_REALLOC
  588. AC_FUNC_MEMCMP
  589. AC_FUNC_MMAP
  590. AC_FUNC_SELECT_ARGTYPES
  591. AC_FUNC_SETVBUF_REVERSED
  592. AC_TYPE_SIGNAL
  593. AC_FUNC_STAT
  594. AC_FUNC_STRCOLL
  595. AC_FUNC_STRFTIME
  596. AC_FUNC_STRNLEN
  597. AC_FUNC_STRTOD
  598. AC_FUNC_UTIME_NULL
  599. AC_FUNC_VPRINTF
  600. AC_CHECK_FUNCS([asprintf atexit closefrom dup2 eaccess endpwent euidaccess ffsll ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday glob ioperm inet_ntoa isascii memchr memmove memset mkdir mkdtemp munmap newlocale ppoll putenv re_comp regcomp select setenv socket strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtod strtol strtold strtoq unsetenv utime vasprintf getpeereid sysctl swapctl])
  601. AC_MSG_CHECKING(for htonll)
  602. AC_LINK_IFELSE(
  603. [AC_LANG_PROGRAM([#include <arpa/inet.h>],
  604. [return htonll(0);])],
  605. AC_MSG_RESULT(yes)
  606. AC_DEFINE(HAVE_HTONLL, 1, [Define to 1 if arpa/inet.h includes a htonll definition.]),
  607. AC_MSG_RESULT(no)
  608. )
  609. AC_MSG_CHECKING(for ntohll)
  610. AC_LINK_IFELSE(
  611. [AC_LANG_PROGRAM([#include <arpa/inet.h>],
  612. [return ntohll(0);])],
  613. AC_MSG_RESULT(yes)
  614. AC_DEFINE(HAVE_NTOHLL, 1, [Define to 1 if arpa/inet.h includes a ntohll definition.]),
  615. AC_MSG_RESULT(no)
  616. )
  617. # NOTE: we use AC_CHECK_LIB to get -lm into the arguments for later checks,
  618. # so that AC_CHECK_FUNCS can detect functions in that library.
  619. AC_CHECK_LIB([m], [sqrt])
  620. # BSD might not have exp2, and/or log2
  621. AC_CHECK_FUNCS([exp2 log2 exp10 log10 sin cos tan asin acos atan atan2 pow rint exp log remainder fmod round roundf trunc floor ceil])
  622. # Certain architectures don't really have long double, even though
  623. # AC_CHECK_FUNCS would otherwise find the following functions.
  624. if test "x${ac_cv_type_long_double_wider}" = "xyes" ; then
  625. AC_CHECK_FUNCS([exp2l log2l exp10l log10l sinl cosl tanl asinl acosl atanl atan2l powl sqrtl rintl expl logl remainderl fmodl roundl truncl floorl ceill])
  626. fi
  627. AC_MSG_CHECKING(for LLONG_MAX in limits.h)
  628. AC_LINK_IFELSE(
  629. [AC_LANG_PROGRAM([#include <limits.h>],
  630. [long long foo = LLONG_MAX])],
  631. AC_MSG_RESULT(yes)
  632. AC_DEFINE([HAVE_LLONG_MAX], 1, [Define to 1 if limits.h includes a LLONG_MAX definition.]),
  633. AC_MSG_RESULT(no)
  634. )
  635. AC_MSG_CHECKING(for timersub in time.h)
  636. AC_LINK_IFELSE(
  637. [AC_LANG_PROGRAM([#include <sys/time.h>],
  638. [struct timeval *a; timersub(a, a, a);])],
  639. AC_MSG_RESULT(yes)
  640. AC_DEFINE([HAVE_TIMERSUB], 1, [Define to 1 if your system defines timersub.]),
  641. AC_MSG_RESULT(no)
  642. )
  643. AC_MSG_CHECKING(for a version of GNU ld that supports the --dynamic-list flag)
  644. old_LDFLAGS=${LDFLAGS}
  645. cat >conftest.dynamics <<_ACEOF
  646. {
  647. *ast_*;
  648. };
  649. _ACEOF
  650. LDFLAGS="${LDFLAGS} -Wl,--dynamic-list,conftest.dynamics"
  651. PBX_DYNAMIC_LIST=0
  652. AC_LINK_IFELSE(
  653. [AC_LANG_PROGRAM([], [])],
  654. PBX_DYNAMIC_LIST=1
  655. AC_MSG_RESULT(yes),
  656. AC_MSG_RESULT(no)
  657. )
  658. AC_SUBST(PBX_DYNAMIC_LIST)
  659. LDFLAGS=${old_LDFLAGS}
  660. rm -f conftest.dynamics
  661. AC_CHECK_HEADER([sys/poll.h],
  662. [HAS_POLL=1]
  663. AC_DEFINE([HAVE_SYS_POLL_H], 1, [Define to 1 if your system has working sys/poll.h]),
  664. )
  665. AC_ARG_ENABLE([internal-poll],
  666. [AS_HELP_STRING([--enable-internal-poll],
  667. [Use Asterisk's poll implementation])],
  668. [case "${enableval}" in
  669. y|ye|yes) HAS_POLL="";;
  670. n|no) HAS_POLL="${HAS_POLL}" ;;
  671. *) AC_MSG_ERROR(bad value ${enableval} for --enable-internal-poll) ;;
  672. esac])
  673. AC_SUBST(HAS_POLL)
  674. AC_ARG_ENABLE([asteriskssl],
  675. [AS_HELP_STRING([--disable-asteriskssl],
  676. [Disable Asterisk's SSL wrapper library])],
  677. [case "${enableval}" in
  678. y|ye|yes) AST_ASTERISKSSL=yes ;;
  679. n|no) AST_ASTERISKSSL=no ;;
  680. *) AC_MSG_ERROR(bad value ${enableval} for --disable-asteriskssl) ;;
  681. esac], [AST_ASTERISKSSL=yes])
  682. AC_SUBST(AST_ASTERISKSSL)
  683. # https support (in main/http.c) uses funopen on BSD systems,
  684. # fopencookie on linux
  685. AC_CHECK_FUNCS([funopen fopencookie])
  686. AC_CHECK_FUNCS([inet_aton])
  687. # check if we have IP_PKTINFO constant defined
  688. AC_MSG_CHECKING(for IP_PKTINFO)
  689. AC_LINK_IFELSE(
  690. [AC_LANG_PROGRAM([#include <netinet/in.h>],
  691. [int pi = IP_PKTINFO;])],
  692. AC_MSG_RESULT(yes)
  693. AC_DEFINE([HAVE_PKTINFO], 1, [Define to 1 if your system defines IP_PKTINFO.]),
  694. AC_MSG_RESULT(no)
  695. )
  696. # some systems already have gethostbyname_r so we don't need to build ours in main/utils.c
  697. AC_SEARCH_LIBS(gethostbyname_r, [socket nsl])
  698. AC_MSG_CHECKING(for gethostbyname_r with 6 arguments)
  699. AC_LINK_IFELSE(
  700. [AC_LANG_PROGRAM([#include <stdlib.h>
  701. #include <netdb.h>],
  702. [struct hostent *he = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (struct hostent **)NULL, (int *)NULL);])],
  703. AC_MSG_RESULT(yes)
  704. AC_DEFINE([HAVE_GETHOSTBYNAME_R_6], 1, [Define to 1 if your system has gethostbyname_r with 6 arguments.]),
  705. AC_MSG_RESULT(no)
  706. )
  707. AC_MSG_CHECKING(for gethostbyname_r with 5 arguments)
  708. AC_LINK_IFELSE(
  709. [AC_LANG_PROGRAM([#include <stdlib.h>
  710. #include <netdb.h>],
  711. [struct hostent *he = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (int *)NULL);])],
  712. AC_MSG_RESULT(yes)
  713. AC_DEFINE([HAVE_GETHOSTBYNAME_R_5], 1, [Define to 1 if your system has gethostbyname_r with 5 arguments.]),
  714. AC_MSG_RESULT(no)
  715. )
  716. AC_CHECK_HEADER([byteswap.h], [AC_DEFINE_UNQUOTED([HAVE_BYTESWAP_H], 1, [Define to 1 if byteswap.h macros are available.])])
  717. AC_MSG_CHECKING(for __swap16 variant of <sys/endian.h> byteswapping macros)
  718. AC_LINK_IFELSE(
  719. [AC_LANG_PROGRAM([#include <sys/endian.h>], [int a = 1; int b = __swap16(a);])],
  720. AC_MSG_RESULT(yes)
  721. AC_DEFINE([HAVE_SYS_ENDIAN_SWAP16], 1, [Define to 1 if your sys/endian.h header file provides the __swap16 macro.]),
  722. AC_MSG_RESULT(no)
  723. )
  724. AC_MSG_CHECKING(for bswap16 variant of <sys/endian.h> byteswapping macros)
  725. AC_LINK_IFELSE(
  726. [AC_LANG_PROGRAM([#include <sys/endian.h>], [int a = 1; int b = bswap16(a);])],
  727. AC_MSG_RESULT(yes)
  728. AC_DEFINE([HAVE_SYS_ENDIAN_BSWAP16], 1, [Define to 1 if your sys/endian.h header file provides the bswap16 macro.]),
  729. AC_MSG_RESULT(no)
  730. )
  731. AC_MSG_CHECKING(for locale_t in locale.h)
  732. AC_LINK_IFELSE(
  733. [AC_LANG_PROGRAM([#include <locale.h>], [locale_t lt = NULL])],
  734. AC_MSG_RESULT(yes)
  735. AC_DEFINE([HAVE_LOCALE_T_IN_LOCALE_H], 1, [Define to 1 if your system defines the locale_t type in locale.h]),
  736. AC_MSG_RESULT(no)
  737. AC_MSG_CHECKING(for locale_t in xlocale.h)
  738. AC_LINK_IFELSE(
  739. [AC_LANG_PROGRAM([#include <xlocale.h>], [locale_t lt = NULL])],
  740. AC_MSG_RESULT(yes)
  741. AC_DEFINE([HAVE_LOCALE_T_IN_XLOCALE_H], 1, [Define to 1 if your system defines the locale_t type in xlocale.h]),
  742. AC_MSG_RESULT(no)
  743. )
  744. )
  745. AC_MSG_CHECKING(for O_EVTONLY in fcntl.h)
  746. AC_LINK_IFELSE(
  747. [AC_LANG_PROGRAM([#include <fcntl.h>], [int a = O_EVTONLY;])],
  748. AC_MSG_RESULT(yes)
  749. AC_DEFINE([HAVE_O_EVTONLY], 1, [Define to 1 if your system defines the file flag O_EVTONLY in fcntl.h]),
  750. AC_MSG_RESULT(no)
  751. )
  752. AC_MSG_CHECKING(for O_SYMLINK in fcntl.h)
  753. AC_LINK_IFELSE(
  754. [AC_LANG_PROGRAM([#include <fcntl.h>], [int a = O_SYMLINK;])],
  755. AC_MSG_RESULT(yes)
  756. AC_DEFINE([HAVE_O_SYMLINK], 1, [Define to 1 if your system defines the file flag O_SYMLINK in fcntl.h]),
  757. AC_MSG_RESULT(no)
  758. )
  759. AST_C_DEFINE_CHECK([PTHREAD_RWLOCK_INITIALIZER], [PTHREAD_RWLOCK_INITIALIZER], [pthread.h])
  760. AC_MSG_CHECKING(for PTHREAD_RWLOCK_PREFER_WRITER_NP in pthread.h)
  761. AC_LINK_IFELSE(
  762. [AC_LANG_PROGRAM([#include <pthread.h>], [int a = PTHREAD_RWLOCK_PREFER_WRITER_NP;])],
  763. AC_MSG_RESULT(yes)
  764. AC_DEFINE([HAVE_PTHREAD_RWLOCK_PREFER_WRITER_NP], 1, [Define to 1 if your system defines PTHREAD_RWLOCK_PREFER_WRITER_NP in pthread.h]),
  765. AC_MSG_RESULT(no)
  766. )
  767. AC_MSG_CHECKING(for PTHREAD_MUTEX_RECURSIVE_NP in pthread.h)
  768. AC_LINK_IFELSE(
  769. [AC_LANG_PROGRAM([#include <pthread.h>], [int a = PTHREAD_MUTEX_RECURSIVE_NP;])],
  770. AC_MSG_RESULT(yes)
  771. AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE_NP], 1, [Define to 1 if your system defines PTHREAD_MUTEX_RECURSIVE_NP in pthread.h]),
  772. AC_MSG_RESULT(no)
  773. )
  774. AC_MSG_CHECKING(for PTHREAD_MUTEX_ADAPTIVE_NP in pthread.h)
  775. AC_LINK_IFELSE(
  776. [AC_LANG_PROGRAM([#include <pthread.h>], [int a = PTHREAD_MUTEX_ADAPTIVE_NP;])],
  777. AC_MSG_RESULT(yes)
  778. AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1, [Define to 1 if your system defines PTHREAD_MUTEX_ADAPTIVE_NP in pthread.h]),
  779. AC_MSG_RESULT(no)
  780. )
  781. AC_MSG_CHECKING(for pthread_spinlock_t in pthread.h)
  782. AC_LINK_IFELSE(
  783. [AC_LANG_PROGRAM([#include <pthread.h>], [pthread_spinlock_t spin;])],
  784. AC_MSG_RESULT(yes)
  785. AC_DEFINE([HAVE_PTHREAD_SPINLOCK], 1, [Define to 1 if your system has pthread_spinlock_t in pthread.h]),
  786. AC_MSG_RESULT(no)
  787. )
  788. save_LIBS="$LIBS"
  789. save_CFLAGS="$CFLAGS"
  790. LIBS="$PTHREAD_LIBS $LIBS"
  791. CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
  792. AC_MSG_CHECKING(for pthread_rwlock_timedwrlock() in pthread.h)
  793. AC_LINK_IFELSE(
  794. [AC_LANG_PROGRAM(
  795. [#include <pthread.h>
  796. #include <time.h>],
  797. [pthread_rwlock_t foo; struct timespec bar; pthread_rwlock_timedwrlock(&foo, &bar)])
  798. ],[
  799. AC_MSG_RESULT(yes)
  800. ac_cv_pthread_rwlock_timedwrlock="yes"
  801. ],[
  802. AC_MSG_RESULT(no)
  803. ac_cv_pthread_rwlock_timedwrlock="no"
  804. ]
  805. )
  806. # Some platforms define sem_init(), but only support sem_open(). joyous.
  807. AC_MSG_CHECKING(for working unnamed semaphores)
  808. AC_RUN_IFELSE(
  809. [AC_LANG_PROGRAM([#include <semaphore.h>],
  810. [sem_t sem; return sem_init(&sem, 0, 0);])],
  811. AC_MSG_RESULT(yes)
  812. AC_DEFINE([HAS_WORKING_SEMAPHORE], 1, [Define to 1 if anonymous semaphores work.]),
  813. AC_MSG_RESULT(no),
  814. AC_MSG_RESULT(cross-compile)
  815. AC_MSG_NOTICE([WARNING: result yes guessed because of cross compilation])
  816. AC_DEFINE([HAS_WORKING_SEMAPHORE], 1, [Define to 1 if anonymous semaphores work.])
  817. )
  818. LIBS="$save_LIBS"
  819. CFLAGS="$save_CFLAGS"
  820. if test "${ac_cv_pthread_rwlock_timedwrlock}" = "yes"; then
  821. AC_DEFINE([HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK], 1, [Define if your system has pthread_rwlock_timedwrlock()])
  822. fi
  823. AC_MSG_CHECKING(if PTHREAD_ONCE_INIT needs braces)
  824. saved_CFLAGS="${CFLAGS}"
  825. CFLAGS="${CFLAGS} -Werror -Wmissing-braces"
  826. AC_COMPILE_IFELSE(
  827. [AC_LANG_PROGRAM(
  828. [#include <pthread.h>
  829. void empty(){}],
  830. [pthread_once_t once = PTHREAD_ONCE_INIT; pthread_once(&once, empty);])
  831. ],[
  832. AC_MSG_RESULT(no)
  833. ac_cv_pthread_once_needsbraces="no"
  834. ],[
  835. AC_MSG_RESULT(yes)
  836. ac_cv_pthread_once_needsbraces="yes"
  837. ]
  838. )
  839. CFLAGS="${saved_CFLAGS}"
  840. if test "${ac_cv_pthread_once_needsbraces}" = "yes"; then
  841. AC_DEFINE([PTHREAD_ONCE_INIT_NEEDS_BRACES], 1, [Define if your system needs braces around PTHREAD_ONCE_INIT])
  842. fi
  843. AST_C_DEFINE_CHECK([PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], [PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], [pthread.h])
  844. # Can we compare a mutex to its initial value?
  845. # Generally yes on OpenBSD/FreeBSD and no on Mac OS X.
  846. AC_MSG_CHECKING(whether we can compare a mutex to its initial value)
  847. AC_LINK_IFELSE(
  848. [AC_LANG_PROGRAM([#include <pthread.h>], [pthread_mutex_t lock;
  849. if ((lock) != ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
  850. return 0;
  851. }
  852. return 0])],
  853. AC_MSG_RESULT(yes)
  854. AC_DEFINE([CAN_COMPARE_MUTEX_TO_INIT_VALUE], 1, [Define to 1 if your system's implementation of mutexes supports comparison of a mutex to its initializer.]),
  855. AC_MSG_RESULT(no)
  856. )
  857. #if test "${cross_compiling}" = "no";
  858. #then
  859. #AC_MSG_CHECKING(for working epoll support)
  860. #AC_LINK_IFELSE(
  861. #AC_LANG_PROGRAM([#include <sys/epoll.h>], [int res = epoll_create(10);
  862. # if (res < 0)
  863. # return 1;
  864. # close (res);
  865. # return 0;]),
  866. #AC_MSG_RESULT(yes)
  867. #AC_DEFINE([HAVE_EPOLL], 1, [Define to 1 if your system has working epoll support.]),
  868. #AC_MSG_RESULT(no)
  869. #)
  870. #fi
  871. # for FreeBSD thr_self
  872. AC_CHECK_HEADERS([sys/thr.h])
  873. AC_MSG_CHECKING(for compiler atomic operations)
  874. AC_LINK_IFELSE(
  875. [AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])],
  876. AC_MSG_RESULT(yes)
  877. AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides atomic operations.]),
  878. AC_MSG_RESULT(no)
  879. )
  880. # glibc, AFAIK, is the only C library that makes printing a NULL to a string safe.
  881. AC_MSG_CHECKING([if your system printf is NULL-safe.])
  882. AC_RUN_IFELSE(
  883. [AC_LANG_PROGRAM([#include <stdio.h>],
  884. [printf("%s", NULL)])],
  885. AC_DEFINE([HAVE_NULLSAFE_PRINTF], 1, [Define to 1 if your C library can safely print NULL to string formats.])
  886. AC_MSG_RESULT(yes),
  887. AC_MSG_RESULT(no),
  888. # It's unlikely an embedded system will have this.
  889. AC_MSG_RESULT(unknown)
  890. )
  891. AC_MSG_CHECKING(if we can increase the maximum select-able file descriptor)
  892. AC_RUN_IFELSE(
  893. [AC_LANG_PROGRAM([
  894. #include <stdio.h>
  895. #include <sys/select.h>
  896. #include <sys/time.h>
  897. #include <sys/resource.h>
  898. #include <string.h>
  899. #include <errno.h>
  900. #include <stdlib.h>
  901. #include <sys/types.h>
  902. #include <sys/stat.h>
  903. #include <fcntl.h>
  904. #include <unistd.h>
  905. ], [[
  906. struct rlimit rlim = { FD_SETSIZE * 2, FD_SETSIZE * 2 };
  907. int fd0, fd1;
  908. struct timeval tv = { 0, };
  909. struct ast_fdset { long fds_bits[[1024]]; } fds = { { 0, } };
  910. if (setrlimit(RLIMIT_NOFILE, &rlim)) { exit(1); }
  911. if ((fd0 = open("/dev/null", O_RDONLY)) < 0) { exit(1); }
  912. if (dup2(fd0, (fd1 = FD_SETSIZE + 1)) < 0) { exit(1); }
  913. FD_SET(fd0, (fd_set *) &fds);
  914. FD_SET(fd1, (fd_set *) &fds);
  915. if (select(FD_SETSIZE + 2, (fd_set *) &fds, NULL, NULL, &tv) < 0) { exit(1); }
  916. exit(0)]])],
  917. AC_MSG_RESULT(yes)
  918. AC_DEFINE([HAVE_VARIABLE_FDSET], 1, [Define to 1 if your system can support larger than default select bitmasks.]),
  919. AC_MSG_RESULT(no),
  920. AC_MSG_RESULT(cross-compile)
  921. )
  922. if test "${ac_cv_have_variable_fdset}x" = "0x"; then
  923. AC_RUN_IFELSE(
  924. [AC_LANG_PROGRAM([
  925. #include <unistd.h>
  926. #include <sys/types.h>
  927. #include <stdlib.h>
  928. ], [if (getuid() != 0) { exit(1); }])],
  929. AC_DEFINE([CONFIGURE_RAN_AS_ROOT], 1, [Some configure tests will unexpectedly fail if configure is run by a non-root user. These may be able to be tested at runtime.]))
  930. fi
  931. AST_GCC_ATTRIBUTE(pure)
  932. AST_GCC_ATTRIBUTE(malloc)
  933. AST_GCC_ATTRIBUTE(const)
  934. AST_GCC_ATTRIBUTE(unused)
  935. AST_GCC_ATTRIBUTE(always_inline)
  936. AST_GCC_ATTRIBUTE(deprecated)
  937. AST_GCC_ATTRIBUTE(sentinel)
  938. AST_GCC_ATTRIBUTE(warn_unused_result)
  939. AST_GCC_ATTRIBUTE(may_alias)
  940. AST_GCC_ATTRIBUTE(constructor)
  941. AST_GCC_ATTRIBUTE(destructor)
  942. AC_MSG_CHECKING(for -ffunction-sections support)
  943. saved_CFLAGS="${CFLAGS}"
  944. CFLAGS="${CFLAGS} -ffunction-sections"
  945. AC_COMPILE_IFELSE(
  946. [AC_LANG_PROGRAM([], [int x = 1;])],
  947. AC_MSG_RESULT(yes)
  948. [saved_LDFLAGS="${LDFLAGS}"]
  949. [LDFLAGS="${LDFLAGS} -Wl,--gc-sections"]
  950. AC_MSG_CHECKING(for --gc-sections support)
  951. AC_LINK_IFELSE(
  952. [AC_LANG_PROGRAM([], [int x = 1;])],
  953. AC_MSG_RESULT(yes)
  954. [GC_CFLAGS="-ffunction-sections"]
  955. [[GC_LDFLAGS="-Wl,--gc-sections"]],
  956. AC_MSG_RESULT(no)
  957. )
  958. [LDFLAGS="${saved_LDFLAGS}"],
  959. AC_MSG_RESULT(no)
  960. )
  961. CFLAGS="${saved_CFLAGS}"
  962. AC_SUBST(GC_CFLAGS)
  963. AC_SUBST(GC_LDFLAGS)
  964. AC_MSG_CHECKING(for -Wdeclaration-after-statement support)
  965. if $(${CC} -Wdeclaration-after-statement -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
  966. AC_MSG_RESULT(yes)
  967. AST_DECLARATION_AFTER_STATEMENT=-Wdeclaration-after-statement
  968. else
  969. AC_MSG_RESULT(no)
  970. AST_DECLARATION_AFTER_STATEMENT=
  971. fi
  972. AC_SUBST(AST_DECLARATION_AFTER_STATEMENT)
  973. AC_MSG_CHECKING(for -Wtrampolines support)
  974. if $(${CC} -Wtrampolines -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
  975. AC_MSG_RESULT(yes)
  976. AST_TRAMPOLINES=-Wtrampolines
  977. else
  978. AC_MSG_RESULT(no)
  979. AST_TRAMPOLINES=
  980. fi
  981. AC_SUBST(AST_TRAMPOLINES)
  982. AC_MSG_CHECKING(for _FORTIFY_SOURCE support)
  983. if $(${CC} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
  984. AC_MSG_RESULT(yes)
  985. AST_FORTIFY_SOURCE="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
  986. else
  987. AC_MSG_RESULT(no)
  988. AST_FORTIFY_SOURCE=
  989. fi
  990. AC_SUBST(AST_FORTIFY_SOURCE)
  991. AC_MSG_CHECKING(for -fno-strict-overflow)
  992. if $(${CC} -O2 -fno-strict-overflow -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
  993. AC_MSG_RESULT(yes)
  994. AST_NO_STRICT_OVERFLOW=-fno-strict-overflow
  995. else
  996. AC_MSG_RESULT(no)
  997. AST_NO_STRICT_OVERFLOW=
  998. fi
  999. AC_SUBST(AST_NO_STRICT_OVERFLOW)
  1000. AC_MSG_CHECKING(for -Wshadow)
  1001. if $(${CC} -Wshadow -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
  1002. AC_MSG_RESULT(yes)
  1003. AST_SHADOW_WARNINGS=-Wshadow
  1004. else
  1005. AC_MSG_RESULT(no)
  1006. AST_SHADOW_WARNINGS=
  1007. fi
  1008. AC_SUBST(AST_SHADOW_WARNINGS)
  1009. AC_MSG_CHECKING(for -march=native support)
  1010. if $(${CC} -march=native -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
  1011. if test "${CONFIG_CFLAGS}" = ""; then
  1012. AC_MSG_RESULT(yes)
  1013. AST_NATIVE_ARCH=1
  1014. else
  1015. AC_MSG_RESULT(user CFLAGS present)
  1016. AST_NATIVE_ARCH=
  1017. fi
  1018. else
  1019. AC_MSG_RESULT(no)
  1020. AST_NATIVE_ARCH=
  1021. fi
  1022. AC_SUBST(AST_NATIVE_ARCH)
  1023. dnl Nested functions required for RAII implementation
  1024. AC_LINK_IFELSE(
  1025. [AC_LANG_PROGRAM([], [
  1026. #if defined(__clang__)
  1027. choke
  1028. #endif
  1029. ])
  1030. ],[
  1031. dnl Nested functions required for RAII implementation
  1032. AC_MSG_CHECKING(for gcc -fnested-functions)
  1033. AC_COMPILE_IFELSE(
  1034. dnl Prototype needed due to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36774
  1035. [AC_LANG_PROGRAM([], [auto void foo(void); void foo(void) {}])],
  1036. AC_MSG_RESULT(no)
  1037. [AST_NESTED_FUNCTIONS=],
  1038. AC_MSG_RESULT(yes)
  1039. [AST_NESTED_FUNCTIONS=-fnested-functions]
  1040. )
  1041. AC_SUBST(AST_NESTED_FUNCTIONS)
  1042. ],[
  1043. AC_MSG_CHECKING(for clang -fblocks)
  1044. if test "`echo "int main(){return ^{return 42;}();}" | ${CC} -o /dev/null -fblocks -x c - 2>&1`" = ""; then
  1045. [AST_CLANG_BLOCKS_LIBS=""]
  1046. [AST_CLANG_BLOCKS="-Wno-unknown-warning-option -fblocks"]
  1047. AC_MSG_RESULT(yes)
  1048. elif test "`echo "int main(){return ^{return 42;}();}" | ${CC} -o /dev/null -fblocks -x c -lBlocksRuntime - 2>&1`" = ""; then
  1049. [AST_CLANG_BLOCKS_LIBS="-lBlocksRuntime"]
  1050. [AST_CLANG_BLOCKS="-fblocks"]
  1051. AC_MSG_RESULT(yes)
  1052. else
  1053. AC_MSG_ERROR("BlocksRuntime is required for clang")
  1054. fi
  1055. AC_SUBST(AST_CLANG_BLOCKS_LIBS)
  1056. AC_SUBST(AST_CLANG_BLOCKS)
  1057. ]
  1058. )
  1059. dnl Check to see if rpath should be set in LDFLAGS
  1060. AC_ARG_ENABLE(rpath,
  1061. [AC_HELP_STRING([--disable-rpath],
  1062. [Disables rpath linker option checking])],
  1063. [case "${enableval}" in
  1064. y|ye|yes) check_rpath=yes ;;
  1065. n|no) check_rpath=no ;;
  1066. *) AC_MSG_ERROR(bad value ${enableval} for --disable-rpath) ;;
  1067. esac], [check_rpath=yes])
  1068. AC_MSG_CHECKING(whether to use rpath)
  1069. AST_RPATH=
  1070. if test "${check_rpath}" != yes; then
  1071. AC_MSG_RESULT(skipped)
  1072. elif test "${prefix}" = /usr || test "${prefix}" = NONE; then
  1073. AC_MSG_RESULT(not needed)
  1074. else
  1075. AST_RPATH="-Wl,-rpath,${libdir}"
  1076. fi
  1077. AC_SUBST(AST_RPATH)
  1078. AC_MSG_CHECKING(for sysinfo)
  1079. AC_LINK_IFELSE(
  1080. [AC_LANG_PROGRAM([#include <sys/sysinfo.h>],
  1081. [struct sysinfo sys_info; int uptime = sys_info.uptime])],
  1082. AC_MSG_RESULT(yes)
  1083. AC_DEFINE([HAVE_SYSINFO], 1, [Define to 1 if your system has sysinfo support]),
  1084. AC_MSG_RESULT(no)
  1085. )
  1086. AC_SEARCH_LIBS(res_9_ninit, resolv)
  1087. AC_MSG_CHECKING(for res_ninit)
  1088. AC_LINK_IFELSE(
  1089. [AC_LANG_PROGRAM([
  1090. #ifdef HAVE_SYS_SOCKET_H
  1091. #include <sys/socket.h>
  1092. #endif
  1093. #ifdef HAVE_NETINET_IN_H
  1094. #include <netinet/in.h>
  1095. #endif
  1096. #ifdef HAVE_ARPA_NAMESER_H
  1097. #include <arpa/nameser.h>
  1098. #endif
  1099. #include <resolv.h>],
  1100. [int foo = res_ninit(NULL);])],
  1101. AC_MSG_RESULT(yes)
  1102. AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.])
  1103. AC_SEARCH_LIBS(res_9_ndestroy, resolv)
  1104. AC_MSG_CHECKING(for res_ndestroy)
  1105. AC_LINK_IFELSE(
  1106. [AC_LANG_PROGRAM([
  1107. #ifdef HAVE_SYS_SOCKET_H
  1108. #include <sys/socket.h>
  1109. #endif
  1110. #ifdef HAVE_NETINET_IN_H
  1111. #include <netinet/in.h>
  1112. #endif
  1113. #ifdef HAVE_ARPA_NAMESER_H
  1114. #include <arpa/nameser.h>
  1115. #endif
  1116. #include <resolv.h>],
  1117. [res_ndestroy(NULL);])],
  1118. AC_MSG_RESULT(yes)
  1119. AC_DEFINE([HAVE_RES_NDESTROY], 1, [Define to 1 if your system has the ndestroy resolver function.]),
  1120. AC_MSG_RESULT(no)
  1121. )
  1122. AC_SEARCH_LIBS(res_9_close, resolv)
  1123. AC_MSG_CHECKING(for res_close)
  1124. AC_LINK_IFELSE(
  1125. [AC_LANG_PROGRAM([
  1126. #ifdef HAVE_SYS_SOCKET_H
  1127. #include <sys/socket.h>
  1128. #endif
  1129. #ifdef HAVE_NETINET_IN_H
  1130. #include <netinet/in.h>
  1131. #endif
  1132. #ifdef HAVE_ARPA_NAMESER_H
  1133. #include <arpa/nameser.h>
  1134. #endif
  1135. #include <resolv.h>],
  1136. [res_close();])],
  1137. AC_MSG_RESULT(yes)
  1138. AC_DEFINE([HAVE_RES_CLOSE], 1, [Define to 1 if your system has the close resolver function.]),
  1139. AC_MSG_RESULT(no)
  1140. ),
  1141. AC_MSG_RESULT(no)
  1142. )
  1143. AST_C_DEFINE_CHECK([GLOB_NOMAGIC], [GLOB_NOMAGIC], [glob.h])
  1144. AST_C_DEFINE_CHECK([GLOB_BRACE], [GLOB_BRACE], [glob.h])
  1145. AST_C_DEFINE_CHECK([RTLD_NOLOAD], [RTLD_NOLOAD], [dlfcn.h])
  1146. AST_C_DEFINE_CHECK([IP_MTU_DISCOVER], [IP_MTU_DISCOVER], [netinet/in.h])
  1147. AC_CHECK_HEADER([libkern/OSAtomic.h],
  1148. [AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])])
  1149. AC_CHECK_SIZEOF([int])
  1150. AC_CHECK_SIZEOF([long])
  1151. AC_CHECK_SIZEOF([long long])
  1152. AC_CHECK_SIZEOF([char *])
  1153. AC_CHECK_SIZEOF(long)
  1154. AC_CHECK_SIZEOF(long long)
  1155. AC_COMPUTE_INT([ac_cv_sizeof_fd_set_fds_bits], [sizeof(foo.fds_bits[[0]])], [$ac_includes_default
  1156. fd_set foo;])
  1157. # This doesn't actually work; what it does is to use the variable set in the
  1158. # previous test as a cached value to set the right output variables.
  1159. AC_CHECK_SIZEOF(fd_set.fds_bits)
  1160. # Set a type compatible with the previous. We cannot just use a generic type
  1161. # for these bits, because on big-endian systems, the bits won't match up
  1162. # correctly if the size is wrong.
  1163. if test $ac_cv_sizeof_int = $ac_cv_sizeof_fd_set_fds_bits; then
  1164. AC_DEFINE([TYPEOF_FD_SET_FDS_BITS], [int], [Define to a type of the same size as fd_set.fds_bits[[0]]])
  1165. else if test $ac_cv_sizeof_long = $ac_cv_sizeof_fd_set_fds_bits; then
  1166. AC_DEFINE([TYPEOF_FD_SET_FDS_BITS], [long], [Define to a type of the same size as fd_set.fds_bits[[0]]])
  1167. else if test $ac_cv_sizeof_long_long = $ac_cv_sizeof_fd_set_fds_bits; then
  1168. AC_DEFINE([TYPEOF_FD_SET_FDS_BITS], [long long], [Define to a type of the same size as fd_set.fds_bits[[0]]])
  1169. fi ; fi ; fi
  1170. AC_MSG_CHECKING(for dladdr in dlfcn.h)
  1171. PBX_DLADDR=0
  1172. old_LIBS=${LIBS}
  1173. LIBS="${LIBS} -ldl"
  1174. AC_LINK_IFELSE(
  1175. [AC_LANG_PROGRAM([#define _GNU_SOURCE 1
  1176. #include <dlfcn.h>],
  1177. [dladdr((void *)0, (void *)0)]
  1178. )],
  1179. AC_MSG_RESULT(yes)
  1180. PBX_DLADDR=1
  1181. AC_SUBST([PBX_DLADDR])
  1182. AC_DEFINE([HAVE_DLADDR], 1, [Define to 1 if your system has the dladdr() GNU extension]),
  1183. AC_MSG_RESULT(no)
  1184. )
  1185. LIBS=${old_LIBS}
  1186. # PKGCONFIG is used in later tests
  1187. PKG_PROG_PKG_CONFIG()
  1188. # do the package library checks now
  1189. AST_EXT_LIB_CHECK([ALSA], [asound], [snd_spcm_init], [alsa/asoundlib.h], [-lm -ldl])
  1190. AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_openr], [bfd.h])
  1191. if test "${PBX_BFD}" = "0"; then
  1192. # Fedora/RedHat/CentOS require extra libraries
  1193. AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_check_format], [bfd.h], [-ldl -liberty])
  1194. fi
  1195. if test "${PBX_BFD}" = "0"; then
  1196. # openSUSE requires -lz
  1197. AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_check_format], [bfd.h], [-ldl -liberty -lz])
  1198. fi
  1199. if test "x${OSARCH}" = "xlinux-gnu" ; then
  1200. AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h])
  1201. fi
  1202. AST_C_DEFINE_CHECK([DAHDI], [DAHDI_RESET_COUNTERS], [dahdi/user.h], [230])
  1203. AST_C_DEFINE_CHECK([DAHDI], [DAHDI_DEFAULT_MTU_MRU], [dahdi/user.h], [220])
  1204. AST_C_DEFINE_CHECK([DAHDI], [DAHDI_CODE], [dahdi/user.h], [200])
  1205. AST_C_DEFINE_CHECK([DAHDI_HALF_FULL], [DAHDI_POLICY_HALF_FULL], [dahdi/user.h])
  1206. AST_C_COMPILE_CHECK([DAHDI_LINEREVERSE_VMWI], [struct dahdi_vmwi_info booger], [dahdi/user.h], , [enhanced dahdi vmwi support])
  1207. AST_C_COMPILE_CHECK([DAHDI_ECHOCANCEL_FAX_MODE], [int foo = DAHDI_ECHOCANCEL_FAX_MODE], [dahdi/user.h])
  1208. AST_C_COMPILE_CHECK([GETIFADDRS], [struct ifaddrs *p; getifaddrs(&p)], [ifaddrs.h], , [getifaddrs() support])
  1209. AST_C_COMPILE_CHECK([TIMERFD], [timerfd_create(0,0); timerfd_settime(0,0,NULL,NULL);], [sys/timerfd.h], , [timerfd support])
  1210. GSM_INTERNAL="yes"
  1211. AC_SUBST(GSM_INTERNAL)
  1212. GSM_SYSTEM="yes"
  1213. if test "${USE_GSM}" != "no"; then
  1214. if test "${GSM_DIR}" = "internal"; then
  1215. GSM_SYSTEM="no"
  1216. elif test "${GSM_DIR}" != ""; then
  1217. GSM_INTERNAL="no"
  1218. fi
  1219. if test "${GSM_SYSTEM}" = "yes"; then
  1220. gsmlibdir=""
  1221. if test "x${GSM_DIR}" != "x"; then
  1222. if test -d ${GSM_DIR}/lib; then
  1223. gsmlibdir="-L${GSM_DIR}/lib"
  1224. else
  1225. gsmlibdir="-L${GSM_DIR}"
  1226. fi
  1227. fi
  1228. AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1,
  1229. [Define to indicate the GSM library]), [], ${gsmlibdir})
  1230. if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
  1231. if test "x${GSM_DIR}" != "x" ; then
  1232. AC_CHECK_HEADER([${GSM_DIR}/include/gsm.h], [GSM_HEADER_FOUND=1], [GSM_HEADER_FOUND=0])
  1233. AC_CHECK_HEADER([${GSM_DIR}/include/gsm/gsm.h], [GSM_GSM_HEADER_FOUND=1], [GSM_GSM_HEADER_FOUND=0])
  1234. else
  1235. AC_CHECK_HEADER([gsm.h], [GSM_HEADER_FOUND=1], [GSM_HEADER_FOUND=0])
  1236. AC_CHECK_HEADER([gsm/gsm.h], [GSM_GSM_HEADER_FOUND=1], [GSM_GSM_HEADER_FOUND=0])
  1237. fi
  1238. if test "${GSM_HEADER_FOUND}" = "0" ; then
  1239. if test "{GSM_GSM_HEADER_FOUND}" = "0" ; then
  1240. if test "x${GSM_MANDATORY}" = "xyes" ; then
  1241. AC_MSG_NOTICE([***])
  1242. AC_MSG_NOTICE([*** It appears that you do not have the gsm development package installed.])
  1243. AC_MSG_NOTICE([*** Please install it to include ${GSM_DESCRIP} support, or re-run configure])
  1244. AC_MSG_NOTICE([*** without explicitly specifying --with-${GSM_OPTION}])
  1245. exit 1
  1246. fi
  1247. fi
  1248. fi
  1249. GSM_OK=0
  1250. if test "${GSM_HEADER_FOUND}" = "1" ; then
  1251. AC_DEFINE_UNQUOTED([HAVE_GSM_HEADER], 1, [Define to indicate that gsm.h has no prefix for its location])
  1252. GSM_OK=1
  1253. else
  1254. if test "${GSM_GSM_HEADER_FOUND}" = "1" ; then
  1255. AC_DEFINE_UNQUOTED([HAVE_GSM_GSM_HEADER], 1, [Define to indicate that gsm.h is in gsm/gsm.h])
  1256. GSM_OK=1
  1257. fi
  1258. fi
  1259. if test "${GSM_OK}" = "1" ; then
  1260. GSM_LIB="-lgsm"
  1261. if test "x${GSM_DIR}" != "x"; then
  1262. GSM_LIB="${gsmlibdir} ${GSM_LIB}"
  1263. GSM_INCLUDE="-I${GSM_DIR}/include"
  1264. fi
  1265. PBX_GSM=1
  1266. GSM_INTERNAL="no"
  1267. fi
  1268. fi
  1269. fi
  1270. if test "${GSM_INTERNAL}" = "yes"; then
  1271. PBX_GSM=1
  1272. AC_DEFINE_UNQUOTED([HAVE_GSM_HEADER], 1, [Define to indicate that gsm.h has no prefix for its location])
  1273. fi
  1274. fi
  1275. ILBC_INTERNAL="yes"
  1276. AC_SUBST(ILBC_INTERNAL)
  1277. ILBC_SYSTEM="yes"
  1278. if test "${USE_ILBC}" != "no"; then
  1279. if test "${ILBC_DIR}" = "internal"; then
  1280. ILBC_SYSTEM="no"
  1281. elif test "${ILBC_DIR}" != ""; then
  1282. ILBC_INTERNAL="no"
  1283. fi
  1284. if test "${ILBC_SYSTEM}" = "yes"; then
  1285. AST_PKG_CONFIG_CHECK(ILBC, libilbc)
  1286. if test "$PBX_ILBC" = "1"; then
  1287. ILBC_INTERNAL="no"
  1288. fi
  1289. fi
  1290. if test "${ILBC_INTERNAL}" = "yes"; then
  1291. PBX_ILBC=1
  1292. fi
  1293. fi
  1294. LIBEDIT_INTERNAL="yes"
  1295. AC_SUBST(LIBEDIT_INTERNAL)
  1296. LIBEDIT_SYSTEM="yes"
  1297. if test "${USE_LIBEDIT}" != "no"; then
  1298. if test "${LIBEDIT_DIR}" = "internal"; then
  1299. LIBEDIT_SYSTEM="no"
  1300. elif test "${LIBEDIT_DIR}" != ""; then
  1301. LIBEDIT_INTERNAL="no"
  1302. fi
  1303. if test "${LIBEDIT_SYSTEM}" = "yes"; then
  1304. AST_PKG_CONFIG_CHECK(LIBEDIT, libedit)
  1305. if test "$PBX_LIBEDIT" = "1"; then
  1306. LIBEDIT_INTERNAL="no"
  1307. fi
  1308. fi
  1309. if test "${LIBEDIT_INTERNAL}" = "yes"; then
  1310. PBX_LIBEDIT=1
  1311. fi
  1312. fi
  1313. AST_EXT_LIB_CHECK([ICONV], [iconv], [iconv_open], [iconv.h])
  1314. # GNU libiconv #define's iconv_open to libiconv_open, so we need to search for that symbol
  1315. AST_EXT_LIB_CHECK([ICONV], [iconv], [libiconv_open], [iconv.h])
  1316. # Some versions of Linux package iconv in glibc
  1317. AST_EXT_LIB_CHECK([ICONV], [c], [iconv_close], [iconv.h])
  1318. # If ical.h is NOT in the libical directory, then it is of a version insufficient for us.
  1319. AST_EXT_LIB_CHECK([ICAL], [ical], [icaltimezone_get_utc_timezone], [libical/ical.h], [${PTHREAD_LIBS}], [${PTHREAD_CFLAGS}])
  1320. AST_EXT_LIB_CHECK([IKSEMEL], [iksemel], [iks_start_sasl], [iksemel.h])
  1321. if test "${USE_IMAP_TK}" != "no"; then
  1322. saved_cppflags="${CPPFLAGS}"
  1323. saved_libs="${LIBS}"
  1324. switch_to_system_on_failure="no"
  1325. if test "${IMAP_TK_DIR}" = ""; then
  1326. IMAP_TK_DIR=`pwd`"/../imap-2004g"
  1327. switch_to_system_on_failure="yes"
  1328. fi
  1329. if test "${IMAP_TK_DIR}" != "system"; then
  1330. AC_MSG_CHECKING(for UW IMAP Toolkit c-client library)
  1331. if test -f "${IMAP_TK_DIR}/c-client/LDFLAGS"; then
  1332. imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
  1333. fi
  1334. imap_libs="${IMAP_TK_DIR}/c-client/c-client.a"
  1335. imap_include="-I${IMAP_TK_DIR}/c-client"
  1336. CPPFLAGS="${CPPFLAGS} ${imap_include}"
  1337. LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}`
  1338. AC_LINK_IFELSE(
  1339. [AC_LANG_PROGRAM(
  1340. [#include "c-client.h"
  1341. void mm_searched (MAILSTREAM *stream,unsigned long number)
  1342. {
  1343. }
  1344. void mm_exists (MAILSTREAM *stream,unsigned long number)
  1345. {
  1346. }
  1347. void mm_expunged (MAILSTREAM *stream,unsigned long number)
  1348. {
  1349. }
  1350. void mm_flags (MAILSTREAM *stream,unsigned long number)
  1351. {
  1352. }
  1353. void mm_notify (MAILSTREAM *stream,char *string,long errflg)
  1354. {
  1355. }
  1356. void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1357. {
  1358. }
  1359. void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1360. {
  1361. }
  1362. void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
  1363. {
  1364. }
  1365. void mm_log (char *string,long errflg)
  1366. {
  1367. }
  1368. void mm_dlog (char *string)
  1369. {
  1370. }
  1371. void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
  1372. {
  1373. }
  1374. void mm_critical (MAILSTREAM *stream)
  1375. {
  1376. }
  1377. void mm_nocritical (MAILSTREAM *stream)
  1378. {
  1379. }
  1380. long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
  1381. {
  1382. }
  1383. void mm_fatal (char *string)
  1384. {
  1385. }],
  1386. [
  1387. MAILSTREAM *foo = mail_open(NULL, "", 0);
  1388. ]
  1389. )],
  1390. [ac_cv_imap_tk="yes"],
  1391. [ac_cv_imap_tk="no"]
  1392. )
  1393. if test "${ac_cv_imap_tk}" = "yes"; then
  1394. AC_LINK_IFELSE(
  1395. [AC_LANG_PROGRAM(
  1396. [#include "c-client.h"
  1397. void mm_searched (MAILSTREAM *stream,unsigned long number)
  1398. {
  1399. }
  1400. void mm_exists (MAILSTREAM *stream,unsigned long number)
  1401. {
  1402. }
  1403. void mm_expunged (MAILSTREAM *stream,unsigned long number)
  1404. {
  1405. }
  1406. void mm_flags (MAILSTREAM *stream,unsigned long number)
  1407. {
  1408. }
  1409. void mm_notify (MAILSTREAM *stream,char *string,long errflg)
  1410. {
  1411. }
  1412. void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1413. {
  1414. }
  1415. void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1416. {
  1417. }
  1418. void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
  1419. {
  1420. }
  1421. void mm_log (char *string,long errflg)
  1422. {
  1423. }
  1424. void mm_dlog (char *string)
  1425. {
  1426. }
  1427. void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
  1428. {
  1429. }
  1430. void mm_critical (MAILSTREAM *stream)
  1431. {
  1432. }
  1433. void mm_nocritical (MAILSTREAM *stream)
  1434. {
  1435. }
  1436. long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
  1437. {
  1438. }
  1439. void mm_fatal (char *string)
  1440. {
  1441. }],
  1442. [
  1443. long check = mail_expunge_full(NULL, "", 0);
  1444. ]
  1445. )],
  1446. [ac_cv_imap_tk2006="yes"],
  1447. [ac_cv_imap_tk2006="no"]
  1448. )
  1449. fi
  1450. CPPFLAGS="${saved_cppflags}"
  1451. LIBS="${saved_libs}"
  1452. if test "${ac_cv_imap_tk}" = "no"; then
  1453. AC_MSG_RESULT(no)
  1454. if test "${switch_to_system_on_failure}" = "yes"; then
  1455. IMAP_TK_DIR="system"
  1456. else #This means they specified a directory. Search for a package installation there too
  1457. AC_MSG_CHECKING([for system c-client library...])
  1458. CPPFLAGS="${saved_cppflags}"
  1459. LIBS="${saved_libs}"
  1460. imap_include="-I${IMAP_TK_DIR}/include"
  1461. imap_ldflags="-L${IMAP_TK_DIR}/lib"
  1462. imap_libs="-lc-client"
  1463. CPPFLAGS="${CPPFLAGS} ${imap_include}"
  1464. LIBS="${LIBS} ${imap_libs} ${imap_ldflags}"
  1465. AC_LINK_IFELSE(
  1466. [AC_LANG_PROGRAM(
  1467. [#include "c-client.h"
  1468. void mm_searched (MAILSTREAM *stream,unsigned long number)
  1469. {
  1470. }
  1471. void mm_exists (MAILSTREAM *stream,unsigned long number)
  1472. {
  1473. }
  1474. void mm_expunged (MAILSTREAM *stream,unsigned long number)
  1475. {
  1476. }
  1477. void mm_flags (MAILSTREAM *stream,unsigned long number)
  1478. {
  1479. }
  1480. void mm_notify (MAILSTREAM *stream,char *string,long errflg)
  1481. {
  1482. }
  1483. void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1484. {
  1485. }
  1486. void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1487. {
  1488. }
  1489. void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
  1490. {
  1491. }
  1492. void mm_log (char *string,long errflg)
  1493. {
  1494. }
  1495. void mm_dlog (char *string)
  1496. {
  1497. }
  1498. void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
  1499. {
  1500. }
  1501. void mm_critical (MAILSTREAM *stream)
  1502. {
  1503. }
  1504. void mm_nocritical (MAILSTREAM *stream)
  1505. {
  1506. }
  1507. long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
  1508. {
  1509. }
  1510. void mm_fatal (char *string)
  1511. {
  1512. }],
  1513. [
  1514. MAILSTREAM *foo = mail_open(NULL, "", 0);
  1515. ]
  1516. )],
  1517. [ac_cv_imap_tk="yes"],
  1518. [ac_cv_imap_tk="no"]
  1519. )
  1520. if test "${ac_cv_imap_tk}" = "yes"; then
  1521. AC_LINK_IFELSE(
  1522. [AC_LANG_PROGRAM(
  1523. [#include "c-client.h"
  1524. void mm_searched (MAILSTREAM *stream,unsigned long number)
  1525. {
  1526. }
  1527. void mm_exists (MAILSTREAM *stream,unsigned long number)
  1528. {
  1529. }
  1530. void mm_expunged (MAILSTREAM *stream,unsigned long number)
  1531. {
  1532. }
  1533. void mm_flags (MAILSTREAM *stream,unsigned long number)
  1534. {
  1535. }
  1536. void mm_notify (MAILSTREAM *stream,char *string,long errflg)
  1537. {
  1538. }
  1539. void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1540. {
  1541. }
  1542. void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1543. {
  1544. }
  1545. void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
  1546. {
  1547. }
  1548. void mm_log (char *string,long errflg)
  1549. {
  1550. }
  1551. void mm_dlog (char *string)
  1552. {
  1553. }
  1554. void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
  1555. {
  1556. }
  1557. void mm_critical (MAILSTREAM *stream)
  1558. {
  1559. }
  1560. void mm_nocritical (MAILSTREAM *stream)
  1561. {
  1562. }
  1563. long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
  1564. {
  1565. }
  1566. void mm_fatal (char *string)
  1567. {
  1568. }],
  1569. [
  1570. long check = mail_expunge_full(NULL, "", 0);
  1571. ]
  1572. )],
  1573. [ac_cv_imap_tk2006="yes"],
  1574. [ac_cv_imap_tk2006="no"]
  1575. )
  1576. fi
  1577. fi
  1578. fi
  1579. fi
  1580. if test "${IMAP_TK_DIR}" = "system"; then
  1581. #We will enter here if user specified "system" or if any of above checks failed
  1582. AC_MSG_CHECKING([for system c-client library...])
  1583. CPPFLAGS="${saved_cppflags}"
  1584. LIBS="${saved_libs}"
  1585. imap_ldflags=""
  1586. imap_libs="-lc-client"
  1587. imap_include="-DUSE_SYSTEM_IMAP" #Try the imap directory first
  1588. CPPFLAGS="${CPPFLAGS} ${imap_include}"
  1589. LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}`
  1590. AC_LINK_IFELSE(
  1591. [AC_LANG_PROGRAM(
  1592. [#include <stdio.h>
  1593. #include <imap/c-client.h>
  1594. void mm_searched (MAILSTREAM *stream,unsigned long number)
  1595. {
  1596. }
  1597. void mm_exists (MAILSTREAM *stream,unsigned long number)
  1598. {
  1599. }
  1600. void mm_expunged (MAILSTREAM *stream,unsigned long number)
  1601. {
  1602. }
  1603. void mm_flags (MAILSTREAM *stream,unsigned long number)
  1604. {
  1605. }
  1606. void mm_notify (MAILSTREAM *stream,char *string,long errflg)
  1607. {
  1608. }
  1609. void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1610. {
  1611. }
  1612. void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1613. {
  1614. }
  1615. void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
  1616. {
  1617. }
  1618. void mm_log (char *string,long errflg)
  1619. {
  1620. }
  1621. void mm_dlog (char *string)
  1622. {
  1623. }
  1624. void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
  1625. {
  1626. }
  1627. void mm_critical (MAILSTREAM *stream)
  1628. {
  1629. }
  1630. void mm_nocritical (MAILSTREAM *stream)
  1631. {
  1632. }
  1633. long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
  1634. {
  1635. }
  1636. void mm_fatal (char *string)
  1637. {
  1638. }],
  1639. [
  1640. MAILSTREAM *foo = mail_open(NULL, "", 0);
  1641. ]
  1642. )],
  1643. [ac_cv_imap_tk="yes"],
  1644. [ac_cv_imap_tk="no"]
  1645. )
  1646. if test "${ac_cv_imap_tk}" = "yes"; then
  1647. AC_LINK_IFELSE(
  1648. [AC_LANG_PROGRAM(
  1649. [#include <stdio.h>
  1650. #include <imap/c-client.h>
  1651. void mm_searched (MAILSTREAM *stream,unsigned long number)
  1652. {
  1653. }
  1654. void mm_exists (MAILSTREAM *stream,unsigned long number)
  1655. {
  1656. }
  1657. void mm_expunged (MAILSTREAM *stream,unsigned long number)
  1658. {
  1659. }
  1660. void mm_flags (MAILSTREAM *stream,unsigned long number)
  1661. {
  1662. }
  1663. void mm_notify (MAILSTREAM *stream,char *string,long errflg)
  1664. {
  1665. }
  1666. void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1667. {
  1668. }
  1669. void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1670. {
  1671. }
  1672. void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
  1673. {
  1674. }
  1675. void mm_log (char *string,long errflg)
  1676. {
  1677. }
  1678. void mm_dlog (char *string)
  1679. {
  1680. }
  1681. void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
  1682. {
  1683. }
  1684. void mm_critical (MAILSTREAM *stream)
  1685. {
  1686. }
  1687. void mm_nocritical (MAILSTREAM *stream)
  1688. {
  1689. }
  1690. long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
  1691. {
  1692. }
  1693. void mm_fatal (char *string)
  1694. {
  1695. }],
  1696. [
  1697. long check = mail_expunge_full(NULL, "", 0);
  1698. ]
  1699. )],
  1700. [ac_cv_imap_tk2006="yes"],
  1701. [ac_cv_imap_tk2006="no"]
  1702. )
  1703. else #looking in imap directory didn't work, try c-client
  1704. imap_ldflags=""
  1705. imap_libs="-lc-client"
  1706. imap_include="-DUSE_SYSTEM_CCLIENT"
  1707. CPPFLAGS="${saved_cppflags}"
  1708. LIBS="${saved_libs}"
  1709. CPPFLAGS="${CPPFLAGS} ${imap_include}"
  1710. LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}`
  1711. AC_LINK_IFELSE(
  1712. [AC_LANG_PROGRAM(
  1713. [#include <stdio.h>
  1714. #include <c-client/c-client.h>
  1715. void mm_searched (MAILSTREAM *stream,unsigned long number)
  1716. {
  1717. }
  1718. void mm_exists (MAILSTREAM *stream,unsigned long number)
  1719. {
  1720. }
  1721. void mm_expunged (MAILSTREAM *stream,unsigned long number)
  1722. {
  1723. }
  1724. void mm_flags (MAILSTREAM *stream,unsigned long number)
  1725. {
  1726. }
  1727. void mm_notify (MAILSTREAM *stream,char *string,long errflg)
  1728. {
  1729. }
  1730. void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1731. {
  1732. }
  1733. void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1734. {
  1735. }
  1736. void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
  1737. {
  1738. }
  1739. void mm_log (char *string,long errflg)
  1740. {
  1741. }
  1742. void mm_dlog (char *string)
  1743. {
  1744. }
  1745. void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
  1746. {
  1747. }
  1748. void mm_critical (MAILSTREAM *stream)
  1749. {
  1750. }
  1751. void mm_nocritical (MAILSTREAM *stream)
  1752. {
  1753. }
  1754. long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
  1755. {
  1756. }
  1757. void mm_fatal (char *string)
  1758. {
  1759. }],
  1760. [
  1761. MAILSTREAM *foo = mail_open(NULL, "", 0);
  1762. ]
  1763. )],
  1764. [ac_cv_imap_tk="yes"],
  1765. [ac_cv_imap_tk="no"]
  1766. )
  1767. if test "${ac_cv_imap_tk}" = "yes"; then
  1768. AC_LINK_IFELSE(
  1769. [AC_LANG_PROGRAM(
  1770. [#include <stdio.h>
  1771. #include <c-client/c-client.h>
  1772. void mm_searched (MAILSTREAM *stream,unsigned long number)
  1773. {
  1774. }
  1775. void mm_exists (MAILSTREAM *stream,unsigned long number)
  1776. {
  1777. }
  1778. void mm_expunged (MAILSTREAM *stream,unsigned long number)
  1779. {
  1780. }
  1781. void mm_flags (MAILSTREAM *stream,unsigned long number)
  1782. {
  1783. }
  1784. void mm_notify (MAILSTREAM *stream,char *string,long errflg)
  1785. {
  1786. }
  1787. void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1788. {
  1789. }
  1790. void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1791. {
  1792. }
  1793. void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
  1794. {
  1795. }
  1796. void mm_log (char *string,long errflg)
  1797. {
  1798. }
  1799. void mm_dlog (char *string)
  1800. {
  1801. }
  1802. void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
  1803. {
  1804. }
  1805. void mm_critical (MAILSTREAM *stream)
  1806. {
  1807. }
  1808. void mm_nocritical (MAILSTREAM *stream)
  1809. {
  1810. }
  1811. long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
  1812. {
  1813. }
  1814. void mm_fatal (char *string)
  1815. {
  1816. }],
  1817. [
  1818. long check = mail_expunge_full(NULL, "", 0);
  1819. ]
  1820. )],
  1821. [ac_cv_imap_tk2006="yes"],
  1822. [ac_cv_imap_tk2006="no"]
  1823. )
  1824. fi
  1825. fi
  1826. fi
  1827. if test "${ac_cv_imap_tk}" = "yes"; then
  1828. AC_MSG_RESULT(yes)
  1829. IMAP_TK_LIB="${imap_libs} "`echo ${imap_ldflags}`
  1830. IMAP_TK_INCLUDE="${imap_include}"
  1831. PBX_IMAP_TK=1
  1832. AC_DEFINE([HAVE_IMAP_TK], 1, [Define if your system has the UW IMAP Toolkit c-client library.])
  1833. if test "${ac_cv_imap_tk2006}" = "yes"; then
  1834. AC_DEFINE([HAVE_IMAP_TK2006], 1, [Define if your system has the UW IMAP Toolkit c-client library version 2006 or greater.])
  1835. fi
  1836. else
  1837. AC_MSG_RESULT(no)
  1838. fi
  1839. CPPFLAGS="${saved_cppflags}"
  1840. LIBS="${saved_libs}"
  1841. fi
  1842. AST_EXT_LIB_CHECK([IODBC], [iodbc], [SQLConnect], [sql.h], [${PTHREAD_LIBS}], [${PTHREAD_CFLAGS}])
  1843. AST_EXT_LIB_CHECK([INOTIFY], [c], [inotify_init], [sys/inotify.h])
  1844. AST_EXT_LIB_CHECK([JACK], [jack], [jack_activate], [jack/jack.h])
  1845. # BSD (and OS X) equivalent of inotify
  1846. AST_EXT_LIB_CHECK([KQUEUE], [c], [kqueue], [sys/event.h])
  1847. # 64-bit version of kevent (from kqueue) on OS X
  1848. AC_CHECK_FUNCS([kevent64])
  1849. # Needed by unixodbc
  1850. AST_EXT_LIB_CHECK([LTDL], [ltdl], [lt_dlinit], [ltdl.h], [])
  1851. AST_EXT_LIB_CHECK([LDAP], [ldap], [ldap_initialize], [ldap.h])
  1852. AST_EXT_LIB_CHECK([MISDN], [mISDN], [mISDN_open], [mISDNuser/mISDNlib.h])
  1853. if test "${PBX_MISDN}" = 1; then
  1854. AST_EXT_LIB_CHECK([ISDNNET], [isdnnet], [init_manager], [mISDNuser/isdn_net.h], [-lmISDN -lpthread])
  1855. AST_EXT_LIB_CHECK([SUPPSERV], [suppserv], [encodeFac], [mISDNuser/suppserv.h])
  1856. AST_C_DEFINE_CHECK([MISDN_FAC_RESULT], [Fac_RESULT], [mISDNuser/suppserv.h])
  1857. AST_C_DEFINE_CHECK([MISDN_FAC_ERROR], [Fac_ERROR], [mISDNuser/suppserv.h])
  1858. AC_CHECK_HEADER([linux/mISDNdsp.h], [AC_DEFINE_UNQUOTED([MISDN_1_2], 1, [Build chan_misdn for mISDN 1.2 or later.])])
  1859. AC_CHECK_MEMBER([Q931_info_t.redirect_dn], [], [PBX_MISDN=0], [#include <mISDNuser/mISDNlib.h>])
  1860. fi
  1861. AST_EXT_TOOL_CHECK([MYSQLCLIENT], [mysql_config])
  1862. AST_EXT_LIB_CHECK([NBS], [nbs], [nbs_connect], [nbs.h])
  1863. AST_EXT_TOOL_CHECK([NEON], [neon-config])
  1864. AST_EXT_TOOL_CHECK([NEON29], [neon-config], , [--libs],
  1865. [#include <ne_auth.h>],
  1866. [#ifndef NE_AUTH_NTLM
  1867. #error Need libneon >= 0.29.0
  1868. #endif])
  1869. AST_EXT_TOOL_CHECK([NETSNMP], [net-snmp-config], , [--agent-libs],
  1870. [#include <net-snmp/net-snmp-config.h>
  1871. #include <net-snmp/net-snmp-includes.h>
  1872. #include <net-snmp/agent/net-snmp-agent-includes.h>],
  1873. [int callback = snmp_register_callback(0, 0, NULL, NULL)])
  1874. AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
  1875. AST_EXT_LIB_CHECK([UNBOUND], [unbound], [ub_ctx_create], [unbound.h], [])
  1876. AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h], [])
  1877. AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], [])
  1878. # Non-glibc platforms require libexecinfo for backtrace support
  1879. AST_EXT_LIB_CHECK([BKTR], [execinfo], [backtrace], [execinfo.h])
  1880. # Linux, however, has backtrace directly in glibc
  1881. AST_EXT_LIB_CHECK([BKTR], [c], [backtrace], [execinfo.h])
  1882. AST_EXT_LIB_CHECK([BLUETOOTH], [bluetooth], [ba2str], [bluetooth/bluetooth.h])
  1883. # possible places for oss definitions
  1884. AST_EXT_LIB_CHECK([OSS], [ossaudio], [], [linux/soundcard.h])
  1885. AST_EXT_LIB_CHECK([OSS], [ossaudio], [], [sys/soundcard.h])
  1886. AST_EXT_LIB_CHECK([OSS], [ossaudio], [oss_ioctl_mixer], [soundcard.h])
  1887. PG_CONFIG=No
  1888. if test "${USE_PGSQL}" != "no"; then
  1889. if test "x${PGSQL_DIR}" != "x"; then
  1890. AC_PATH_TOOL([PG_CONFIG], [pg_config], No, [${PGSQL_DIR}/bin])
  1891. if test x"${PG_CONFIG}" = xNo; then
  1892. AC_MSG_NOTICE([***])
  1893. AC_MSG_NOTICE([*** pg_config was not found in the path you specified:])
  1894. AC_MSG_NOTICE([*** ${PGSQL_DIR}/bin])
  1895. AC_MSG_NOTICE([*** Either correct the installation, or run configure])
  1896. AC_MSG_NOTICE([*** including --without-postgres])
  1897. exit 1
  1898. fi
  1899. else
  1900. AC_PATH_TOOL([PG_CONFIG], [pg_config], No)
  1901. fi
  1902. fi
  1903. if test "${PG_CONFIG}" != No; then
  1904. PGSQL_libdir=`${PG_CONFIG} --libdir`
  1905. PGSQL_includedir=`${PG_CONFIG} --includedir`
  1906. if test "x$?" != "x0" ; then
  1907. if test -n "${PGSQL_MANDATORY}" ; then
  1908. AC_MSG_NOTICE([***])
  1909. AC_MSG_NOTICE([*** The PostgreSQL installation on this system appears to be broken.])
  1910. AC_MSG_NOTICE([*** Either correct the installation, or run configure])
  1911. AC_MSG_NOTICE([*** including --without-postgres])
  1912. exit 1
  1913. fi
  1914. else
  1915. AC_CHECK_LIB([pq], [PQescapeStringConn], AC_DEFINE_UNQUOTED([HAVE_PGSQL], 1,
  1916. [Define to indicate the PostgreSQL library]), [], -L${PGSQL_libdir} -lz)
  1917. AC_MSG_CHECKING(for pg_encoding_to_char within Postgres headers)
  1918. old_CFLAGS=${CFLAGS}
  1919. CFLAGS="${CFLAGS} -I${PGSQL_includedir} -Werror"
  1920. old_LDFLAGS=${LDFLAGS}
  1921. LDFLAGS="${LDFLAGS} -L${PGSQL_libdir} -lpq -lz"
  1922. AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <libpq-fe.h>],
  1923. [const char *foo = pg_encoding_to_char(1)])],
  1924. [AC_MSG_RESULT(yes)
  1925. AC_DEFINE_UNQUOTED([HAVE_PGSQL_pg_encoding_to_char], 1, [Define to indicate presence of the pg_encoding_to_char API.])],
  1926. [AC_MSG_RESULT(no)])
  1927. CFLAGS=${old_CFLAGS}
  1928. LDFLAGS=${old_LDFLAGS}
  1929. if test "${ac_cv_lib_pq_PQescapeStringConn}" = "yes"; then
  1930. PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz"
  1931. PGSQL_INCLUDE="-I${PGSQL_includedir}"
  1932. PBX_PGSQL=1
  1933. elif test -n "${PGSQL_MANDATORY}";
  1934. then
  1935. AC_MSG_NOTICE([***])
  1936. AC_MSG_NOTICE([*** The PostgreSQL installation on this system appears to be broken.])
  1937. AC_MSG_NOTICE([*** Either correct the installation, or run configure])
  1938. AC_MSG_NOTICE([*** including --without-postgres])
  1939. exit 1
  1940. fi
  1941. fi
  1942. fi
  1943. AST_PKG_CONFIG_CHECK([PJPROJECT], [libpjproject])
  1944. AST_EXT_LIB_CHECK([PJ_TRANSACTION_GRP_LOCK], [pjsip], [pjsip_tsx_create_uac2], [pjsip.h], [$PJPROJECT_LIBS], [$PJPROJECT_CFLAGS])
  1945. saved_cppflags="${CPPFLAGS}"
  1946. saved_libs="${LIBS}"
  1947. CPPFLAGS="${CPPFLAGS} ${PJPROJECT_CFLAGS}"
  1948. LIBS="${LIBS} ${PJPROJECT_LIBS}"
  1949. AST_C_COMPILE_CHECK([PJSIP_REPLACE_MEDIA_STREAM], [pjmedia_mod_offer_flag flag = PJMEDIA_SDP_NEG_ALLOW_MEDIA_CHANGE], [pjmedia.h])
  1950. LIBS="${saved_libs}"
  1951. CPPFLAGS="${saved_cppflags}"
  1952. AST_EXT_LIB_CHECK([PJSIP_GET_DEST_INFO], [pjsip], [pjsip_get_dest_info], [pjsip.h], [$PJPROJECT_LIBS], [$PJPROJECT_CFLAGS])
  1953. AST_EXT_LIB_CHECK([PJ_SSL_CERT_LOAD_FROM_FILES2], [pj], [pj_ssl_cert_load_from_files2], [pjlib.h], [$PJPROJECT_LIBS], [$PJPROJECT_CFLAGS])
  1954. AST_EXT_LIB_CHECK([POPT], [popt], [poptStrerror], [popt.h])
  1955. AST_EXT_LIB_CHECK([PORTAUDIO], [portaudio], [Pa_GetDeviceCount], [portaudio.h])
  1956. AST_EXT_LIB_CHECK([PRI], [pri], [pri_connected_line_update], [libpri.h])
  1957. AST_EXT_LIB_CHECK([PRI_SETUP_ACK_INBAND], [pri], [pri_setup_ack], [libpri.h])
  1958. AST_EXT_LIB_CHECK([PRI_L2_PERSISTENCE], [pri], [pri_persistent_layer2_option], [libpri.h])
  1959. AST_EXT_LIB_CHECK([PRI_DATETIME_SEND], [pri], [pri_date_time_send_option], [libpri.h])
  1960. AST_EXT_LIB_CHECK([PRI_MWI_V2], [pri], [pri_mwi_indicate_v2], [libpri.h])
  1961. AST_EXT_LIB_CHECK([PRI_DISPLAY_TEXT], [pri], [pri_display_text], [libpri.h])
  1962. AST_EXT_LIB_CHECK([PRI_MWI], [pri], [pri_mwi_indicate], [libpri.h])
  1963. AST_EXT_LIB_CHECK([PRI_MCID], [pri], [pri_mcid_enable], [libpri.h])
  1964. AST_EXT_LIB_CHECK([PRI_CALL_WAITING], [pri], [pri_connect_ack_enable], [libpri.h])
  1965. AST_EXT_LIB_CHECK([PRI_AOC_EVENTS], [pri], [pri_aoc_events_enable], [libpri.h])
  1966. AST_EXT_LIB_CHECK([PRI_TRANSFER], [pri], [pri_transfer_enable], [libpri.h])
  1967. AST_EXT_LIB_CHECK([PRI_CCSS], [pri], [pri_cc_enable], [libpri.h])
  1968. AST_EXT_LIB_CHECK([PRI_HANGUP_FIX], [pri], [pri_hangup_fix_enable], [libpri.h])
  1969. AST_EXT_LIB_CHECK([PRI_SUBADDR], [pri], [pri_sr_set_called_subaddress], [libpri.h])
  1970. AST_EXT_LIB_CHECK([PRI_CALL_HOLD], [pri], [pri_hold_enable], [libpri.h])
  1971. AST_EXT_LIB_CHECK([PRI_CALL_REROUTING], [pri], [pri_reroute_enable], [libpri.h])
  1972. AST_EXT_LIB_CHECK([PRI_SETUP_KEYPAD], [pri], [pri_sr_set_keypad_digits], [libpri.h])
  1973. # ------------------------------------v
  1974. # TODO: The code can be changed to always include these features now.
  1975. # These features will always be present if pri_connected_line_update is available.
  1976. AST_EXT_LIB_CHECK([PRI_PROG_W_CAUSE], [pri], [pri_progress_with_cause], [libpri.h])
  1977. AST_EXT_LIB_CHECK([PRI_INBANDDISCONNECT], [pri], [pri_set_inbanddisconnect], [libpri.h])
  1978. AST_EXT_LIB_CHECK([PRI_SERVICE_MESSAGES], [pri], [pri_maintenance_service], [libpri.h])
  1979. AST_EXT_LIB_CHECK([PRI_REVERSE_CHARGE], [pri], [pri_sr_set_reversecharge], [libpri.h])
  1980. # ------------------------------------^
  1981. AST_EXT_LIB_CHECK([RESAMPLE], [resample], [resample_open], [libresample.h], [-lm])
  1982. AST_C_COMPILE_CHECK([SPANDSP], [
  1983. #if SPANDSP_RELEASE_DATE < 20080516
  1984. #error "spandsp 0.0.5 or greater is required"
  1985. #endif
  1986. ], [spandsp/version.h], , [minimum version of SpanDSP])
  1987. if test "x${PBX_SPANDSP}" = "x1" ; then
  1988. # We found the correct version in the header, now let's make sure it links
  1989. # properly, and that libtiff is available
  1990. PBX_SPANDSP=0
  1991. AST_EXT_LIB_CHECK([SPANDSP], [spandsp], [span_set_message_handler], [spandsp.h], [-ltiff])
  1992. fi
  1993. if test "x${PBX_SPANDSP}" = "x1" ; then
  1994. # We also need t38_terminal_init()
  1995. PBX_SPANDSP=0
  1996. AST_EXT_LIB_CHECK([SPANDSP], [spandsp], [t38_terminal_init], [spandsp.h], [-ltiff])
  1997. fi
  1998. # Check for libss7 v2.0 branch compatible version.
  1999. AST_EXT_LIB_CHECK([SS7], [ss7], [ss7_set_isup_timer], [libss7.h])
  2000. AST_EXT_LIB_CHECK([OPENR2], [openr2], [openr2_chan_new], [openr2.h])
  2001. AST_EXT_LIB_CHECK([OPUS], [opus], [opus_encoder_create], [opus/opus.h])
  2002. if test "${USE_PWLIB}" != "no"; then
  2003. if test -n "${PWLIB_DIR}"; then
  2004. PWLIBDIR="${PWLIB_DIR}"
  2005. fi
  2006. AST_CHECK_PWLIB()
  2007. AST_CHECK_PWLIB_VERSION([PWLib], [PWLIB], [ptbuildopts.h], [1], [9], [2], [P[[WT]]LIB_VERSION])
  2008. if test "${HAS_PWLIB:-unset}" != "unset"; then
  2009. AST_CHECK_PWLIB_PLATFORM()
  2010. PLATFORM_PWLIB="pt_${PWLIB_PLATFORM}_r"
  2011. AST_CHECK_PWLIB_BUILD([PWLib], [PWLIB],
  2012. [Define if your system has the PWLib libraries.],
  2013. [#include "ptlib.h"],
  2014. [int q = (int) PTime::IsDaylightSavings();])
  2015. fi
  2016. fi
  2017. if test "${PBX_PWLIB}" = "1" -a "${USE_OPENH323}" != "no" ; then
  2018. if test -n "${OPENH323_DIR}"; then
  2019. OPENH323DIR="${OPENH323_DIR}"
  2020. fi
  2021. AST_CHECK_OPENH323()
  2022. AST_CHECK_PWLIB_VERSION([OpenH323], [OPENH323], [openh323buildopts.h], [1], [17], [3], [], [1], [19], [0])
  2023. AST_CHECK_OPENH323_BUILD()
  2024. PLATFORM_OPENH323="h323_${PWLIB_PLATFORM}_${OPENH323_SUFFIX}"
  2025. AST_CHECK_PWLIB_BUILD([OpenH323], [OPENH323],
  2026. [Define if your system has the OpenH323 libraries.],
  2027. [#include "ptlib.h"
  2028. #include "h323.h"
  2029. #include "h323ep.h"],
  2030. [H323EndPoint ep = H323EndPoint();],
  2031. [${PWLIB_INCLUDE}], [${PWLIB_LIB}])
  2032. fi
  2033. AST_EXT_LIB_CHECK([LUA], [lua5.2], [luaL_newstate], [lua5.2/lua.h], [-lm])
  2034. if test "x${PBX_LUA}" = "x1" ; then
  2035. if test x"${LUA_DIR}" = x; then
  2036. LUA_INCLUDE="${LUA_INCLUDE} -I/usr/include/lua5.2"
  2037. else
  2038. LUA_INCLUDE="${LUA_INCLUDE} -I${LUA_DIR}/lua5.2"
  2039. fi
  2040. fi
  2041. AST_EXT_LIB_CHECK([LUA], [lua5.1], [luaL_newstate], [lua5.1/lua.h], [-lm])
  2042. if test "x${PBX_LUA}" = "x1" ; then
  2043. if test x"${LUA_DIR}" = x; then
  2044. LUA_INCLUDE="${LUA_INCLUDE} -I/usr/include/lua5.1"
  2045. else
  2046. LUA_INCLUDE="${LUA_INCLUDE} -I${LUA_DIR}/lua5.1"
  2047. fi
  2048. fi
  2049. # Some distributions (like SuSE) remove the 5.1 suffix.
  2050. AST_EXT_LIB_CHECK([LUA], [lua], [luaL_openlib], [lua.h], [-lm])
  2051. # Accept either RADIUS client library, their APIs are fully compatible,
  2052. # just different header filenames and different SONAMEs
  2053. AST_EXT_LIB_CHECK([RADIUS], [freeradius-client], [rc_read_config], [freeradius-client.h])
  2054. if test "x${PBX_RADIUS}" = "x1"; then
  2055. AC_DEFINE(FREERADIUS_CLIENT, [], [Use the FreeRADIUS-client library])
  2056. else
  2057. AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
  2058. fi
  2059. AST_EXT_LIB_CHECK([COROSYNC], [cpg], [cpg_join], [corosync/cpg.h], [-lcfg])
  2060. AST_EXT_LIB_CHECK([COROSYNC_CFG_STATE_TRACK], [cfg], [corosync_cfg_state_track], [corosync/cfg.h], [-lcfg])
  2061. AST_EXT_LIB_CHECK([SPEEX], [speex], [speex_encode], [speex/speex.h], [-lm])
  2062. # See if the main speex library contains the preprocess functions
  2063. AST_EXT_LIB_CHECK([SPEEX_PREPROCESS], [speex], [speex_preprocess_ctl], [speex/speex.h], [-lm])
  2064. if test "${PBX_SPEEX_PREPROCESS}" = 1; then
  2065. PBX_SPEEX_PREPROCESS=1
  2066. fi
  2067. AST_EXT_LIB_CHECK([SPEEXDSP], [speexdsp], [speex_preprocess_ctl], [speex/speex.h], [-lm])
  2068. if test "${PBX_SPEEXDSP}" = 1; then
  2069. PBX_SPEEX_PREPROCESS=1
  2070. fi
  2071. AC_SUBST(PBX_SPEEX_PREPROCESS)
  2072. AST_EXT_LIB_CHECK([SQLITE], [sqlite], [sqlite_exec], [sqlite.h])
  2073. AST_EXT_LIB_CHECK([SQLITE3], [sqlite3], [sqlite3_open], [sqlite3.h], [${PTHREAD_LIBS}], [${PTHREAD_CFLAGS}])
  2074. if test "${PBX_SQLITE3}" != 1; then
  2075. AC_MSG_ERROR(*** Asterisk now uses SQLite3 for the internal Asterisk database.)
  2076. AC_MSG_ERROR(*** Please install the SQLite3 development package.)
  2077. exit 1
  2078. fi
  2079. # Find crypt support
  2080. # * -lcrypt on *NIX
  2081. # * in libsystem on OS X
  2082. AST_EXT_LIB_CHECK([LIBCRYPT], [crypt], [crypt], [crypt.h])
  2083. AC_CHECK_FUNC([crypt], [SYSCRYPT=true], [SYSCRYPT=""])
  2084. if test "x$LIBCRYPT_LIB" != "x" ; then
  2085. CRYPT_LIB="$LIBCRYPT_LIB"
  2086. CRYPT_INCLUDE="$LIBCRYPT_INCLUDE"
  2087. AC_DEFINE([HAVE_CRYPT], [1], [Define to 1 if you have the `crypt' function.])
  2088. elif test "x$SYSCRYPT" != "x" ; then
  2089. CRYPT_LIB=""
  2090. CRYPT_INCLUDE=""
  2091. AC_DEFINE([HAVE_CRYPT], [1], [Define to 1 if you have the `crypt' function.])
  2092. fi
  2093. AC_SUBST(CRYPT_LIB)
  2094. AC_SUBST(CRYPT_INCLUDE)
  2095. # Find crypt_r support
  2096. AC_CHECK_LIB([crypt], [crypt_r],
  2097. [AC_DEFINE([HAVE_CRYPT_R], [1], [Define to 1 if you have the `crypt_r' function.])])
  2098. AST_EXT_LIB_CHECK([CRYPTO], [crypto], [AES_encrypt], [openssl/aes.h])
  2099. if test "$PBX_CRYPTO" = "1";
  2100. then
  2101. AST_EXT_LIB_CHECK([OPENSSL], [ssl], [SSL_connect], [openssl/ssl.h], [-lcrypto])
  2102. fi
  2103. if test "$PBX_OPENSSL" = "1";
  2104. then
  2105. AST_CHECK_OSPTK([4], [0], [0])
  2106. AST_EXT_LIB_CHECK([OPENSSL_SRTP], [ssl], [SSL_CTX_set_tlsext_use_srtp], [openssl/ssl.h], [-lcrypto])
  2107. fi
  2108. if test "$PBX_OPENSSL" = "1";
  2109. then
  2110. AST_EXT_LIB_CHECK([OPENSSL_EC], [ssl], [EC_KEY_new_by_curve_name], [openssl/ec.h], [-lcrypto])
  2111. fi
  2112. AST_EXT_LIB_CHECK([SRTP], [srtp], [srtp_init], [srtp/srtp.h])
  2113. if test "$PBX_SRTP" = "1";
  2114. then
  2115. saved_libs="${LIBS}"
  2116. saved_ldflags="${LDFLAGS}"
  2117. saved_cflags="${CFLAGS}"
  2118. LIBS="${LIBS} ${SRTP_LIB}"
  2119. LDFLAGS="${LDFLAGS} -shared -fPIC"
  2120. CFLAGS="${CFLAGS} ${SRTP_INCLUDE}"
  2121. AC_MSG_CHECKING(for the ability of -lsrtp to be linked in a shared object)
  2122. AC_LINK_IFELSE(
  2123. [
  2124. AC_LANG_PROGRAM(
  2125. [#include <srtp/srtp.h>],
  2126. [srtp_init();]
  2127. )
  2128. ],
  2129. [ AC_MSG_RESULT(yes) ],
  2130. [
  2131. AC_MSG_RESULT(no)
  2132. AC_MSG_WARN(***)
  2133. AC_MSG_WARN(*** libsrtp could not be linked as a shared object.)
  2134. AC_MSG_WARN(*** Try compiling libsrtp manually. Configure libsrtp)
  2135. AC_MSG_WARN(*** with ./configure CFLAGS=-fPIC --prefix=/usr)
  2136. AC_MSG_WARN(*** replacing /usr with the prefix of your choice.)
  2137. AC_MSG_WARN(*** After re-installing libsrtp, re-run the Asterisk)
  2138. AC_MSG_WARN(*** configure script.)
  2139. AC_MSG_WARN(***)
  2140. AC_MSG_WARN(*** If you do not need SRTP support re-run configure)
  2141. AC_MSG_WARN(*** with the --without-srtp option.)
  2142. exit 1
  2143. ]
  2144. )
  2145. LIBS="${saved_libs}"
  2146. LDFLAGS="${saved_ldflags}"
  2147. CFLAGS="${saved_cflags}"
  2148. fi
  2149. AST_EXT_LIB_CHECK([SRTP_SHUTDOWN], [srtp], [srtp_shutdown], [srtp/srtp.h])
  2150. for ver in 2.0 2.2 2.4 2.6; do
  2151. AST_PKG_CONFIG_CHECK([GMIME], gmime-$ver)
  2152. if test "$PBX_GMIME" = 1; then
  2153. break;
  2154. fi
  2155. done
  2156. AST_EXT_LIB_CHECK([HOARD], [hoard], [malloc], [])
  2157. AST_EXT_LIB_CHECK([FREETDS], [sybdb], [dbinit], [sybdb.h])
  2158. AC_CHECK_LIB([tonezone], [tone_zone_find_by_num], tonezone_does_not_need_lm=yes, tonezone_does_not_need_lm=no)
  2159. if test "${tonezone_does_not_need_lm}" = "no" ; then
  2160. tonezone_extra="-lm"
  2161. fi
  2162. AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [dahdi/tonezone.h], [${tonezone_extra} ${DAHDI_INCLUDE}])
  2163. if test "${OSARCH}" = "OpenBSD";
  2164. then
  2165. AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc -lvorbisfile -logg])
  2166. else
  2167. AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc -lvorbisfile])
  2168. fi
  2169. AST_C_DECLARE_CHECK([VORBIS_OPEN_CALLBACKS], [OV_CALLBACKS_NOCLOSE], [vorbis/vorbisfile.h])
  2170. AC_LANG_PUSH(C++)
  2171. if test "${USE_VPB}" != "no"; then
  2172. AC_MSG_CHECKING(for vpb_open in -lvpb)
  2173. saved_libs="${LIBS}"
  2174. saved_cppflags="${CPPFLAGS}"
  2175. if test "x${VPB_DIR}" != "x"; then
  2176. if test -d ${VPB_DIR}/lib; then
  2177. vpblibdir=${VPB_DIR}/lib
  2178. else
  2179. vpblibdir=${VPB_DIR}
  2180. fi
  2181. LIBS="${LIBS} -L${vpblibdir}"
  2182. CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include"
  2183. fi
  2184. LIBS="${PTHREAD_LIBS} ${LIBS} -lvpb"
  2185. CPPFLAGS="${CPPFLAGS} ${PTHREAD_CFLAGS}"
  2186. AC_LINK_IFELSE(
  2187. [
  2188. AC_LANG_PROGRAM(
  2189. [#include <vpbapi.h>],
  2190. [int q = vpb_open(0,0);])
  2191. ],
  2192. [ AC_MSG_RESULT(yes)
  2193. ac_cv_lib_vpb_vpb_open="yes"
  2194. ],
  2195. [ AC_MSG_RESULT(no)
  2196. ac_cv_lib_vpb_vpb_open="no"
  2197. ]
  2198. )
  2199. LIBS="${saved_libs}"
  2200. CPPFLAGS="${saved_cppflags}"
  2201. if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
  2202. VPB_LIB="-lvpb"
  2203. if test "${VPB_DIR}" != ""; then
  2204. VPB_LIB="-L${vpblibdir} ${VPB_LIB}"
  2205. VPB_INCLUDE="-I${VPB_DIR}/include"
  2206. fi
  2207. PBX_VPB=1
  2208. AC_DEFINE([HAVE_VPB], 1, [Define if your system has the VoiceTronix API libraries.])
  2209. fi
  2210. fi
  2211. AC_LANG_POP
  2212. AST_EXT_LIB_CHECK([ZLIB], [z], [compress], [zlib.h])
  2213. if test "x${PBX_UNIXODBC}" = "x1" -o "x${PBX_IODBC}" = "x1"; then
  2214. # Does ODBC support wide characters?
  2215. AC_MSG_CHECKING(whether ODBC has support for Unicode types)
  2216. AC_LINK_IFELSE(
  2217. [AC_LANG_PROGRAM(
  2218. [#include <sql.h>
  2219. #include <sqlext.h>],
  2220. [int foo = SQL_WCHAR])],
  2221. AC_MSG_RESULT(yes)
  2222. AC_DEFINE([HAVE_ODBC_WCHAR], [1], [Define to 1 if your ODBC library has wide (Unicode) types.]),
  2223. AC_MSG_RESULT(no)
  2224. )
  2225. fi
  2226. AC_CHECK_HEADER([linux/compiler.h],
  2227. [AC_DEFINE_UNQUOTED([HAVE_LINUX_COMPILER_H], 1, [Define to 1 if your system has linux/compiler.h.])])
  2228. AC_CHECK_HEADER([linux/ixjuser.h], [PBX_IXJUSER=1], [PBX_IXJUSER=0], [
  2229. #include <linux/version.h>
  2230. #ifdef HAVE_LINUX_COMPILER_H
  2231. #include <linux/compiler.h>
  2232. #endif
  2233. ])
  2234. AC_SUBST(PBX_IXJUSER)
  2235. # Used in res/res_pktccops
  2236. AST_C_DEFINE_CHECK([MSG_NOSIGNAL], [MSG_NOSIGNAL], [sys/socket.h])
  2237. AST_C_DEFINE_CHECK([SO_NOSIGPIPE], [SO_NOSIGPIPE], [sys/socket.h])
  2238. AST_EXT_TOOL_CHECK([SDL], [sdl-config])
  2239. AST_EXT_LIB_CHECK([SDL_IMAGE], [SDL_image], [IMG_Load], [SDL_image.h], [${SDL_LIB}], [${SDL_INCLUDE}])
  2240. AST_EXT_LIB_CHECK([FFMPEG], [avcodec], [sws_getContext], [ffmpeg/avcodec.h], [${PTHREAD_LIBS} -lz -lm], [${PTHREAD_CFLAGS}])
  2241. # possible places for video4linux version 1
  2242. AC_CHECK_HEADER([linux/videodev.h],
  2243. [AC_DEFINE_UNQUOTED([HAVE_VIDEODEV_H], 1, [Define to 1 if your system has linux/videodev.h.])])
  2244. # possible places for X11
  2245. AST_EXT_LIB_CHECK([X11], [X11], [XOpenDisplay], [X11/Xlib.h],,, [standard_path])
  2246. AST_EXT_LIB_CHECK([X11], [X11], [XOpenDisplay], [X11/Xlib.h],, [-I/usr/X11R6/include], [X11R6])
  2247. PBX_LAUNCHD=0
  2248. if test "${cross_compiling}" = "no";
  2249. then
  2250. AC_CHECK_FILE(/sbin/launchd,
  2251. [PBX_LAUNCHD=1]
  2252. AC_DEFINE([HAVE_SBIN_LAUNCHD], 1, [Define to 1 if your system has /sbin/launchd.]))
  2253. fi
  2254. AC_SUBST(PBX_LAUNCHD)
  2255. AST_PKG_CONFIG_CHECK([GTK2], [gtk+-2.0])
  2256. # build a GENERIC_ODBC result based on the presence of either UnixODBC (preferred)
  2257. # or iODBC
  2258. PBX_GENERIC_ODBC=0
  2259. if test "${PBX_UNIXODBC}" = 1; then
  2260. PBX_GENERIC_ODBC=1
  2261. GENERIC_ODBC_LIB="${UNIXODBC_LIB}"
  2262. GENERIC_ODBC_INCLUDE="${UNIXODBC_INCLUDE}"
  2263. elif test "${PBX_IODBC}" = 1; then
  2264. PBX_GENERIC_ODBC=1
  2265. GENERIC_ODBC_LIB="${IODBC_LIB}"
  2266. GENERIC_ODBC_INCLUDE="${IODBC_INCLUDE}"
  2267. fi
  2268. AC_SUBST([GENERIC_ODBC_LIB])
  2269. AC_SUBST([GENERIC_ODBC_INCLUDE])
  2270. AC_SUBST([PBX_GENERIC_ODBC])
  2271. PBX_SYSLOG=0
  2272. if test "${ac_cv_header_syslog_h}" = "yes"; then
  2273. # syslog facilities
  2274. AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_AUTH], [LOG_AUTH], [syslog.h])
  2275. AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_AUTHPRIV], [LOG_AUTHPRIV], [syslog.h])
  2276. AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_CRON], [LOG_CRON], [syslog.h])
  2277. AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_DAEMON], [LOG_DAEMON], [syslog.h])
  2278. AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_FTP], [LOG_FTP], [syslog.h])
  2279. AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_KERN], [LOG_KERN], [syslog.h])
  2280. AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_LPR], [LOG_LPR], [syslog.h])
  2281. AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_MAIL], [LOG_MAIL], [syslog.h])
  2282. AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_NEWS], [LOG_NEWS], [syslog.h])
  2283. AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_SYSLOG], [LOG_SYSLOG], [syslog.h])
  2284. AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_UUCP], [LOG_UUCP], [syslog.h])
  2285. PBX_SYSLOG=1
  2286. fi
  2287. AC_SUBST([PBX_SYSLOG])
  2288. if test -f makeopts; then
  2289. ${ac_cv_path_EGREP} 'CURSES|GTK2|OSARCH|NEWT' makeopts > makeopts.acbak
  2290. else
  2291. touch makeopts.acbak
  2292. fi
  2293. AC_CONFIG_FILES([build_tools/menuselect-deps makeopts])
  2294. AST_CHECK_MANDATORY
  2295. if test -f build_tools/menuselect-deps; then
  2296. # extract old values of all PBX_ variables from menuselect-deps
  2297. # and preserve them so that menuselect can determine whether
  2298. # any previously-met dependencies are no longer met and warn
  2299. # the user appropriately
  2300. while IFS="=:" read var val old_val; do
  2301. eval "PBX_${var}=\${PBX_${var}}:${val}"
  2302. done < build_tools/menuselect-deps
  2303. fi
  2304. AC_OUTPUT
  2305. ${ac_cv_path_EGREP} 'CURSES|GTK2|OSARCH|NEWT' makeopts > makeopts.acbak2
  2306. if test "x${ac_cv_path_CMP}" = "x:"; then
  2307. ( cd `pwd`/menuselect && ./configure )
  2308. else if ${ac_cv_path_CMP} -s makeopts.acbak makeopts.acbak2; then : ; else
  2309. ( cd `pwd`/menuselect && ./configure )
  2310. fi ; fi
  2311. rm makeopts.acbak makeopts.acbak2
  2312. if test "x${silent}" != "xyes" ; then
  2313. echo
  2314. echo " .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=.. "
  2315. echo " .\$7\$7.. .7\$\$7:. "
  2316. echo " .\$\$:. ,\$7.7 "
  2317. echo " .\$7. 7\$\$\$\$ .\$\$77 "
  2318. echo " ..\$\$. \$\$\$\$\$ .\$\$\$7 "
  2319. echo " ..7\$ .?. \$\$\$\$\$ .?. 7\$\$\$."
  2320. echo " \$.\$. .\$\$\$7. \$\$\$\$7 .7\$\$\$. .\$\$\$."
  2321. echo " .777. .\$\$\$\$\$\$77\$\$\$77\$\$\$\$\$7. \$\$\$,"
  2322. echo " \$\$\$~ .7\$\$\$\$\$\$\$\$\$\$\$\$\$7. .\$\$\$."
  2323. echo ".\$\$7 .7\$\$\$\$\$\$\$7: ?\$\$\$."
  2324. echo "\$\$\$ ?7\$\$\$\$\$\$\$\$\$\$I .\$\$\$7 "
  2325. echo "\$\$\$ .7\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ :\$\$\$. "
  2326. echo "\$\$\$ \$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$\$\$\$ .\$\$\$. "
  2327. echo "\$\$\$ \$\$\$ 7\$\$\$7 .\$\$\$ .\$\$\$. "
  2328. echo "\$\$\$\$ \$\$\$\$7 .\$\$\$. "
  2329. echo "7\$\$\$7 7\$\$\$\$ 7\$\$\$ "
  2330. echo " \$\$\$\$\$ \$\$\$ "
  2331. echo " \$\$\$\$7. \$\$ (TM) "
  2332. echo " \$\$\$\$\$\$\$. .7\$\$\$\$\$\$ \$\$ "
  2333. echo " \$\$\$\$\$\$\$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$.\$\$\$\$\$\$ "
  2334. echo " \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$. "
  2335. echo
  2336. fi
  2337. if test "x${AST_IODBC_FOUND}" = "xyes"; then
  2338. echo "WARNING: iodbc libs/headers found!"
  2339. echo
  2340. echo " If you plan to use ODBC functionality, you should consider"
  2341. echo " switching to unixodbc instead."
  2342. echo " See: https://issues.asterisk.org/jira/browse/ASTERISK-22459"
  2343. echo
  2344. fi
  2345. AC_MSG_NOTICE(Package configured for: )
  2346. AC_MSG_NOTICE( OS type : $host_os)
  2347. AC_MSG_NOTICE( Host CPU : $host_cpu)
  2348. AC_MSG_NOTICE( build-cpu:vendor:os: $build_cpu : $build_vendor : $build_os :)
  2349. AC_MSG_NOTICE( host-cpu:vendor:os: $host_cpu : $host_vendor : $host_os :)
  2350. if test "${cross_compiling}" = "yes"; then
  2351. AC_MSG_NOTICE( Cross Compilation = YES)
  2352. fi