configure.ac 100 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957
  1. AC_PREREQ(2.60a)
  2. AC_INIT([asterisk], [master], [https://github.com/asterisk/asterisk/issues])
  3. # cross-compile macros
  4. AC_CANONICAL_BUILD
  5. AC_CANONICAL_HOST
  6. # check existence of the package
  7. AC_CONFIG_SRCDIR([main/asterisk.c])
  8. AC_COPYRIGHT("Asterisk")
  9. # preserve any CFLAGS or LDFLAGS that may be set
  10. # NOTE: This must be done before calling any macros that end up
  11. # calling AC_PROG_CC or the like, since they will set a default
  12. # set of CFLAGS ("-g -O2") if the user did not supply any, and
  13. # we don't want those default flags to be carried over into the
  14. # rest of the build system since we have other means of controlling
  15. # debugging symbol generation and optimization.
  16. CONFIG_CFLAGS="${CFLAGS}"
  17. CONFIG_LDFLAGS="${LDFLAGS}"
  18. AC_SUBST(CONFIG_CFLAGS)
  19. AC_SUBST(CONFIG_LDFLAGS)
  20. # specify output header file
  21. AC_CONFIG_HEADERS([include/asterisk/autoconfig.h])
  22. # Note: AC_PROG_CC *must* be specified before AC_USE_SYSTEM_EXTENSIONS or any
  23. # other macro that uses the C compiler, or the default order will be used.
  24. AC_PROG_CC([gcc cc])
  25. AC_USE_SYSTEM_EXTENSIONS dnl note- does not work on FreeBSD
  26. # System default paths
  27. AC_SUBST([astsbindir], ['${sbindir}'])dnl
  28. AC_SUBST([astcachedir], ['${localstatedir}/cache/asterisk'])dnl
  29. AC_SUBST([astetcdir], ['${sysconfdir}/asterisk'])dnl
  30. AC_SUBST([astheaderdir], ['${includedir}/asterisk'])dnl
  31. AC_SUBST([astlibdir], ['${libdir}'])dnl
  32. AC_SUBST([astmoddir], ['${libdir}/asterisk/modules'])dnl
  33. AC_SUBST([astmandir], ['${mandir}'])dnl
  34. AC_SUBST([astvarlibdir], ['${localstatedir}/lib/asterisk'])dnl
  35. AC_SUBST([astdatadir], ['${astvarlibdir}'])dnl
  36. AC_SUBST([astdbdir], ['${astvarlibdir}'])dnl
  37. AC_SUBST([astkeydir], ['${astvarlibdir}'])dnl
  38. AC_SUBST([astspooldir], ['${localstatedir}/spool/asterisk'])dnl
  39. AC_SUBST([astlogdir], ['${localstatedir}/log/asterisk'])dnl
  40. AC_SUBST([astvarrundir], ['${localstatedir}/run/asterisk'])dnl
  41. case "${host_os}" in
  42. *bsd*)
  43. if test ${prefix} != 'NONE'; then
  44. astvarlibdir='${prefix}/share/asterisk'
  45. astdbdir='${localstatedir}/db/asterisk'
  46. fi
  47. ;;
  48. darwin*)
  49. if test ${prefix} = 'NONE'; then
  50. astvarrundir='/Library/Application Support/Asterisk/Run'
  51. fi
  52. ;;
  53. esac
  54. case "${host_os}" in
  55. netbsd*)
  56. ac_default_prefix=/usr/pkg
  57. CPPFLAGS=-I/usr/pkg/include
  58. LDFLAGS=-L/usr/pkg/lib
  59. ;;
  60. dragonfly*|freebsd*)
  61. ac_default_prefix=/usr/local
  62. CPPFLAGS=-I/usr/local/include
  63. LDFLAGS=-L/usr/local/lib
  64. ;;
  65. openbsd*)
  66. ac_default_prefix=/usr/local
  67. if test ${prefix} = '/usr/local' || test ${prefix} = 'NONE'; then
  68. if test ${sysconfdir} = '${prefix}/etc'; then
  69. astetcdir=/etc/asterisk
  70. fi
  71. if test ${mandir} = '${prefix}/man'; then
  72. astmandir=/usr/share/man
  73. fi
  74. fi
  75. CPPFLAGS=-I/usr/local/include
  76. LDFLAGS=-L/usr/local/lib
  77. ;;
  78. darwin*)
  79. ac_default_prefix=/usr/local
  80. if test ${prefix} = 'NONE'; then
  81. astmoddir='/Library/Application Support/Asterisk/Modules'
  82. astvarlibdir='/Library/Application Support/Asterisk'
  83. astlogdir=/Library/Logs/Asterisk
  84. astvarrundir='/Library/Application Support/Asterisk/Run'
  85. fi
  86. AC_DEFINE([AST_POLL_COMPAT], 1, [Define to 1 if internal poll should be used.])
  87. AC_DEFINE([_DARWIN_UNLIMITED_SELECT], 1, [Define to 1 if running on Darwin.])
  88. ;;
  89. solaris*)
  90. if test ${prefix} = 'NONE'; then
  91. astcachedir=/var/cache/asterisk
  92. astetcdir=/var/etc/asterisk
  93. astsbindir=/opt/asterisk/sbin
  94. astlibdir=/opt/asterisk/lib
  95. astmoddir=/opt/asterisk/lib/modules
  96. astheaderdir=/opt/asterisk/include
  97. astmandir=/opt/asterisk/man
  98. astvarlibdir=/var/opt/asterisk
  99. astspooldir=/var/spool/asterisk
  100. astlogdir=/var/log/asterisk
  101. astvarrundir=/var/run/asterisk
  102. fi
  103. ;;
  104. *)
  105. ac_default_prefix=/usr
  106. if test ${prefix} = '/usr' || test ${prefix} = 'NONE'; then
  107. if test ${sysconfdir} = '${prefix}/etc'; then
  108. sysconfdir=/etc
  109. fi
  110. if test ${mandir} = '${prefix}/man'; then
  111. mandir=/usr/share/man
  112. fi
  113. fi
  114. ;;
  115. esac
  116. if test ${prefix} = ${ac_default_prefix} || test ${prefix} = 'NONE'; then
  117. if test ${localstatedir} = '${prefix}/var'; then
  118. localstatedir=/var
  119. fi
  120. fi
  121. BUILD_PLATFORM=${build}
  122. BUILD_CPU=${build_cpu}
  123. BUILD_VENDOR=${build_vendor}
  124. BUILD_OS=${build_os}
  125. AC_SUBST(BUILD_PLATFORM)
  126. AC_SUBST(BUILD_CPU)
  127. AC_SUBST(BUILD_VENDOR)
  128. AC_SUBST(BUILD_OS)
  129. HOST_PLATFORM=${host}
  130. HOST_CPU=${host_cpu}
  131. HOST_VENDOR=${host_vendor}
  132. HOST_OS=${host_os}
  133. AC_SUBST(HOST_PLATFORM)
  134. AC_SUBST(HOST_CPU)
  135. AC_SUBST(HOST_VENDOR)
  136. AC_SUBST(HOST_OS)
  137. PBX_WINARCH=0
  138. case "${host_os}" in
  139. dragonfly*|freebsd*)
  140. OSARCH=FreeBSD
  141. ;;
  142. netbsd*)
  143. OSARCH=NetBSD
  144. ;;
  145. openbsd*)
  146. OSARCH=OpenBSD
  147. ;;
  148. solaris*)
  149. OSARCH=SunOS
  150. ;;
  151. mingw32)
  152. OSARCH=mingw32
  153. PBX_WINARCH=1
  154. ;;
  155. cygwin)
  156. OSARCH=cygwin
  157. PBX_WINARCH=1
  158. ;;
  159. linux-gnu*)
  160. OSARCH=linux-gnu
  161. ;;
  162. linux-musl*)
  163. OSARCH=linux-musl
  164. ;;
  165. kfreebsd*-gnu)
  166. OSARCH=kfreebsd-gnu
  167. ;;
  168. *)
  169. OSARCH=${host_os}
  170. ;;
  171. esac
  172. AC_SUBST(OSARCH)
  173. AC_SUBST(PBX_WINARCH)
  174. AC_MSG_CHECKING(whether char is unsigned)
  175. AC_COMPILE_IFELSE(
  176. [
  177. AC_LANG_SOURCE(
  178. #include <limits.h>
  179. #if CHAR_MIN == 0
  180. #error
  181. #endif
  182. )
  183. ],[
  184. AC_MSG_RESULT(no)
  185. CONFIG_SIGNED_CHAR=""
  186. ],[
  187. AC_MSG_RESULT(yes)
  188. CONFIG_SIGNED_CHAR="-fsigned-char"
  189. ]
  190. )
  191. AC_SUBST(CONFIG_SIGNED_CHAR)
  192. # check for uname
  193. AC_PATH_TOOL([UNAME], [uname], :)
  194. if test "x${UNAME}" != "x:"; then
  195. PBX_OSREV=$(${UNAME} -r)
  196. fi
  197. AC_SUBST(PBX_OSREV)
  198. AH_TOP([#ifndef ASTERISK_AUTOCONFIG_H
  199. #define ASTERISK_AUTOCONFIG_H
  200. /* IWYU pragma: private, include "asterisk.h" */
  201. #include "asterisk/buildopts.h" /* IWYU pragma: export */])
  202. AH_BOTTOM([#endif /* ASTERISK_AUTOCONFIG_H */])
  203. # cross-compile checks
  204. if test "${cross_compiling}" = "yes";
  205. then
  206. AC_CHECK_TOOL(CC, gcc, :)
  207. AC_CHECK_TOOL(CXX, g++, :)
  208. AC_CHECK_TOOL(LD, ld, :)
  209. AC_CHECK_TOOL(RANLIB, ranlib, :)
  210. CROSS_COMPILING=1
  211. AC_SUBST(CROSS_COMPILING)
  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([CAT], [cat], :)
  236. AC_PATH_PROG([CUT], [cut], :)
  237. AC_PATH_PROG([FLEX], [flex], :)
  238. AC_PATH_PROG([GREP], [grep], :)
  239. AC_PATH_PROGS([PYTHON], [python2.7 python2 python python3], :)
  240. AC_PATH_PROG([FIND], [find], :)
  241. AC_PATH_PROG([BASENAME], [basename], :)
  242. AC_PATH_PROG([DIRNAME], [dirname], :)
  243. AC_PATH_PROG([SHELL], [sh], :)
  244. AC_PATH_PROG([LN], [ln], :)
  245. AC_PATH_PROG([DOXYGEN], [doxygen], :)
  246. AC_PATH_PROG([DOT], [dot], :)
  247. AC_PATH_PROG([WGET], [wget], :)
  248. AC_PATH_PROG([CURL], [curl], :)
  249. AC_PATH_PROG([XMLLINT], [xmllint], :)
  250. AC_PATH_PROGS([XMLSTARLET], [xmlstarlet xml], :)
  251. AC_PATH_PROG([BASH], [bash], :)
  252. AC_PATH_PROG([GIT], [git], :)
  253. AC_PATH_PROG([ALEMBIC], [alembic], :)
  254. AC_PATH_PROG([BZIP2], [bzip2], :)
  255. AC_PATH_PROG([TAR], [tar], :)
  256. AC_PATH_PROG([PATCH], [patch], :)
  257. AC_PATH_PROG([SED], [sed], :)
  258. AC_PATH_PROG([NM], [nm], :)
  259. AC_PATH_PROG([REALPATH], [realpath], :)
  260. DOWNLOAD=":"
  261. DOWNLOAD_TO_STDOUT=
  262. DOWNLOAD_TIMEOUT=
  263. if test "x${WGET}" != "x:"; then
  264. DOWNLOAD=${WGET}
  265. DOWNLOAD_TO_STDOUT="${WGET} -q -O-"
  266. DOWNLOAD_TIMEOUT='--timeout=$1'
  267. elif test "x${CURL}" != "x:"; then
  268. DOWNLOAD="${CURL} -L -O --progress-bar -w \"%{url_effective}\n\""
  269. DOWNLOAD_TO_STDOUT="${CURL} -Ls"
  270. DOWNLOAD_TIMEOUT='--max-time $(or $2,$1)'
  271. else
  272. AC_PATH_PROG([FETCH], [fetch], :)
  273. if test "x${FETCH}" != "x:"; then
  274. DOWNLOAD=${FETCH}
  275. DOWNLOAD_TO_STDOUT="${FETCH} -o-"
  276. DOWNLOAD_TIMEOUT='--timeout=$(or $2,$1)'
  277. fi
  278. fi
  279. AC_SUBST(DOWNLOAD)
  280. AC_SUBST(DOWNLOAD_TO_STDOUT)
  281. AC_SUBST(DOWNLOAD_TIMEOUT)
  282. AC_PATH_PROG([LDCONFIG], [ldconfig], :)
  283. AC_PATH_PROG([SHA1SUM], [sha1sum], $ac_aux_dir/build_tools/sha1sum-sh)
  284. AC_PATH_PROG([OPENSSL], [openssl], :)
  285. PKG_PROG_PKG_CONFIG()
  286. AC_CACHE_CHECK([for bison that supports parse-param], [ac_cv_path_BISON2], [
  287. if test "x$BISON" != "x:" ; then
  288. # Create a temporary directory $tmp in $TMPDIR (default /tmp).
  289. # Use mktemp if possible; otherwise fall back on mkdir,
  290. # with $RANDOM to make collisions less likely.
  291. : ${TMPDIR=/tmp}
  292. {
  293. tmp=`
  294. (umask 077 && mktemp -d "$TMPDIR/fooXXXXXX") 2>/dev/null
  295. ` &&
  296. test -n "$tmp" && test -d "$tmp"
  297. } || {
  298. tmp=$TMPDIR/foo$$-$RANDOM
  299. (umask 077 && mkdir "$tmp")
  300. } || exit $?
  301. cat >$tmp/test.y <<__EOL__
  302. %parse-param {struct parse_io *parseio}
  303. %%
  304. file : { \$\$ = parseio->pval = 1; }
  305. ;
  306. %%
  307. __EOL__
  308. ${BISON} -o ${tmp}/test.tab.c ${tmp}/test.y >/dev/null 2>&1
  309. if test -e "${tmp}/test.tab.c"; then
  310. ac_cv_path_BISON2=${BISON}
  311. fi
  312. rm -rf ${tmp}
  313. fi
  314. ])
  315. if test "x${ac_cv_path_BISON2}" = "x" ; then
  316. BISON=:
  317. PBX_BISON=0
  318. else
  319. PBX_BISON=1
  320. fi
  321. AC_SUBST(PBX_BISON)
  322. if test "${FLEX}" = ":"; then
  323. PBX_FLEX=0
  324. else
  325. PBX_FLEX=1
  326. fi
  327. AC_SUBST(PBX_FLEX)
  328. if test "${XMLSTARLET}" = ":"; then
  329. PBX_XMLSTARLET=0
  330. else
  331. PBX_XMLSTARLET=1
  332. fi
  333. AC_SUBST(PBX_XMLSTARLET)
  334. if test "${BASH}" = ":"; then
  335. PBX_BASH=0
  336. else
  337. PBX_BASH=1
  338. fi
  339. AC_SUBST(PBX_BASH)
  340. AC_CHECK_TOOL([SOXMIX], [soxmix], :)
  341. if test "x${SOXMIX}" != "x:"; then
  342. AC_DEFINE([HAVE_SOXMIX], 1, [Define to 1 if your system has soxmix application.])
  343. fi
  344. AC_CHECK_PROGS([MD5], [md5 md5sum gmd5sum digest])
  345. if test "${MD5}" = "digest" ; then
  346. MD5="${MD5} -a md5"
  347. fi
  348. AX_PTHREAD
  349. AC_LANG(C)
  350. PBX_NO_BINARY_MODULES=0
  351. AC_ARG_ENABLE([binary-modules],
  352. [AS_HELP_STRING([--disable-binary-modules],
  353. [Block installation of binary modules.])],
  354. [case "${enableval}" in
  355. y|ye|yes) PBX_NO_BINARY_MODULES=0 ;;
  356. n|no) PBX_NO_BINARY_MODULES=1 ;;
  357. *) AC_MSG_ERROR(bad value ${enableval} for --disable-binary-modules) ;;
  358. esac])
  359. AC_SUBST(PBX_NO_BINARY_MODULES)
  360. AC_ARG_ENABLE([dev-mode],
  361. [AS_HELP_STRING([--enable-dev-mode],
  362. [Turn on developer mode])],
  363. [case "${enableval}" in
  364. y|ye|yes) AST_DEVMODE=yes ;;
  365. n|no) AST_DEVMODE=no ;;
  366. noisy)
  367. AST_DEVMODE=yes
  368. NOISY_BUILD=yes
  369. ;;
  370. strict)
  371. AST_DEVMODE=yes
  372. AST_DEVMODE_STRICT=yes
  373. ;;
  374. *) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode) ;;
  375. esac])
  376. AC_SUBST(NOISY_BUILD)
  377. AC_SUBST(AST_DEVMODE)
  378. AC_SUBST(AST_DEVMODE_STRICT)
  379. AST_OPTION_ONLY([download-cache], [AST_DOWNLOAD_CACHE], [cached sound AND external module tarfiles], [])
  380. AST_OPTION_ONLY([sounds-cache], [SOUNDS_CACHE_DIR], [cached sound tarfiles], [])
  381. AST_OPTION_ONLY([externals-cache], [EXTERNALS_CACHE_DIR], [cached external module tarfiles], [])
  382. AST_CODE_COVERAGE=no
  383. AC_ARG_ENABLE([coverage],
  384. [AS_HELP_STRING([--enable-coverage],
  385. [Turn on code coverage tracking (for gcov)])],
  386. [case "${enableval}" in
  387. y|ye|yes) AST_CODE_COVERAGE=yes ;;
  388. n|no) AST_CODE_COVERAGE=no ;;
  389. *) AC_MSG_ERROR(bad value ${enableval} for --enable-coverage) ;;
  390. esac])
  391. AC_SUBST(AST_CODE_COVERAGE)
  392. AST_CHECK_RAII()
  393. AST_CHECK_STRSEP_ARRAY_BOUNDS()
  394. JANSSON_BUNDLED=no
  395. AC_ARG_WITH([jansson-bundled],
  396. [AS_HELP_STRING([--with-jansson-bundled],
  397. [Use bundled jansson library])],
  398. [case "${withval}" in
  399. y|ye|yes) JANSSON_BUNDLED=yes ;;
  400. *) JANSSON_BUNDLED=no ;;
  401. esac])
  402. PJPROJECT_BUNDLED=yes
  403. AH_TEMPLATE(m4_bpatsubst([[HAVE_PJPROJECT_BUNDLED]], [(.*)]), [Define to 1 when using the bundled pjproject.])
  404. AC_ARG_WITH([pjproject-bundled],
  405. [AS_HELP_STRING([--with-pjproject-bundled],
  406. [Use bundled pjproject libraries (default)])],
  407. [case "${withval}" in
  408. n|no) PJPROJECT_BUNDLED=no ;;
  409. *) PJPROJECT_BUNDLED=yes ;;
  410. esac])
  411. if test "${with_pjproject}" = "no" || test "${with_pjproject}" = "n" ; then
  412. PJPROJECT_BUNDLED=no
  413. fi
  414. LIBJWT_BUNDLED=no
  415. AC_ARG_WITH([libjwt-bundled],
  416. [AS_HELP_STRING([--with-libjwt-bundled],
  417. [Use bundled libjwt library])],
  418. [case "${withval}" in
  419. y|ye|yes) LIBJWT_BUNDLED=yes ;;
  420. *) LIBJWT_BUNDLED=no ;;
  421. esac])
  422. #
  423. # OpenSSL stuff has to be done here because we want to pass
  424. # any resulting CFLAGS and LDFLAGS to the bundled pjproject
  425. # configure done in THIRD_PARTY_CONFIGURE()
  426. #
  427. AST_EXT_LIB_SETUP([CRYPTO], [OpenSSL Cryptography], [crypto])
  428. AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL Secure Sockets Layer], [ssl])
  429. AST_EXT_LIB_SETUP_OPTIONAL([OPENSSL_BIO_METHOD], [OpenSSL BIO Method Support], [CRYPTO], [crypto])
  430. # If neither --without-ssl (PBX_OPENSSL=-1) nor --without-crypto (PBX_CRYPTO=-1)
  431. # and there were no directories atdded to --with-ssl and --with-crypto, and
  432. # pkg-config is installed (which is should be by install_prereq).
  433. if test "x$PKG_CONFIG" != "x" -a $PBX_OPENSSL -ge 0 -a $PBX_CRYPTO -ge 0 -a "x$OPENSSL_DIR" = "x" ; then
  434. AC_MSG_NOTICE(checking OPENSSL with pkg-config)
  435. AC_MSG_NOTICE(checking whether system openssl > 1.1.0)
  436. AST_PKG_CONFIG_CHECK([OPENSSL], [openssl >= 1.1.0])
  437. if test $PBX_OPENSSL -eq 0 ; then
  438. AC_MSG_NOTICE(checking whether alternate openssl11 is installed)
  439. AST_PKG_CONFIG_CHECK([OPENSSL], [openssl11])
  440. fi
  441. if test $PBX_OPENSSL -eq 1 ; then
  442. AC_DEFINE([HAVE_OPENSSL_BIO_METHOD], 1)
  443. PBX_OPENSSL_BIO_METHOD=1
  444. else
  445. AC_MSG_NOTICE(checking fallback system openssl)
  446. AST_PKG_CONFIG_CHECK([OPENSSL], [openssl])
  447. fi
  448. if test $PBX_OPENSSL -eq 1; then
  449. AC_DEFINE([HAVE_CRYPTO], 1)
  450. PBX_CRYPTO=1
  451. fi
  452. else
  453. AC_MSG_NOTICE(Checking OPENSSL without pkg-config)
  454. AST_EXT_LIB_CHECK([CRYPTO], [crypto], [AES_encrypt], [openssl/aes.h])
  455. if test "$PBX_CRYPTO" = "1";
  456. then
  457. AST_EXT_LIB_CHECK([OPENSSL], [ssl], [SSL_connect], [openssl/ssl.h], [-lcrypto])
  458. AST_EXT_LIB_CHECK([OPENSSL_BIO_METHOD], [ssl], [BIO_meth_new], [openssl/ssl.h], [-lcrypto])
  459. fi
  460. fi
  461. if test $PBX_OPENSSL -eq 0 ; then
  462. AC_MSG_WARN(OpenSSL does not seem to be installed)
  463. fi
  464. THIRD_PARTY_CONFIGURE()
  465. # AST_EXT_LIB_SETUP is used to tell configure to handle variables for
  466. # various packages.
  467. # $1 is the prefix for the variables in makeopts and autoconfig.h
  468. # $2 is the short comment, $4 is the long comment
  469. # $3 is the name used in --with- or --without- flags for configure.
  470. #
  471. # Package option names should be in alphabetical order
  472. # by the --with option name (the third field),
  473. # to make things easier for the users.
  474. AST_EXT_LIB_SETUP([BFD], [Debug symbol decoding], [bfd])
  475. # BKTR is used for backtrace support on platforms that do not
  476. # have it natively.
  477. AST_EXT_LIB_SETUP([BKTR], [Stack Backtrace], [execinfo])
  478. AST_EXT_LIB_SETUP([BLUETOOTH], [Bluetooth], [bluetooth])
  479. AST_EXT_LIB_SETUP([CAP], [POSIX 1.e capabilities], [cap])
  480. AST_EXT_LIB_SETUP([CODEC2], [Codec 2 Audio Decoder/Encoder], [codec2])
  481. AST_EXT_LIB_SETUP([COROSYNC], [Corosync], [cpg])
  482. AST_EXT_LIB_SETUP_OPTIONAL([COROSYNC_CFG_STATE_TRACK], [A callback only in corosync 1.x], [COROSYNC], [cfg])
  483. AST_EXT_LIB_SETUP([CRYPT], [password and data encryption], [crypt])
  484. AST_EXT_LIB_SETUP([DAHDI], [DAHDI], [dahdi])
  485. AST_EXT_LIB_SETUP([FFMPEG], [Ffmpeg and avcodec], [avcodec])
  486. AST_EXT_LIB_SETUP([GSM], [External GSM], [gsm], [, use 'internal' GSM otherwise])
  487. AST_EXT_LIB_SETUP([ILBC], [System iLBC], [ilbc], [, use 'internal' iLBC otherwise])
  488. AST_EXT_LIB_SETUP([GTK2], [gtk2], [gtk2])
  489. AST_EXT_LIB_SETUP([GMIME], [GMime], [gmime])
  490. AST_EXT_LIB_SETUP([HOARD], [Hoard Memory Allocator], [hoard])
  491. AST_EXT_LIB_SETUP([ICAL], [iCal], [ical])
  492. AST_EXT_LIB_SETUP([ICONV], [Iconv], [iconv])
  493. AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber], [iksemel])
  494. AST_EXT_LIB_SETUP([IMAP_TK], [UW IMAP Toolkit], [imap])
  495. AST_EXT_LIB_SETUP([INOTIFY], [inotify support], [inotify])
  496. AST_EXT_LIB_SETUP([IODBC], [iODBC], [iodbc])
  497. AST_EXT_LIB_SETUP([JACK], [Jack Audio Connection Kit], [jack])
  498. AST_EXT_LIB_SETUP([JANSSON], [Jansson JSON library], [jansson])
  499. AST_EXT_LIB_SETUP([URIPARSER], [uriparser library], [uriparser])
  500. AST_EXT_LIB_SETUP([KQUEUE], [kqueue support], [kqueue])
  501. AST_EXT_LIB_SETUP([LDAP], [OpenLDAP], [ldap])
  502. AST_LIBCURL_CHECK_CONFIG([], [7.10.1])
  503. AST_EXT_LIB_SETUP([LIBEDIT], [NetBSD Editline library], [libedit])
  504. AST_EXT_LIB_SETUP_OPTIONAL([LIBEDIT_IS_UNICODE], [Libedit compiled for unicode], [LIBEDIT], [libedit])
  505. AST_EXT_LIB_SETUP([LIBJWT], [LIBJWT], [libjwt])
  506. AST_EXT_LIB_SETUP([LIBXML2], [LibXML2], [libxml2])
  507. AST_EXT_LIB_SETUP([LIBXSLT], [LibXSLT], [libxslt])
  508. AST_EXT_LIB_SETUP_OPTIONAL([LIBXSLT_CLEANUP], [LibXSLT Library Cleanup Function], [LIBXSLT], [libxslt])
  509. AST_EXT_LIB_SETUP([LUA], [Lua], [lua])
  510. AC_ARG_VAR([LUA_VERSIONS],[A space separated list of target lua versions to test.])
  511. AST_EXT_LIB_SETUP([MYSQLCLIENT], [MySQL client], [mysqlclient])
  512. AST_EXT_LIB_SETUP([NEON], [neon], [neon])
  513. AST_EXT_LIB_SETUP([NEON29], [neon29], [neon29])
  514. AST_EXT_LIB_SETUP([NETSNMP], [Net-SNMP], [netsnmp])
  515. AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
  516. AST_EXT_LIB_SETUP([OGG], [OGG], [ogg])
  517. AST_EXT_LIB_SETUP([OPENR2], [MFR2], [openr2])
  518. AST_EXT_LIB_SETUP([OPUS], [Opus], [opus])
  519. AST_EXT_LIB_SETUP([OPUSFILE], [Opusfile], [opusfile])
  520. AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])
  521. AST_EXT_LIB_SETUP([BEANSTALK], [Beanstalk Job Queue], [beanstalk])
  522. if test "x${PBX_PJPROJECT}" != "x1" ; then
  523. AST_EXT_LIB_SETUP([PJPROJECT], [PJPROJECT], [pjproject])
  524. AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_DLG_CREATE_UAS_AND_INC_LOCK], [PJSIP Dialog Create UAS with Incremented Lock], [PJPROJECT], [pjsip])
  525. AST_EXT_LIB_SETUP_OPTIONAL([PJ_TRANSACTION_GRP_LOCK], [PJSIP Transaction Group Lock Support], [PJPROJECT], [pjsip])
  526. AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_REPLACE_MEDIA_STREAM], [PJSIP Media Stream Replacement Support], [PJPROJECT], [pjsip])
  527. AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_GET_DEST_INFO], [pjsip_get_dest_info support], [PJPROJECT], [pjsip])
  528. AST_EXT_LIB_SETUP_OPTIONAL([PJ_SSL_CERT_LOAD_FROM_FILES2], [pj_ssl_cert_load_from_files2 support], [PJPROJECT], [pjsip])
  529. AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_EXTERNAL_RESOLVER], [PJSIP External Resolver Support], [PJPROJECT], [pjsip])
  530. AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_TLS_TRANSPORT_PROTO], [PJSIP TLS Transport proto field support], [PJPROJECT], [pjsip])
  531. AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_TLS_1_1], [PJSIP TLS 1.1 Support], [PJPROJECT], [pjsip])
  532. AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_TLS_1_2], [PJSIP TLS 1.2 Support], [PJPROJECT], [pjsip])
  533. AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_TLS_1_3], [PJSIP TLS 1.3 Support], [PJPROJECT], [pjsip])
  534. AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_EVSUB_GRP_LOCK], [PJSIP EVSUB Group Lock support], [PJPROJECT], [pjsip])
  535. AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_INV_SESSION_REF], [PJSIP INVITE Session Reference Count support], [PJPROJECT], [pjsip])
  536. AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_AUTH_CLT_DEINIT], [pjsip_auth_clt_deinit support], [PJPROJECT], [pjsip])
  537. AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_TSX_LAYER_FIND_TSX2], [pjsip_tsx_layer_find_tsx2 support], [PJPROJECT], [pjsip])
  538. AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_INV_ACCEPT_MULTIPLE_SDP_ANSWERS], [PJSIP INVITE Accept Multiple SDP Answers], [PJPROJECT], [pjsip])
  539. AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_ENDPOINT_COMPACT_FORM], [PJSIP Compact Form Support on Endpoint], [PJPROJECT], [pjsip])
  540. AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_TRANSPORT_DISABLE_CONNECTION_REUSE], [PJSIP Transport Connection Reuse Disabling], [PJPROJECT], [pjsip])
  541. AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_OAUTH_AUTHENTICATION], [PJSIP OAuth Authentication Support], [PJPROJECT], [pjsip])
  542. AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_TLS_TRANSPORT_RESTART], [PJSIP TLS Transport Restart Support], [PJPROJECT], [pjsip])
  543. fi
  544. AST_EXT_LIB_SETUP([POPT], [popt], [popt])
  545. AST_EXT_LIB_SETUP([PORTAUDIO], [PortAudio], [portaudio])
  546. AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
  547. AST_EXT_LIB_SETUP_OPTIONAL([PRI_SETUP_ACK_INBAND], [ISDN PRI progress inband ie in SETUP ACK], [PRI], [pri])
  548. AST_EXT_LIB_SETUP_OPTIONAL([PRI_L2_PERSISTENCE], [ISDN Layer 2 persistence option], [PRI], [pri])
  549. AST_EXT_LIB_SETUP_OPTIONAL([PRI_DATETIME_SEND], [ISDN PRI Date/time ie send policy], [PRI], [pri])
  550. AST_EXT_LIB_SETUP_OPTIONAL([PRI_MWI_V2], [ISDN PRI Message Waiting Indication (Fixed)], [PRI], [pri])
  551. AST_EXT_LIB_SETUP_OPTIONAL([PRI_DISPLAY_TEXT], [ISDN PRI user display text IE contents during call], [PRI], [pri])
  552. AST_EXT_LIB_SETUP_OPTIONAL([PRI_MWI], [ISDN PRI Message Waiting Indication], [PRI], [pri])
  553. AST_EXT_LIB_SETUP_OPTIONAL([PRI_MCID], [ISDN PRI Malicious Call ID], [PRI], [pri])
  554. AST_EXT_LIB_SETUP_OPTIONAL([PRI_CALL_WAITING], [ISDN PRI call waiting supplementary service], [PRI], [pri])
  555. AST_EXT_LIB_SETUP_OPTIONAL([PRI_AOC_EVENTS], [ISDN PRI advice of charge supplementary service events], [PRI], [pri])
  556. AST_EXT_LIB_SETUP_OPTIONAL([PRI_TRANSFER], [ISDN PRI call transfer supplementary service], [PRI], [pri])
  557. AST_EXT_LIB_SETUP_OPTIONAL([PRI_CCSS], [ISDN PRI call completion supplementary service], [PRI], [pri])
  558. AST_EXT_LIB_SETUP_OPTIONAL([PRI_HANGUP_FIX], [ISDN PRI hangup fix], [PRI], [pri])
  559. AST_EXT_LIB_SETUP_OPTIONAL([PRI_SUBADDR], [ISDN PRI subaddressing], [PRI], [pri])
  560. AST_EXT_LIB_SETUP_OPTIONAL([PRI_CALL_HOLD], [ISDN PRI call hold], [PRI], [pri])
  561. AST_EXT_LIB_SETUP_OPTIONAL([PRI_CALL_REROUTING], [ISDN PRI call rerouting and call deflection], [PRI], [pri])
  562. AST_EXT_LIB_SETUP_OPTIONAL([PRI_SETUP_KEYPAD], [ISDN PRI keypad facility in SETUP], [PRI], [pri])
  563. # ------------------------------------v
  564. # TODO: The code can be changed to always include these features now.
  565. # These features will always be present if pri_connected_line_update is available.
  566. AST_EXT_LIB_SETUP_OPTIONAL([PRI_INBANDDISCONNECT], [ISDN PRI set_inbanddisconnect], [PRI], [pri])
  567. AST_EXT_LIB_SETUP_OPTIONAL([PRI_PROG_W_CAUSE], [ISDN progress with cause], [PRI], [pri])
  568. AST_EXT_LIB_SETUP_OPTIONAL([PRI_SERVICE_MESSAGES], [ISDN service messages], [PRI], [pri])
  569. AST_EXT_LIB_SETUP_OPTIONAL([PRI_REVERSE_CHARGE], [ISDN reverse charge], [PRI], [pri])
  570. # ------------------------------------^
  571. AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
  572. AST_EXT_LIB_SETUP([FFTW3], [LIBFFTW3], [fftw3])
  573. AST_EXT_LIB_SETUP([RESAMPLE], [LIBRESAMPLE], [resample])
  574. AST_EXT_LIB_SETUP([SNDFILE], [libsndfile], [sndfile])
  575. AST_EXT_LIB_SETUP([SDL], [Sdl], [sdl])
  576. AST_EXT_LIB_SETUP([SDL_IMAGE], [Sdl Image], [SDL_image])
  577. AST_EXT_LIB_SETUP([SPANDSP], [SPANDSP], [spandsp])
  578. AST_EXT_LIB_SETUP([SS7], [ISDN SS7], [ss7])
  579. AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
  580. AST_EXT_LIB_SETUP([SPEEX_PREPROCESS], [Speex preprocess routines], [speex])
  581. AST_EXT_LIB_SETUP([SPEEXDSP], [SpeexDSP], [speexdsp])
  582. AST_EXT_LIB_SETUP_DEPENDENT([SPEEX_PREPROCESS], [speex_preprocess_ctl], [], [speex])
  583. AST_EXT_LIB_SETUP([SQLITE3], [SQLite], [sqlite3])
  584. AST_EXT_LIB_SETUP([SRTP], [Secure RTP], [srtp])
  585. AST_EXT_LIB_SETUP_OPTIONAL([SRTP_256], [SRTP Library AES-256 (ICM)], [SRTP], [srtp])
  586. AST_EXT_LIB_SETUP_OPTIONAL([SRTP_192], [SRTP Library AES-192 (ICM)], [SRTP], [srtp])
  587. AST_EXT_LIB_SETUP_OPTIONAL([SRTP_GCM], [SRTP Library AES-128 (GCM) and AES-256 (GCM)], [SRTP], [srtp])
  588. AST_EXT_LIB_SETUP_OPTIONAL([SRTP_SHUTDOWN], [SRTP Library Shutdown Function], [SRTP], [srtp])
  589. AST_EXT_LIB_SETUP_OPTIONAL([SRTP_GET_VERSION], [SRTP Library Version Function], [SRTP], [srtp])
  590. AST_EXT_LIB_SETUP_OPTIONAL([RT], [Realtime functions], [rt])
  591. AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds])
  592. AST_EXT_LIB_SETUP([TIMERFD], [timerfd], [timerfd])
  593. AST_EXT_LIB_SETUP([TONEZONE], [tonezone], [tonezone])
  594. AST_EXT_LIB_SETUP([UNBOUND], [unbound], [unbound])
  595. AST_EXT_LIB_SETUP([UNIXODBC], [unixODBC], [unixodbc])
  596. AST_EXT_LIB_SETUP([VORBIS], [Vorbis], [vorbis])
  597. AST_EXT_LIB_SETUP([X11], [X11], [x11])
  598. AST_EXT_LIB_SETUP([ZLIB], [zlib compression], [z])
  599. # check for basic system features and functionality before
  600. # checking for package libraries
  601. AC_FUNC_ALLOCA
  602. AC_HEADER_DIRENT
  603. if test -z $ac_header_dirent -o "$ac_header_dirent" = "no"; then
  604. AC_MSG_ERROR([*** Could not find dirent header that defines 'DIR'.])
  605. fi
  606. AC_HEADER_SYS_WAIT
  607. if test "$ac_cv_header_sys_wait_h" != "yes"; then
  608. AC_MSG_ERROR([*** POSIX.1 compatible sys/wait.h is required.])
  609. fi
  610. AC_HEADER_RESOLV
  611. if test "$ac_cv_header_resolv_h" != "yes"; then
  612. AC_MSG_ERROR([*** resolv.h is required.])
  613. fi
  614. # Check for headers that are unconditionally required on all platforms. Do not use
  615. # this to check for headers that are only needed by modules.
  616. AC_CHECK_HEADERS([ \
  617. arpa/nameser.h assert.h ctype.h dlfcn.h errno.h fcntl.h float.h grp.h \
  618. inttypes.h limits.h locale.h math.h pwd.h netinet/in.h regex.h \
  619. sched.h stdarg.h stdint.h stdio.h stdlib.h string.h syslog.h \
  620. sys/file.h sys/ioctl.h sys/param.h sys/resource.h sys/socket.h sys/stat.h \
  621. sys/time.h sys/types.h sys/un.h \
  622. termios.h time.h unistd.h \
  623. ], [], [
  624. AC_MSG_ERROR([*** A required header was not found.])
  625. ])
  626. AC_CHECK_HEADERS([arpa/inet.h libintl.h malloc.h netdb.h stddef.h strings.h sys/event.h utime.h])
  627. # Find required NetBSD Editline library (libedit).
  628. AST_PKG_CONFIG_CHECK(LIBEDIT, libedit)
  629. # some platforms do not list libedit via pkg-config, for example OpenBSD 6.2
  630. AST_EXT_LIB_CHECK([LIBEDIT], [edit], [history_init], [histedit.h], [-ltermcap])
  631. if test "${PBX_LIBEDIT}" != 1; then
  632. AC_MSG_ERROR(*** Please install the 'libedit' development package.)
  633. exit 1
  634. fi
  635. AST_C_COMPILE_CHECK([LIBEDIT_IS_UNICODE], [el_rfunc_t *callback;], [histedit.h], [], [Testing for libedit unicode support])
  636. # Find required UUID support.
  637. # * -luuid on Linux
  638. # * -le2fs-uuid on OpenBSD
  639. # * in libsystem on OS X
  640. AST_EXT_LIB_CHECK([LIBUUID], [uuid], [uuid_generate_random], [uuid/uuid.h])
  641. if test "x$LIBUUID_LIB" != "x" ; then
  642. UUID_INCLUDE="$LIBUUID_INCLUDE"
  643. UUID_LIB="$LIBUUID_LIB"
  644. else
  645. AST_EXT_LIB_CHECK([E2FSUUID], [e2fs-uuid], [uuid_generate_random], [uuid/uuid.h])
  646. if test "x$E2FSUUID_LIB" != "x" ; then
  647. UUID_INCLUDE="$E2FSUUID_INCLUDE"
  648. UUID_LIB="$E2FSUUID_LIB"
  649. else
  650. AC_CHECK_FUNCS([uuid_generate_random], [SYSUUID=true], [SYSUUID=""])
  651. if test "x$SYSUUID" != "x" ; then
  652. UUID_INCLUDE=""
  653. UUID_LIB=""
  654. else
  655. AC_MSG_ERROR([*** uuid support not found (this typically means the uuid development package is missing)])
  656. fi
  657. fi
  658. fi
  659. AC_SUBST(UUID_INCLUDE)
  660. AC_SUBST(UUID_LIB)
  661. # Find required JSON support if bundled is not enabled.
  662. if test "$JANSSON_BUNDLED" = "no" ; then
  663. AST_PKG_CONFIG_CHECK([JANSSON], [jansson >= 2.11])
  664. # json_sprintf is available in 2.11+
  665. AST_EXT_LIB_CHECK([JANSSON], [jansson], [json_sprintf], [jansson.h])
  666. if test "${PBX_JANSSON}" != 1; then
  667. AC_MSG_NOTICE(*** Asterisk requires libjansson >= 2.11 and no system copy was found.)
  668. AC_MSG_NOTICE(*** Please install the 'libjansson' development package or)
  669. AC_MSG_NOTICE(*** use './configure --with-jansson-bundled')
  670. exit 1
  671. fi
  672. JANSSON_DEFINE_JSON_INT()
  673. else
  674. PBX_JANSSON=1
  675. fi
  676. . ./third-party/versions.mak
  677. # Find required JWT support if bundled is not enabled.
  678. if test "$LIBJWT_BUNDLED" = "no" ; then
  679. AST_PKG_CONFIG_CHECK([LIBJWT], [libjwt >= $LIBJWT_VERSION])
  680. else
  681. PBX_LIBJWT=1
  682. fi
  683. # See if clock_gettime is in librt
  684. AST_EXT_LIB_CHECK([RT], [rt], [clock_gettime], [])
  685. AST_PKG_CONFIG_CHECK([LIBXML2], [libxml-2.0])
  686. AST_EXT_TOOL_CHECK([LIBXML2], [xml2-config], , ,
  687. [#include <libxml/tree.h>
  688. #include <libxml/parser.h>],
  689. [LIBXML_TEST_VERSION])
  690. if test "${PBX_LIBXML2}" != 1; then
  691. AC_MSG_NOTICE(*** The Asterisk menuselect tool requires the 'libxml2' development package.)
  692. AC_MSG_NOTICE(*** Please install the 'libxml2' development package.)
  693. exit 1
  694. fi
  695. AST_EXT_LIB_CHECK([URIPARSER], [uriparser], [uriParseUriA], [uriparser/Uri.h])
  696. # Another mandatory item (unless it's explicitly disabled)
  697. AC_ARG_ENABLE([xmldoc],
  698. [AS_HELP_STRING([--disable-xmldoc],
  699. [Explicitly disable XML documentation])],
  700. [case "${enableval}" in
  701. y|ye|yes) DISABLE_XMLDOC=no ;;
  702. n|no) DISABLE_XMLDOC=yes ;;
  703. *) AC_MSG_ERROR(bad value ${enableval} for --disable-xmldoc) ;;
  704. esac], [DISABLE_XMLDOC=no])
  705. AC_SUBST([DISABLE_XMLDOC])
  706. if test "${DISABLE_XMLDOC}" != "yes"; then
  707. AC_DEFINE([AST_XML_DOCS], 1, [Define to enable XML documentation.])
  708. fi
  709. AST_EXT_LIB_CHECK([LIBXSLT], [xslt], [xsltLoadStylesheetPI], [libxslt/xsltInternals.h], [${LIBXML2_LIB}], [${LIBXML2_INCLUDE}])
  710. AST_EXT_LIB_CHECK([LIBXSLT_CLEANUP], [xslt], [xsltCleanupGlobals], [libxslt/xsltInternals.h], [${LIBXML2_LIB}], [${LIBXML2_INCLUDE}])
  711. AC_ARG_ENABLE([permanent-dlopen],
  712. [AS_HELP_STRING([--enable-permanent-dlopen],
  713. [Enable when your libc has a permanent dlopen like musl])],
  714. [case "${enableval}" in
  715. y|ye|yes) PERMANENT_DLOPEN=yes ;;
  716. n|no) PERMANENT_DLOPEN=no ;;
  717. *) AC_MSG_ERROR(bad value ${enableval} for --enable-permanent-dlopen) ;;
  718. esac], [PERMANENT_DLOPEN=no])
  719. AC_SUBST([PERMANENT_DLOPEN])
  720. if test "${PERMANENT_DLOPEN}" = "yes"; then
  721. AC_DEFINE([HAVE_PERMANENT_DLOPEN], 1, [Define to support libc with permanent dlopen.])
  722. fi
  723. # some embedded systems omit internationalization (locale) support
  724. AC_CHECK_HEADERS([xlocale.h])
  725. AC_CHECK_HEADERS([winsock.h winsock2.h])
  726. AC_CHECK_HEADER([sys/poll.h],
  727. [],
  728. AC_DEFINE([AST_POLL_COMPAT], 1, [Define to 1 if internal poll should be used.]))
  729. AC_SYS_LARGEFILE
  730. # Checks for typedefs, structures, and compiler characteristics.
  731. AC_HEADER_STDBOOL
  732. AC_C_CONST
  733. AC_TYPE_UID_T
  734. AC_C_INLINE
  735. AC_TYPE_LONG_DOUBLE_WIDER
  736. AC_TYPE_MODE_T
  737. AC_TYPE_OFF_T
  738. AC_TYPE_PID_T
  739. AC_TYPE_SIZE_T
  740. AC_CHECK_MEMBERS([struct stat.st_blksize])
  741. AC_CHECK_MEMBERS([struct ucred.uid, struct ucred.cr_uid, struct sockpeercred.uid], [], [], [#include <sys/types.h>
  742. #include <sys/socket.h> ])
  743. AC_CHECK_MEMBERS([struct ifreq.ifr_ifru.ifru_hwaddr], [], [], [#include <net/if.h>])
  744. AC_STRUCT_TM
  745. AC_C_VOLATILE
  746. AC_CHECK_TYPES([ptrdiff_t])
  747. stat_nsec_found=no
  748. AC_CHECK_MEMBERS([struct stat.st_mtim, struct stat.st_mtimensec, struct stat.st_mtimespec], [stat_nsec_found=yes], [], [[#include <sys/stat.h>]])
  749. if test "${stat_nsec_found}" != yes; then
  750. AC_MSG_WARN(Cannot determine nanosecond field of struct stat)
  751. fi
  752. # Checks for library functions.
  753. AC_FUNC_CHOWN
  754. AC_FUNC_CLOSEDIR_VOID
  755. AC_FUNC_ERROR_AT_LINE
  756. AST_FUNC_FORK
  757. AC_FUNC_FSEEKO
  758. AC_PROG_GCC_TRADITIONAL
  759. # XXX: these are commented out until we determine whether it matters if our malloc()
  760. # acts exactly like glibc's or not
  761. # AC_FUNC_MALLOC
  762. # AC_FUNC_REALLOC
  763. AC_FUNC_MEMCMP
  764. AC_FUNC_MMAP
  765. AC_FUNC_SELECT_ARGTYPES
  766. AC_FUNC_STAT
  767. AC_FUNC_STRCOLL
  768. AC_FUNC_STRFTIME
  769. AC_FUNC_STRNLEN
  770. AC_FUNC_STRTOD
  771. AC_FUNC_UTIME_NULL
  772. AC_FUNC_VPRINTF
  773. 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 pipe2 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 uselocale utime vasprintf getpeereid sysctl swapctl malloc_trim])
  774. AC_MSG_CHECKING(for htonll)
  775. AC_LINK_IFELSE(
  776. [AC_LANG_PROGRAM([#include <arpa/inet.h>],
  777. [return htonll(0);])],
  778. AC_MSG_RESULT(yes)
  779. AC_DEFINE(HAVE_HTONLL, 1, [Define to 1 if arpa/inet.h includes a htonll definition.]),
  780. AC_MSG_RESULT(no)
  781. )
  782. AC_MSG_CHECKING(for ntohll)
  783. AC_LINK_IFELSE(
  784. [AC_LANG_PROGRAM([#include <arpa/inet.h>],
  785. [return ntohll(0);])],
  786. AC_MSG_RESULT(yes)
  787. AC_DEFINE(HAVE_NTOHLL, 1, [Define to 1 if arpa/inet.h includes a ntohll definition.]),
  788. AC_MSG_RESULT(no)
  789. )
  790. # NOTE: we use AC_CHECK_LIB to get -lm into the arguments for later checks,
  791. # so that AC_CHECK_FUNCS can detect functions in that library.
  792. AC_CHECK_LIB([m], [sqrt])
  793. # BSD might not have exp2, and/or log2
  794. 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])
  795. # Certain architectures don't really have long double, even though
  796. # AC_CHECK_FUNCS would otherwise find the following functions.
  797. if test "x${ac_cv_type_long_double_wider}" = "xyes" ; then
  798. 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])
  799. fi
  800. AC_MSG_CHECKING(for LLONG_MAX in limits.h)
  801. AC_LINK_IFELSE(
  802. [AC_LANG_PROGRAM([#include <limits.h>],
  803. [long long foo = LLONG_MAX])],
  804. AC_MSG_RESULT(yes)
  805. AC_DEFINE([HAVE_LLONG_MAX], 1, [Define to 1 if limits.h includes a LLONG_MAX definition.]),
  806. AC_MSG_RESULT(no)
  807. )
  808. AC_MSG_CHECKING(for timersub in time.h)
  809. AC_LINK_IFELSE(
  810. [AC_LANG_PROGRAM([#include <sys/time.h>],
  811. [struct timeval *a; timersub(a, a, a);])],
  812. AC_MSG_RESULT(yes)
  813. AC_DEFINE([HAVE_TIMERSUB], 1, [Define to 1 if your system defines timersub.]),
  814. AC_MSG_RESULT(no)
  815. )
  816. AC_MSG_CHECKING(for a version of GNU ld that supports the --dynamic-list flag)
  817. old_LDFLAGS=${LDFLAGS}
  818. cat >conftest.dynamics <<_ACEOF
  819. {
  820. *ast_*;
  821. };
  822. _ACEOF
  823. LDFLAGS="${LDFLAGS} -Wl,--dynamic-list,conftest.dynamics"
  824. PBX_DYNAMIC_LIST=0
  825. AC_LINK_IFELSE(
  826. [AC_LANG_PROGRAM([], [])],
  827. PBX_DYNAMIC_LIST=1
  828. AC_MSG_RESULT(yes),
  829. AC_MSG_RESULT(no)
  830. )
  831. AC_SUBST(PBX_DYNAMIC_LIST)
  832. LDFLAGS=${old_LDFLAGS}
  833. rm -f conftest.dynamics
  834. AC_CHECK_HEADER([sys/poll.h],
  835. [HAS_POLL=1]
  836. AC_DEFINE([HAVE_SYS_POLL_H], 1, [Define to 1 if your system has working sys/poll.h]),
  837. )
  838. AC_ARG_ENABLE([internal-poll],
  839. [AS_HELP_STRING([--enable-internal-poll],
  840. [Use Asterisk's poll implementation])],
  841. [case "${enableval}" in
  842. y|ye|yes) HAS_POLL="";;
  843. n|no) HAS_POLL="${HAS_POLL}" ;;
  844. *) AC_MSG_ERROR(bad value ${enableval} for --enable-internal-poll) ;;
  845. esac])
  846. AC_SUBST(HAS_POLL)
  847. AC_ARG_ENABLE([asteriskssl],
  848. [AS_HELP_STRING([--disable-asteriskssl],
  849. [Disable Asterisk's SSL wrapper library])],
  850. [case "${enableval}" in
  851. y|ye|yes) AST_ASTERISKSSL=yes ;;
  852. n|no) AST_ASTERISKSSL=no ;;
  853. *) AC_MSG_ERROR(bad value ${enableval} for --disable-asteriskssl) ;;
  854. esac], [AST_ASTERISKSSL=yes])
  855. AC_SUBST(AST_ASTERISKSSL)
  856. AC_CHECK_FUNCS([inet_aton])
  857. # check if we have IP_PKTINFO constant defined
  858. AC_MSG_CHECKING(for IP_PKTINFO)
  859. AC_LINK_IFELSE(
  860. [AC_LANG_PROGRAM([#include <netinet/in.h>],
  861. [int pi = IP_PKTINFO;])],
  862. AC_MSG_RESULT(yes)
  863. AC_DEFINE([HAVE_PKTINFO], 1, [Define to 1 if your system defines IP_PKTINFO.]),
  864. AC_MSG_RESULT(no)
  865. )
  866. # NetBSD libc ships with an internal-only incompatible symbol gethostbyname_r
  867. AC_CHECK_DECLS([gethostbyname_r],
  868. [have_gethostbyname_r_public_declaration=yes],
  869. [have_gethostbyname_r_public_declaration=no],
  870. [#include <stdlib.h>
  871. #include <netdb.h>]
  872. )
  873. if test "x$have_gethostbyname_r_public_declaration" = "xyes"; then
  874. # some systems already have gethostbyname_r so we don't need to build ours in main/utils.c
  875. AC_SEARCH_LIBS(gethostbyname_r, [socket nsl])
  876. AC_MSG_CHECKING(for gethostbyname_r with 6 arguments)
  877. AC_LINK_IFELSE(
  878. [AC_LANG_PROGRAM([#include <stdlib.h>
  879. #include <netdb.h>],
  880. [int r = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (struct hostent **)NULL, (int *)NULL);])],
  881. AC_MSG_RESULT(yes)
  882. AC_DEFINE([HAVE_GETHOSTBYNAME_R_6], 1, [Define to 1 if your system has gethostbyname_r with 6 arguments.]),
  883. AC_MSG_RESULT(no)
  884. )
  885. AC_MSG_CHECKING(for gethostbyname_r with 5 arguments)
  886. AC_LINK_IFELSE(
  887. [AC_LANG_PROGRAM([#include <stdlib.h>
  888. #include <netdb.h>],
  889. [int r = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (int *)NULL);])],
  890. AC_MSG_RESULT(yes)
  891. AC_DEFINE([HAVE_GETHOSTBYNAME_R_5], 1, [Define to 1 if your system has gethostbyname_r with 5 arguments.]),
  892. AC_MSG_RESULT(no)
  893. )
  894. fi
  895. AC_CHECK_HEADER([byteswap.h], [AC_DEFINE_UNQUOTED([HAVE_BYTESWAP_H], 1, [Define to 1 if byteswap.h macros are available.])])
  896. AC_MSG_CHECKING(for __swap16 variant of <sys/endian.h> byteswapping macros)
  897. AC_LINK_IFELSE(
  898. [AC_LANG_PROGRAM([#include <sys/endian.h>], [int a = 1; int b = __swap16(a);])],
  899. AC_MSG_RESULT(yes)
  900. AC_DEFINE([HAVE_SYS_ENDIAN_SWAP16], 1, [Define to 1 if your sys/endian.h header file provides the __swap16 macro.]),
  901. AC_MSG_RESULT(no)
  902. )
  903. AC_MSG_CHECKING(for bswap16 variant of <sys/endian.h> byteswapping macros)
  904. AC_LINK_IFELSE(
  905. [AC_LANG_PROGRAM([#include <sys/endian.h>], [int a = 1; int b = bswap16(a);])],
  906. AC_MSG_RESULT(yes)
  907. AC_DEFINE([HAVE_SYS_ENDIAN_BSWAP16], 1, [Define to 1 if your sys/endian.h header file provides the bswap16 macro.]),
  908. AC_MSG_RESULT(no)
  909. )
  910. AC_MSG_CHECKING(for locale_t in locale.h)
  911. AC_LINK_IFELSE(
  912. [AC_LANG_PROGRAM([#include <locale.h>], [locale_t lt = NULL])],
  913. AC_MSG_RESULT(yes)
  914. AC_DEFINE([HAVE_LOCALE_T_IN_LOCALE_H], 1, [Define to 1 if your system defines the locale_t type in locale.h]),
  915. AC_MSG_RESULT(no)
  916. AC_MSG_CHECKING(for locale_t in xlocale.h)
  917. AC_LINK_IFELSE(
  918. [AC_LANG_PROGRAM([#include <xlocale.h>], [locale_t lt = NULL])],
  919. AC_MSG_RESULT(yes)
  920. AC_DEFINE([HAVE_LOCALE_T_IN_XLOCALE_H], 1, [Define to 1 if your system defines the locale_t type in xlocale.h]),
  921. AC_MSG_RESULT(no)
  922. )
  923. )
  924. AC_MSG_CHECKING(for O_EVTONLY in fcntl.h)
  925. AC_LINK_IFELSE(
  926. [AC_LANG_PROGRAM([#include <fcntl.h>], [int a = O_EVTONLY;])],
  927. AC_MSG_RESULT(yes)
  928. AC_DEFINE([HAVE_O_EVTONLY], 1, [Define to 1 if your system defines the file flag O_EVTONLY in fcntl.h]),
  929. AC_MSG_RESULT(no)
  930. )
  931. AC_MSG_CHECKING(for O_SYMLINK in fcntl.h)
  932. AC_LINK_IFELSE(
  933. [AC_LANG_PROGRAM([#include <fcntl.h>], [int a = O_SYMLINK;])],
  934. AC_MSG_RESULT(yes)
  935. AC_DEFINE([HAVE_O_SYMLINK], 1, [Define to 1 if your system defines the file flag O_SYMLINK in fcntl.h]),
  936. AC_MSG_RESULT(no)
  937. )
  938. AST_C_DEFINE_CHECK([PTHREAD_RWLOCK_INITIALIZER], [PTHREAD_RWLOCK_INITIALIZER], [pthread.h])
  939. AC_MSG_CHECKING(for PTHREAD_RWLOCK_PREFER_WRITER_NP in pthread.h)
  940. AC_LINK_IFELSE(
  941. [AC_LANG_PROGRAM([#include <pthread.h>], [int a = PTHREAD_RWLOCK_PREFER_WRITER_NP;])],
  942. AC_MSG_RESULT(yes)
  943. AC_DEFINE([HAVE_PTHREAD_RWLOCK_PREFER_WRITER_NP], 1, [Define to 1 if your system defines PTHREAD_RWLOCK_PREFER_WRITER_NP in pthread.h]),
  944. AC_MSG_RESULT(no)
  945. )
  946. AC_MSG_CHECKING(for PTHREAD_MUTEX_RECURSIVE_NP in pthread.h)
  947. AC_LINK_IFELSE(
  948. [AC_LANG_PROGRAM([#include <pthread.h>], [int a = PTHREAD_MUTEX_RECURSIVE_NP;])],
  949. AC_MSG_RESULT(yes)
  950. AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE_NP], 1, [Define to 1 if your system defines PTHREAD_MUTEX_RECURSIVE_NP in pthread.h]),
  951. AC_MSG_RESULT(no)
  952. )
  953. AC_MSG_CHECKING(for PTHREAD_MUTEX_ADAPTIVE_NP in pthread.h)
  954. AC_LINK_IFELSE(
  955. [AC_LANG_PROGRAM([#include <pthread.h>], [int a = PTHREAD_MUTEX_ADAPTIVE_NP;])],
  956. AC_MSG_RESULT(yes)
  957. AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1, [Define to 1 if your system defines PTHREAD_MUTEX_ADAPTIVE_NP in pthread.h]),
  958. AC_MSG_RESULT(no)
  959. )
  960. AC_MSG_CHECKING(for pthread_spinlock_t in pthread.h)
  961. AC_LINK_IFELSE(
  962. [AC_LANG_PROGRAM([#include <pthread.h>], [pthread_spinlock_t spin;])],
  963. AC_MSG_RESULT(yes)
  964. AC_DEFINE([HAVE_PTHREAD_SPINLOCK], 1, [Define to 1 if your system has pthread_spinlock_t in pthread.h]),
  965. AC_MSG_RESULT(no)
  966. )
  967. save_LIBS="$LIBS"
  968. save_CFLAGS="$CFLAGS"
  969. LIBS="$PTHREAD_LIBS $LIBS"
  970. CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
  971. AC_MSG_CHECKING(for pthread_rwlock_timedwrlock() in pthread.h)
  972. AC_LINK_IFELSE(
  973. [AC_LANG_PROGRAM(
  974. [#include <pthread.h>
  975. #include <time.h>],
  976. [pthread_rwlock_t foo; struct timespec bar; pthread_rwlock_timedwrlock(&foo, &bar)])
  977. ],[
  978. AC_MSG_RESULT(yes)
  979. ac_cv_pthread_rwlock_timedwrlock="yes"
  980. ],[
  981. AC_MSG_RESULT(no)
  982. ac_cv_pthread_rwlock_timedwrlock="no"
  983. ]
  984. )
  985. # Some platforms define sem_init(), but only support sem_open(). joyous.
  986. AC_MSG_CHECKING(for working unnamed semaphores)
  987. AC_RUN_IFELSE(
  988. [AC_LANG_PROGRAM([#include <semaphore.h>],
  989. [sem_t sem; return sem_init(&sem, 0, 0);])],
  990. AC_MSG_RESULT(yes)
  991. AC_DEFINE([HAS_WORKING_SEMAPHORE], 1, [Define to 1 if anonymous semaphores work.]),
  992. AC_MSG_RESULT(no),
  993. AC_MSG_RESULT(cross-compile)
  994. AC_MSG_NOTICE([WARNING: result yes guessed because of cross compilation])
  995. AC_DEFINE([HAS_WORKING_SEMAPHORE], 1, [Define to 1 if anonymous semaphores work.])
  996. )
  997. LIBS="$save_LIBS"
  998. CFLAGS="$save_CFLAGS"
  999. if test "${ac_cv_pthread_rwlock_timedwrlock}" = "yes"; then
  1000. AC_DEFINE([HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK], 1, [Define if your system has pthread_rwlock_timedwrlock()])
  1001. fi
  1002. AC_MSG_CHECKING(if PTHREAD_ONCE_INIT needs braces)
  1003. saved_CFLAGS="${CFLAGS}"
  1004. CFLAGS="${CFLAGS} -Werror -Wmissing-braces"
  1005. AC_COMPILE_IFELSE(
  1006. [AC_LANG_PROGRAM(
  1007. [#include <pthread.h>
  1008. void empty(){}],
  1009. [pthread_once_t once = PTHREAD_ONCE_INIT; pthread_once(&once, empty);])
  1010. ],[
  1011. AC_MSG_RESULT(no)
  1012. ac_cv_pthread_once_needsbraces="no"
  1013. ],[
  1014. AC_MSG_RESULT(yes)
  1015. ac_cv_pthread_once_needsbraces="yes"
  1016. ]
  1017. )
  1018. CFLAGS="${saved_CFLAGS}"
  1019. if test "${ac_cv_pthread_once_needsbraces}" = "yes"; then
  1020. AC_DEFINE([PTHREAD_ONCE_INIT_NEEDS_BRACES], 1, [Define if your system needs braces around PTHREAD_ONCE_INIT])
  1021. fi
  1022. AST_C_DEFINE_CHECK([PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], [PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], [pthread.h])
  1023. # Can we compare a mutex to its initial value?
  1024. # Generally yes on OpenBSD/FreeBSD and no on Mac OS X.
  1025. AC_MSG_CHECKING(whether we can compare a mutex to its initial value)
  1026. AC_LINK_IFELSE(
  1027. [AC_LANG_PROGRAM([#include <pthread.h>], [pthread_mutex_t lock;
  1028. if ((lock) != ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
  1029. return 0;
  1030. }
  1031. return 0])],
  1032. AC_MSG_RESULT(yes)
  1033. 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.]),
  1034. AC_MSG_RESULT(no)
  1035. )
  1036. #if test "${cross_compiling}" = "no";
  1037. #then
  1038. #AC_MSG_CHECKING(for working epoll support)
  1039. #AC_LINK_IFELSE(
  1040. #AC_LANG_PROGRAM([#include <sys/epoll.h>], [int res = epoll_create(10);
  1041. # if (res < 0)
  1042. # return 1;
  1043. # close (res);
  1044. # return 0;]),
  1045. #AC_MSG_RESULT(yes)
  1046. #AC_DEFINE([HAVE_EPOLL], 1, [Define to 1 if your system has working epoll support.]),
  1047. #AC_MSG_RESULT(no)
  1048. #)
  1049. #fi
  1050. AC_MSG_CHECKING(for compiler sync operations)
  1051. AC_LINK_IFELSE(
  1052. [AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])],
  1053. AC_MSG_RESULT(yes)
  1054. ax_cv_have_gcc_atomics=1
  1055. AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides __sync atomic operations.]),
  1056. AC_MSG_RESULT(no)
  1057. )
  1058. AC_MSG_CHECKING(for compiler atomic operations)
  1059. AC_LINK_IFELSE(
  1060. [AC_LANG_PROGRAM([], [int foo1; int foo2 = __atomic_fetch_add(&foo1, 1, __ATOMIC_RELAXED);])],
  1061. AC_MSG_RESULT(yes)
  1062. ax_cv_have_c_atomics=1
  1063. AC_DEFINE([HAVE_C_ATOMICS], 1, [Define to 1 if your C compiler provides __atomic operations.]),
  1064. AC_MSG_RESULT(no)
  1065. )
  1066. if test -z $ax_cv_have_c_atomics$ax_cv_have_gcc_atomics; then
  1067. AC_MSG_ERROR([*** Atomic operations are not supported by your compiler.])
  1068. fi
  1069. # glibc, AFAIK, is the only C library that makes printing a NULL to a string safe.
  1070. AC_MSG_CHECKING([if your system printf is NULL-safe.])
  1071. AC_RUN_IFELSE(
  1072. [AC_LANG_PROGRAM([#include <stdio.h>],
  1073. [printf("%s", NULL)])],
  1074. AC_DEFINE([HAVE_NULLSAFE_PRINTF], 1, [Define to 1 if your C library can safely print NULL to string formats.])
  1075. AC_MSG_RESULT(yes),
  1076. AC_MSG_RESULT(no),
  1077. # It's unlikely an embedded system will have this.
  1078. AC_MSG_RESULT(unknown)
  1079. )
  1080. AC_MSG_CHECKING([if socket() accepts SOCK_NONBLOCK])
  1081. AC_RUN_IFELSE(
  1082. [AC_LANG_PROGRAM([
  1083. #ifdef HAVE_SYS_TYPES_H
  1084. # include <sys/types.h>
  1085. #endif
  1086. #ifdef HAVE_SYS_SOCKET_H
  1087. # include <sys/socket.h>
  1088. #endif
  1089. ], [
  1090. if (socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0) < 0) {
  1091. return 1;
  1092. }
  1093. return 0;
  1094. ])],
  1095. AC_MSG_RESULT(yes)
  1096. AC_DEFINE([HAVE_SOCK_NONBLOCK], 1, [Define to 1 if your socket() implementation can accept SOCK_NONBLOCK.]),
  1097. AC_MSG_RESULT(no),
  1098. AC_MSG_RESULT(cross-compile)
  1099. )
  1100. AC_MSG_CHECKING(if we can increase the maximum select-able file descriptor)
  1101. AC_RUN_IFELSE(
  1102. [AC_LANG_PROGRAM([
  1103. #include <stdio.h>
  1104. #include <sys/select.h>
  1105. #include <sys/time.h>
  1106. #include <sys/resource.h>
  1107. #include <string.h>
  1108. #include <errno.h>
  1109. #include <stdlib.h>
  1110. #include <sys/types.h>
  1111. #include <sys/stat.h>
  1112. #include <fcntl.h>
  1113. #include <unistd.h>
  1114. ], [[
  1115. struct rlimit rlim = { FD_SETSIZE * 2, FD_SETSIZE * 2 };
  1116. int fd0, fd1;
  1117. struct timeval tv = { 0, };
  1118. struct ast_fdset { long fds_bits[[1024]]; } fds = { { 0, } };
  1119. if (setrlimit(RLIMIT_NOFILE, &rlim)) { exit(1); }
  1120. if ((fd0 = open("/dev/null", O_RDONLY)) < 0) { exit(1); }
  1121. if (dup2(fd0, (fd1 = FD_SETSIZE + 1)) < 0) { exit(1); }
  1122. FD_SET(fd0, (fd_set *) &fds);
  1123. FD_SET(fd1, (fd_set *) &fds);
  1124. if (select(FD_SETSIZE + 2, (fd_set *) &fds, NULL, NULL, &tv) < 0) { exit(1); }
  1125. exit(0)]])],
  1126. AC_MSG_RESULT(yes)
  1127. AC_DEFINE([HAVE_VARIABLE_FDSET], 1, [Define to 1 if your system can support larger than default select bitmasks.]),
  1128. AC_MSG_RESULT(no),
  1129. AC_MSG_RESULT(cross-compile)
  1130. )
  1131. if test "${ac_cv_have_variable_fdset}x" = "0x"; then
  1132. AC_RUN_IFELSE(
  1133. [AC_LANG_PROGRAM([
  1134. #include <unistd.h>
  1135. #include <sys/types.h>
  1136. #include <stdlib.h>
  1137. ], [if (getuid() != 0) { exit(1); }])],
  1138. 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.]))
  1139. fi
  1140. AC_MSG_CHECKING([if we have usable eventfd support])
  1141. AC_RUN_IFELSE(
  1142. [AC_LANG_PROGRAM([#include <sys/eventfd.h>],
  1143. [return eventfd(0, EFD_NONBLOCK | EFD_SEMAPHORE) == -1;])],
  1144. AC_MSG_RESULT(yes)
  1145. AC_DEFINE([HAVE_EVENTFD], 1, [Define to 1 if your system supports eventfd and the EFD_NONBLOCK and EFD_SEMAPHORE flags.]),
  1146. AC_MSG_RESULT(no),
  1147. AC_MSG_RESULT(cross-compile)
  1148. )
  1149. AST_GCC_ATTRIBUTE(pure)
  1150. AST_GCC_ATTRIBUTE(malloc)
  1151. AST_GCC_ATTRIBUTE(const)
  1152. AST_GCC_ATTRIBUTE(unused)
  1153. AST_GCC_ATTRIBUTE(always_inline)
  1154. AST_GCC_ATTRIBUTE(deprecated)
  1155. AST_GCC_ATTRIBUTE(sentinel)
  1156. AST_GCC_ATTRIBUTE(warn_unused_result)
  1157. AST_GCC_ATTRIBUTE(may_alias)
  1158. AST_GCC_ATTRIBUTE(constructor)
  1159. if test "$ax_cv_have_func_attribute_constructor" != "1"; then
  1160. AC_MSG_ERROR([*** Function constructor attribute is not supported by your compiler.])
  1161. fi
  1162. AST_GCC_ATTRIBUTE(destructor)
  1163. if test "$ax_cv_have_func_attribute_destructor" != "1"; then
  1164. AC_MSG_ERROR([*** Function destructor attribute is not supported by your compiler.])
  1165. fi
  1166. AST_GCC_ATTRIBUTE(noreturn,noreturn)
  1167. AC_MSG_CHECKING(for -fsanitize=address support)
  1168. saved_sanitize_CFLAGS="${CFLAGS}"
  1169. saved_sanitize_LDFLAGS="${LDFLAGS}"
  1170. CFLAGS="-fsanitize=address -fno-omit-frame-pointer"
  1171. LDFLAGS="-fsanitize=address"
  1172. AC_COMPILE_IFELSE(
  1173. [AC_LANG_PROGRAM([], [int x = 1;])],
  1174. AC_MSG_RESULT(yes)
  1175. [AST_ADDRESS_SANITIZER=1],
  1176. [AST_ADDRESS_SANITIZER=0]
  1177. AC_MSG_RESULT(no)
  1178. )
  1179. CFLAGS="${saved_sanitize_CFLAGS}"
  1180. LDFLAGS="${saved_sanitize_LDFLAGS}"
  1181. AC_SUBST(AST_ADDRESS_SANITIZER)
  1182. AC_MSG_CHECKING(for -fsanitize=thread support)
  1183. saved_sanitize_CFLAGS="${CFLAGS}"
  1184. saved_sanitize_LDFLAGS="${LDFLAGS}"
  1185. CFLAGS="-fno-omit-frame-pointer -pie -fPIE -fsanitize=thread"
  1186. LDFLAGS="-fsanitize=thread -pie -fPIE"
  1187. AC_COMPILE_IFELSE(
  1188. [AC_LANG_PROGRAM([], [int x = 1;])],
  1189. AC_MSG_RESULT(yes)
  1190. [AST_THREAD_SANITIZER=1],
  1191. [AST_THREAD_SANITIZER=0]
  1192. AC_MSG_RESULT(no)
  1193. )
  1194. CFLAGS="${saved_sanitize_CFLAGS}"
  1195. LDFLAGS="${saved_sanitize_LDFLAGS}"
  1196. AC_SUBST(AST_THREAD_SANITIZER)
  1197. AC_MSG_CHECKING(for -fsanitize=leak support)
  1198. saved_sanitize_CFLAGS="${CFLAGS}"
  1199. saved_sanitize_LDFLAGS="${LDFLAGS}"
  1200. CFLAGS="-fno-omit-frame-pointer -fsanitize=leak"
  1201. LDFLAGS="-fsanitize=leak"
  1202. AC_COMPILE_IFELSE(
  1203. [AC_LANG_PROGRAM([], [int x = 1;])],
  1204. AC_MSG_RESULT(yes)
  1205. [AST_LEAK_SANITIZER=1],
  1206. [AST_LEAK_SANITIZER=0]
  1207. AC_MSG_RESULT(no)
  1208. )
  1209. CFLAGS="${saved_sanitize_CFLAGS}"
  1210. LDFLAGS="${saved_sanitize_LDFLAGS}"
  1211. AC_SUBST(AST_LEAK_SANITIZER)
  1212. AC_MSG_CHECKING(for -fsanitize=undefined support)
  1213. saved_sanitize_CFLAGS="${CFLAGS}"
  1214. saved_sanitize_LDFLAGS="${LDFLAGS}"
  1215. CFLAGS="-fno-omit-frame-pointer -fsanitize=undefined"
  1216. LDFLAGS="-fsanitize=undefined"
  1217. AC_COMPILE_IFELSE(
  1218. [AC_LANG_PROGRAM([], [int x = 1;])],
  1219. AC_MSG_RESULT(yes)
  1220. [AST_UNDEFINED_SANITIZER=1],
  1221. [AST_UNDEFINED_SANITIZER=0]
  1222. AC_MSG_RESULT(no)
  1223. )
  1224. CFLAGS="${saved_sanitize_CFLAGS}"
  1225. LDFLAGS="${saved_sanitize_LDFLAGS}"
  1226. AC_SUBST(AST_UNDEFINED_SANITIZER)
  1227. AC_MSG_CHECKING(for -Wdeclaration-after-statement support)
  1228. if $(${CC} -Wdeclaration-after-statement -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
  1229. AC_MSG_RESULT(yes)
  1230. AST_DECLARATION_AFTER_STATEMENT=-Wdeclaration-after-statement
  1231. else
  1232. AC_MSG_RESULT(no)
  1233. AST_DECLARATION_AFTER_STATEMENT=
  1234. fi
  1235. AC_SUBST(AST_DECLARATION_AFTER_STATEMENT)
  1236. AC_MSG_CHECKING(for -Wtrampolines support)
  1237. if $(${CC} -Wtrampolines -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
  1238. AC_MSG_RESULT(yes)
  1239. AST_TRAMPOLINES=-Wtrampolines
  1240. else
  1241. AC_MSG_RESULT(no)
  1242. AST_TRAMPOLINES=
  1243. fi
  1244. AC_SUBST(AST_TRAMPOLINES)
  1245. AC_MSG_CHECKING(for _FORTIFY_SOURCE support)
  1246. if $(${CC} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
  1247. AC_MSG_RESULT(yes)
  1248. AST_FORTIFY_SOURCE="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
  1249. else
  1250. AC_MSG_RESULT(no)
  1251. AST_FORTIFY_SOURCE=
  1252. fi
  1253. AC_SUBST(AST_FORTIFY_SOURCE)
  1254. AC_MSG_CHECKING(for -fno-strict-overflow)
  1255. if $(${CC} -O2 -fno-strict-overflow -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
  1256. AC_MSG_RESULT(yes)
  1257. AST_NO_STRICT_OVERFLOW=-fno-strict-overflow
  1258. else
  1259. AC_MSG_RESULT(no)
  1260. AST_NO_STRICT_OVERFLOW=
  1261. fi
  1262. AC_SUBST(AST_NO_STRICT_OVERFLOW)
  1263. AC_MSG_CHECKING(for -Wno-format-truncation)
  1264. if $(${CC} -Wno-format-truncation -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
  1265. AC_MSG_RESULT(yes)
  1266. AST_NO_FORMAT_TRUNCATION=-Wno-format-truncation
  1267. else
  1268. AC_MSG_RESULT(no)
  1269. AST_NO_FORMAT_TRUNCATION=
  1270. fi
  1271. AC_SUBST(AST_NO_FORMAT_TRUNCATION)
  1272. AC_MSG_CHECKING(for -Wno-format-y2k)
  1273. if $(${CC} -Wno-format-y2k -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
  1274. AC_MSG_RESULT(yes)
  1275. AST_NO_FORMAT_Y2K=-Wno-format-y2k
  1276. else
  1277. AC_MSG_RESULT(no)
  1278. AST_NO_FORMAT_Y2K=
  1279. fi
  1280. AC_SUBST(AST_NO_FORMAT_Y2K)
  1281. AC_MSG_CHECKING(for -Wno-stringop-truncation)
  1282. if $(${CC} -Wno-stringop-truncation -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
  1283. AC_MSG_RESULT(yes)
  1284. AST_NO_STRINGOP_TRUNCATION=-Wno-stringop-truncation
  1285. else
  1286. AC_MSG_RESULT(no)
  1287. AST_NO_STRINGOP_TRUNCATION=
  1288. fi
  1289. AC_SUBST(AST_NO_STRINGOP_TRUNCATION)
  1290. AC_MSG_CHECKING(for -Wshadow)
  1291. if $(${CC} -Wshadow -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
  1292. AC_MSG_RESULT(yes)
  1293. AST_SHADOW_WARNINGS=-Wshadow
  1294. else
  1295. AC_MSG_RESULT(no)
  1296. AST_SHADOW_WARNINGS=
  1297. fi
  1298. AC_SUBST(AST_SHADOW_WARNINGS)
  1299. AC_MSG_CHECKING(for -march=native support)
  1300. if $(${CC} -march=native -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
  1301. AC_MSG_RESULT(yes)
  1302. AST_NATIVE_ARCH=1
  1303. else
  1304. AC_MSG_RESULT(no)
  1305. AST_NATIVE_ARCH=0
  1306. fi
  1307. AC_SUBST(AST_NATIVE_ARCH)
  1308. dnl Check to see if rpath should be set in LDFLAGS
  1309. AC_ARG_ENABLE(rpath,
  1310. [AS_HELP_STRING([--disable-rpath],
  1311. [Disables rpath linker option checking])],
  1312. [case "${enableval}" in
  1313. y|ye|yes) check_rpath=yes ;;
  1314. n|no) check_rpath=no ;;
  1315. *) AC_MSG_ERROR(bad value ${enableval} for --disable-rpath) ;;
  1316. esac], [check_rpath=yes])
  1317. AC_MSG_CHECKING(whether to use rpath)
  1318. AST_RPATH=
  1319. if test "${OSARCH}" = "NetBSD"; then
  1320. AST_RPATH="-Wl,-rpath,/usr/pkg/lib"
  1321. fi
  1322. if test "${check_rpath}" != yes; then
  1323. AC_MSG_RESULT(skipped)
  1324. elif test "${prefix}" = /usr || test "${prefix}" = NONE; then
  1325. AC_MSG_RESULT(not needed)
  1326. else
  1327. AST_RPATH="-Wl,-rpath,${libdir}"
  1328. fi
  1329. AC_SUBST(AST_RPATH)
  1330. AC_MSG_CHECKING(for sysinfo)
  1331. AC_LINK_IFELSE(
  1332. [AC_LANG_PROGRAM([#include <sys/sysinfo.h>],
  1333. [struct sysinfo sys_info; int uptime = sys_info.uptime])],
  1334. AC_MSG_RESULT(yes)
  1335. AC_DEFINE([HAVE_SYSINFO], 1, [Define to 1 if your system has sysinfo support]),
  1336. AC_MSG_RESULT(no)
  1337. )
  1338. AC_SEARCH_LIBS(res_9_ninit, resolv)
  1339. AC_MSG_CHECKING(for res_ninit)
  1340. AC_LINK_IFELSE(
  1341. [AC_LANG_PROGRAM([
  1342. #ifdef HAVE_SYS_SOCKET_H
  1343. #include <sys/socket.h>
  1344. #endif
  1345. #ifdef HAVE_NETINET_IN_H
  1346. #include <netinet/in.h>
  1347. #endif
  1348. #ifdef HAVE_ARPA_NAMESER_H
  1349. #include <arpa/nameser.h>
  1350. #endif
  1351. #include <resolv.h>],
  1352. [
  1353. int foo;
  1354. foo = res_ninit(NULL);
  1355. foo = res_nsearch(NULL, NULL, 0, 0, NULL, 0);
  1356. ])],
  1357. AC_MSG_RESULT(yes)
  1358. AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.])
  1359. AC_SEARCH_LIBS(res_9_ndestroy, resolv)
  1360. AC_MSG_CHECKING(for res_ndestroy)
  1361. AC_LINK_IFELSE(
  1362. [AC_LANG_PROGRAM([
  1363. #ifdef HAVE_SYS_SOCKET_H
  1364. #include <sys/socket.h>
  1365. #endif
  1366. #ifdef HAVE_NETINET_IN_H
  1367. #include <netinet/in.h>
  1368. #endif
  1369. #ifdef HAVE_ARPA_NAMESER_H
  1370. #include <arpa/nameser.h>
  1371. #endif
  1372. #include <resolv.h>],
  1373. [res_ndestroy(NULL);])],
  1374. AC_MSG_RESULT(yes)
  1375. AC_DEFINE([HAVE_RES_NDESTROY], 1, [Define to 1 if your system has the ndestroy resolver function.]),
  1376. AC_MSG_RESULT(no)
  1377. )
  1378. AC_SEARCH_LIBS(res_9_close, resolv)
  1379. AC_MSG_CHECKING(for res_close)
  1380. AC_LINK_IFELSE(
  1381. [AC_LANG_PROGRAM([
  1382. #ifdef HAVE_SYS_SOCKET_H
  1383. #include <sys/socket.h>
  1384. #endif
  1385. #ifdef HAVE_NETINET_IN_H
  1386. #include <netinet/in.h>
  1387. #endif
  1388. #ifdef HAVE_ARPA_NAMESER_H
  1389. #include <arpa/nameser.h>
  1390. #endif
  1391. #include <resolv.h>],
  1392. [res_close();])],
  1393. AC_MSG_RESULT(yes)
  1394. AC_DEFINE([HAVE_RES_CLOSE], 1, [Define to 1 if your system has the close resolver function.]),
  1395. AC_MSG_RESULT(no)
  1396. )
  1397. AC_CHECK_MEMBERS([struct __res_state._u._ext.nsaddrs], [], [], [[#include <resolv.h>]]),
  1398. AC_MSG_RESULT(no)
  1399. )
  1400. AC_MSG_CHECKING(for BIND_8_COMPAT required)
  1401. AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
  1402. [[
  1403. #undef BIND_8_COMPAT
  1404. #include <arpa/nameser.h>
  1405. ]],
  1406. [[int x = NXDOMAIN]])],
  1407. AC_MSG_RESULT(no),
  1408. AC_MSG_RESULT(yes)
  1409. [BIND8_CFLAGS=-DBIND_8_COMPAT])
  1410. AC_SUBST(BIND8_CFLAGS)
  1411. AST_C_DEFINE_CHECK([GLOB_NOMAGIC], [GLOB_NOMAGIC], [glob.h])
  1412. AST_C_DEFINE_CHECK([GLOB_BRACE], [GLOB_BRACE], [glob.h])
  1413. AST_C_DEFINE_CHECK([RTLD_NOLOAD], [RTLD_NOLOAD], [dlfcn.h])
  1414. AST_C_DEFINE_CHECK([IP_MTU_DISCOVER], [IP_MTU_DISCOVER], [netinet/in.h])
  1415. AC_CHECK_SIZEOF([int])
  1416. AC_CHECK_SIZEOF([long])
  1417. AC_CHECK_SIZEOF([long long])
  1418. AC_CHECK_SIZEOF([char *])
  1419. AC_CHECK_SIZEOF(long)
  1420. AC_CHECK_SIZEOF(long long)
  1421. AC_COMPUTE_INT([ac_cv_sizeof_fd_set_fds_bits], [sizeof(foo.fds_bits[[0]])], [$ac_includes_default
  1422. fd_set foo;])
  1423. # This doesn't actually work; what it does is to use the variable set in the
  1424. # previous test as a cached value to set the right output variables.
  1425. AC_CHECK_SIZEOF(fd_set.fds_bits)
  1426. # Set a type compatible with the previous. We cannot just use a generic type
  1427. # for these bits, because on big-endian systems, the bits won't match up
  1428. # correctly if the size is wrong.
  1429. if test $ac_cv_sizeof_int = $ac_cv_sizeof_fd_set_fds_bits; then
  1430. AC_DEFINE([TYPEOF_FD_SET_FDS_BITS], [int], [Define to a type of the same size as fd_set.fds_bits[[0]]])
  1431. elif test $ac_cv_sizeof_long = $ac_cv_sizeof_fd_set_fds_bits; then
  1432. AC_DEFINE([TYPEOF_FD_SET_FDS_BITS], [long], [Define to a type of the same size as fd_set.fds_bits[[0]]])
  1433. elif test $ac_cv_sizeof_long_long = $ac_cv_sizeof_fd_set_fds_bits; then
  1434. AC_DEFINE([TYPEOF_FD_SET_FDS_BITS], [long long], [Define to a type of the same size as fd_set.fds_bits[[0]]])
  1435. fi
  1436. AC_MSG_CHECKING(for dladdr in dlfcn.h)
  1437. PBX_DLADDR=0
  1438. old_LIBS=${LIBS}
  1439. LIBS="${LIBS} -ldl"
  1440. AC_LINK_IFELSE(
  1441. [AC_LANG_PROGRAM([#define _GNU_SOURCE 1
  1442. #include <dlfcn.h>],
  1443. [dladdr((void *)0, (void *)0)]
  1444. )],
  1445. AC_MSG_RESULT(yes)
  1446. PBX_DLADDR=1
  1447. AC_SUBST([PBX_DLADDR])
  1448. AC_DEFINE([HAVE_DLADDR], 1, [Define to 1 if your system has the dladdr() GNU extension]),
  1449. AC_MSG_RESULT(no)
  1450. )
  1451. LIBS=${old_LIBS}
  1452. # re-check without -ldl
  1453. # Non-Linux platforms like FreeBSD and NetBSD do not need a library libdl.so.
  1454. if test "${PBX_DLADDR}" = "0"; then
  1455. AC_MSG_CHECKING(for dladdr in dlfcn.h without -ldl)
  1456. AC_LINK_IFELSE(
  1457. [AC_LANG_PROGRAM([#define _GNU_SOURCE 1
  1458. #include <dlfcn.h>],
  1459. [dladdr((void *)0, (void *)0)]
  1460. )],
  1461. AC_MSG_RESULT(yes)
  1462. PBX_DLADDR=1
  1463. AC_SUBST([PBX_DLADDR])
  1464. AC_DEFINE([HAVE_DLADDR], 1, [Define to 1 if your system has the dladdr() GNU extension]),
  1465. AC_MSG_RESULT(no)
  1466. )
  1467. fi
  1468. # do the package library checks now
  1469. AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_openr], [bfd.h])
  1470. # Fedora/RedHat/CentOS require extra libraries
  1471. AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_openr], [bfd.h], [-ldl -liberty])
  1472. # openSUSE requires -lz
  1473. AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_openr], [bfd.h], [-ldl -liberty -lz])
  1474. case "${OSARCH}" in
  1475. linux*)
  1476. AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h])
  1477. ;;
  1478. esac
  1479. AST_C_DEFINE_CHECK([DAHDI], [DAHDI_RESET_COUNTERS], [dahdi/user.h], [230])
  1480. AST_C_DEFINE_CHECK([DAHDI], [DAHDI_DEFAULT_MTU_MRU], [dahdi/user.h], [220])
  1481. AST_C_DEFINE_CHECK([DAHDI], [DAHDI_CODE], [dahdi/user.h], [200])
  1482. AST_C_DEFINE_CHECK([DAHDI_HALF_FULL], [DAHDI_POLICY_HALF_FULL], [dahdi/user.h])
  1483. AST_C_COMPILE_CHECK([DAHDI_LINEREVERSE_VMWI], [struct dahdi_vmwi_info booger], [dahdi/user.h], , [enhanced dahdi vmwi support])
  1484. AST_C_COMPILE_CHECK([DAHDI_ECHOCANCEL_FAX_MODE], [int foo = DAHDI_ECHOCANCEL_FAX_MODE], [dahdi/user.h])
  1485. AST_C_COMPILE_CHECK([GETIFADDRS], [struct ifaddrs *p; getifaddrs(&p)], [ifaddrs.h], , [getifaddrs() support])
  1486. AST_C_COMPILE_CHECK([TIMERFD], [timerfd_create(0,0); timerfd_settime(0,0,NULL,NULL);], [sys/timerfd.h], , [timerfd support])
  1487. GSM_INTERNAL="yes"
  1488. AC_SUBST(GSM_INTERNAL)
  1489. GSM_SYSTEM="yes"
  1490. if test "${USE_GSM}" != "no"; then
  1491. if test "${GSM_DIR}" = "internal"; then
  1492. GSM_SYSTEM="no"
  1493. elif test "${GSM_DIR}" != ""; then
  1494. GSM_INTERNAL="no"
  1495. fi
  1496. if test "${GSM_SYSTEM}" = "yes"; then
  1497. gsmlibdir=""
  1498. if test "x${GSM_DIR}" != "x"; then
  1499. if test -d ${GSM_DIR}/lib; then
  1500. gsmlibdir="-L${GSM_DIR}/lib"
  1501. else
  1502. gsmlibdir="-L${GSM_DIR}"
  1503. fi
  1504. fi
  1505. AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1,
  1506. [Define to indicate the GSM library]), [], ${gsmlibdir})
  1507. if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
  1508. if test "x${GSM_DIR}" != "x" ; then
  1509. AC_CHECK_HEADER([${GSM_DIR}/include/gsm.h], [GSM_HEADER_FOUND=1], [GSM_HEADER_FOUND=0])
  1510. AC_CHECK_HEADER([${GSM_DIR}/include/gsm/gsm.h], [GSM_GSM_HEADER_FOUND=1], [GSM_GSM_HEADER_FOUND=0])
  1511. else
  1512. AC_CHECK_HEADER([gsm.h], [GSM_HEADER_FOUND=1], [GSM_HEADER_FOUND=0])
  1513. AC_CHECK_HEADER([gsm/gsm.h], [GSM_GSM_HEADER_FOUND=1], [GSM_GSM_HEADER_FOUND=0])
  1514. fi
  1515. if test "${GSM_HEADER_FOUND}" = "0" ; then
  1516. if test "{GSM_GSM_HEADER_FOUND}" = "0" ; then
  1517. if test "x${GSM_MANDATORY}" = "xyes" ; then
  1518. AC_MSG_NOTICE([***])
  1519. AC_MSG_NOTICE([*** It appears that you do not have the gsm development package installed.])
  1520. AC_MSG_NOTICE([*** Please install it to include ${GSM_DESCRIP} support, or re-run configure])
  1521. AC_MSG_NOTICE([*** without explicitly specifying --with-${GSM_OPTION}])
  1522. exit 1
  1523. fi
  1524. fi
  1525. fi
  1526. GSM_OK=0
  1527. if test "${GSM_HEADER_FOUND}" = "1" ; then
  1528. AC_DEFINE_UNQUOTED([HAVE_GSM_HEADER], 1, [Define to indicate that gsm.h has no prefix for its location])
  1529. GSM_OK=1
  1530. elif test "${GSM_GSM_HEADER_FOUND}" = "1" ; then
  1531. AC_DEFINE_UNQUOTED([HAVE_GSM_GSM_HEADER], 1, [Define to indicate that gsm.h is in gsm/gsm.h])
  1532. GSM_OK=1
  1533. fi
  1534. if test "${GSM_OK}" = "1" ; then
  1535. GSM_LIB="-lgsm"
  1536. if test "x${GSM_DIR}" != "x"; then
  1537. GSM_LIB="${gsmlibdir} ${GSM_LIB}"
  1538. GSM_INCLUDE="-I${GSM_DIR}/include"
  1539. fi
  1540. PBX_GSM=1
  1541. GSM_INTERNAL="no"
  1542. fi
  1543. fi
  1544. fi
  1545. if test "${GSM_INTERNAL}" = "yes"; then
  1546. PBX_GSM=1
  1547. AC_DEFINE_UNQUOTED([HAVE_GSM_HEADER], 1, [Define to indicate that gsm.h has no prefix for its location])
  1548. fi
  1549. fi
  1550. ILBC_INTERNAL="yes"
  1551. AC_SUBST(ILBC_INTERNAL)
  1552. ILBC_SYSTEM="yes"
  1553. if test "${USE_ILBC}" != "no"; then
  1554. if test "${ILBC_DIR}" = "internal"; then
  1555. ILBC_SYSTEM="no"
  1556. elif test "${ILBC_DIR}" != ""; then
  1557. ILBC_INTERNAL="no"
  1558. fi
  1559. if test "${ILBC_SYSTEM}" = "yes"; then
  1560. AST_PKG_CONFIG_CHECK(ILBC, libilbc < 3)
  1561. if test "$PBX_ILBC" = "1"; then
  1562. ILBC_INTERNAL="no"
  1563. fi
  1564. fi
  1565. if test "${ILBC_INTERNAL}" = "yes"; then
  1566. PBX_ILBC=1
  1567. fi
  1568. fi
  1569. AST_EXT_LIB_CHECK([ICONV], [iconv], [iconv_open], [iconv.h])
  1570. # GNU libiconv #define's iconv_open to libiconv_open, so we need to search for that symbol
  1571. AST_EXT_LIB_CHECK([ICONV], [iconv], [libiconv_open], [iconv.h])
  1572. # Some versions of Linux package iconv in glibc
  1573. AST_EXT_LIB_CHECK([ICONV], [c], [iconv_close], [iconv.h])
  1574. # If ical.h is NOT in the libical directory, then it is of a version insufficient for us.
  1575. AST_EXT_LIB_CHECK([ICAL], [ical], [icaltimezone_get_utc_timezone], [libical/ical.h], [${PTHREAD_LIBS}], [${PTHREAD_CFLAGS}])
  1576. AST_EXT_LIB_CHECK([IKSEMEL], [iksemel], [iks_start_sasl], [iksemel.h])
  1577. if test "${USE_IMAP_TK}" != "no"; then
  1578. saved_cppflags="${CPPFLAGS}"
  1579. saved_libs="${LIBS}"
  1580. switch_to_system_on_failure="no"
  1581. if test "${IMAP_TK_DIR}" = ""; then
  1582. IMAP_TK_DIR="`pwd`/../imap-2004g"
  1583. switch_to_system_on_failure="yes"
  1584. fi
  1585. if test "${IMAP_TK_DIR}" != "system"; then
  1586. AC_MSG_CHECKING(for UW IMAP Toolkit c-client library)
  1587. if test -f "${IMAP_TK_DIR}/c-client/LDFLAGS"; then
  1588. imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
  1589. fi
  1590. imap_libs="${IMAP_TK_DIR}/c-client/c-client.a"
  1591. imap_include="-I${IMAP_TK_DIR}/c-client"
  1592. CPPFLAGS="${CPPFLAGS} ${imap_include}"
  1593. LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}`
  1594. AC_LINK_IFELSE(
  1595. [AC_LANG_PROGRAM(
  1596. [#include "c-client.h"
  1597. void mm_searched (MAILSTREAM *stream,unsigned long number)
  1598. {
  1599. }
  1600. void mm_exists (MAILSTREAM *stream,unsigned long number)
  1601. {
  1602. }
  1603. void mm_expunged (MAILSTREAM *stream,unsigned long number)
  1604. {
  1605. }
  1606. void mm_flags (MAILSTREAM *stream,unsigned long number)
  1607. {
  1608. }
  1609. void mm_notify (MAILSTREAM *stream,char *string,long errflg)
  1610. {
  1611. }
  1612. void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1613. {
  1614. }
  1615. void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1616. {
  1617. }
  1618. void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
  1619. {
  1620. }
  1621. void mm_log (char *string,long errflg)
  1622. {
  1623. }
  1624. void mm_dlog (char *string)
  1625. {
  1626. }
  1627. void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
  1628. {
  1629. }
  1630. void mm_critical (MAILSTREAM *stream)
  1631. {
  1632. }
  1633. void mm_nocritical (MAILSTREAM *stream)
  1634. {
  1635. }
  1636. long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
  1637. {
  1638. }
  1639. void mm_fatal (char *string)
  1640. {
  1641. }],
  1642. [
  1643. MAILSTREAM *foo = mail_open(NULL, "", 0);
  1644. ]
  1645. )],
  1646. [ac_cv_imap_tk="yes"],
  1647. [ac_cv_imap_tk="no"]
  1648. )
  1649. if test "${ac_cv_imap_tk}" = "yes"; then
  1650. AC_LINK_IFELSE(
  1651. [AC_LANG_PROGRAM(
  1652. [#include "c-client.h"
  1653. void mm_searched (MAILSTREAM *stream,unsigned long number)
  1654. {
  1655. }
  1656. void mm_exists (MAILSTREAM *stream,unsigned long number)
  1657. {
  1658. }
  1659. void mm_expunged (MAILSTREAM *stream,unsigned long number)
  1660. {
  1661. }
  1662. void mm_flags (MAILSTREAM *stream,unsigned long number)
  1663. {
  1664. }
  1665. void mm_notify (MAILSTREAM *stream,char *string,long errflg)
  1666. {
  1667. }
  1668. void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1669. {
  1670. }
  1671. void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1672. {
  1673. }
  1674. void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
  1675. {
  1676. }
  1677. void mm_log (char *string,long errflg)
  1678. {
  1679. }
  1680. void mm_dlog (char *string)
  1681. {
  1682. }
  1683. void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
  1684. {
  1685. }
  1686. void mm_critical (MAILSTREAM *stream)
  1687. {
  1688. }
  1689. void mm_nocritical (MAILSTREAM *stream)
  1690. {
  1691. }
  1692. long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
  1693. {
  1694. }
  1695. void mm_fatal (char *string)
  1696. {
  1697. }],
  1698. [
  1699. long check = mail_expunge_full(NULL, "", 0);
  1700. ]
  1701. )],
  1702. [ac_cv_imap_tk2006="yes"],
  1703. [ac_cv_imap_tk2006="no"]
  1704. )
  1705. fi
  1706. CPPFLAGS="${saved_cppflags}"
  1707. LIBS="${saved_libs}"
  1708. if test "${ac_cv_imap_tk}" = "no"; then
  1709. AC_MSG_RESULT(no)
  1710. if test "${switch_to_system_on_failure}" = "yes"; then
  1711. IMAP_TK_DIR="system"
  1712. else #This means they specified a directory. Search for a package installation there too
  1713. AC_MSG_CHECKING([for system c-client library...])
  1714. CPPFLAGS="${saved_cppflags}"
  1715. LIBS="${saved_libs}"
  1716. imap_include="-I${IMAP_TK_DIR}/include"
  1717. imap_ldflags="-L${IMAP_TK_DIR}/lib"
  1718. imap_libs="-lc-client"
  1719. CPPFLAGS="${CPPFLAGS} ${imap_include}"
  1720. LIBS="${LIBS} ${imap_libs} ${imap_ldflags}"
  1721. AC_LINK_IFELSE(
  1722. [AC_LANG_PROGRAM(
  1723. [#include "c-client.h"
  1724. void mm_searched (MAILSTREAM *stream,unsigned long number)
  1725. {
  1726. }
  1727. void mm_exists (MAILSTREAM *stream,unsigned long number)
  1728. {
  1729. }
  1730. void mm_expunged (MAILSTREAM *stream,unsigned long number)
  1731. {
  1732. }
  1733. void mm_flags (MAILSTREAM *stream,unsigned long number)
  1734. {
  1735. }
  1736. void mm_notify (MAILSTREAM *stream,char *string,long errflg)
  1737. {
  1738. }
  1739. void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1740. {
  1741. }
  1742. void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1743. {
  1744. }
  1745. void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
  1746. {
  1747. }
  1748. void mm_log (char *string,long errflg)
  1749. {
  1750. }
  1751. void mm_dlog (char *string)
  1752. {
  1753. }
  1754. void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
  1755. {
  1756. }
  1757. void mm_critical (MAILSTREAM *stream)
  1758. {
  1759. }
  1760. void mm_nocritical (MAILSTREAM *stream)
  1761. {
  1762. }
  1763. long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
  1764. {
  1765. }
  1766. void mm_fatal (char *string)
  1767. {
  1768. }],
  1769. [
  1770. MAILSTREAM *foo = mail_open(NULL, "", 0);
  1771. ]
  1772. )],
  1773. [ac_cv_imap_tk="yes"],
  1774. [ac_cv_imap_tk="no"]
  1775. )
  1776. if test "${ac_cv_imap_tk}" = "yes"; then
  1777. AC_LINK_IFELSE(
  1778. [AC_LANG_PROGRAM(
  1779. [#include "c-client.h"
  1780. void mm_searched (MAILSTREAM *stream,unsigned long number)
  1781. {
  1782. }
  1783. void mm_exists (MAILSTREAM *stream,unsigned long number)
  1784. {
  1785. }
  1786. void mm_expunged (MAILSTREAM *stream,unsigned long number)
  1787. {
  1788. }
  1789. void mm_flags (MAILSTREAM *stream,unsigned long number)
  1790. {
  1791. }
  1792. void mm_notify (MAILSTREAM *stream,char *string,long errflg)
  1793. {
  1794. }
  1795. void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1796. {
  1797. }
  1798. void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1799. {
  1800. }
  1801. void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
  1802. {
  1803. }
  1804. void mm_log (char *string,long errflg)
  1805. {
  1806. }
  1807. void mm_dlog (char *string)
  1808. {
  1809. }
  1810. void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
  1811. {
  1812. }
  1813. void mm_critical (MAILSTREAM *stream)
  1814. {
  1815. }
  1816. void mm_nocritical (MAILSTREAM *stream)
  1817. {
  1818. }
  1819. long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
  1820. {
  1821. }
  1822. void mm_fatal (char *string)
  1823. {
  1824. }],
  1825. [
  1826. long check = mail_expunge_full(NULL, "", 0);
  1827. ]
  1828. )],
  1829. [ac_cv_imap_tk2006="yes"],
  1830. [ac_cv_imap_tk2006="no"]
  1831. )
  1832. fi
  1833. fi
  1834. fi
  1835. fi
  1836. if test "${IMAP_TK_DIR}" = "system"; then
  1837. #We will enter here if user specified "system" or if any of above checks failed
  1838. AC_MSG_CHECKING([for system c-client library...])
  1839. CPPFLAGS="${saved_cppflags}"
  1840. LIBS="${saved_libs}"
  1841. imap_ldflags=""
  1842. imap_libs="-lcrypto -lssl -lc-client"
  1843. imap_include="-DUSE_SYSTEM_IMAP" #Try the imap directory first
  1844. CPPFLAGS="${CPPFLAGS} ${imap_include}"
  1845. LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}`
  1846. AC_LINK_IFELSE(
  1847. [AC_LANG_PROGRAM(
  1848. [#include <stdio.h>
  1849. #include <imap/c-client.h>
  1850. void mm_searched (MAILSTREAM *stream,unsigned long number)
  1851. {
  1852. }
  1853. void mm_exists (MAILSTREAM *stream,unsigned long number)
  1854. {
  1855. }
  1856. void mm_expunged (MAILSTREAM *stream,unsigned long number)
  1857. {
  1858. }
  1859. void mm_flags (MAILSTREAM *stream,unsigned long number)
  1860. {
  1861. }
  1862. void mm_notify (MAILSTREAM *stream,char *string,long errflg)
  1863. {
  1864. }
  1865. void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1866. {
  1867. }
  1868. void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1869. {
  1870. }
  1871. void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
  1872. {
  1873. }
  1874. void mm_log (char *string,long errflg)
  1875. {
  1876. }
  1877. void mm_dlog (char *string)
  1878. {
  1879. }
  1880. void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
  1881. {
  1882. }
  1883. void mm_critical (MAILSTREAM *stream)
  1884. {
  1885. }
  1886. void mm_nocritical (MAILSTREAM *stream)
  1887. {
  1888. }
  1889. long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
  1890. {
  1891. }
  1892. void mm_fatal (char *string)
  1893. {
  1894. }],
  1895. [
  1896. MAILSTREAM *foo = mail_open(NULL, "", 0);
  1897. ]
  1898. )],
  1899. [ac_cv_imap_tk="yes"],
  1900. [ac_cv_imap_tk="no"]
  1901. )
  1902. if test "${ac_cv_imap_tk}" = "yes"; then
  1903. AC_LINK_IFELSE(
  1904. [AC_LANG_PROGRAM(
  1905. [#include <stdio.h>
  1906. #include <imap/c-client.h>
  1907. void mm_searched (MAILSTREAM *stream,unsigned long number)
  1908. {
  1909. }
  1910. void mm_exists (MAILSTREAM *stream,unsigned long number)
  1911. {
  1912. }
  1913. void mm_expunged (MAILSTREAM *stream,unsigned long number)
  1914. {
  1915. }
  1916. void mm_flags (MAILSTREAM *stream,unsigned long number)
  1917. {
  1918. }
  1919. void mm_notify (MAILSTREAM *stream,char *string,long errflg)
  1920. {
  1921. }
  1922. void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1923. {
  1924. }
  1925. void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1926. {
  1927. }
  1928. void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
  1929. {
  1930. }
  1931. void mm_log (char *string,long errflg)
  1932. {
  1933. }
  1934. void mm_dlog (char *string)
  1935. {
  1936. }
  1937. void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
  1938. {
  1939. }
  1940. void mm_critical (MAILSTREAM *stream)
  1941. {
  1942. }
  1943. void mm_nocritical (MAILSTREAM *stream)
  1944. {
  1945. }
  1946. long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
  1947. {
  1948. }
  1949. void mm_fatal (char *string)
  1950. {
  1951. }],
  1952. [
  1953. long check = mail_expunge_full(NULL, "", 0);
  1954. ]
  1955. )],
  1956. [ac_cv_imap_tk2006="yes"],
  1957. [ac_cv_imap_tk2006="no"]
  1958. )
  1959. else #looking in imap directory didn't work, try c-client
  1960. imap_ldflags=""
  1961. imap_libs="-lcrypto -lssl -lc-client"
  1962. imap_include="-DUSE_SYSTEM_CCLIENT"
  1963. CPPFLAGS="${saved_cppflags}"
  1964. LIBS="${saved_libs}"
  1965. CPPFLAGS="${CPPFLAGS} ${imap_include}"
  1966. LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}`
  1967. AC_LINK_IFELSE(
  1968. [AC_LANG_PROGRAM(
  1969. [#include <stdio.h>
  1970. #include <c-client/c-client.h>
  1971. void mm_searched (MAILSTREAM *stream,unsigned long number)
  1972. {
  1973. }
  1974. void mm_exists (MAILSTREAM *stream,unsigned long number)
  1975. {
  1976. }
  1977. void mm_expunged (MAILSTREAM *stream,unsigned long number)
  1978. {
  1979. }
  1980. void mm_flags (MAILSTREAM *stream,unsigned long number)
  1981. {
  1982. }
  1983. void mm_notify (MAILSTREAM *stream,char *string,long errflg)
  1984. {
  1985. }
  1986. void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1987. {
  1988. }
  1989. void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  1990. {
  1991. }
  1992. void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
  1993. {
  1994. }
  1995. void mm_log (char *string,long errflg)
  1996. {
  1997. }
  1998. void mm_dlog (char *string)
  1999. {
  2000. }
  2001. void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
  2002. {
  2003. }
  2004. void mm_critical (MAILSTREAM *stream)
  2005. {
  2006. }
  2007. void mm_nocritical (MAILSTREAM *stream)
  2008. {
  2009. }
  2010. long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
  2011. {
  2012. }
  2013. void mm_fatal (char *string)
  2014. {
  2015. }],
  2016. [
  2017. MAILSTREAM *foo = mail_open(NULL, "", 0);
  2018. ]
  2019. )],
  2020. [ac_cv_imap_tk="yes"],
  2021. [ac_cv_imap_tk="no"]
  2022. )
  2023. if test "${ac_cv_imap_tk}" = "no"; then
  2024. imap_libs="-lcrypto -lssl -lc-client4"
  2025. LIBS="${saved_libs} ${imap_libs} "`echo ${imap_ldflags}`
  2026. AC_LINK_IFELSE(
  2027. [AC_LANG_PROGRAM(
  2028. [#include <stdio.h>
  2029. #include <c-client/c-client.h>
  2030. void mm_searched (MAILSTREAM *stream,unsigned long number)
  2031. {
  2032. }
  2033. void mm_exists (MAILSTREAM *stream,unsigned long number)
  2034. {
  2035. }
  2036. void mm_expunged (MAILSTREAM *stream,unsigned long number)
  2037. {
  2038. }
  2039. void mm_flags (MAILSTREAM *stream,unsigned long number)
  2040. {
  2041. }
  2042. void mm_notify (MAILSTREAM *stream,char *string,long errflg)
  2043. {
  2044. }
  2045. void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  2046. {
  2047. }
  2048. void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  2049. {
  2050. }
  2051. void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
  2052. {
  2053. }
  2054. void mm_log (char *string,long errflg)
  2055. {
  2056. }
  2057. void mm_dlog (char *string)
  2058. {
  2059. }
  2060. void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
  2061. {
  2062. }
  2063. void mm_critical (MAILSTREAM *stream)
  2064. {
  2065. }
  2066. void mm_nocritical (MAILSTREAM *stream)
  2067. {
  2068. }
  2069. long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
  2070. {
  2071. }
  2072. void mm_fatal (char *string)
  2073. {
  2074. }],
  2075. [
  2076. MAILSTREAM *foo = mail_open(NULL, "", 0);
  2077. ]
  2078. )],
  2079. [ac_cv_imap_tk="yes"],
  2080. [ac_cv_imap_tk="no"]
  2081. )
  2082. fi
  2083. if test "${ac_cv_imap_tk}" = "yes"; then
  2084. AC_LINK_IFELSE(
  2085. [AC_LANG_PROGRAM(
  2086. [#include <stdio.h>
  2087. #include <c-client/c-client.h>
  2088. void mm_searched (MAILSTREAM *stream,unsigned long number)
  2089. {
  2090. }
  2091. void mm_exists (MAILSTREAM *stream,unsigned long number)
  2092. {
  2093. }
  2094. void mm_expunged (MAILSTREAM *stream,unsigned long number)
  2095. {
  2096. }
  2097. void mm_flags (MAILSTREAM *stream,unsigned long number)
  2098. {
  2099. }
  2100. void mm_notify (MAILSTREAM *stream,char *string,long errflg)
  2101. {
  2102. }
  2103. void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  2104. {
  2105. }
  2106. void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
  2107. {
  2108. }
  2109. void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
  2110. {
  2111. }
  2112. void mm_log (char *string,long errflg)
  2113. {
  2114. }
  2115. void mm_dlog (char *string)
  2116. {
  2117. }
  2118. void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
  2119. {
  2120. }
  2121. void mm_critical (MAILSTREAM *stream)
  2122. {
  2123. }
  2124. void mm_nocritical (MAILSTREAM *stream)
  2125. {
  2126. }
  2127. long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
  2128. {
  2129. }
  2130. void mm_fatal (char *string)
  2131. {
  2132. }],
  2133. [
  2134. long check = mail_expunge_full(NULL, "", 0);
  2135. ]
  2136. )],
  2137. [ac_cv_imap_tk2006="yes"],
  2138. [ac_cv_imap_tk2006="no"]
  2139. )
  2140. fi
  2141. fi
  2142. fi
  2143. if test "${ac_cv_imap_tk}" = "yes"; then
  2144. AC_MSG_RESULT(yes)
  2145. IMAP_TK_LIB="${imap_libs} "`echo ${imap_ldflags}`
  2146. IMAP_TK_INCLUDE="${imap_include}"
  2147. PBX_IMAP_TK=1
  2148. AC_DEFINE([HAVE_IMAP_TK], 1, [Define if your system has the UW IMAP Toolkit c-client library.])
  2149. if test "${ac_cv_imap_tk2006}" = "yes"; then
  2150. AC_DEFINE([HAVE_IMAP_TK2006], 1, [Define if your system has the UW IMAP Toolkit c-client library version 2006 or greater.])
  2151. fi
  2152. else
  2153. AC_MSG_RESULT(no)
  2154. fi
  2155. CPPFLAGS="${saved_cppflags}"
  2156. LIBS="${saved_libs}"
  2157. fi
  2158. AST_EXT_LIB_CHECK([IODBC], [iodbc], [SQLConnect], [sql.h], [${PTHREAD_LIBS}], [${PTHREAD_CFLAGS}])
  2159. AST_EXT_LIB_CHECK([INOTIFY], [c], [inotify_init], [sys/inotify.h])
  2160. AST_EXT_LIB_CHECK([JACK], [jack], [jack_activate], [jack/jack.h])
  2161. # BSD (and OS X) equivalent of inotify
  2162. AST_EXT_LIB_CHECK([KQUEUE], [c], [kqueue], [sys/event.h])
  2163. # 64-bit version of kevent (from kqueue) on OS X
  2164. AC_CHECK_FUNCS([kevent64])
  2165. AST_EXT_LIB_CHECK([LDAP], [ldap], [ldap_initialize], [ldap.h])
  2166. AST_EXT_TOOL_CHECK([MYSQLCLIENT], [mysql_config])
  2167. if test "${PBX_MYSQLCLIENT}" = 1; then
  2168. AC_MSG_CHECKING(for MySQL client bool support)
  2169. AC_LINK_IFELSE(
  2170. [AC_LANG_PROGRAM([#include <mysql/mysql.h>],
  2171. [bool test = 1;])],
  2172. AC_MSG_RESULT(yes)
  2173. AC_DEFINE(HAVE_MYSQLCLIENT_BOOL, 1, [Define to 1 if mysql/mysql.h has bool defined.]),
  2174. AC_MSG_RESULT(no)
  2175. )
  2176. AC_MSG_CHECKING(for MySQL client my_bool support)
  2177. AC_LINK_IFELSE(
  2178. [AC_LANG_PROGRAM([#include <mysql/mysql.h>],
  2179. [my_bool test = 1;])],
  2180. AC_MSG_RESULT(yes)
  2181. AC_DEFINE(HAVE_MYSQLCLIENT_MY_BOOL, 1, [Define to 1 if mysql/mysql.h has my_bool defined.]),
  2182. AC_MSG_RESULT(no)
  2183. )
  2184. fi
  2185. AST_EXT_TOOL_CHECK([NEON], [neon-config])
  2186. AST_EXT_TOOL_CHECK([NEON29], [neon-config], , [--libs],
  2187. [#include <ne_auth.h>],
  2188. [#ifndef NE_AUTH_NTLM
  2189. #error Need libneon >= 0.29.0
  2190. #endif])
  2191. AST_PKG_CONFIG_CHECK(NETSNMP, netsnmp-agent)
  2192. AST_EXT_TOOL_CHECK([NETSNMP], [net-snmp-config], , [--agent-libs],
  2193. [#include <net-snmp/net-snmp-config.h>
  2194. #include <net-snmp/net-snmp-includes.h>
  2195. #include <net-snmp/agent/net-snmp-agent-includes.h>],
  2196. [int callback = snmp_register_callback(0, 0, NULL, NULL)])
  2197. AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
  2198. # Check that unbound is installed and the version code fragment compiles
  2199. AST_EXT_LIB_EXTRA_CHECK([UNBOUND], [unbound], [ub_ctx_delete], [unbound.h],
  2200. [], [], [
  2201. AC_LANG_PROGRAM( [#include <unbound.h>],
  2202. [
  2203. #if (UNBOUND_VERSION_MAJOR < 1 || (UNBOUND_VERSION_MAJOR == 1 && UNBOUND_VERSION_MINOR < 5 ))
  2204. #error "Unbound version must be >= 1.5"
  2205. #endif
  2206. ]
  2207. )
  2208. ], [unbound version >= 1.5])
  2209. AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h])
  2210. AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_stream_init], [ogg/ogg.h])
  2211. # Non-glibc platforms require libexecinfo for backtrace support
  2212. AST_EXT_LIB_CHECK([BKTR], [execinfo], [backtrace], [execinfo.h])
  2213. # Linux, however, has backtrace directly in glibc
  2214. AST_EXT_LIB_CHECK([BKTR], [c], [backtrace], [execinfo.h])
  2215. AST_EXT_LIB_CHECK([BLUETOOTH], [bluetooth], [ba2str], [bluetooth/bluetooth.h])
  2216. AST_EXT_LIB_CHECK([BEANSTALK], [beanstalk], [bs_version], [beanstalk.h])
  2217. PG_CONFIG=":"
  2218. if test "${USE_PGSQL}" != "no"; then
  2219. if test "x${PGSQL_DIR}" != "x"; then
  2220. AC_PATH_TOOL([PG_CONFIG], [pg_config], :, [${PGSQL_DIR}/bin])
  2221. if test "${PG_CONFIG}" = ":"; then
  2222. AC_MSG_NOTICE([***])
  2223. AC_MSG_NOTICE([*** pg_config was not found in the path you specified:])
  2224. AC_MSG_NOTICE([*** ${PGSQL_DIR}/bin])
  2225. AC_MSG_NOTICE([*** Either correct the installation, or run configure])
  2226. AC_MSG_NOTICE([*** including --without-postgres])
  2227. exit 1
  2228. fi
  2229. else
  2230. AC_PATH_TOOL([PG_CONFIG], [pg_config], :)
  2231. fi
  2232. fi
  2233. if test "x${PG_CONFIG}" != "x:"; then
  2234. PGSQL_libdir=`${PG_CONFIG} --libdir`
  2235. PGSQL_includedir=`${PG_CONFIG} --includedir`
  2236. if test "x$?" != "x0" ; then
  2237. if test -n "${PGSQL_MANDATORY}" ; then
  2238. AC_MSG_NOTICE([***])
  2239. AC_MSG_NOTICE([*** The PostgreSQL installation on this system appears to be broken.])
  2240. AC_MSG_NOTICE([*** Either correct the installation, or run configure])
  2241. AC_MSG_NOTICE([*** including --without-postgres])
  2242. exit 1
  2243. fi
  2244. else
  2245. AC_CHECK_LIB([pq], [PQescapeStringConn], AC_DEFINE_UNQUOTED([HAVE_PGSQL], 1,
  2246. [Define to indicate the PostgreSQL library]), [], -L${PGSQL_libdir} -lz)
  2247. AC_MSG_CHECKING(for pg_encoding_to_char within Postgres headers)
  2248. old_CFLAGS=${CFLAGS}
  2249. CFLAGS="${CFLAGS} -I${PGSQL_includedir} -Werror"
  2250. old_LDFLAGS=${LDFLAGS}
  2251. LDFLAGS="${LDFLAGS} -L${PGSQL_libdir} -lpq -lz"
  2252. AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <libpq-fe.h>],
  2253. [const char *foo = pg_encoding_to_char(1)])],
  2254. [AC_MSG_RESULT(yes)
  2255. AC_DEFINE_UNQUOTED([HAVE_PGSQL_pg_encoding_to_char], 1, [Define to indicate presence of the pg_encoding_to_char API.])],
  2256. [AC_MSG_RESULT(no)])
  2257. CFLAGS=${old_CFLAGS}
  2258. LDFLAGS=${old_LDFLAGS}
  2259. if test "${ac_cv_lib_pq_PQescapeStringConn}" = "yes"; then
  2260. PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz"
  2261. PGSQL_INCLUDE="-I${PGSQL_includedir}"
  2262. PBX_PGSQL=1
  2263. elif test -n "${PGSQL_MANDATORY}";
  2264. then
  2265. AC_MSG_NOTICE([***])
  2266. AC_MSG_NOTICE([*** The PostgreSQL installation on this system appears to be broken.])
  2267. AC_MSG_NOTICE([*** Either correct the installation, or run configure])
  2268. AC_MSG_NOTICE([*** including --without-postgres])
  2269. exit 1
  2270. fi
  2271. fi
  2272. fi
  2273. if test "$USE_PJPROJECT" != "no" ; then
  2274. if test "$PJPROJECT_BUNDLED" = "no" ; then
  2275. AST_PKG_CONFIG_CHECK([PJPROJECT], [libpjproject])
  2276. if test "x$PBX_PJPROJECT" = "x1" ; then
  2277. AST_EXT_LIB_CHECK([PJSIP_DLG_CREATE_UAS_AND_INC_LOCK], [pjsip], [pjsip_dlg_create_uas_and_inc_lock], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS])
  2278. AST_EXT_LIB_CHECK([PJ_TRANSACTION_GRP_LOCK], [pjsip], [pjsip_tsx_create_uac2], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS])
  2279. saved_cppflags="${CPPFLAGS}"
  2280. saved_libs="${LIBS}"
  2281. CPPFLAGS="${CPPFLAGS} ${PJPROJECT_CFLAGS}"
  2282. LIBS="${LIBS} ${PJPROJECT_LIB}"
  2283. AST_C_COMPILE_CHECK([PJSIP_REPLACE_MEDIA_STREAM], [pjmedia_mod_offer_flag flag = PJMEDIA_SDP_NEG_ALLOW_MEDIA_CHANGE], [pjmedia.h])
  2284. LIBS="${saved_libs}"
  2285. CPPFLAGS="${saved_cppflags}"
  2286. AST_EXT_LIB_CHECK([PJSIP_GET_DEST_INFO], [pjsip], [pjsip_get_dest_info], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS])
  2287. AST_EXT_LIB_CHECK([PJ_SSL_CERT_LOAD_FROM_FILES2], [pj], [pj_ssl_cert_load_from_files2], [pjlib.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS])
  2288. AST_EXT_LIB_CHECK([PJSIP_EXTERNAL_RESOLVER], [pjsip], [pjsip_endpt_set_ext_resolver], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS])
  2289. saved_cppflags="${CPPFLAGS}"
  2290. saved_libs="${LIBS}"
  2291. CPPFLAGS="${CPPFLAGS} ${PJPROJECT_CFLAGS}"
  2292. LIBS="${LIBS} ${PJPROJECT_LIB}"
  2293. AST_C_COMPILE_CHECK([PJSIP_TLS_TRANSPORT_PROTO], [struct pjsip_tls_setting setting; int proto; proto = setting.proto;], [pjsip.h])
  2294. AST_C_COMPILE_CHECK([PJSIP_TLS_1_1], [enum pjsip_ssl_method method = PJSIP_TLSV1_1_METHOD;], [pjsip.h])
  2295. AST_C_COMPILE_CHECK([PJSIP_TLS_1_2], [enum pjsip_ssl_method method = PJSIP_TLSV1_2_METHOD;], [pjsip.h])
  2296. AST_C_COMPILE_CHECK([PJSIP_TLS_1_3], [enum pjsip_ssl_method method = PJSIP_TLSV1_3_METHOD;], [pjsip.h])
  2297. AST_C_COMPILE_CHECK([PJSIP_INV_ACCEPT_MULTIPLE_SDP_ANSWERS], [pjsip_cfg()->endpt.accept_multiple_sdp_answers = 0;], [pjsip.h])
  2298. AST_C_COMPILE_CHECK([PJSIP_ENDPOINT_COMPACT_FORM], [pjsip_cfg()->endpt.use_compact_form = PJ_TRUE;], [pjsip.h])
  2299. AST_C_COMPILE_CHECK([PJSIP_TRANSPORT_DISABLE_CONNECTION_REUSE], [struct pjsip_tpselector sel; sel.disable_connection_reuse = PJ_TRUE;], [pjsip.h])
  2300. AST_C_COMPILE_CHECK([PJSIP_OAUTH_AUTHENTICATION], [struct pjsip_oauth_credential credential;], [pjsip.h])
  2301. AC_MSG_CHECKING(for pjproject on_valid_pair callback)
  2302. AC_LINK_IFELSE(
  2303. [AC_LANG_PROGRAM(
  2304. [#include <pjsip.h>
  2305. #include <pjsip_ua.h>
  2306. #include <pjnath.h>
  2307. void on_valid_pair(pj_ice_sess *ice) {}
  2308. void on_ice_complete(pj_ice_sess *ice, pj_status_t status) {}
  2309. void on_rx_data(pj_ice_sess *ice, unsigned comp_id, unsigned transport_id, void *pkt, pj_size_t size, const pj_sockaddr_t *src_addr, unsigned src_addr_len) {}
  2310. pj_status_t on_tx_pkt(pj_ice_sess *ice, unsigned comp_id, unsigned transport_id, const void *pkt, pj_size_t size, const pj_sockaddr_t *dst_addr, unsigned dst_addr_len) {}],
  2311. [pj_ice_sess_cb ice_sess_cb = {
  2312. .on_valid_pair = on_valid_pair,
  2313. .on_ice_complete = on_ice_complete,
  2314. .on_rx_data = on_rx_data,
  2315. .on_tx_pkt = on_tx_pkt,
  2316. };])],
  2317. AC_MSG_RESULT(yes)
  2318. AC_DEFINE(HAVE_PJPROJECT_ON_VALID_ICE_PAIR_CALLBACK, 1, [Define to 1 if on_valid_pair callback is present.]),
  2319. AC_MSG_RESULT(no)
  2320. )
  2321. LIBS="${saved_libs}"
  2322. CPPFLAGS="${saved_cppflags}"
  2323. AST_EXT_LIB_CHECK([PJSIP_EVSUB_GRP_LOCK], [pjsip], [pjsip_evsub_add_ref], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS])
  2324. AST_EXT_LIB_CHECK([PJSIP_INV_SESSION_REF], [pjsip], [pjsip_inv_add_ref], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS])
  2325. AST_EXT_LIB_CHECK([PJSIP_AUTH_CLT_DEINIT], [pjsip], [pjsip_auth_clt_deinit], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS])
  2326. AST_EXT_LIB_CHECK([PJSIP_TSX_LAYER_FIND_TSX2], [pjsip], [pjsip_tsx_layer_find_tsx2], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS])
  2327. AST_EXT_LIB_CHECK([PJSIP_TLS_TRANSPORT_RESTART], [pjsip], [pjsip_tls_transport_restart], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS])
  2328. fi
  2329. fi
  2330. if test "x$PBX_PJPROJECT" = "x1" ; then
  2331. if test "x${AST_DEVMODE}" = "xyes" ; then
  2332. AC_SUBST([PYTHONDEV_LIB])
  2333. AC_SUBST([PYTHONDEV_INCLUDE])
  2334. AST_PKG_CONFIG_CHECK([PYTHONDEV], [python-2.7])
  2335. AST_PKG_CONFIG_CHECK([PYTHONDEV], [python2])
  2336. AST_PKG_CONFIG_CHECK([PYTHONDEV], [python])
  2337. # The PJProject offers a C extension to Python. That wrapper is used by the
  2338. # Asterisk Test Framework, which requires Asterisk to be in Developer Mode.
  2339. # However, the used wrapper (called 'PJSUA Python') is deprecated and was not
  2340. # ported from Python 2.7 to Python 3.x. This is confirmed; it simply does not
  2341. # build. For more see <http://www.pjsip.org/trac/wiki/Python_SIP_Tutorial>.
  2342. # Therefore, the C libraries for Python 3 are of no help in Asterisk:
  2343. #AST_PKG_CONFIG_CHECK([PYTHONDEV], [python3])
  2344. fi
  2345. fi
  2346. fi
  2347. AST_EXT_LIB_CHECK([POPT], [popt], [poptStrerror], [popt.h])
  2348. AST_PKG_CONFIG_CHECK([PORTAUDIO], [portaudio-2.0])
  2349. AST_EXT_LIB_CHECK([PORTAUDIO], [portaudio], [Pa_GetDeviceCount], [portaudio.h])
  2350. AST_EXT_LIB_CHECK([PRI], [pri], [pri_connected_line_update], [libpri.h])
  2351. if test "x$PBX_PRI" = "x1" ; then
  2352. AST_EXT_LIB_CHECK([PRI_SETUP_ACK_INBAND], [pri], [pri_setup_ack], [libpri.h])
  2353. AST_EXT_LIB_CHECK([PRI_L2_PERSISTENCE], [pri], [pri_persistent_layer2_option], [libpri.h])
  2354. AST_EXT_LIB_CHECK([PRI_DATETIME_SEND], [pri], [pri_date_time_send_option], [libpri.h])
  2355. AST_EXT_LIB_CHECK([PRI_MWI_V2], [pri], [pri_mwi_indicate_v2], [libpri.h])
  2356. AST_EXT_LIB_CHECK([PRI_DISPLAY_TEXT], [pri], [pri_display_text], [libpri.h])
  2357. AST_EXT_LIB_CHECK([PRI_MWI], [pri], [pri_mwi_indicate], [libpri.h])
  2358. AST_EXT_LIB_CHECK([PRI_MCID], [pri], [pri_mcid_enable], [libpri.h])
  2359. AST_EXT_LIB_CHECK([PRI_CALL_WAITING], [pri], [pri_connect_ack_enable], [libpri.h])
  2360. AST_EXT_LIB_CHECK([PRI_AOC_EVENTS], [pri], [pri_aoc_events_enable], [libpri.h])
  2361. AST_EXT_LIB_CHECK([PRI_TRANSFER], [pri], [pri_transfer_enable], [libpri.h])
  2362. AST_EXT_LIB_CHECK([PRI_CCSS], [pri], [pri_cc_enable], [libpri.h])
  2363. AST_EXT_LIB_CHECK([PRI_HANGUP_FIX], [pri], [pri_hangup_fix_enable], [libpri.h])
  2364. AST_EXT_LIB_CHECK([PRI_SUBADDR], [pri], [pri_sr_set_called_subaddress], [libpri.h])
  2365. AST_EXT_LIB_CHECK([PRI_CALL_HOLD], [pri], [pri_hold_enable], [libpri.h])
  2366. AST_EXT_LIB_CHECK([PRI_CALL_REROUTING], [pri], [pri_reroute_enable], [libpri.h])
  2367. AST_EXT_LIB_CHECK([PRI_SETUP_KEYPAD], [pri], [pri_sr_set_keypad_digits], [libpri.h])
  2368. # ------------------------------------v
  2369. # TODO: The code can be changed to always include these features now.
  2370. # These features will always be present if pri_connected_line_update is available.
  2371. AST_EXT_LIB_CHECK([PRI_PROG_W_CAUSE], [pri], [pri_progress_with_cause], [libpri.h])
  2372. AST_EXT_LIB_CHECK([PRI_INBANDDISCONNECT], [pri], [pri_set_inbanddisconnect], [libpri.h])
  2373. AST_EXT_LIB_CHECK([PRI_SERVICE_MESSAGES], [pri], [pri_maintenance_service], [libpri.h])
  2374. AST_EXT_LIB_CHECK([PRI_REVERSE_CHARGE], [pri], [pri_sr_set_reversecharge], [libpri.h])
  2375. # ------------------------------------^
  2376. fi
  2377. AST_EXT_LIB_CHECK([RESAMPLE], [resample], [resample_open], [libresample.h], [-lm])
  2378. AST_EXT_LIB_CHECK([FFTW3], [fftw3], [fftw_malloc], [fftw3.h])
  2379. AST_EXT_LIB_CHECK([SNDFILE], [sndfile], [sf_open], [sndfile.h])
  2380. AST_C_COMPILE_CHECK([SPANDSP], [
  2381. #if SPANDSP_RELEASE_DATE < 20080516
  2382. #error "spandsp 0.0.5 or greater is required"
  2383. #endif
  2384. ], [spandsp/version.h], , [minimum version of SpanDSP])
  2385. if test "x${PBX_SPANDSP}" = "x1" ; then
  2386. # We found the correct version in the header, now let's make sure it links
  2387. # properly, and that libtiff is available
  2388. PBX_SPANDSP=0
  2389. AST_EXT_LIB_CHECK([SPANDSP], [spandsp], [span_set_message_handler], [spandsp.h], [-ltiff])
  2390. fi
  2391. if test "x${PBX_SPANDSP}" = "x1" ; then
  2392. # We also need t38_terminal_init()
  2393. PBX_SPANDSP=0
  2394. AST_EXT_LIB_CHECK([SPANDSP], [spandsp], [t38_terminal_init], [spandsp.h], [-ltiff])
  2395. fi
  2396. # Check for libss7 v2.0 branch compatible version.
  2397. AST_EXT_LIB_CHECK([SS7], [ss7], [ss7_set_isup_timer], [libss7.h])
  2398. AST_EXT_LIB_CHECK([OPENR2], [openr2], [openr2_chan_new], [openr2.h])
  2399. AST_EXT_LIB_CHECK([OPUS], [opus], [opus_encoder_create], [opus/opus.h])
  2400. # opusfile.h includes <opus_multistream.h> so we need to make sure that
  2401. # either $OPUS_INCLUDE or /usr/include/opus is added to the search path.
  2402. __opus_include=${OPUS_INCLUDE}
  2403. if test -z "$__opus_include" -o x"$__opus_include" = x" " ; then
  2404. __opus_include=-I/usr/include/opus
  2405. fi
  2406. AST_EXT_LIB_CHECK([OPUSFILE], [opusfile], [op_open_callbacks], [opus/opusfile.h], [], [$__opus_include])
  2407. for ver in ${LUA_VERSIONS:-5.4 5.3 5.2 5.1}; do
  2408. AST_EXT_LIB_CHECK([LUA], lua${ver}, [luaL_newstate], lua${ver}/lua.h, [-lm])
  2409. if test "x${PBX_LUA}" = "x1" ; then
  2410. if test x"${LUA_DIR}" = x; then
  2411. LUA_INCLUDE="${LUA_INCLUDE} -I/usr/include/lua${ver}"
  2412. else
  2413. LUA_INCLUDE="${LUA_INCLUDE} -I${LUA_DIR}/lua${ver}"
  2414. fi
  2415. break;
  2416. fi
  2417. done
  2418. # Some distributions (like openSUSE and NetBSD) remove the 5.x suffix.
  2419. if test "x${LUA_VERSIONS}" = "x"; then
  2420. AST_EXT_LIB_CHECK([LUA], [lua], [luaL_newstate], [lua.h], [-lm])
  2421. fi
  2422. # Accept either RADIUS client library, their APIs are fully compatible,
  2423. # just different header filenames and different SONAMEs
  2424. AST_EXT_LIB_CHECK([RADIUS], [freeradius-client], [rc_read_config], [freeradius-client.h])
  2425. if test "x${PBX_RADIUS}" = "x1"; then
  2426. AC_DEFINE(RADIUS_HEADER_STR, [<freeradius-client.h>], [Name of RADIUS library include header])
  2427. else
  2428. AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
  2429. if test "x${PBX_RADIUS}" = "x1"; then
  2430. AC_DEFINE(RADIUS_HEADER_STR, [<radiusclient-ng.h>], [Name of RADIUS library include header])
  2431. else
  2432. AST_EXT_LIB_CHECK([RADIUS], [radcli], [rc_read_config], [radcli/radcli.h])
  2433. if test "x${PBX_RADIUS}" = "x1"; then
  2434. AC_DEFINE(RADIUS_HEADER_STR, [<radcli/radcli.h>], [Name of RADIUS library include header])
  2435. fi
  2436. fi
  2437. fi
  2438. AST_EXT_LIB_CHECK([CODEC2], [codec2], [codec2_create], [codec2/codec2.h])
  2439. AST_EXT_LIB_CHECK([COROSYNC], [cpg], [cpg_join], [corosync/cpg.h], [-lcpg -lcfg])
  2440. AST_EXT_LIB_CHECK([COROSYNC_CFG_STATE_TRACK], [cfg], [corosync_cfg_state_track], [corosync/cfg.h], [-lcfg])
  2441. AST_EXT_LIB_CHECK([SPEEX], [speex], [speex_encode], [speex/speex.h], [-lm])
  2442. # See if the main speex library contains the preprocess functions
  2443. AST_EXT_LIB_CHECK([SPEEX_PREPROCESS], [speex], [speex_preprocess_ctl], [speex/speex.h], [-lm])
  2444. if test "${PBX_SPEEX_PREPROCESS}" = 1; then
  2445. PBX_SPEEX_PREPROCESS=1
  2446. fi
  2447. AST_EXT_LIB_CHECK([SPEEXDSP], [speexdsp], [speex_preprocess_ctl], [speex/speex.h], [-lm])
  2448. if test "${PBX_SPEEXDSP}" = 1; then
  2449. PBX_SPEEX_PREPROCESS=1
  2450. fi
  2451. AC_SUBST(PBX_SPEEX_PREPROCESS)
  2452. AST_EXT_LIB_CHECK([SQLITE3], [sqlite3], [sqlite3_open], [sqlite3.h], [${PTHREAD_LIBS}], [${PTHREAD_CFLAGS}])
  2453. if test "${PBX_SQLITE3}" != 1; then
  2454. AC_MSG_ERROR(*** Asterisk now uses SQLite3 for the internal Asterisk database.)
  2455. AC_MSG_ERROR(*** Please install the SQLite3 development package.)
  2456. exit 1
  2457. fi
  2458. # Find crypt support
  2459. # * -lcrypt on *NIX
  2460. # * in libsystem on OS X
  2461. AST_EXT_LIB_CHECK([LIBCRYPT], [crypt], [crypt], [crypt.h])
  2462. AC_CHECK_FUNC([crypt], [SYSCRYPT=true], [SYSCRYPT=""])
  2463. if test "x$LIBCRYPT_LIB" != "x" ; then
  2464. CRYPT_LIB="$LIBCRYPT_LIB"
  2465. CRYPT_INCLUDE="$LIBCRYPT_INCLUDE"
  2466. AC_DEFINE([HAVE_CRYPT], [1], [Define to 1 if you have the 'crypt' function.])
  2467. elif test "x$SYSCRYPT" != "x" ; then
  2468. CRYPT_LIB=""
  2469. CRYPT_INCLUDE=""
  2470. AC_DEFINE([HAVE_CRYPT], [1], [Define to 1 if you have the 'crypt' function.])
  2471. fi
  2472. AC_SUBST(CRYPT_LIB)
  2473. AC_SUBST(CRYPT_INCLUDE)
  2474. # Find crypt_r support
  2475. AC_CHECK_LIB([crypt], [crypt_r],
  2476. [AC_DEFINE([HAVE_CRYPT_R], [1], [Define to 1 if you have the 'crypt_r' function.])])
  2477. AST_EXT_LIB_CHECK([SRTP], [srtp2], [srtp_init], [srtp2/srtp.h], [], [], [2])
  2478. AST_EXT_LIB_CHECK_SHARED([SRTP], [srtp2], [srtp_init], [srtp2/srtp.h], [], [], [], [
  2479. AC_MSG_WARN([***])
  2480. AC_MSG_WARN([*** libsrtp2 could not be linked as a shared object.])
  2481. AC_MSG_WARN([*** Try compiling libsrtp2 manually. Configure libsrtp2])
  2482. AC_MSG_WARN([*** with ./configure --prefix=/usr replacing /usr with])
  2483. AC_MSG_WARN([*** the prefix of your choice, and then make with])
  2484. AC_MSG_WARN([*** 'make libsrtp2.so'])
  2485. AC_MSG_WARN([***])
  2486. AC_MSG_WARN([*** After re-installing libsrtp2, re-run the Asterisk])
  2487. AC_MSG_WARN([*** configure script.])
  2488. AC_MSG_WARN([***])
  2489. AC_MSG_WARN([*** If you do not need SRTP support re-run configure])
  2490. AC_MSG_WARN([*** with the --without-srtp option.])
  2491. exit 1
  2492. ])
  2493. if test "x$PBX_SRTP" = x1;
  2494. then
  2495. AST_EXT_LIB_CHECK([SRTP_256], [srtp2], [srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80])
  2496. AST_EXT_LIB_CHECK([SRTP_192], [srtp2], [srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80])
  2497. AST_EXT_LIB_CHECK([SRTP_GCM], [srtp2], [srtp_crypto_policy_set_aes_gcm_128_8_auth])
  2498. AST_EXT_LIB_CHECK([SRTP_SHUTDOWN], [srtp2], [srtp_shutdown], [srtp2/srtp.h])
  2499. AST_EXT_LIB_CHECK([SRTP_GET_VERSION], [srtp2], [srtp_get_version_string], [srtp2/srtp.h])
  2500. # libsrtp2 removed support for PRNG, so we require OpenSSL
  2501. if test "x$PBX_OPENSSL" != x1;
  2502. then
  2503. AC_MSG_WARN([***])
  2504. AC_MSG_WARN([*** OpenSSL required when using libsrtp2, checking for libsrtp instead.])
  2505. AC_MSG_WARN([***])
  2506. PBX_SRTP=0
  2507. fi
  2508. fi
  2509. if test "x$PBX_SRTP" != x1;
  2510. then
  2511. AST_EXT_LIB_CHECK([SRTP], [srtp], [srtp_init], [srtp/srtp.h], [], [], [1])
  2512. AST_EXT_LIB_CHECK_SHARED([SRTP], [srtp], [srtp_init], [srtp/srtp.h], [], [], [], [
  2513. AC_MSG_WARN([***])
  2514. AC_MSG_WARN([*** libsrtp could not be linked as a shared object.])
  2515. AC_MSG_WARN([*** Try compiling libsrtp manually. Configure libsrtp])
  2516. AC_MSG_WARN([*** with ./configure CFLAGS=-fPIC --prefix=/usr])
  2517. AC_MSG_WARN([*** replacing /usr with the prefix of your choice.])
  2518. AC_MSG_WARN([*** After re-installing libsrtp, re-run the Asterisk])
  2519. AC_MSG_WARN([*** configure script.])
  2520. AC_MSG_WARN([***])
  2521. AC_MSG_WARN([*** If you do not need SRTP support re-run configure])
  2522. AC_MSG_WARN([*** with the --without-srtp option.])
  2523. exit 1
  2524. ])
  2525. if test "x$PBX_SRTP" = x1;
  2526. then
  2527. AST_EXT_LIB_CHECK([SRTP_256], [srtp], [crypto_policy_set_aes_cm_256_hmac_sha1_80])
  2528. AST_EXT_LIB_CHECK([SRTP_192], [srtp], [crypto_policy_set_aes_cm_192_hmac_sha1_80])
  2529. AST_EXT_LIB_CHECK([SRTP_GCM], [srtp], [crypto_policy_set_aes_gcm_128_8_auth])
  2530. AST_EXT_LIB_CHECK([SRTP_SHUTDOWN], [srtp], [srtp_shutdown], [srtp/srtp.h])
  2531. AST_EXT_LIB_CHECK([SRTP_GET_VERSION], [srtp], [srtp_get_version_string], [srtp/srtp.h])
  2532. fi
  2533. fi
  2534. for ver in 3.0 2.6 2.4 2.2 2.0; do
  2535. AST_PKG_CONFIG_CHECK([GMIME], gmime-$ver)
  2536. if test "$PBX_GMIME" = 1; then
  2537. break;
  2538. fi
  2539. done
  2540. AST_EXT_LIB_CHECK([HOARD], [hoard], [malloc], [])
  2541. AST_EXT_LIB_CHECK([FREETDS], [sybdb], [dbinit], [sybdb.h])
  2542. AC_CHECK_LIB([tonezone], [tone_zone_find_by_num], tonezone_does_not_need_lm=yes, tonezone_does_not_need_lm=no)
  2543. if test "${tonezone_does_not_need_lm}" = "no" ; then
  2544. tonezone_extra="-lm"
  2545. fi
  2546. AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [dahdi/tonezone.h], [${tonezone_extra} ${DAHDI_INCLUDE}])
  2547. AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc -lvorbisfile])
  2548. AST_C_DECLARE_CHECK([VORBIS_OPEN_CALLBACKS], [OV_CALLBACKS_NOCLOSE], [vorbis/vorbisfile.h])
  2549. AST_EXT_LIB_CHECK([ZLIB], [z], [compress], [zlib.h])
  2550. if test "x${PBX_UNIXODBC}" = "x1" -o "x${PBX_IODBC}" = "x1"; then
  2551. # Does ODBC support wide characters?
  2552. AC_MSG_CHECKING(whether ODBC has support for Unicode types)
  2553. AC_LINK_IFELSE(
  2554. [AC_LANG_PROGRAM(
  2555. [#include <sql.h>
  2556. #include <sqlext.h>],
  2557. [int foo = SQL_WCHAR])],
  2558. AC_MSG_RESULT(yes)
  2559. AC_DEFINE([HAVE_ODBC_WCHAR], [1], [Define to 1 if your ODBC library has wide (Unicode) types.]),
  2560. AC_MSG_RESULT(no)
  2561. )
  2562. fi
  2563. AC_CHECK_HEADER([linux/compiler.h],
  2564. [AC_DEFINE_UNQUOTED([HAVE_LINUX_COMPILER_H], 1, [Define to 1 if your system has linux/compiler.h.])])
  2565. AST_EXT_TOOL_CHECK([SDL], [sdl-config])
  2566. AST_EXT_LIB_CHECK([SDL_IMAGE], [SDL_image], [IMG_Load], [SDL_image.h], [${SDL_LIB}], [${SDL_INCLUDE}])
  2567. AST_EXT_LIB_CHECK([FFMPEG], [avcodec], [sws_getContext], [ffmpeg/avcodec.h], [${PTHREAD_LIBS} -lz -lm], [${PTHREAD_CFLAGS}])
  2568. # possible places for video4linux version 1
  2569. AC_CHECK_HEADER([linux/videodev.h],
  2570. [AC_DEFINE_UNQUOTED([HAVE_VIDEODEV_H], 1, [Define to 1 if your system has linux/videodev.h.])])
  2571. # possible places for X11
  2572. AST_EXT_LIB_CHECK([X11], [X11], [XOpenDisplay], [X11/Xlib.h],,, [standard_path])
  2573. AST_EXT_LIB_CHECK([X11], [X11], [XOpenDisplay], [X11/Xlib.h],, [-I/usr/X11R6/include], [X11R6])
  2574. PBX_LAUNCHD=0
  2575. if test "${cross_compiling}" = "no";
  2576. then
  2577. AC_CHECK_FILE(/sbin/launchd,
  2578. [PBX_LAUNCHD=1]
  2579. AC_DEFINE([HAVE_SBIN_LAUNCHD], 1, [Define to 1 if your system has /sbin/launchd.]))
  2580. fi
  2581. AC_SUBST(PBX_LAUNCHD)
  2582. AST_PKG_CONFIG_CHECK([GTK2], [gtk+-2.0])
  2583. # build a GENERIC_ODBC result based on the presence of either UnixODBC (preferred)
  2584. # or iODBC
  2585. PBX_GENERIC_ODBC=0
  2586. if test "${PBX_UNIXODBC}" = 1; then
  2587. PBX_GENERIC_ODBC=1
  2588. GENERIC_ODBC_LIB="${UNIXODBC_LIB}"
  2589. GENERIC_ODBC_INCLUDE="${UNIXODBC_INCLUDE}"
  2590. elif test "${PBX_IODBC}" = 1; then
  2591. PBX_GENERIC_ODBC=1
  2592. GENERIC_ODBC_LIB="${IODBC_LIB}"
  2593. GENERIC_ODBC_INCLUDE="${IODBC_INCLUDE}"
  2594. fi
  2595. AC_SUBST([GENERIC_ODBC_LIB])
  2596. AC_SUBST([GENERIC_ODBC_INCLUDE])
  2597. AC_SUBST([PBX_GENERIC_ODBC])
  2598. AC_SUBST([PBX_SYSTEMD])
  2599. AC_SUBST([SYSTEMD_LIB])
  2600. AC_SUBST([SYSTEMD_INCLUDE])
  2601. AST_PKG_CONFIG_CHECK([SYSTEMD], [libsystemd])
  2602. PBX_SYSLOG=0
  2603. if test "${ac_cv_header_syslog_h}" = "yes"; then
  2604. # syslog facilities
  2605. AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_AUTH], [LOG_AUTH], [syslog.h])
  2606. AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_AUTHPRIV], [LOG_AUTHPRIV], [syslog.h])
  2607. AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_CRON], [LOG_CRON], [syslog.h])
  2608. AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_DAEMON], [LOG_DAEMON], [syslog.h])
  2609. AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_FTP], [LOG_FTP], [syslog.h])
  2610. AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_KERN], [LOG_KERN], [syslog.h])
  2611. AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_LPR], [LOG_LPR], [syslog.h])
  2612. AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_MAIL], [LOG_MAIL], [syslog.h])
  2613. AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_NEWS], [LOG_NEWS], [syslog.h])
  2614. AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_SYSLOG], [LOG_SYSLOG], [syslog.h])
  2615. AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_UUCP], [LOG_UUCP], [syslog.h])
  2616. PBX_SYSLOG=1
  2617. fi
  2618. AC_SUBST([PBX_SYSLOG])
  2619. if test -f makeopts; then
  2620. ${ac_cv_path_EGREP} 'CURSES|GTK2|OSARCH|NEWT' makeopts > makeopts.acbak
  2621. else
  2622. touch makeopts.acbak
  2623. fi
  2624. # conf_bridge (binaural rendering): check if HRIRs are available
  2625. # this check does not work when cross-compiling
  2626. if test "${cross_compiling}" = "no"; then
  2627. AC_CHECK_FILES([bridges/bridge_softmix/include/hrirs.h])
  2628. fi
  2629. AC_CONFIG_FILES([build_tools/menuselect-deps makeopts])
  2630. AST_CHECK_MANDATORY
  2631. if test -f build_tools/menuselect-deps; then
  2632. # extract old values of all PBX_ variables from menuselect-deps
  2633. # and preserve them so that menuselect can determine whether
  2634. # any previously-met dependencies are no longer met and warn
  2635. # the user appropriately
  2636. while IFS="=:" read var val old_val; do
  2637. eval "PBX_${var}=\${PBX_${var}}:${val}"
  2638. done < build_tools/menuselect-deps
  2639. fi
  2640. AC_OUTPUT
  2641. ${ac_cv_path_EGREP} 'CURSES|GTK2|OSARCH|NEWT' makeopts > makeopts.acbak2
  2642. if test "${ac_cv_path_CMP}" = ":"; then
  2643. ( cd "`pwd`/menuselect" && ./configure )
  2644. elif ${ac_cv_path_CMP} -s makeopts.acbak makeopts.acbak2; then : ; else
  2645. ( cd "`pwd`/menuselect" && ./configure )
  2646. fi
  2647. rm makeopts.acbak makeopts.acbak2
  2648. if test "x${silent}" != "xyes" ; then
  2649. echo
  2650. echo " .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=.. "
  2651. echo " .\$7\$7.. .7\$\$7:. "
  2652. echo " .\$\$:. ,\$7.7 "
  2653. echo " .\$7. 7\$\$\$\$ .\$\$77 "
  2654. echo " ..\$\$. \$\$\$\$\$ .\$\$\$7 "
  2655. echo " ..7\$ .?. \$\$\$\$\$ .?. 7\$\$\$."
  2656. echo " \$.\$. .\$\$\$7. \$\$\$\$7 .7\$\$\$. .\$\$\$."
  2657. echo " .777. .\$\$\$\$\$\$77\$\$\$77\$\$\$\$\$7. \$\$\$,"
  2658. echo " \$\$\$~ .7\$\$\$\$\$\$\$\$\$\$\$\$\$7. .\$\$\$."
  2659. echo ".\$\$7 .7\$\$\$\$\$\$\$7: ?\$\$\$."
  2660. echo "\$\$\$ ?7\$\$\$\$\$\$\$\$\$\$I .\$\$\$7 "
  2661. echo "\$\$\$ .7\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ :\$\$\$. "
  2662. echo "\$\$\$ \$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$\$\$\$ .\$\$\$. "
  2663. echo "\$\$\$ \$\$\$ 7\$\$\$7 .\$\$\$ .\$\$\$. "
  2664. echo "\$\$\$\$ \$\$\$\$7 .\$\$\$. "
  2665. echo "7\$\$\$7 7\$\$\$\$ 7\$\$\$ "
  2666. echo " \$\$\$\$\$ \$\$\$ "
  2667. echo " \$\$\$\$7. \$\$ (TM) "
  2668. echo " \$\$\$\$\$\$\$. .7\$\$\$\$\$\$ \$\$ "
  2669. echo " \$\$\$\$\$\$\$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$.\$\$\$\$\$\$ "
  2670. echo " \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$. "
  2671. echo
  2672. fi
  2673. if test "x${AST_IODBC_FOUND}" = "xyes"; then
  2674. echo "WARNING: iodbc libs/headers found!"
  2675. echo
  2676. echo " If you plan to use ODBC functionality, you should consider"
  2677. echo " switching to unixodbc instead."
  2678. echo " See: https://issues.asterisk.org/jira/browse/ASTERISK-22459"
  2679. echo
  2680. fi
  2681. AC_MSG_NOTICE(Package configured for: )
  2682. AC_MSG_NOTICE( OS type : $host_os)
  2683. AC_MSG_NOTICE( Host CPU : $host_cpu)
  2684. AC_MSG_NOTICE( build-cpu:vendor:os: $build_cpu : $build_vendor : $build_os :)
  2685. AC_MSG_NOTICE( host-cpu:vendor:os: $host_cpu : $host_vendor : $host_os :)
  2686. if test "${cross_compiling}" = "yes"; then
  2687. AC_MSG_NOTICE( Cross Compilation = YES)
  2688. fi