configure.ac 74 KB

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