configure.ac 74 KB

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