configure.ac 75 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. # Must change all of the below together
  4. # For a release, set revision for that tagged release as well and uncomment
  5. AC_INIT([freeswitch], [1.6.20], bugs@freeswitch.org)
  6. AC_SUBST(SWITCH_VERSION_MAJOR, [1])
  7. AC_SUBST(SWITCH_VERSION_MINOR, [6])
  8. AC_SUBST(SWITCH_VERSION_MICRO, [20])
  9. AC_SUBST(SWITCH_VERSION_REVISION, [])
  10. AC_SUBST(SWITCH_VERSION_REVISION_HUMAN, [])
  11. AC_CONFIG_FILES([src/include/switch_version.h.in:src/include/switch_version.h.template])
  12. AC_CONFIG_AUX_DIR(build/config)
  13. AM_INIT_AUTOMAKE
  14. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  15. AC_CONFIG_SRCDIR([src/switch.c])
  16. AC_CONFIG_HEADER([src/include/switch_private.h])
  17. AC_CONFIG_HEADER([libs/esl/src/include/esl_config_auto.h])
  18. AC_CONFIG_HEADER([libs/xmlrpc-c/xmlrpc_amconfig.h])
  19. AC_CANONICAL_HOST
  20. # Absolute source/build directory
  21. switch_srcdir=`(cd $srcdir && pwd)`
  22. switch_builddir=`pwd`
  23. AC_SUBST(switch_srcdir)
  24. AC_SUBST(switch_builddir)
  25. #
  26. # --enable-64 has been moved up higher prior to AC_PROG_CC so that we can tuck in the -m64 flag
  27. # so devs on with Solaris wanting to build 64bit can not bother with adding any additional
  28. # flags on the ./configure line. User friendly.
  29. #
  30. # Enable 64 bit build
  31. AC_ARG_ENABLE(64,
  32. [AC_HELP_STRING([--enable-64],[build with 64 bit support])],[enable_64="$enable_64"],[enable_64="no"])
  33. if test "${enable_64}" = "yes"; then
  34. case "$host" in
  35. *-solaris2*)
  36. # All three have to have -m64 for AC_PROG_CC to pick the right libtool
  37. CFLAGS="$CFLAGS -m64"
  38. LDFLAGS="$LDFLAGS -m64"
  39. CXXFLAGS="$CXXFLAGS -m64"
  40. ;;
  41. *)
  42. ;;
  43. esac
  44. fi
  45. # use mtmalloc on Solaris SPARC if available
  46. AS_CASE([$host], [sparc-*-solaris2*], [AC_CHECK_LIB(mtmalloc, malloc)])
  47. # Whether to follow FHS
  48. AC_ARG_ENABLE([fhs],[AS_HELP_STRING([--disable-fhs],
  49. [Do Not follow the FHS when placing files and directories (default only when not specifying prefix])],[enable_fhs="$enableval"],[enable_fhs="yes"])
  50. AC_PREFIX_DEFAULT(/usr/local/freeswitch)
  51. # AC_PREFIX_DEFAULT does not get expanded until too late so we need to do this to use prefix in this script
  52. if test "x$prefix" = "xNONE" ; then
  53. enable_fhs=no
  54. prefix='/usr/local/freeswitch'
  55. fi
  56. if test "x${exec_prefix}" = "xNONE" ; then
  57. exec_prefix="$prefix"
  58. fi
  59. default_scriptdir="$prefix/scripts"
  60. default_grammardir="$prefix/grammar"
  61. default_soundsdir="$prefix/sounds"
  62. default_htdocsdir="$prefix/htdocs"
  63. default_modulesdir="$prefix/mod"
  64. default_dbdir="$prefix/db"
  65. default_storagedir="$prefix/storage"
  66. default_cachedir="$prefix/cache"
  67. default_recordingsdir="$prefix/recordings"
  68. rundir="$prefix/run"
  69. logdir="${prefix}/log"
  70. confdir="$prefix/conf"
  71. default_certsdir="$prefix/certs"
  72. default_fontsdir="$prefix/fonts"
  73. default_imagesdir="$prefix/images"
  74. if test "${enable_fhs}" = "yes"; then
  75. eval full_datadir="${datadir}/freeswitch"
  76. eval datadir=$full_datadir
  77. eval full_localstatedir="${localstatedir}"
  78. eval localstatedir=$full_localstatedir
  79. eval libdir=$libdir
  80. default_cachedir="${localstatedir}/cache/freeswitch"
  81. rundir="${localstatedir}/run/freeswitch"
  82. logdir="${localstatedir}/log/freeswitch"
  83. localstatedir="${localstatedir}/lib/freeswitch"
  84. default_scriptdir="${datadir}/scripts"
  85. default_grammardir="${datadir}/grammar"
  86. default_soundsdir="${datadir}/sounds"
  87. default_htdocsdir="${datadir}/htdocs"
  88. default_fontsdir="${datadir}/fonts"
  89. default_modulesdir="${libdir}/freeswitch/mod"
  90. default_dbdir="${localstatedir}/db"
  91. default_storagedir="${localstatedir}/storage"
  92. default_recordingsdir="${localstatedir}/recordings"
  93. default_imagesdir="${localstatedir}/images"
  94. eval confdir="${sysconfdir}/freeswitch"
  95. eval default_certsdir="${confdir}/tls"
  96. else
  97. if test "$datadir" = "\${datarootdir}" ; then
  98. datadir="${prefix}"
  99. fi
  100. if test "$localstatedir" = "\${prefix}/var" ; then
  101. localstatedir="${prefix}"
  102. fi
  103. fi
  104. if test "$includedir" = "\${prefix}/include" ; then
  105. includedir="${prefix}/include/freeswitch"
  106. fi
  107. default_pkgconfigdir="$libdir/pkgconfig"
  108. default_runtimedir="$rundir"
  109. default_logfiledir="$logdir"
  110. AC_SUBST(libdir)
  111. # Where to install the modules
  112. AC_ARG_WITH([modinstdir],
  113. [AS_HELP_STRING([--with-modinstdir=DIR], [Install modules into this location (default: $prefix/mod)])], [modulesdir="$withval"], [modulesdir="${default_modulesdir}"])
  114. eval modulesdir="${modulesdir}"
  115. AC_SUBST(modulesdir)
  116. AC_DEFINE_UNQUOTED([SWITCH_MOD_DIR],"${modulesdir}",[where to install the modules to])
  117. # Where to put pidfile
  118. AC_ARG_WITH([rundir],
  119. [AS_HELP_STRING([--with-rundir=DIR], [Put pidfile into this location (default: $prefix/run)])], [runtimedir="$withval"], [runtimedir="${default_runtimedir}"])
  120. AC_SUBST(runtimedir)
  121. AC_DEFINE_UNQUOTED([SWITCH_RUN_DIR],"${runtimedir}",[where to put pidfile to])
  122. AC_ARG_WITH([logfiledir],
  123. [AS_HELP_STRING([--with-logfiledir=DIR], [Put logfiles into this location (default: $localstatedir/log)])], [logfiledir="$withval"], [logfiledir="${default_logfiledir}"])
  124. AC_SUBST(logfiledir)
  125. AC_DEFINE_UNQUOTED([SWITCH_LOG_DIR],"${logfiledir}",[where to put log files])
  126. AC_ARG_WITH([dbdir],
  127. [AS_HELP_STRING([--with-dbdir=DIR], [Put database files into this location (default: $prefix/db)])], [dbdir="$withval"], [dbdir="${default_dbdir}"])
  128. AC_SUBST(dbdir)
  129. AC_DEFINE_UNQUOTED([SWITCH_DB_DIR],"${dbdir}",[where to put db files])
  130. AC_ARG_WITH([htdocsdir],
  131. [AS_HELP_STRING([--with-htdocsdir=DIR], [Put html files into this location (default: $prefix/htdocs)])], [htdocsdir="$withval"], [htdocsdir="${default_htdocsdir}"])
  132. AC_SUBST(htdocsdir)
  133. AC_DEFINE_UNQUOTED([SWITCH_HTDOCS_DIR],"${htdocsdir}",[where to put htdocs files])
  134. AC_ARG_WITH([fontsdir],
  135. [AS_HELP_STRING([--with-fontsdir=DIR], [Put font files into this location (default: $prefix/fonts)])], [fontsdir="$withval"], [fontsdir="${default_fontsdir}"])
  136. AC_SUBST(fontsdir)
  137. AC_DEFINE_UNQUOTED([SWITCH_FONTS_DIR],"${fontsdir}",[where to put font files])
  138. AC_ARG_WITH([soundsdir],
  139. [AS_HELP_STRING([--with-soundsdir=DIR], [Put sound files into this location (default: $prefix/sounds)])], [soundsdir="$withval"], [soundsdir="${default_soundsdir}"])
  140. AC_SUBST(soundsdir)
  141. AC_DEFINE_UNQUOTED([SWITCH_SOUNDS_DIR],"${soundsdir}",[where to put sounds files])
  142. AC_ARG_WITH([grammardir],
  143. [AS_HELP_STRING([--with-grammardir=DIR], [Put grammar files into this location (default: $prefix/grammar)])], [grammardir="$withval"], [grammardir="${default_grammardir}"])
  144. AC_SUBST(grammardir)
  145. AC_DEFINE_UNQUOTED([SWITCH_GRAMMAR_DIR],"${grammardir}",[where to put grammar files])
  146. AC_ARG_WITH([certsdir],
  147. [AS_HELP_STRING([--with-certsdir=DIR], [Put certs files into this location (default: $prefix/certs)])], [certsdir="$withval"], [certsdir="${default_certsdir}"])
  148. AC_SUBST(certsdir)
  149. AC_DEFINE_UNQUOTED([SWITCH_CERTS_DIR],"${certsdir}",[where to put certs files])
  150. AC_ARG_WITH([scriptdir],
  151. [AS_HELP_STRING([--with-scriptdir=DIR], [Put script files into this location (default: $prefix/scripts)])], [scriptdir="$withval"], [scriptdir="${default_scriptdir}"])
  152. AC_SUBST(scriptdir)
  153. AC_DEFINE_UNQUOTED([SWITCH_SCRIPT_DIR],"${scriptdir}",[where to put script files])
  154. AC_ARG_WITH([recordingsdir],
  155. [AS_HELP_STRING([--with-recordingsdir=DIR], [Put recordings files into this location (default: $prefix/recordings)])], [recordingsdir="$withval"], [recordingsdir="${default_recordingsdir}"])
  156. AC_SUBST(recordingsdir)
  157. AC_DEFINE_UNQUOTED([SWITCH_RECORDINGS_DIR],"${recordingsdir}",[where to put recording files])
  158. AC_ARG_WITH([imagesdir],
  159. [AS_HELP_STRING([--with-imagesdir=DIR], [Put images files into this location (default: $prefix/images)])], [imagesdir="$withval"], [imagesdir="${default_imagesdir}"])
  160. AC_SUBST(imagesdir)
  161. AC_DEFINE_UNQUOTED([SWITCH_IMAGES_DIR],"${imagesdir}",[where to put image files])
  162. AC_ARG_WITH([storagedir],
  163. [AS_HELP_STRING([--with-storagedir=DIR], [Put storage files into this location (default: $prefix/storage)])], [storagedir="$withval"], [storagedir="${default_storagedir}"])
  164. AC_SUBST(storagedir)
  165. AC_DEFINE_UNQUOTED([SWITCH_STORAGE_DIR],"${storagedir}",[where to put storage files])
  166. AC_ARG_WITH([cachedir],
  167. [AS_HELP_STRING([--with-cachedir=DIR], [Put cache files into this location (default: $prefix/cache)])], [cachedir="$withval"], [cachedir="${default_cachedir}"])
  168. AC_SUBST(cachedir)
  169. AC_DEFINE_UNQUOTED([SWITCH_CACHE_DIR],"${cachedir}",[where to put cache files])
  170. AC_SUBST(confdir)
  171. AC_DEFINE_UNQUOTED([SWITCH_CONF_DIR],"${confdir}",[directory for configuration files])
  172. AC_SUBST(datadir)
  173. AC_DEFINE_UNQUOTED([SWITCH_DATA_DIR],"${datadir}",[directory for data files])
  174. AC_SUBST(localstatedir)
  175. AC_DEFINE_UNQUOTED([SWITCH_LOCALSTATE_DIR],"${localstatedir}",[directory for local state files])
  176. AC_SUBST(bindir)
  177. AC_SUBST(includedir)
  178. AC_ARG_WITH([pkgconfigdir],
  179. [AS_HELP_STRING([--with-pkgconfigdir=DIR], [Installation directory for pkgconfig file (default: ${libdir}/pkgconfig)])],
  180. [case "${withval}" in
  181. yes|no) AC_MSG_ERROR([Invalid value ${withval} for option --with-pkgconfigdir]) ;;
  182. *) pkgconfigdir="${withval}" ;;
  183. esac
  184. ],
  185. [pkgconfigdir="${default_pkgconfigdir}"]
  186. )
  187. AC_SUBST([pkgconfigdir])
  188. #Set default language
  189. AC_LANG_C
  190. # Checks for programs.
  191. AC_PROG_CC
  192. AC_PROG_CXX
  193. #check if the g++ compiler works
  194. AC_CACHE_CHECK([whether the C++ compiler works], [ac_cv_sys_cxx_works], [
  195. AC_LANG_PUSH([C++])
  196. AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main() { }])], [ac_cv_sys_cxx_works=yes],
  197. [ac_cv_sys_cxx_works=no])
  198. AC_LANG_POP([C++])
  199. ])
  200. [ if [ "x$ac_cv_sys_cxx_works" = "xno" ]; then ]
  201. AC_MSG_FAILURE([The C++ compiler does not work. Please (re)install the C++ compiler])
  202. [ fi ]
  203. AC_PROG_AWK
  204. AC_PROG_MAKE_SET
  205. AC_PROG_INSTALL
  206. #override some default libtool behavior and invoke AC_PROG_LIBTOOL (see http://lists.gnu.org/archive/html/libtool/2007-03/msg00000.html)
  207. m4_defun([_LT_AC_LANG_F77_CONFIG], [:])
  208. m4_defun([_LT_AC_LANG_GCJ_CONFIG], [:])
  209. m4_defun([_LT_AC_LANG_RC_CONFIG], [:])
  210. AM_PROG_CC_C_O
  211. AC_PROG_LIBTOOL
  212. #Check for compiler vendor
  213. AX_COMPILER_VENDOR
  214. # Set CC_FOR_BUILD
  215. if test "x${cross_compiling}" = "xyes"; then
  216. CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
  217. case "$host" in
  218. arm*-linux-gnueabi*|arm*-*-linux-gnueabi*)
  219. # spandsp modem
  220. ac_cv_file__dev_ptmx=yes
  221. # libjs
  222. export ac_cv_va_copy=yes
  223. # srtp
  224. export ac_cv_file__dev_urandom=yes
  225. # rpl_malloc
  226. export ac_cv_func_realloc_0_nonnull=yes
  227. export ac_cv_func_malloc_0_nonnull=yes
  228. # apr
  229. export ac_cv_func_setpgrp_void=yes
  230. export ac_cv_file__dev_zero=yes
  231. export apr_cv_tcp_nodelay_with_cork=yes
  232. export ac_cv_file_dbd_apr_dbd_mysql_c=no
  233. export ac_cv_sizeof_ssize_t=4
  234. export apr_cv_mutex_recursive=yes
  235. export ac_cv_func_pthread_rwlock_init=yes
  236. export apr_cv_type_rwlock_t=yes
  237. export apr_cv_process_shared_works=yes
  238. export apr_cv_mutex_robust_shared=yes
  239. ;;
  240. esac
  241. else
  242. CC_FOR_BUILD='$(CC)'
  243. fi
  244. AC_SUBST(CC_FOR_BUILD)
  245. if test -n "$lt_sysroot" ; then
  246. APR_ADDTO(CFLAGS, --sysroot=$lt_sysroot)
  247. APR_ADDTO(CXXFLAGS, --sysroot=$lt_sysroot)
  248. APR_ADDTO(CPPFLAGS, --sysroot=$lt_sysroot)
  249. APR_ADDTO(LDFLAGS, --sysroot=$lt_sysroot)
  250. PKG_CONFIG_SYSROOT_DIR=$lt_sysroot
  251. fi
  252. # Optimize
  253. AC_ARG_ENABLE(optimization,
  254. [AC_HELP_STRING([--enable-optimization],[Set if you want us to add max optimising compiler flags])],[enable_optimizer="$enableval"],[enable_optimizer="no"])
  255. if test "${enable_optimizer}" = "yes" ; then
  256. AC_DEFINE([OPTIMZER],[],[Enable Optimization.])
  257. AX_CC_MAXOPT
  258. fi
  259. # set defaults for use on all platforms
  260. SWITCH_AM_CFLAGS="-I${switch_srcdir}/src/include -I${switch_builddir}/src/include -I${switch_srcdir}/libs/libteletone/src"
  261. SWITCH_AM_CXXFLAGS="-I${switch_srcdir}/src/include -I${switch_builddir}/src/include -I${switch_srcdir}/libs/libteletone/src"
  262. SWITCH_AM_CPPFLAGS="-I${switch_srcdir}/src/include -I${switch_builddir}/src/include -I${switch_srcdir}/libs/libteletone/src"
  263. SWITCH_AM_LDFLAGS="-lm"
  264. #set SOLINK variable based on compiler and host
  265. if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
  266. SOLINK="-Bdynamic -dy -G"
  267. elif test "x${ax_cv_c_compiler_vendor}" = "xclang" ; then
  268. case "$host" in
  269. *darwin*)
  270. SOLINK="-dynamic -force-flat-namespace"
  271. ;;
  272. *)
  273. SOLINK="-shared -Xlinker -x"
  274. ;;
  275. esac
  276. elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
  277. case "$host" in
  278. # older Xcode test for darwin, Xcode 4/5 use clang above
  279. *darwin*)
  280. SOLINK="-dynamic -bundle -force-flat-namespace"
  281. ;;
  282. *-solaris2*)
  283. SOLINK="-shared -Xlinker"
  284. ;;
  285. *)
  286. SOLINK="-shared -Xlinker -x"
  287. ;;
  288. esac
  289. elif test "x${ax_cv_c_compiler_vendor}" = "xintel" ; then
  290. case "$host" in
  291. *)
  292. SOLINK="-shared -Xlinker -x"
  293. ;;
  294. esac
  295. else
  296. AC_ERROR([Please update configure.in with SOLINK values for your compiler])
  297. fi
  298. ##
  299. # detect libtool major version,
  300. # set libtool library extension based on this
  301. # to work around some brokeness when using 'la' with libtool-1.5
  302. #
  303. AC_MSG_CHECKING([libtool major version])
  304. libtool="${switch_builddir}/libtool"
  305. LIBTOOL_MAJOR_VERSION="`$libtool --version 2>/dev/null| sed -e 's/([[^)]]*)//g;s/^[[^0-9]]*//;s/[[- ]].*//g;q'| awk 'BEGIN { FS = "." } { print $1 }' `"
  306. if test -z "$LIBTOOL_MAJOR_VERSION" ; then
  307. LIBTOOL_MAJOR_VERSION="`sed -n -e '/^VERSION/{s/^.*=\"\{0,1\}\([[0-9]]\{1,\}\)\..*/\1/;p;}' ${switch_srcdir}/build/config/ltmain.sh`"
  308. fi
  309. if test -z "$LIBTOOL_MAJOR_VERSION" ; then
  310. AC_MSG_ERROR([Failed to detect your libtool version, please open a bug report on https://freeswitch.org/jira])
  311. fi
  312. AC_MSG_RESULT([${LIBTOOL_MAJOR_VERSION}])
  313. LIBTOOL_LIB_EXTEN=so
  314. if test "${LIBTOOL_MAJOR_VERSION}" = "2" ; then
  315. LIBTOOL_LIB_EXTEN="la"
  316. fi
  317. AC_MSG_RESULT([using libtool library extension... ${LIBTOOL_LIB_EXTEN}])
  318. if test "$ax_cv_c_compiler_vendor" = "gnu"; then
  319. saved_CFLAGS="$CFLAGS"
  320. AC_CACHE_CHECK([whether compiler supports -Wno-unused-result],
  321. [ac_cv_gcc_supports_w_no_unused_result], [
  322. CFLAGS="$CFLAGS -Wno-unused-result -Wno-error=unused-result"
  323. AC_TRY_COMPILE([],[return 0;],
  324. [ac_cv_gcc_supports_w_no_unused_result=yes],
  325. [ac_cv_gcc_supports_w_no_unused_result=no])])
  326. CFLAGS="$saved_CFLAGS"
  327. AC_MSG_RESULT($ac_cv_gcc_supports_w_no_unused_result)
  328. saved_CFLAGS="$CFLAGS"
  329. AC_CACHE_CHECK([whether compiler supports -Wno-misleading-indentation],
  330. [ac_cv_gcc_supports_w_no_misleading_indentation], [
  331. CFLAGS="$CFLAGS -Wno-misleading-indentation -Wno-error=misleading-indentation"
  332. AC_TRY_COMPILE([],[return 0;],
  333. [ac_cv_gcc_supports_w_no_misleading_indentation=yes],
  334. [ac_cv_gcc_supports_w_no_misleading_indentation=no])])
  335. CFLAGS="$saved_CFLAGS"
  336. AC_MSG_RESULT($ac_cv_gcc_supports_w_no_misleading_indentation)
  337. fi
  338. # tweak compiler specific flags
  339. if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
  340. APR_ADDTO(SWITCH_AM_CFLAGS, -KPIC)
  341. APR_ADDTO(SWITCH_AM_CFLAGS, -DPIC)
  342. APR_ADDTO(SWITCH_AM_CFLAGS, -erroff=E_END_OF_LOOP_CODE_NOT_REACHED)
  343. APR_ADDTO(SWITCH_AM_CFLAGS, -errtags=yes)
  344. APR_ADDTO(SWITCH_AM_CFLAGS, -D__FUNCTION__=__func__ )
  345. APR_ADDTO(SWITCH_AM_CFLAGS, -mt)
  346. APR_ADDTO(SWITCH_AM_CXXFLAGS, -errtags=yes)
  347. APR_ADDTO(SWITCH_AM_CXXFLAGS, -KPIC)
  348. APR_ADDTO(SWITCH_AM_CXXFLAGS, -DPIC)
  349. APR_ADDTO(SWITCH_AM_CXXFLAGS, "-features=extensions")
  350. APR_ADDTO(SWITCH_AM_CXXFLAGS, -D__FUNCTION__=__func__)
  351. APR_ADDTO(SWITCH_AM_CXXFLAGS, -mt)
  352. APR_ADDTO(SWITCH_AM_LDFLAGS, -R${prefix}/lib)
  353. if test "${enable_64}" = "yes"; then
  354. APR_ADDTO(SWITCH_AM_CFLAGS, -m64)
  355. APR_ADDTO(SWITCH_AM_CXXFLAGS, -m64)
  356. APR_ADDTO(SWITCH_AM_LDFLAGS, -m64)
  357. LIBS="$LIBS -m64"
  358. fi
  359. elif test "x${ax_cv_c_compiler_vendor}" = "xclang" ; then
  360. APR_ADDTO(SWITCH_AM_CFLAGS, -fPIC)
  361. APR_ADDTO(SWITCH_AM_CXXFLAGS, -fPIC)
  362. APR_ADDTO(SWITCH_AM_CFLAGS, -Werror)
  363. elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
  364. APR_ADDTO(SWITCH_AM_CFLAGS, -fPIC)
  365. APR_ADDTO(SWITCH_AM_CXXFLAGS, -fPIC)
  366. AC_SUBST([AM_MOD_AVMD_CXXFLAGS], [-std=gnu99]) # FS-8809, needed for MAP_POPULATE
  367. if test "$ac_cv_gcc_supports_w_no_unused_result" = yes; then
  368. APR_ADDTO(SWITCH_AM_CFLAGS, -Werror)
  369. APR_ADDTO(SWITCH_AM_CFLAGS, -Wno-unused-result)
  370. fi
  371. if test "$ac_cv_gcc_supports_w_no_misleading_indentation" = yes; then
  372. APR_ADDTO(SWITCH_AM_CFLAGS, -Wno-misleading-indentation)
  373. fi
  374. if test "${enable_64}" = "yes"; then
  375. case "$host" in
  376. *darwin*)
  377. osxvrm=`sw_vers -productVersion` # Get version.release.modlevel
  378. osxrel=`echo $osxvrm | cut -d. -f2` # Get release only
  379. if test "$osxrel" -ge 4; then # 10.4 and up are x64
  380. APR_ADDTO(CFLAGS, -arch x86_64)
  381. APR_ADDTO(LDFLAGS, -arch x86_64)
  382. APR_ADDTO(CXXFLAGS, -arch x86_64)
  383. fi
  384. ;;
  385. *-solaris2*)
  386. APR_ADDTO(CFLAGS, -m64)
  387. APR_ADDTO(LDFLAGS, -m64)
  388. APR_ADDTO(CXXFLAGS, -m64)
  389. ;;
  390. *)
  391. LIBS="$LIBS -m64"
  392. ;;
  393. esac
  394. fi
  395. fi
  396. # Enable clang address sanitizer bit build
  397. AC_ARG_ENABLE(address_sanitizer,
  398. [AC_HELP_STRING([--enable-address-sanitizer],[build with address sanitizer])],
  399. [enable_address_sanitizer="$enable_address_sanitizer"],
  400. [enable_address_sanitizer="no"])
  401. if test "${enable_address_sanitizer}" = "yes"; then
  402. if test "x${ax_cv_c_compiler_vendor}" = "xclang" ; then
  403. APR_ADDTO(CFLAGS, -fsanitize=address -fno-omit-frame-pointer)
  404. APR_ADDTO(CXXFLAGS, -fsanitize=address -fno-omit-frame-pointer)
  405. APR_ADDTO(LDFLAGS, -fsanitize=address)
  406. fi
  407. fi
  408. case "${ax_cv_c_compiler_vendor}" in
  409. sun)
  410. VISIBILITY_FLAG=-xldscope=hidden
  411. ;;
  412. *)
  413. VISIBILITY_FLAG=-fvisibility=hidden
  414. ;;
  415. esac
  416. AC_SUBST(VISIBILITY_FLAG)
  417. #
  418. # gcc visibility cflag checks
  419. #
  420. AC_ARG_ENABLE([visibility],
  421. [AS_HELP_STRING([--disable-visibility], [Disable or enable API visibility support (default: use if available)])],
  422. [enable_visibility="${enableval}"],
  423. [enable_visibility="detect"]
  424. )
  425. HAVE_VISIBILITY="no"
  426. if test "x${enable_visibility}" != "xno" ; then
  427. case "${ax_cv_c_compiler_vendor}" in
  428. gnu)
  429. save_CFLAGS="${CFLAGS}"
  430. CFLAGS="${CFLAGS} -fvisibility=hidden"
  431. AC_MSG_CHECKING([whether the compiler supports -fvisibility=hidden])
  432. AC_COMPILE_IFELSE(
  433. [AC_LANG_PROGRAM(
  434. [int foo __attribute__ ((visibility("default")));],
  435. [;]
  436. )],
  437. [AC_MSG_RESULT([yes])
  438. APR_ADDTO([SWITCH_AM_CFLAGS], [-fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1])
  439. APR_ADDTO([SWITCH_AM_CXXFLAGS], [-fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1])
  440. HAVE_VISIBILITY="yes"],
  441. [AC_MSG_RESULT([no])]
  442. )
  443. CFLAGS="${save_CFLAGS}"
  444. ;;
  445. sun)
  446. # save_CFLAGS="${CFLAGS}"
  447. # CFLAGS="${CFLAGS} -xldscope=hidden"
  448. # AC_MSG_CHECKING([whether the compiler supports -xldscope=hidden])
  449. # AC_COMPILE_IFELSE(
  450. # [AC_LANG_PROGRAM(
  451. # [int foo __attribute__ ((visibility("default")));],
  452. # [;]
  453. # )],
  454. #
  455. # [AC_MSG_RESULT([yes])
  456. # APR_ADDTO([SWITCH_AM_CFLAGS], [-xldscope=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1])
  457. # APR_ADDTO([SWITCH_AM_CXXFLAGS], [-xldscope=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1])
  458. # HAVE_VISIBILITY="yes"],
  459. #
  460. # [AC_MSG_RESULT([no])]
  461. # )
  462. # CFLAGS="${save_CFLAGS}"
  463. ;;
  464. *)
  465. if test "x${enable_visibility}" = "xyes" ; then
  466. AC_MSG_ERROR([Non-GNU / SUN compilers are currently unsupported])
  467. else
  468. AC_MSG_WARN([Non-GNU / SUN compilers are currently unsupported])
  469. fi
  470. ;;
  471. esac
  472. #
  473. # visibility explicitly requested but not supported by this compiler => error
  474. #
  475. if test "x${enable_visibility}" = "xyes" -a "x${HAVE_VISIBILITY}" = "xno" ; then
  476. AC_MSG_ERROR([API visibility not supported by this compiler])
  477. fi
  478. fi
  479. # Enable debugging (default: on)
  480. # (rename option if the default is changed)
  481. AC_ARG_ENABLE(debug,
  482. [AC_HELP_STRING([--disable-debug],[build without debug information])],[enable_debug="$enableval"],[enable_debug="yes"])
  483. if test "${enable_debug}" = "yes"; then
  484. AC_DEFINE([DEBUG],[],[Enable extra debugging.])
  485. saved_CFLAGS="$CFLAGS"
  486. CFLAGS=
  487. AX_CFLAGS_WARN_ALL_ANSI
  488. SWITCH_ANSI_CFLAGS=$CFLAGS
  489. CFLAGS="$saved_CFLAGS"
  490. if test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
  491. if test "$ac_cv_gcc_supports_w_no_unused_result" = yes; then
  492. APR_ADDTO(SWITCH_AM_CFLAGS, -Wno-unused-result)
  493. fi
  494. APR_ADDTO(SWITCH_AM_CFLAGS, -g -ggdb)
  495. export DEBUG_CFLAGS="-g -ggdb"
  496. fi
  497. fi
  498. AC_ARG_ENABLE(libyuv,
  499. [AC_HELP_STRING([--disable-libyuv],[build without libyuv])],[enable_libyuv="$enableval"],[enable_libyuv="yes"])
  500. AM_CONDITIONAL([ENABLE_LIBYUV],[test "${enable_libyuv}" = "yes"])
  501. AC_ARG_ENABLE(libvpx,
  502. [AC_HELP_STRING([--disable-libvpx],[build without libvpx])],[enable_libvpx="$enableval"],[enable_libvpx="yes"])
  503. AM_CONDITIONAL([ENABLE_LIBVPX],[test "${enable_libvpx}" = "yes"])
  504. AC_ARG_ENABLE(cpp,
  505. [AC_HELP_STRING([--disable-cpp],[build without cpp code])],[enable_cpp="$enableval"],[enable_cpp="yes"])
  506. AM_CONDITIONAL([ENABLE_CPP],[test "${enable_cpp}" = "yes"])
  507. AM_CONDITIONAL([DISABLE_CC],[test "${disable_cc}" = "yes"])
  508. AC_ARG_ENABLE([system-xmlrpc-c],
  509. [AS_HELP_STRING([--enable-system-xmlrpc-c],
  510. [use system lib for xmlrpc-c])],,
  511. [enable_xmlrpcc="no"])
  512. if test "${enable_xmlrpcc}" = "yes" ; then
  513. SYS_XMLRPC_CFLAGS=`xmlrpc-c-config --cflags`
  514. SYS_XMLRPC_LDFLAGS=`xmlrpc-c-config --libs`
  515. fi
  516. AC_SUBST(SYS_XMLRPC_CFLAGS)
  517. AC_SUBST(SYS_XMLRPC_LDFLAGS)
  518. AM_CONDITIONAL([SYSTEM_XMLRPCC],[test "${enable_xmlrpcc}" = "yes"])
  519. for luaversion in lua5.2 lua-5.2 lua52 lua5.1 lua-5.1 lua; do
  520. PKG_CHECK_MODULES([LUA],[${luaversion}],[have_lua=yes],[have_lua=no])
  521. if test ${have_lua} = yes; then
  522. break
  523. fi
  524. done
  525. if test x"${LUA_LIBS}" = x"" ; then
  526. LUA_LIBS="-llua"
  527. fi
  528. #AC_ARG_ENABLE([system-lua],[AS_HELP_STRING([--enable-system-lua],[use system lib for lua])],,[enable_system_lua="no"])
  529. enable_system_lua=yes
  530. AM_CONDITIONAL([SYSTEM_LUA],[test "${enable_system_lua}" = "yes"])
  531. AC_ARG_ENABLE(srtp,
  532. [AC_HELP_STRING([--disable-srtp],[build without srtp support])],[enable_srtp="$enableval"],[enable_srtp="yes"])
  533. AM_CONDITIONAL([ENABLE_SRTP],[test "${enable_srtp}" = "yes"])
  534. have_openal=no
  535. AC_CHECK_LIB(openal, alMidiGainSOFT, [have_openal="yes"])
  536. AM_CONDITIONAL([HAVE_OPENAL],[test "${have_openal}" = "yes"])
  537. AC_ARG_ENABLE(zrtp,
  538. [AS_HELP_STRING([--enable-zrtp], [Compile with zrtp Support])],,[enable_zrtp="no"])
  539. if test "x$enable_zrtp" = "xyes" ; then
  540. LIBS="-lpthread $LIBS"
  541. APR_ADDTO(SWITCH_AM_CFLAGS, -DENABLE_ZRTP)
  542. fi
  543. PA_LIBS=
  544. PKG_CHECK_MODULES(JACK, jack, have_jack=yes, have_jack=no)
  545. if test "x$have_jack" = "xyes" ; then
  546. PA_LIBS+=$JACK_LIBS
  547. fi
  548. AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no)
  549. if test "x$have_alsa" = "xyes" ; then
  550. PA_LIBS+=-lasound
  551. fi
  552. AC_SUBST(PA_LIBS)
  553. AM_CONDITIONAL([ENABLE_ZRTP],[test "x$enable_zrtp" != "xno"])
  554. AM_CONDITIONAL([WANT_DEBUG],[test "${enable_debug}" = "yes"])
  555. AC_ARG_ENABLE(core-odbc-support,
  556. [AS_HELP_STRING([--enable-core-odbc-support], [Compile with ODBC Support (default is optional)])],,[enable_core_odbc_support="optional"])
  557. if ! test "$enable_core_odbc_support" = "no"; then
  558. AX_LIB_ODBC
  559. if test "$ac_cv_found_odbc" = "yes" ; then
  560. enable_core_odbc_support="yes"
  561. elif test "$enable_core_odbc_support" = "yes"; then
  562. AC_MSG_ERROR([no usable libodbc; please install unixodbc devel package or equivalent])
  563. else
  564. enable_core_odbc_support="no"
  565. fi
  566. fi
  567. CHECK_LIBUUID
  568. SWITCH_AM_LDFLAGS="$LIBUUID_LIBS $SWITCH_AM_LDFLAGS"
  569. SWITCH_AM_CFLAGS="$LIBUUID_CFLAGS $SWITCH_AM_CFLAGS"
  570. AC_ARG_ENABLE(core-pgsql-support,
  571. [AS_HELP_STRING([--enable-core-pgsql-support], [Compile with PGSQL Support])],,[enable_core_pgsql_support="no"])
  572. AC_ARG_ENABLE(core-pgsql-pkgconfig,
  573. [AS_HELP_STRING([--disable-core-pgsql-pkgconfig], [Use pg_config to get PGQSL build options])],[enable_core_pgsql_pkgconfig="$enableval"],[enable_core_pgsql_pkgconfig="yes"])
  574. if test x"$enable_core_pgsql_support" = x"yes" ; then
  575. AC_PATH_PROG([PG_CONFIG], [pg_config], [no])
  576. AC_PATH_PROG([PKG_CONFIG], [pkg-config], [no])
  577. if test "$PKG_CONFIG" = "no" \
  578. || test x"$enable_core_pgsql_pkgconfig" = x"no" \
  579. || ! pkg-config libpq; then
  580. if test "$PG_CONFIG" != "no"; then
  581. AC_MSG_CHECKING([for PostgreSQL libraries via pg_config])
  582. POSTGRESQL_CFLAGS="-I`$PG_CONFIG --includedir`"
  583. POSTGRESQL_LIBDIR="-L`$PG_CONFIG --libdir`"
  584. POSTGRESQL_LDFLAGS="-L`$PG_CONFIG --libdir` -lpq"
  585. POSTGRESQL_VERSION=`$PG_CONFIG --version | awk '{ print $NF }'`
  586. POSTGRESQL_MAJOR_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $1 }'`
  587. POSTGRESQL_MINOR_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $2 }'`
  588. POSTGRESQL_PATCH_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $3 }'`
  589. else
  590. AC_MSG_ERROR([no usable pkg-config or pg_config; please install libpq devel package or equivalent])
  591. fi
  592. else
  593. AC_MSG_CHECKING([for PostgreSQL libraries via pkg_config])
  594. POSTGRESQL_CFLAGS="`$PKG_CONFIG --cflags libpq`"
  595. POSTGRESQL_LIBDIR="`$PKG_CONFIG libpq --libs-only-L`"
  596. POSTGRESQL_LDFLAGS="`$PKG_CONFIG --libs libpq`"
  597. POSTGRESQL_VERSION="`$PKG_CONFIG --modversion libpq`"
  598. POSTGRESQL_MAJOR_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f1 | sed 's/^\([[0-9]]*\)[[^0-9]].*/\1/'`"
  599. POSTGRESQL_MINOR_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f2 | sed 's/^\([[0-9]]*\)[[^0-9]].*/\1/'`"
  600. POSTGRESQL_PATCH_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f3 | sed 's/^\([[0-9]]*\)[[^0-9]].*/\1/'`"
  601. test -n "$POSTGRESQL_PATCH_VERSION" || POSTGRESQL_PATCH_VERSION=0
  602. fi
  603. save_LIBS="$LIBS"
  604. LIBS="$POSTGRESQL_LIBDIR $LIBS"
  605. AC_MSG_RESULT([$POSTGRESQL_LIBDIR])
  606. AC_DEFINE([SWITCH_HAVE_PGSQL], [1], [Define to 1 if PostgreSQL libraries are available])
  607. AM_CONDITIONAL([HAVE_PGSQL],[true])
  608. AC_DEFINE_UNQUOTED([POSTGRESQL_VERSION], "${POSTGRESQL_VERSION}", [Specifies the version of PostgreSQL we are linking against])
  609. AC_DEFINE_UNQUOTED([POSTGRESQL_MAJOR_VERSION], ${POSTGRESQL_MAJOR_VERSION}, [Specifies the version of PostgreSQL we are linking against])
  610. AC_DEFINE_UNQUOTED([POSTGRESQL_MINOR_VERSION], ${POSTGRESQL_MINOR_VERSION}, [Specifies the version of PostgreSQL we are linking against])
  611. AC_DEFINE_UNQUOTED([POSTGRESQL_PATCH_VERSION], ${POSTGRESQL_PATCH_VERSION}, [Specifies the version of PostgreSQL we are linking against])
  612. AC_CHECK_LIB([pq], [PQgetvalue],, AC_MSG_ERROR([no usable libpq; please install PostgreSQL devel package or equivalent]))
  613. AC_MSG_RESULT([yes])
  614. SWITCH_AM_CXXFLAGS="$POSTGRESQL_CFLAGS $SWITCH_AM_CXXFLAGS"
  615. SWITCH_AM_LDFLAGS="$POSTGRESQL_LDFLAGS $SWITCH_AM_LDFLAGS"
  616. LIBS="$save_LIBS"
  617. else
  618. AM_CONDITIONAL([HAVE_PGSQL],[false])
  619. fi
  620. AC_ARG_ENABLE(deprecated-core-db-events,
  621. [AS_HELP_STRING([--enable-deprecated-core-db-events], [Keep deprecated core db events])],,[enable_deprecated_core_db_events="no"])
  622. if test x"$enable_deprecated_core_db_events" = x"yes" ; then
  623. AC_DEFINE([SWITCH_DEPRECATED_CORE_DB], [1], [Define to 1 to enable deprecated core db events])
  624. fi
  625. ESL_LDFLAGS=
  626. PLATFORM_CORE_LDFLAGS=
  627. PLATFORM_CORE_LIBS=
  628. path_remove () {
  629. echo "$1" | tr ':' '\n' | grep -Fxv "$2" | tr '\n' ':' | sed 's/:$//'
  630. }
  631. path_push_unique () {
  632. x="$(eval echo \$$1)"
  633. x="$(path_remove "$x" "$2")"
  634. if test -z "$x"; then
  635. eval export $1="$2"
  636. else
  637. eval export $1="$2:$x"
  638. fi
  639. }
  640. # tweak platform specific flags
  641. case "$host" in
  642. *darwin*)
  643. # Common Apple Darwin settings
  644. APR_ADDTO(SWITCH_AM_CFLAGS, -DMACOSX)
  645. APR_REMOVEFROM(SWITCH_AM_CFLAGS, -fPIC)
  646. APR_ADDTO(CPPFLAGS, -I/usr/local/opt/openssl/include)
  647. APR_ADDTO(LDFLAGS, -L/usr/local/opt/openssl/lib)
  648. if test "x$enable_core_odbc_support" != "xno"; then
  649. APR_ADDTO([PLATFORM_CORE_LDFLAGS], [--framework CoreFoundation])
  650. fi
  651. APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl])
  652. # Get OSX and clang version
  653. osxvrm=`sw_vers -productVersion` # Get version.release.modlevel
  654. osxrel=`echo $osxvrm | cut -d. -f2` # Get release only
  655. clangvers="`clang -v 2>&1 >/dev/null | grep version | sed -e 's/.*version \([[0-9]]*\).*$/\1/'`"
  656. if test "$clangvers" -ge 6; then # Xcode 6 drops std lib search, add it to clang
  657. APR_ADDTO(LDFLAGS, -L/usr/local/lib)
  658. APR_ADDTO(CPPFLAGS, -I/usr/local/include)
  659. fi
  660. if test "$clangvers" -ge 4; then # Xcode 4 / 10.7 and up
  661. APR_ADDTO(CFLAGS, -Wno-deprecated-declarations)
  662. fi
  663. if test "$osxrel" -ge 6; then # 10.6 and up
  664. APR_ADDTO(CFLAGS, -pipe -no-cpp-precomp)
  665. APR_ADDTO(LDFLAGS, -pipe -bind_at_load)
  666. APR_ADDTO(CXXFLAGS, -pipe)
  667. fi
  668. ;;
  669. *-solaris2*)
  670. if test "${enable_64}" = "yes"; then
  671. APR_ADDTO(CPPFLAGS, [-I/opt/64/include])
  672. APR_ADDTO(LDFLAGS, [-L/opt/64/lib -Wl,-rpath,/opt/64/lib])
  673. APR_ADDTO(SWITCH_AM_CFLAGS, [-I/opt/64/include])
  674. APR_ADDTO(SWITCH_AM_LDFLAGS, [-L/opt/64/lib -Wl,-rpath,/opt/64/lib])
  675. else
  676. APR_ADDTO(CPPFLAGS, [-I/opt/include])
  677. APR_ADDTO(LDFLAGS, [-L/opt/lib -Wl,-rpath,/opt/lib])
  678. APR_ADDTO(SWITCH_AM_CFLAGS, [-I/opt/include])
  679. APR_ADDTO(SWITCH_AM_LDFLAGS, [-L/opt/lib -Wl,-rpath,/opt/lib])
  680. fi
  681. APR_ADDTO(SWITCH_AM_CFLAGS, -DPATH_MAX=2048 -D__EXTENSIONS__)
  682. APR_ADDTO(SWITCH_AM_LDFLAGS, -lsendfile -lresolv -lsocket -lnsl -luuid)
  683. APR_ADDTO(ESL_LDFLAGS, -lnsl -lsocket)
  684. APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl -lcrypt -lrt -lsendfile -lresolv -lsocket -lnsl -luuid])
  685. ;;
  686. *dragonfly*)
  687. APR_ADDTO(CPPFLAGS, -I/usr/local/include)
  688. APR_ADDTO(LDFLAGS, -L/usr/local/lib)
  689. APR_ADDTO(SWITCH_AM_CFLAGS, -I/usr/local/include)
  690. ;;
  691. *openbsd*)
  692. APR_ADDTO(CPPFLAGS, -I/usr/local/include)
  693. APR_ADDTO(LDFLAGS, -L/usr/local/lib -ltermcap)
  694. APR_ADDTO(SWITCH_AM_CFLAGS, -I/usr/local/include)
  695. ;;
  696. *netbsd*)
  697. APR_ADDTO(CPPFLAGS, -I/usr/pkg/include)
  698. APR_ADDTO(LDFLAGS, [-L/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib])
  699. APR_ADDTO(SWITCH_AM_CFLAGS, -I/usr/pkg/include)
  700. ;;
  701. *bsd*)
  702. APR_ADDTO(CPPFLAGS, -I/usr/local/include)
  703. APR_ADDTO(LDFLAGS, -L/usr/local/lib)
  704. APR_ADDTO(SWITCH_AM_CFLAGS, -I/usr/local/include)
  705. APR_ADDTO([PLATFORM_CORE_LIBS], [-lcrypt -lrt])
  706. ;;
  707. *linux*)
  708. APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl -lcrypt -lrt])
  709. ;;
  710. esac
  711. APR_REMOVEFROM(SWITCH_AM_CXXFLAGS, -std=c99)
  712. # check for usable system MD5 library
  713. AS_CASE([$host],
  714. [*-solaris2*], [AC_CHECK_LIB(md5, MD5Init)],
  715. [*-freebsd*], [AC_CHECK_LIB(md, MD5Init)],
  716. [*-openbsd*|*-netbsd*], [AC_CHECK_FUNCS([MD5Init])])
  717. AC_CHECK_LIB(z, inflateReset, have_libz=yes, AC_MSG_ERROR([no usable zlib; please install zlib devel package or equivalent]))
  718. if test "x$have_libz" = "xyes" ; then
  719. APR_ADDTO([PLATFORM_CORE_LIBS], [-lz])
  720. fi
  721. PKG_CHECK_MODULES([MPG123], [libmpg123 >= 1.16.0],[
  722. AM_CONDITIONAL([HAVE_MPG123],[true])],[
  723. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MPG123],[false])])
  724. AC_CHECK_LIB(apr-1, apr_pool_mutex_set, use_system_apr=yes, use_system_apr=no)
  725. AM_CONDITIONAL([SYSTEM_APR],[test "${use_system_apr}" = "yes"])
  726. AC_CHECK_LIB(aprutil-1, apr_queue_pop_timeout, use_system_aprutil=yes, use_system_aprutil=no)
  727. AM_CONDITIONAL([SYSTEM_APRUTIL],[test "${use_system_aprutil}" = "yes"])
  728. save_LIBS="$LIBS"
  729. LIBS=
  730. AC_CHECK_LIB(jpeg, jpeg_std_error,, AC_MSG_ERROR([no usable libjpeg; please install libjpeg devel package or equivalent]))
  731. AC_CHECK_LIB(jbig, jbg_enc_out, have_libjbig=yes, have_libjbig=no)
  732. if test "x$have_libjbig" = "xyes" ; then
  733. SPANDSP_LA_JBIG="-ljbig $LIBS"
  734. AC_SUBST(SPANDSP_LA_JBIG)
  735. fi
  736. LIBS="$save_LIBS"
  737. AC_CHECK_LIB(lzma, lzma_code, have_liblzma=yes, have_liblzma=no)
  738. if test "x$have_liblzma" = "xyes" ; then
  739. SPANDSP_LA_LZMA="-llzma"
  740. AC_SUBST(SPANDSP_LA_LZMA)
  741. fi
  742. AC_CHECK_LIB(resolv, res_init, have_libresolv=yes, have_libresolv=no)
  743. if test "x$have_libresolv" = "xyes" ; then
  744. APR_ADDTO(SWITCH_AM_LDFLAGS, -lresolv)
  745. fi
  746. AC_SUBST(SWITCH_AM_CFLAGS)
  747. AC_SUBST(SWITCH_ANSI_CFLAGS)
  748. AC_SUBST(SWITCH_AM_CXXFLAGS)
  749. AC_SUBST(SWITCH_AM_CPPFLAGS)
  750. AC_SUBST(SWITCH_AM_LDFLAGS)
  751. AC_SUBST(ESL_LDFLAGS)
  752. AC_SUBST(PLATFORM_CORE_LDFLAGS)
  753. AC_SUBST(PLATFORM_CORE_LIBS)
  754. AC_SUBST(SOLINK)
  755. AC_SUBST(LIBTOOL_LIB_EXTEN)
  756. # Checks for header files.
  757. AC_HEADER_DIRENT
  758. AC_HEADER_STDC
  759. AC_CHECK_HEADERS([sys/types.h sys/resource.h sched.h wchar.h sys/filio.h sys/ioctl.h sys/prctl.h sys/select.h netdb.h execinfo.h sys/time.h])
  760. # Solaris 11 privilege management
  761. AS_CASE([$host],
  762. [*-*-solaris2.11], [AC_CHECK_HEADER([priv.h], [AC_DEFINE([SOLARIS_PRIVILEGES],[1],[Solaris 11 privilege management])])]
  763. )
  764. if test x"$ac_cv_header_wchar_h" = xyes; then
  765. HAVE_WCHAR_H_DEFINE=1
  766. else
  767. HAVE_WCHAR_H_DEFINE=0
  768. fi
  769. AC_SUBST(HAVE_WCHAR_H_DEFINE)
  770. # Needed by Abyss on Solaris:
  771. if test x"$ac_cv_header_sys_filio_h" = xyes; then
  772. HAVE_SYS_FILIO_H_DEFINE=1
  773. else
  774. HAVE_SYS_FILIO_H_DEFINE=0
  775. fi
  776. AC_SUBST(HAVE_SYS_FILIO_H_DEFINE)
  777. # Needed by Abyss on Solaris:
  778. if test x"$ac_cv_header_sys_ioctl_h" = xyes; then
  779. HAVE_SYS_IOCTL_H_DEFINE=1
  780. else
  781. HAVE_SYS_IOCTL_H_DEFINE=0
  782. fi
  783. AC_SUBST(HAVE_SYS_IOCTL_H_DEFINE)
  784. if test x"$ac_cv_header_sys_select_h" = xyes; then
  785. HAVE_SYS_SELECT_H_DEFINE=1
  786. else
  787. HAVE_SYS_SELECT_H_DEFINE=0
  788. fi
  789. AC_SUBST(HAVE_SYS_SELECT_H_DEFINE)
  790. # Checks for typedefs, structures, and compiler characteristics.
  791. AC_C_CONST
  792. AC_C_INLINE
  793. AC_TYPE_SIZE_T
  794. AC_HEADER_TIME
  795. AC_STRUCT_TM
  796. # Checks for library functions.
  797. AC_PROG_GCC_TRADITIONAL
  798. AC_FUNC_MALLOC
  799. AC_TYPE_SIGNAL
  800. AC_FUNC_STRFTIME
  801. AC_CHECK_FUNCS([gethostname vasprintf mmap mlock mlockall usleep getifaddrs timerfd_create getdtablesize posix_openpt poll])
  802. AC_CHECK_FUNCS([sched_setscheduler setpriority setrlimit setgroups initgroups getrusage])
  803. AC_CHECK_FUNCS([wcsncmp setgroups asprintf setenv pselect gettimeofday localtime_r gmtime_r strcasecmp stricmp _stricmp])
  804. # Check availability and return type of strerror_r
  805. # (NOTE: apr-1-config sets -D_GNU_SOURCE at build-time, need to run the check with it too)
  806. save_CPPFLAGS="$CPPFLAGS"
  807. CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
  808. AC_FUNC_STRERROR_R
  809. CPPFLAGS="$save_CPPFLAGS"
  810. AX_HAVE_CPU_SET
  811. AC_CHECK_LIB(rt, clock_gettime, [AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if you have clock_gettime()])])
  812. AC_CHECK_LIB(rt, clock_getres, [AC_DEFINE(HAVE_CLOCK_GETRES, 1, [Define if you have clock_getres()])])
  813. AC_CHECK_LIB(rt, clock_nanosleep, [AC_DEFINE(HAVE_CLOCK_NANOSLEEP, 1, [Define if you have clock_nanosleep()])])
  814. AC_CHECK_LIB(pthread, pthread_setschedparam, [AC_DEFINE(HAVE_PTHREAD_SETSCHEDPARAM, 1, [Define if you have pthread_setschedparam()])])
  815. AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket))
  816. AC_CHECK_FILE(/dev/ptmx, [AC_DEFINE(HAVE_DEV_PTMX, 1, [Define if you have /dev/ptmx])])
  817. AC_CHECK_LIB(util, openpty, [AC_DEFINE(HAVE_OPENPTY, 1, [Define if you have openpty()])])
  818. AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
  819. #include <sys/types.h>
  820. #include <time.h>])
  821. AC_CHECK_MEMBERS([struct tm.tm_zone],,,[
  822. #include <sys/types.h>
  823. #include <time.h>])
  824. AC_CHECK_DECL([RLIMIT_MEMLOCK],
  825. [AC_DEFINE([HAVE_RLIMIT_MEMLOCK],[1],[RLIMIT_MEMLOCK constant for setrlimit])],,
  826. [#ifdef HAVE_SYS_RESOURCE_H
  827. #include <sys/resource.h>
  828. #endif])
  829. AC_CHECK_DECL([SCHED_RR],
  830. [AC_DEFINE([HAVE_SCHED_RR],[1],[SCHED_RR constant for sched_setscheduler])],,
  831. [#ifdef HAVE_SCHED_H
  832. #include <sched.h>
  833. #endif])
  834. AC_CHECK_DECL([SCHED_FIFO],
  835. [AC_DEFINE([HAVE_SCHED_FIFO],[1],[SCHED_FIFO constant for sched_setscheduler])],,
  836. [#ifdef HAVE_SCHED_H
  837. #include <sched.h>
  838. #endif])
  839. #
  840. # use mlockall only on linux (for now; if available)
  841. #
  842. if test "x${ac_cv_func_mlockall}" = "xyes"; then
  843. AC_MSG_CHECKING([whether to use mlockall])
  844. case "$host" in
  845. *-linux-*)
  846. AC_DEFINE([USE_MLOCKALL],[1],[Enable mlockall support])
  847. AC_MSG_RESULT([yes])
  848. USE_MLOCKALL=yes
  849. ;;
  850. *-freebsd*)
  851. APR_ADDTO(SWITCH_AM_CFLAGS, -fPIC)
  852. APR_ADDTO(SWITCH_AM_CXXFLAGS, -fPIC)
  853. AC_MSG_RESULT([no, broken for non-root users])
  854. ;;
  855. *)
  856. AC_MSG_RESULT([no])
  857. ;;
  858. esac
  859. #
  860. # setrlimit prerequisites
  861. #
  862. if test "x${USE_MLOCKALL}" = "xyes" -a \
  863. "x${ac_cv_func_setrlimit}" = "xyes" -a \
  864. "x${ac_cv_have_decl_RLIMIT_MEMLOCK}" = "xyes"
  865. then
  866. AC_DEFINE([USE_SETRLIMIT],[1],[Use setrlimit to disable mlock limit for non-root users])
  867. fi
  868. fi
  869. #
  870. # sched_setcheduler + round-robin scheduler prerequisites
  871. #
  872. if test "x${ac_cv_func_sched_setscheduler}" = "xyes" -a \
  873. "x${ac_cv_have_decl_SCHED_RR}" = "xyes"
  874. then
  875. AC_DEFINE([USE_SCHED_SETSCHEDULER],[1],[Enable round-robin scheduler using sched_setscheduler])
  876. fi
  877. #
  878. # xmlrpc-c checks
  879. #
  880. AC_CHECK_FUNCS(setenv strtoll strtoull strtoq strtouq __strtoll __strtoull)
  881. HAVE_LIBWWW_SSL_DEFINE=0
  882. AC_SUBST(HAVE_LIBWWW_SSL_DEFINE)
  883. DIRECTORY_SEPARATOR="/"
  884. AC_SUBST(DIRECTORY_SEPARATOR)
  885. va_list_is_array=no
  886. AC_MSG_CHECKING(whether va_list is an array)
  887. AC_TRY_COMPILE([
  888. #include <stdarg.h>
  889. ], [va_list list1, list2; list1 = list2;], ,
  890. va_list_is_array=yes)
  891. AC_MSG_RESULT($va_list_is_array)
  892. if test x"$va_list_is_array" = xyes; then
  893. VA_LIST_IS_ARRAY_DEFINE=1
  894. else
  895. VA_LIST_IS_ARRAY_DEFINE=0
  896. fi
  897. AC_SUBST(VA_LIST_IS_ARRAY_DEFINE)
  898. AC_MSG_CHECKING(whether compiler has __attribute__)
  899. AC_TRY_COMPILE(, [int x __attribute__((__unused__));],
  900. compiler_has_attribute=yes,
  901. compiler_has_attribute=no)
  902. AC_MSG_RESULT($compiler_has_attribute)
  903. if test x"$compiler_has_attribute" = xyes; then
  904. ATTR_UNUSED="__attribute__((__unused__))"
  905. else
  906. ATTR_UNUSED=
  907. fi
  908. AC_SUBST(ATTR_UNUSED)
  909. saved_CFLAGS="$CFLAGS"
  910. AC_CACHE_CHECK([whether compiler supports -Wdeclaration-after-statement], [ac_cv_gcc_declaration_after_statement], [
  911. CFLAGS="$CFLAGS -Wdeclaration-after-statement"
  912. AC_TRY_COMPILE([],[return 0;],[ac_cv_gcc_declaration_after_statement=yes],[ac_cv_gcc_declaration_after_statement=no])
  913. ])
  914. AC_MSG_RESULT($ac_cv_gcc_declaration_after_statement)
  915. if test x"$ac_cv_gcc_declaration_after_statement" = xyes; then
  916. APR_ADDTO(SWITCH_ANSI_CFLAGS, -Wdeclaration-after-statement)
  917. fi
  918. CFLAGS="$saved_CFLAGS"
  919. if test "x${ax_cv_c_compiler_vendor}" = "xclang" ; then
  920. # Next check added for Xcode 5 and systems with clang 5 llvm 3.3 or above, extended offset must be off
  921. AC_CACHE_CHECK([whether compiler supports -Wextended-offsetof], [ac_cv_clang_extended_offsetof], [
  922. AC_TRY_COMPILE([],[return 0;],[ac_cv_clang_extended_offsetof=yes],[ac_cv_clang_extended_offsetof=no])
  923. ])
  924. AC_MSG_RESULT($ac_cv_clang_extended_offsetof)
  925. if test x"$ac_cv_clang_extended_offsetof" = xyes; then
  926. APR_ADDTO(CFLAGS, -Wno-extended-offsetof)
  927. fi
  928. fi
  929. # Tested and fixed lot of modules, but some are untested. Will be added back when the core team decide it ready
  930. # Untested modules : mod_osp mod_soundtouch mod_sangoma_codec mod_dingaling mod_opal mod_skypopen mod_h323 mod_khomp
  931. # mod_unimrcp mod_cepstral mod_erlang_event mod_snmp mod_perl mod_java mod_managed
  932. #
  933. #saved_CFLAGS="$CFLAGS"
  934. #AC_CACHE_CHECK([whether compiler supports -Wunused-but-set-variable], [ac_cv_gcc_unused_but_set_variable], [
  935. #CFLAGS="$CFLAGS -Wunused-but-set-variable"
  936. #AC_TRY_COMPILE([],[return 0;],[ac_cv_gcc_unused_but_set_variable=yes],[ac_cv_gcc_unused_but_set_variable=no])
  937. #])
  938. #AC_MSG_RESULT($ac_cv_gcc_unused_but_set_variable)
  939. #if test x"$ac_cv_gcc_unused_but_set_variable" = xyes; then
  940. # APR_ADDTO(SWITCH_ANSI_CFLAGS, -Wunused-but-set-variable)
  941. #fi
  942. #CFLAGS="$saved_CFLAGS"
  943. AC_C_BIGENDIAN(AC_DEFINE([SWITCH_BYTE_ORDER],__BIG_ENDIAN,[Big Endian]),AC_DEFINE([SWITCH_BYTE_ORDER],__LITTLE_ENDIAN,[Little Endian]))
  944. # Checks for integer size
  945. AC_CHECK_SIZEOF(char, 1)
  946. AC_CHECK_SIZEOF(int, 4)
  947. AC_CHECK_SIZEOF(long, 4)
  948. AC_CHECK_SIZEOF(short, 2)
  949. AC_CHECK_SIZEOF(long long, 8)
  950. AC_TYPE_SIZE_T
  951. AC_CHECK_TYPE(ssize_t, int)
  952. # Checks for pointer size
  953. AC_CHECK_SIZEOF(void*, 4)
  954. if test "x$ac_cv_sizeof_voidp" != "x"; then
  955. voidp_size=$ac_cv_sizeof_voidp
  956. else
  957. AC_ERROR([Cannot determine size of void*])
  958. fi
  959. if test "$ac_cv_sizeof_short" = "2"; then
  960. short_value=short
  961. fi
  962. if test "$ac_cv_sizeof_int" = "4"; then
  963. int_value=int
  964. fi
  965. if test "$ac_cv_sizeof_int" = "8"; then
  966. int64_t_fmt='#define SWITCH_INT64_T_FMT "d"'
  967. uint64_t_fmt='#define SWITCH_UINT64_T_FMT "u"'
  968. int64_value="int"
  969. long_value=int
  970. elif test "$ac_cv_sizeof_long" = "8"; then
  971. int64_t_fmt='#define SWITCH_INT64_T_FMT "ld"'
  972. uint64_t_fmt='#define SWITCH_UINT64_T_FMT "lu"'
  973. int64_value="long"
  974. long_value=long
  975. case "$host" in
  976. *pc-solaris2*)
  977. ;;
  978. sparc-*-solaris2*)
  979. ;;
  980. *-solaris2*|*apple-darwin*|*-openbsd*)
  981. if test "$ac_cv_sizeof_long_long" = "8"; then
  982. int64_t_fmt='#define SWITCH_INT64_T_FMT "lld"'
  983. uint64_t_fmt='#define SWITCH_UINT64_T_FMT "llu"'
  984. int64_value="long long"
  985. long_value="long long"
  986. fi
  987. ;;
  988. esac
  989. elif test "$ac_cv_sizeof_long_long" = "8"; then
  990. int64_t_fmt='#define SWITCH_INT64_T_FMT "lld"'
  991. uint64_t_fmt='#define SWITCH_UINT64_T_FMT "llu"'
  992. int64_value="long long"
  993. long_value="long long"
  994. elif test "$ac_cv_sizeof_longlong" = "8"; then
  995. int64_t_fmt='#define SWITCH_INT64_T_FMT "qd"'
  996. uint64_t_fmt='#define SWITCH_UINT64_T_FMT "qu"'
  997. int64_value="__int64"
  998. long_value="__int64"
  999. else
  1000. AC_ERROR([could not detect a 64-bit integer type])
  1001. fi
  1002. if test "$ac_cv_type_size_t" = "yes"; then
  1003. size_t_value="size_t"
  1004. else
  1005. size_t_value="switch_int32_t"
  1006. fi
  1007. if test "$ac_cv_type_ssize_t" = "yes"; then
  1008. ssize_t_value="ssize_t"
  1009. else
  1010. ssize_t_value="switch_int32_t"
  1011. fi
  1012. APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], ssize_t, 8)
  1013. if test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_int"; then
  1014. ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "d"'
  1015. elif test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_long"; then
  1016. ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
  1017. else
  1018. ssize_t_fmt='#error Can not determine the proper size for ssize_t'
  1019. fi
  1020. APR_CHECK_SIZEOF_EXTENDED([#include <stddef.h>], size_t, 8)
  1021. if test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_int"; then
  1022. size_t_fmt='#define SWITCH_SIZE_T_FMT "d"'
  1023. elif test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_long"; then
  1024. size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
  1025. else
  1026. size_t_fmt='#define SWITCH_SIZE_T_FMT "zu"'
  1027. fi
  1028. # Basically, we have tried to figure out the correct format strings
  1029. # for SWITCH types which vary between platforms, but we don't always get
  1030. # it right. If you find that we don't get it right for your platform,
  1031. # you can override our decision below.
  1032. # NOTE: borrowed much of this logic from apr.
  1033. case $host in
  1034. s390*linux*)
  1035. # uniquely, the 31-bit Linux/s390 uses "unsigned long int"
  1036. # for size_t rather than "unsigned int":
  1037. size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
  1038. ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
  1039. ;;
  1040. *-os2*)
  1041. size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
  1042. ;;
  1043. *-openbsd*)
  1044. size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
  1045. ;;
  1046. *aix4*|*aix5*)
  1047. ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
  1048. size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
  1049. ;;
  1050. *beos*)
  1051. ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
  1052. size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
  1053. ;;
  1054. *apple-darwin*)
  1055. ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
  1056. size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
  1057. ;;
  1058. esac
  1059. AC_SUBST(voidp_size)
  1060. AC_SUBST(short_value)
  1061. AC_SUBST(int_value)
  1062. AC_SUBST(long_value)
  1063. AC_SUBST(int64_value)
  1064. AC_SUBST(size_t_value)
  1065. AC_SUBST(ssize_t_value)
  1066. AC_SUBST(int64_t_fmt)
  1067. AC_SUBST(uint64_t_fmt)
  1068. AC_SUBST(ssize_t_fmt)
  1069. AC_SUBST(size_t_fmt)
  1070. case $host in
  1071. *-openbsd*)
  1072. # OpenBSD's gunzip and friends don't like -d because its redundant, only gzip does
  1073. AC_PATH_PROGS(ZCAT, gzip)
  1074. ;;
  1075. *)
  1076. AC_PATH_PROGS(ZCAT, gunzip gzcat gzip zcat)
  1077. ;;
  1078. esac
  1079. AC_PATH_PROGS(BZIP, bzip2)
  1080. AC_PATH_PROGS(XZ, xz)
  1081. AC_PATH_PROGS(TAR, gtar tar)
  1082. AC_PATH_PROGS(WGET, wget)
  1083. AC_PATH_PROGS(CURL, curl)
  1084. GETLIB="cd $switch_srcdir/libs && ${SHELL} $switch_builddir/build/getlib.sh"
  1085. AC_SUBST(GETLIB)
  1086. GETG729="cd $switch_srcdir/libs && ${SHELL} $switch_builddir/build/getg729.sh"
  1087. AC_SUBST(GETG729)
  1088. GETSOUNDS="${SHELL} $switch_builddir/build/getsounds.sh"
  1089. AC_SUBST(GETSOUNDS)
  1090. case $host in
  1091. *-darwin*)
  1092. path_push_unique PKG_CONFIG_PATH /usr/local/opt/curl/lib/pkgconfig
  1093. path_push_unique PKG_CONFIG_PATH /usr/local/opt/sqlite/lib/pkgconfig/
  1094. path_push_unique PKG_CONFIG_PATH /usr/local/opt/ldns/lib/pkgconfig/
  1095. path_push_unique PKG_CONFIG_PATH /usr/local/opt/portaudio/lib/pkgconfig/
  1096. ;;
  1097. esac
  1098. if ! (test -x "$PKG_CONFIG" || test -x "$(which pkg-config)"); then
  1099. AC_MSG_ERROR([You need to install pkg-config to configure FreeSWITCH.])
  1100. fi
  1101. # temporary workaround for Debian libldns-dev package bug
  1102. if test "$cross_compiling" != "yes" && test -f /usr/lib/pkg-config/libldns.pc; then
  1103. path_push_unique PKG_CONFIG_PATH /usr/lib/pkg-config
  1104. fi
  1105. module_enabled() {
  1106. grep -v -e "\#" -e "^\$" modules.conf | sed -e "s|^.*/||" | grep "^${1}\$" >/dev/null
  1107. }
  1108. AC_ARG_WITH(png,
  1109. [AS_HELP_STRING([--without-png],
  1110. [disable support for libpng])],
  1111. [with_png="$withval"],
  1112. [with_png="yes"])
  1113. if test "$with_png" = "yes"; then
  1114. PKG_CHECK_MODULES([LIBPNG], [libpng >= 1.6.16],[
  1115. AM_CONDITIONAL([HAVE_PNG],[true])],[
  1116. PKG_CHECK_MODULES([LIBPNG], [libpng16 >= 1.6.16],[
  1117. AM_CONDITIONAL([HAVE_PNG],[true])],[
  1118. PKG_CHECK_MODULES([LIBPNG], [libpng >= 1.2.49],[
  1119. AM_CONDITIONAL([HAVE_PNG],[true])],[
  1120. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_PNG],[false])])])])
  1121. else
  1122. AM_CONDITIONAL([HAVE_PNG],[false])
  1123. fi
  1124. AC_ARG_WITH(freetype,
  1125. [AS_HELP_STRING([--without-freetype],
  1126. [disable support for freetype])],
  1127. [with_freetype="$withval"],
  1128. [with_freetype="yes"])
  1129. if test "$with_freetype" = "yes"; then
  1130. PKG_CHECK_MODULES([FREETYPE], [freetype2 >= 2.4.9],[
  1131. AM_CONDITIONAL([HAVE_FREETYPE],[true])],[
  1132. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_FREETYPE],[false])])
  1133. else
  1134. AM_CONDITIONAL([HAVE_FREETYPE],[false])
  1135. fi
  1136. PKG_CHECK_MODULES([SQLITE], [sqlite3 >= 3.6.20])
  1137. PKG_CHECK_MODULES([CURL], [libcurl >= 7.19])
  1138. PKG_CHECK_MODULES([PCRE], [libpcre >= 7.8])
  1139. PKG_CHECK_MODULES([SPEEX], [speex >= 1.2rc1 speexdsp >= 1.2rc1])
  1140. PKG_CHECK_MODULES([YAML], [yaml-0.1 >= 0.1.4],[
  1141. AM_CONDITIONAL([HAVE_YAML],[true])],[
  1142. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_YAML],[false])])
  1143. PKG_CHECK_MODULES([PORTAUDIO], [portaudio-2.0 >= 19],[
  1144. AM_CONDITIONAL([HAVE_PORTAUDIO],[true])],[
  1145. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_PORTAUDIO],[false])])
  1146. PKG_CHECK_MODULES([LDNS], [libldns >= 1.6.6],[
  1147. AM_CONDITIONAL([HAVE_LDNS],[true])],[
  1148. AC_CHECK_LIB([ldns], [ldns_str2rdf_a], [LDNS_LIBS=-lldns])
  1149. AS_IF([test -z "$LDNS_LIBS"],[
  1150. if module_enabled mod_enum; then
  1151. AC_MSG_ERROR([You need to either install libldns-dev or disable mod_enum in modules.conf])
  1152. else
  1153. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_LDNS],[false])
  1154. fi],[
  1155. AM_CONDITIONAL([HAVE_LDNS],[true])])])
  1156. PKG_CHECK_MODULES([SNDFILE], [sndfile >= 1.0.20],[
  1157. AM_CONDITIONAL([HAVE_SNDFILE],[true])],[
  1158. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SNDFILE],[false])])
  1159. PKG_CHECK_MODULES([MPG123], [libmpg123 >= 1.16.0],[
  1160. AM_CONDITIONAL([HAVE_MPG123],[true])],[
  1161. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MPG123],[false])])
  1162. PKG_CHECK_MODULES([SHOUT], [shout >= 2.2.2],[
  1163. AM_CONDITIONAL([HAVE_SHOUT],[true])],[
  1164. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SHOUT],[false])])
  1165. mp3lame=false
  1166. AC_CHECK_LIB([mp3lame], [lame_init],[
  1167. AC_CHECK_HEADER([lame/lame.h],[
  1168. mp3lame=true
  1169. AC_SUBST([MP3LAME_LIBS], [-lmp3lame])
  1170. AC_SUBST([MP3LAME_CFLAGS], [$CPPFLAGS])])])
  1171. AM_CONDITIONAL([HAVE_MP3LAME],[$mp3lame])
  1172. PKG_CHECK_MODULES([AVCODEC], [libavcodec >= 53.35.0],[
  1173. AM_CONDITIONAL([HAVE_AVCODEC],[true])],[
  1174. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AVCODEC],[false])])
  1175. PKG_CHECK_MODULES([X264], [x264 >= 0.142.2431],[
  1176. AM_CONDITIONAL([HAVE_X264],[true])],[
  1177. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_X264],[false])])
  1178. PKG_CHECK_MODULES([AVFORMAT], [libavformat >= 53.21.1],[
  1179. AM_CONDITIONAL([HAVE_AVFORMAT],[true])],[
  1180. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AVFORMAT],[false])])
  1181. PKG_CHECK_MODULES([AVUTIL], [libavutil >= 54.3.0],[
  1182. AM_CONDITIONAL([HAVE_AVUTIL],[true])],[
  1183. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AVUTIL],[false])])
  1184. PKG_CHECK_MODULES([AVRESAMPLE], [libavresample >= 2.1.0],[
  1185. AM_CONDITIONAL([HAVE_AVRESAMPLE],[true])],[
  1186. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AVRESAMPLE],[false])])
  1187. PKG_CHECK_MODULES([SWSCALE], [libswscale >= 3.0.0],[
  1188. AM_CONDITIONAL([HAVE_SWSCALE],[true])],[
  1189. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SWSCALE],[false])])
  1190. PKG_CHECK_MODULES([VLC], [libvlc >= 2.1.0],[
  1191. AM_CONDITIONAL([HAVE_VLC],[true])],[
  1192. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_VLC],[false])])
  1193. PKG_CHECK_MODULES([OPENCV], [opencv >= 2.4.5],[
  1194. AM_CONDITIONAL([HAVE_OPENCV],[true])],[
  1195. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_OPENCV],[false])])
  1196. PKG_CHECK_MODULES([MAGICK], [ImageMagick >= 6.0.0],[
  1197. AM_CONDITIONAL([HAVE_MAGICK],[true])],[
  1198. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MAGICK],[false])])
  1199. PKG_CHECK_MODULES([SILK], [silk >= 1.0.8],[
  1200. AM_CONDITIONAL([HAVE_SILK],[true])],[
  1201. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SILK],[false])])
  1202. PKG_CHECK_MODULES([BROADVOICE], [broadvoice >= 0.1.0],[
  1203. AM_CONDITIONAL([HAVE_BROADVOICE],[true])],[
  1204. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_BROADVOICE],[false])])
  1205. PKG_CHECK_MODULES([ILBC], [ilbc2 >= 0.0.1],[
  1206. AM_CONDITIONAL([HAVE_ILBC],[true])],[
  1207. PKG_CHECK_MODULES([ILBC], [ilbc >= 0.0.1],[
  1208. AM_CONDITIONAL([HAVE_ILBC],[true])],[
  1209. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_ILBC],[false])])])
  1210. PKG_CHECK_MODULES([G7221], [g722_1 >= 0.2.0],[
  1211. AM_CONDITIONAL([HAVE_G7221],[true])],[
  1212. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_G7221],[false])])
  1213. PKG_CHECK_MODULES([CODEC2], [codec2 >= 0.2],[
  1214. AM_CONDITIONAL([HAVE_CODEC2],[true])],[
  1215. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_CODEC2],[false])])
  1216. PKG_CHECK_MODULES([OPUS], [opus >= 1.1],[
  1217. AM_CONDITIONAL([HAVE_OPUS],[true])],[
  1218. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_OPUS],[false])])
  1219. PKG_CHECK_MODULES([SOUNDTOUCH], [soundtouch >= 1.7.0],[
  1220. AM_CONDITIONAL([HAVE_SOUNDTOUCH],[true])],[
  1221. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SOUNDTOUCH],[false])])
  1222. PKG_CHECK_MODULES([FLITE], [flite >= 2.0.0],[
  1223. AM_CONDITIONAL([HAVE_FLITE],[true])],[
  1224. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_FLITE],[false])])
  1225. PKG_CHECK_MODULES([MONGOC], [libmongoc-1.0 >= 1.0.8],[
  1226. AM_CONDITIONAL([HAVE_MONGOC],[true])],[
  1227. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MONGOC],[false])])
  1228. PKG_CHECK_MODULES([MEMCACHED], [libmemcached >= 0.31],[
  1229. AM_CONDITIONAL([HAVE_MEMCACHED],[true])
  1230. MEMCACHED_LIBS="${MEMCACHED_LIBS} -lpthread"
  1231. save_LIBS="${LIBS}"
  1232. save_CPPFLAGS="${CPPFLAGS}"
  1233. LIBS="${MEMCACHED_LIBS}"
  1234. CPPFLAGS="${MEMCACHED_CFLAGS}"
  1235. AC_CHECK_FUNCS([memcached_server_name memcached_stat_execute])
  1236. AC_CHECK_TYPES([memcached_instance_st*],,, [[#include <libmemcached/memcached.h>]])
  1237. LIBS="${save_LIBS}"
  1238. CPPFLAGS="${save_CPPFLAGS}"
  1239. ],[
  1240. AC_MSG_RESULT([no])
  1241. AM_CONDITIONAL([HAVE_MEMCACHED],[false])
  1242. ])
  1243. PKG_CHECK_MODULES([AMQP], [librabbitmq >= 0.5.2],[
  1244. AM_CONDITIONAL([HAVE_AMQP],[true])],[
  1245. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AMQP],[false])])
  1246. PKG_CHECK_MODULES([H2O], [libh2o-evloop >= 0.11.0],[
  1247. AM_CONDITIONAL([HAVE_H2O],[true])],[
  1248. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_H2O],[false])])
  1249. PKG_CHECK_MODULES([BROTLIENC], [libbrotlienc >= 0.1.0],[
  1250. AM_CONDITIONAL([HAVE_BROTLIENC],[true])],[
  1251. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_BROTLIENC],[false])])
  1252. PKG_CHECK_MODULES([BROTLIDEC], [libbrotlidec >= 0.1.0],[
  1253. AM_CONDITIONAL([HAVE_BROTLIDEC],[true])],[
  1254. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_BROTLIDEC],[false])])
  1255. PKG_CHECK_MODULES([TAP], [tap >= 0.1.0],[
  1256. AM_CONDITIONAL([HAVE_TAP],[true])],[
  1257. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_TAP],[false])])
  1258. PKG_CHECK_MODULES([SMPP34], [libsmpp34 >= 1.10],[
  1259. AM_CONDITIONAL([HAVE_SMPP34],[true])],[
  1260. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SMPP34],[false])])
  1261. PKG_CHECK_MODULES([HIREDIS], [hiredis >= 0.10.0],[
  1262. AM_CONDITIONAL([HAVE_HIREDIS],[true])],[
  1263. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_HIREDIS],[false])])
  1264. AC_ARG_ENABLE(core-libedit-support,
  1265. [AS_HELP_STRING([--disable-core-libedit-support], [Compile without libedit Support])])
  1266. AS_IF([test "x$enable_core_libedit_support" != "xno"],[
  1267. PKG_CHECK_MODULES([LIBEDIT], [libedit >= 2.11],,[
  1268. AC_MSG_RESULT([no])
  1269. AC_CHECK_LIB([edit], [el_line], [LIBEDIT_LIBS=-ledit])
  1270. AC_CHECK_LIB([edit], [el_cursor], [ac_cv_has_el_cursor=yes])
  1271. AC_CHECK_HEADER([histedit.h], [], [unset LIBEDIT_LIBS])
  1272. AS_IF([test "x$LIBEDIT_LIBS" = "x"], [
  1273. AC_MSG_ERROR([You need to either install libedit-dev (>= 2.11) or configure with --disable-core-libedit-support])
  1274. ])])])
  1275. dnl ---------------------------------------------------------------------------
  1276. dnl - OpenLDAP SDK
  1277. dnl ---------------------------------------------------------------------------
  1278. AC_CHECK_LIB(ldap, ldap_search, with_ldap=yes)
  1279. dnl Check for other libraries we need to link with to get the main routines.
  1280. test "$with_ldap" != "yes" && { AC_CHECK_LIB(ldap, ldap_open, [with_ldap=yes with_ldap_lber=yes], , -llber) }
  1281. test "$with_ldap" != "yes" && { AC_CHECK_LIB(ldap, ldap_open, [with_ldap=yes with_ldap_lber=yes with_ldap_krb=yes], , -llber -lkrb) }
  1282. test "$with_ldap" != "yes" && { AC_CHECK_LIB(ldap, ldap_open, [with_ldap=yes with_ldap_lber=yes with_ldap_krb=yes with_ldap_des=yes], , -llber -lkrb -ldes) }
  1283. test "$with_ldap_lber" != "yes" && { AC_CHECK_LIB(lber, ber_pvt_opt_on, with_ldap_lber=yes) }
  1284. if test "$with_ldap" = "yes"; then
  1285. if test "$with_ldap_des" = "yes" ; then
  1286. OPENLDAP_LIBS="${OPENLDAP_LIBS} -ldes"
  1287. fi
  1288. if test "$with_ldap_krb" = "yes" ; then
  1289. OPENLDAP_LIBS="${OPENLDAP_LIBS} -lkrb"
  1290. fi
  1291. if test "$with_ldap_lber" = "yes" ; then
  1292. OPENLDAP_LIBS="${OPENLDAP_LIBS} -llber"
  1293. fi
  1294. OPENLDAP_LIBS="${OPENLDAP_LIBS} -lldap"
  1295. fi
  1296. AM_CONDITIONAL([HAVE_LDAP],[test "x$with_ldap" == "xyes"])
  1297. AC_SUBST(OPENLDAP_LIBS)
  1298. AS_IF([test "x$enable_core_libedit_support" != "xno"], [
  1299. # If making changes here, don't forget to run autoheader and
  1300. # update libs/esl/src/include/esl_config_auto.h.in manually.
  1301. AC_DEFINE([HAVE_LIBEDIT], [1], [Define to 1 if you have libedit is available])
  1302. if test x$ac_cv_has_el_cursor = xyes; then
  1303. AC_DEFINE([HAVE_EL_CURSOR], [1], [Define to 1 if you have libedit el_cursor support])
  1304. fi
  1305. save_LIBS="${LIBS}"
  1306. save_CPPFLAGS="${CPPFLAGS}"
  1307. LIBS="${LIBEDIT_LIBS}"
  1308. CPPFLAGS="${LIBEDIT_CFLAGS}"
  1309. AC_CHECK_DECLS([EL_PROMPT_ESC, EL_REFRESH],,, [[#include <histedit.h>]])
  1310. AC_CHECK_FUNCS([el_wset])
  1311. LIBS="${save_LIBS}"
  1312. CPPFLAGS="${save_CPPFLAGS}"
  1313. ])
  1314. SAC_OPENSSL
  1315. if test x$HAVE_OPENSSL = x1; then
  1316. openssl_CFLAGS="$openssl_CFLAGS -DHAVE_OPENSSL";
  1317. APR_ADDTO(SWITCH_AM_CFLAGS, -DHAVE_OPENSSL)
  1318. AC_CHECK_LIB(ssl, SSL_CTX_set_tlsext_use_srtp, AC_DEFINE_UNQUOTED(HAVE_OPENSSL_DTLS_SRTP, 1, HAVE_OPENSSL_DTLS_SRTP), AC_MSG_ERROR([OpenSSL >= 1.0.1e and associated developement headers required]))
  1319. AC_CHECK_LIB(ssl, DTLSv1_method, AC_DEFINE_UNQUOTED(HAVE_OPENSSL_DTLS, 1, HAVE_OPENSSL_DTLS), AC_MSG_ERROR([OpenSSL >= 1.0.1e and associaed developement headers required]))
  1320. else
  1321. AC_MSG_ERROR([OpenSSL >= 1.0.1e and associated developement headers required])
  1322. fi
  1323. AX_CHECK_JAVA
  1324. # Option to enable static linking of Google's V8 inside mod_v8
  1325. AC_ARG_ENABLE(static-v8,
  1326. [AS_HELP_STRING([--enable-static-v8], [Statically link V8 into mod_v8])], [enable_static_v8="$enableval"], [enable_static_v8="no"])
  1327. AM_CONDITIONAL([ENABLE_STATIC_V8],[test "x$enable_static_v8" != "xno"])
  1328. # Option to disable parallel build of Google's V8
  1329. AC_ARG_ENABLE(parallel-build-v8,
  1330. [AS_HELP_STRING([--disable-parallel-build-v8], [Disable parallel build of V8])], [enable_parallel_build_v8="$enableval"], [enable_parallel_build_v8="yes"])
  1331. AM_CONDITIONAL([ENABLE_PARALLEL_BUILD_V8],[test "x$enable_parallel_build_v8" != "xno"])
  1332. AM_CONDITIONAL([HAVE_ODBC],[test "x$enable_core_odbc_support" != "xno"])
  1333. AM_CONDITIONAL([HAVE_MYSQL],[test "$found_mysql" = "yes"])
  1334. #
  1335. # perl checks
  1336. #
  1337. AC_CHECK_PROG(PERL,perl,[ac_cv_have_perl=yes],[ac_cv_have_perl=no])
  1338. # -a "x$ac_cv_have_EXTERN_h" != "xno"
  1339. if test "x$ac_cv_have_perl" != "xno"; then
  1340. PERL=perl
  1341. PERL_SITEDIR="`$PERL -MConfig -e 'print $Config{archlib}'`"
  1342. PERL_LIBDIR="-L`$PERL -MConfig -e 'print $Config{archlib}'`/CORE"
  1343. PERL_LIBS="`$PERL -MConfig -e 'print $Config{libs}'`"
  1344. PERL_CFLAGS="-w -DMULTIPLICITY `$PERL -MExtUtils::Embed -e ccopts | sed -e 's|-arch x86_64 -arch i386||'` -DEMBED_PERL"
  1345. PERL_LDFLAGS="`$PERL -MExtUtils::Embed -e ldopts| sed -e 's|-arch x86_64 -arch i386||'`"
  1346. PERL_INC="`$PERL -MExtUtils::Embed -e perl_inc`"
  1347. save_CFLAGS="$CFLAGS"
  1348. CFLAGS="$PERL_CFLAGS"
  1349. AC_CHECK_HEADER([EXTERN.h], [ac_cv_have_EXTERN_h=yes], [ac_cv_have_EXTERN_h=no], [[#include <EXTERN.h>
  1350. # include <perl.h>]])
  1351. CFLAGS="$save_CFLAGS"
  1352. save_LDFLAGS="$LDFLAGS"
  1353. LDFLAGS="$PERL_LDFLAGS"
  1354. AC_CHECK_LIB([perl], [perl_alloc], ac_cv_use_libperl=yes, ac_cv_use_libperl=no)
  1355. LDFLAGS="$save_LDFLAGS"
  1356. AC_SUBST(PERL_SITEDIR)
  1357. AC_SUBST(PERL_LIBDIR)
  1358. AC_SUBST(PERL_LIBS)
  1359. AC_SUBST(PERL_CFLAGS)
  1360. AC_SUBST(PERL_LDFLAGS)
  1361. AC_SUBST(PERL_INC)
  1362. fi
  1363. AM_CONDITIONAL([HAVE_PERL],[test "x$ac_cv_have_perl" != "xno" -a "x$ac_cv_have_EXTERN_h" != "xno" -a "x$ac_cv_use_libperl" != "xno"])
  1364. #
  1365. # php checks
  1366. #
  1367. AC_CHECK_PROG(PHP,php,[ac_cv_have_php=yes],[ac_cv_have_php=no])
  1368. AC_CHECK_PROG(PHP_CONFIG,php-config,[ac_cv_have_php_config=yes],[ac_cv_have_php_config=no])
  1369. AM_CONDITIONAL([HAVE_PHP],[test "x$ac_cv_have_php" != "xno" -a "x$ac_cv_have_php_config" != "xno"])
  1370. if test "x$ac_cv_have_php" != "xno" -a "x$ac_cv_have_php_config" != "xno"; then
  1371. PHP=php
  1372. PHP_CONFIG=php-config
  1373. PHP_LDFLAGS="`$PHP_CONFIG --ldflags`"
  1374. PHP_LIBS="`$PHP_CONFIG --libs | sed -r 's/ ?-l(bz2|pcre|xml2|gssapi_krb5|krb5|k5crypto|com_err|history|z|readline|gmp|ssl|crypto)//g'`"
  1375. PHP_EXT_DIR="`$PHP_CONFIG --extension-dir`"
  1376. PHP_INC_DIR="`$PHP -r 'echo ini_get("include_path");' | cut -d: -f2`"
  1377. PHP_INI_DIR="`$PHP_CONFIG --configure-options | tr " " "\n" | grep -- --with-config-file-scan-dir | cut -f2 -d=`"
  1378. PHP_CFLAGS="`$PHP_CONFIG --includes`"
  1379. AC_SUBST(PHP_LDFLAGS)
  1380. AC_SUBST(PHP_LIBS)
  1381. AC_SUBST(PHP_EXT_DIR)
  1382. AC_SUBST(PHP_INC_DIR)
  1383. AC_SUBST(PHP_INI_DIR)
  1384. AC_SUBST(PHP_CFLAGS)
  1385. fi
  1386. #
  1387. # Python checks for mod_python
  1388. #
  1389. AC_ARG_WITH(
  1390. [python],
  1391. [AS_HELP_STRING([--with-python], [Use system provided version of python (default: try)])],
  1392. [with_python="$withval"],
  1393. [with_python="try"]
  1394. )
  1395. if test "$with_python" != "no"
  1396. then
  1397. save_CFLAGS="$CFLAGS"
  1398. save_LIBS="$LIBS"
  1399. if test "$with_python" != "yes" -a "$with_python" != "try" ; then
  1400. AC_MSG_CHECKING([for python])
  1401. if test ! -x "$with_python" ; then
  1402. AC_MSG_ERROR([Specified python does not exist or is not executable: $with_python])
  1403. fi
  1404. AC_MSG_RESULT([$with_python])
  1405. AC_SUBST([PYTHON], ["$with_python"])
  1406. else
  1407. AC_PATH_PROG([PYTHON], ["python"], ["no"], ["$PATH:/usr/bin:/usr/local/bin"])
  1408. fi
  1409. if test "$PYTHON" != "no" ; then
  1410. AC_MSG_CHECKING([python version])
  1411. PYTHON_VER="`$PYTHON -V 2>&1 | cut -d' ' -f2`"
  1412. if test -z "$PYTHON_VER" ; then
  1413. AC_MSG_ERROR([Unable to detect python version])
  1414. fi
  1415. AC_MSG_RESULT([$PYTHON_VER])
  1416. AC_MSG_CHECKING([for python distutils])
  1417. python_result="`$PYTHON -c 'import distutils;' 2>&1`"
  1418. if test -z "$python_result" ; then
  1419. python_has_distutils="yes"
  1420. else
  1421. python_has_distutils="no"
  1422. fi
  1423. AC_MSG_RESULT([$python_has_distutils])
  1424. if test "$python_has_distutils" != "no" ; then
  1425. AC_MSG_CHECKING([location of site-packages])
  1426. PYTHON_SITE_DIR="`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_python_lib(0));'`"
  1427. if test -z "$PYTHON_SITE_DIR" ; then
  1428. AC_MSG_ERROR([Unable to detect python site-packages path])
  1429. elif test ! -d "$PYTHON_SITE_DIR" ; then
  1430. AC_MSG_ERROR([Path $PYTHON_SITE_DIR returned by python does not exist!])
  1431. fi
  1432. AC_MSG_RESULT([$PYTHON_SITE_DIR])
  1433. AC_SUBST([PYTHON_SITE_DIR], [$PYTHON_SITE_DIR])
  1434. #
  1435. # python distutils found, get settings from python directly
  1436. #
  1437. PYTHON_CFLAGS="`$PYTHON -c 'from distutils import sysconfig; flags = [[\"-I\" + sysconfig.get_python_inc(0), \"-I\" + sysconfig.get_python_inc(1), \" \".join(sysconfig.get_config_var(\"CFLAGS\").split())]]; print(\" \".join(flags));' | sed -e 's/-arch i386//g;s/-arch x86_64//g'`"
  1438. PYTHON_LDFLAGS="`$PYTHON -c 'from distutils import sysconfig; libs = sysconfig.get_config_var(\"LIBS\").split() + sysconfig.get_config_var(\"SYSLIBS\").split(); libs.append(\"-lpython\"+sysconfig.get_config_var(\"VERSION\")); print(\" \".join(libs));'`"
  1439. PYTHON_LIB="`$PYTHON -c 'from distutils import sysconfig; print(\"python\" + sysconfig.get_config_var(\"VERSION\"));'`"
  1440. PYTHON_LIBDIR="`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_config_var(\"LIBDIR\"));'`"
  1441. # handle python being installed into /usr/local
  1442. AC_MSG_CHECKING([python libdir])
  1443. if test -z "`echo $PYTHON_LIBDIR | grep "/usr/lib"`" ; then
  1444. PYTHON_LDFLAGS="-L$PYTHON_LIBDIR $PYTHON_LDFLAGS"
  1445. LIBS="-L$PYTHON_LIBDIR $LIBS"
  1446. fi
  1447. AC_MSG_RESULT([$PYTHON_LIBDIR])
  1448. # check libpython
  1449. AC_CHECK_LIB([$PYTHON_LIB], [main], [has_libpython="yes"], [has_libpython="no"])
  1450. if test "$has_libpython" = "no" ; then
  1451. AS_IF([test "$with_python" = "try"],
  1452. [AC_MSG_WARN([$PYTHON_LIB is unusable])],
  1453. [AC_MSG_ERROR([$PYTHON_LIB is unusable])]
  1454. )
  1455. fi
  1456. # check whether system libpython is usable and has threads support
  1457. CFLAGS="$PYTHON_CFLAGS"
  1458. LIBS="$PYTHON_LDFLAGS"
  1459. AC_CHECK_FUNC([PyThread_init_thread], [python_has_threads="yes"], [python_has_threads="no"])
  1460. if test "$python_has_threads" = "no"; then
  1461. AS_IF([test "$with_python" = "try"],
  1462. [AC_MSG_WARN([Your python lacks threads support, can not build mod_python])],
  1463. [AC_MSG_ERROR([Your python lacks threads support, can not build mod_python])]
  1464. )
  1465. else
  1466. AC_MSG_NOTICE([Your python seems OK, do not forget to enable mod_python in modules.conf])
  1467. AC_SUBST([PYTHON_CFLAGS], [$PYTHON_CFLAGS])
  1468. AC_SUBST([PYTHON_LDFLAGS], [$PYTHON_LDFLAGS])
  1469. fi
  1470. else
  1471. AS_IF([test "$with_python" = "try"],
  1472. [AC_MSG_WARN([Could not find or use python distutils module: $python_result])],
  1473. [AC_MSG_ERROR([Could not find or use python distutils module: $python_result])]
  1474. )
  1475. fi
  1476. LIBS="$save_LIBS"
  1477. CFLAGS="$save_CFLAGS"
  1478. unset python_has_threads
  1479. unset python_has_distutils
  1480. unset python_result
  1481. else
  1482. AS_IF([test "$with_python" = "try"],
  1483. [AC_MSG_WARN([Could not find python, mod_python will not build, use --with-python to specify the location])],
  1484. [AC_MSG_ERROR([Could not find python, use --with-python to specify the location])]
  1485. )
  1486. fi
  1487. else
  1488. AC_MSG_WARN([python support disabled, building mod_python will fail!])
  1489. fi
  1490. #
  1491. # SNMP checks for mod_snmp
  1492. #
  1493. AC_PATH_PROG([NET_SNMP_CONFIG], [net-snmp-config], [no])
  1494. if test "$NET_SNMP_CONFIG" != "no"; then
  1495. AC_MSG_CHECKING([for Net-SNMP libraries via net-snmp-config])
  1496. SNMP_LIBS="`$NET_SNMP_CONFIG --base-agent-libs`"
  1497. else
  1498. # net-snmp-config not in path, fallback to sensible defaults
  1499. SNMP_LIBS="-lnetsnmpmibs -lnetsnmpagent -lnetsnmp"
  1500. fi
  1501. # fix linking error on Solaris patched Net-SNMP
  1502. AS_CASE([$host], [*-solaris2*], [AC_CHECK_LIB([dladm], [dladm_open], [SNMP_LIBS="$SNMP_LIBS -ldladm"])])
  1503. AC_SUBST(SNMP_LIBS)
  1504. CHECK_ERLANG
  1505. # we never use this, and hard setting it will make cross compile work better
  1506. ac_cv_file_dbd_apr_dbd_mysql_c=no
  1507. AC_CONFIG_FILES([Makefile
  1508. build/Makefile
  1509. src/Makefile
  1510. src/mod/Makefile
  1511. src/mod/applications/mod_abstraction/Makefile
  1512. src/mod/applications/mod_avmd/Makefile
  1513. src/mod/applications/mod_bert/Makefile
  1514. src/mod/applications/mod_blacklist/Makefile
  1515. src/mod/applications/mod_callcenter/Makefile
  1516. src/mod/applications/mod_cidlookup/Makefile
  1517. src/mod/applications/mod_cluechoo/Makefile
  1518. src/mod/applications/mod_commands/Makefile
  1519. src/mod/applications/mod_conference/Makefile
  1520. src/mod/applications/mod_curl/Makefile
  1521. src/mod/applications/mod_cv/Makefile
  1522. src/mod/applications/mod_db/Makefile
  1523. src/mod/applications/mod_directory/Makefile
  1524. src/mod/applications/mod_distributor/Makefile
  1525. src/mod/applications/mod_dptools/Makefile
  1526. src/mod/applications/mod_easyroute/Makefile
  1527. src/mod/applications/mod_enum/Makefile
  1528. src/mod/applications/mod_esf/Makefile
  1529. src/mod/applications/mod_esl/Makefile
  1530. src/mod/applications/mod_expr/Makefile
  1531. src/mod/applications/mod_fifo/Makefile
  1532. src/mod/applications/mod_fsk/Makefile
  1533. src/mod/applications/mod_fsv/Makefile
  1534. src/mod/applications/mod_hash/Makefile
  1535. src/mod/applications/mod_hiredis/Makefile
  1536. src/mod/applications/mod_httapi/Makefile
  1537. src/mod/applications/mod_http_cache/Makefile
  1538. src/mod/applications/mod_ladspa/Makefile
  1539. src/mod/applications/mod_lcr/Makefile
  1540. src/mod/applications/mod_limit/Makefile
  1541. src/mod/applications/mod_memcache/Makefile
  1542. src/mod/applications/mod_mongo/Makefile
  1543. src/mod/applications/mod_mp4/Makefile
  1544. src/mod/applications/mod_mp4v2/Makefile
  1545. src/mod/applications/mod_nibblebill/Makefile
  1546. src/mod/applications/mod_oreka/Makefile
  1547. src/mod/applications/mod_osp/Makefile
  1548. src/mod/applications/mod_prefix/Makefile
  1549. src/mod/applications/mod_rad_auth/Makefile
  1550. src/mod/applications/mod_random/Makefile
  1551. src/mod/applications/mod_redis/Makefile
  1552. src/mod/applications/mod_rss/Makefile
  1553. src/mod/applications/mod_skel/Makefile
  1554. src/mod/applications/mod_sms/Makefile
  1555. src/mod/applications/mod_sms_flowroute/Makefile
  1556. src/mod/applications/mod_snapshot/Makefile
  1557. src/mod/applications/mod_snom/Makefile
  1558. src/mod/applications/mod_sonar/Makefile
  1559. src/mod/applications/mod_soundtouch/Makefile
  1560. src/mod/applications/mod_spandsp/Makefile
  1561. src/mod/applications/mod_spy/Makefile
  1562. src/mod/applications/mod_stress/Makefile
  1563. src/mod/applications/mod_translate/Makefile
  1564. src/mod/applications/mod_valet_parking/Makefile
  1565. src/mod/applications/mod_vmd/Makefile
  1566. src/mod/applications/mod_voicemail/Makefile
  1567. src/mod/applications/mod_voicemail_ivr/Makefile
  1568. src/mod/asr_tts/mod_cepstral/Makefile
  1569. src/mod/asr_tts/mod_flite/Makefile
  1570. src/mod/asr_tts/mod_pocketsphinx/Makefile
  1571. src/mod/asr_tts/mod_tts_commandline/Makefile
  1572. src/mod/asr_tts/mod_unimrcp/Makefile
  1573. src/mod/codecs/mod_amr/Makefile
  1574. src/mod/codecs/mod_amrwb/Makefile
  1575. src/mod/codecs/mod_b64/Makefile
  1576. src/mod/codecs/mod_bv/Makefile
  1577. src/mod/codecs/mod_codec2/Makefile
  1578. src/mod/codecs/mod_com_g729/Makefile
  1579. src/mod/codecs/mod_dahdi_codec/Makefile
  1580. src/mod/codecs/mod_clearmode/Makefile
  1581. src/mod/codecs/mod_g723_1/Makefile
  1582. src/mod/codecs/mod_g729/Makefile
  1583. src/mod/codecs/mod_h26x/Makefile
  1584. src/mod/codecs/mod_ilbc/Makefile
  1585. src/mod/codecs/mod_isac/Makefile
  1586. src/mod/codecs/mod_mp4v/Makefile
  1587. src/mod/codecs/mod_opus/Makefile
  1588. src/mod/codecs/mod_openh264/Makefile
  1589. src/mod/codecs/mod_sangoma_codec/Makefile
  1590. src/mod/codecs/mod_silk/Makefile
  1591. src/mod/codecs/mod_siren/Makefile
  1592. src/mod/codecs/mod_skel_codec/Makefile
  1593. src/mod/codecs/mod_theora/Makefile
  1594. src/mod/dialplans/mod_dialplan_asterisk/Makefile
  1595. src/mod/dialplans/mod_dialplan_directory/Makefile
  1596. src/mod/dialplans/mod_dialplan_xml/Makefile
  1597. src/mod/directories/mod_ldap/Makefile
  1598. src/mod/endpoints/mod_alsa/Makefile
  1599. src/mod/endpoints/mod_dingaling/Makefile
  1600. src/mod/endpoints/mod_gsmopen/Makefile
  1601. src/mod/endpoints/mod_h323/Makefile
  1602. src/mod/endpoints/mod_khomp/Makefile
  1603. src/mod/endpoints/mod_loopback/Makefile
  1604. src/mod/endpoints/mod_opal/Makefile
  1605. src/mod/endpoints/mod_portaudio/Makefile
  1606. src/mod/endpoints/mod_reference/Makefile
  1607. src/mod/endpoints/mod_rtmp/Makefile
  1608. src/mod/endpoints/mod_skinny/Makefile
  1609. src/mod/endpoints/mod_skypopen/Makefile
  1610. src/mod/endpoints/mod_sofia/Makefile
  1611. src/mod/endpoints/mod_unicall/Makefile
  1612. src/mod/endpoints/mod_rtc/Makefile
  1613. src/mod/endpoints/mod_verto/Makefile
  1614. src/mod/event_handlers/mod_amqp/Makefile
  1615. src/mod/event_handlers/mod_cdr_csv/Makefile
  1616. src/mod/event_handlers/mod_cdr_mongodb/Makefile
  1617. src/mod/event_handlers/mod_cdr_pg_csv/Makefile
  1618. src/mod/event_handlers/mod_cdr_sqlite/Makefile
  1619. src/mod/event_handlers/mod_erlang_event/Makefile
  1620. src/mod/event_handlers/mod_event_multicast/Makefile
  1621. src/mod/event_handlers/mod_event_socket/Makefile
  1622. src/mod/event_handlers/mod_event_test/Makefile
  1623. src/mod/event_handlers/mod_format_cdr/Makefile
  1624. src/mod/event_handlers/mod_json_cdr/Makefile
  1625. src/mod/event_handlers/mod_kazoo/Makefile
  1626. src/mod/event_handlers/mod_radius_cdr/Makefile
  1627. src/mod/event_handlers/mod_odbc_cdr/Makefile
  1628. src/mod/event_handlers/mod_rayo/Makefile
  1629. src/mod/event_handlers/mod_smpp/Makefile
  1630. src/mod/event_handlers/mod_snmp/Makefile
  1631. src/mod/event_handlers/mod_event_zmq/Makefile
  1632. src/mod/formats/mod_imagick/Makefile
  1633. src/mod/formats/mod_local_stream/Makefile
  1634. src/mod/formats/mod_native_file/Makefile
  1635. src/mod/formats/mod_shell_stream/Makefile
  1636. src/mod/formats/mod_shout/Makefile
  1637. src/mod/formats/mod_sndfile/Makefile
  1638. src/mod/formats/mod_ssml/Makefile
  1639. src/mod/formats/mod_tone_stream/Makefile
  1640. src/mod/formats/mod_vlc/Makefile
  1641. src/mod/formats/mod_portaudio_stream/Makefile
  1642. src/mod/languages/mod_java/Makefile
  1643. src/mod/languages/mod_lua/Makefile
  1644. src/mod/languages/mod_managed/Makefile
  1645. src/mod/languages/mod_perl/Makefile
  1646. src/mod/languages/mod_python/Makefile
  1647. src/mod/languages/mod_v8/Makefile
  1648. src/mod/languages/mod_yaml/Makefile
  1649. src/mod/languages/mod_basic/Makefile
  1650. src/mod/loggers/mod_console/Makefile
  1651. src/mod/loggers/mod_graylog2/Makefile
  1652. src/mod/loggers/mod_logfile/Makefile
  1653. src/mod/loggers/mod_syslog/Makefile
  1654. src/mod/say/mod_say_de/Makefile
  1655. src/mod/say/mod_say_en/Makefile
  1656. src/mod/say/mod_say_es/Makefile
  1657. src/mod/say/mod_say_es_ar/Makefile
  1658. src/mod/say/mod_say_fa/Makefile
  1659. src/mod/say/mod_say_fr/Makefile
  1660. src/mod/say/mod_say_he/Makefile
  1661. src/mod/say/mod_say_hr/Makefile
  1662. src/mod/say/mod_say_hu/Makefile
  1663. src/mod/say/mod_say_it/Makefile
  1664. src/mod/say/mod_say_ja/Makefile
  1665. src/mod/say/mod_say_nl/Makefile
  1666. src/mod/say/mod_say_pl/Makefile
  1667. src/mod/say/mod_say_pt/Makefile
  1668. src/mod/say/mod_say_ru/Makefile
  1669. src/mod/say/mod_say_sv/Makefile
  1670. src/mod/say/mod_say_th/Makefile
  1671. src/mod/say/mod_say_zh/Makefile
  1672. src/mod/timers/mod_posix_timer/Makefile
  1673. src/mod/timers/mod_timerfd/Makefile
  1674. src/mod/xml_int/mod_xml_cdr/Makefile
  1675. src/mod/xml_int/mod_xml_curl/Makefile
  1676. src/mod/xml_int/mod_xml_ldap/Makefile
  1677. src/mod/xml_int/mod_xml_radius/Makefile
  1678. src/mod/xml_int/mod_xml_rpc/Makefile
  1679. src/mod/xml_int/mod_xml_scgi/Makefile
  1680. src/mod/applications/mod_av/Makefile
  1681. src/include/switch_am_config.h
  1682. build/getsounds.sh
  1683. build/getlib.sh
  1684. build/getg729.sh
  1685. build/freeswitch.pc
  1686. build/modmake.rules
  1687. libs/esl/Makefile
  1688. libs/esl/perl/Makefile
  1689. libs/esl/php/Makefile
  1690. libs/xmlrpc-c/include/xmlrpc-c/config.h
  1691. libs/xmlrpc-c/xmlrpc_config.h
  1692. libs/xmlrpc-c/config.mk
  1693. libs/xmlrpc-c/srcdir.mk
  1694. libs/xmlrpc-c/stamp-h
  1695. scripts/gentls_cert])
  1696. AM_CONDITIONAL(ISLINUX, [test `uname -s` = Linux])
  1697. AM_CONDITIONAL(ISMAC, [test `uname -s` = Darwin])
  1698. AM_CONDITIONAL(ISFREEBSD, [test `uname -s` = FreeBSD])
  1699. AM_CONDITIONAL(IS64BITLINUX, [test `uname -m` = x86_64])
  1700. AM_CONDITIONAL(HAVE_AMR, [ test -d ${switch_srcdir}/libs/amr ])
  1701. AM_CONDITIONAL(HAVE_AMRWB, [ test -d ${switch_srcdir}/libs/amrwb ])
  1702. AM_CONDITIONAL(HAVE_G723_1, [ test -d ${switch_srcdir}/libs/libg723_1 ])
  1703. AM_CONDITIONAL(HAVE_G729, [ test -d ${switch_srcdir}/libs/libg729 ])
  1704. #some vars to sub into the Makefile.am's
  1705. #LIBS+=> core.log || error="yes";if test -n "$(VERBOSE)" -o "$$error" = "yes";then cat core.log;fi;if test "$$error" = "yes";then exit 1;fi
  1706. LIBTOOL='$(SHELL) $(switch_builddir)/libtool'
  1707. TOUCH_TARGET='if test -f "$@";then touch "$@";fi;'
  1708. CONF_MODULES='$$(grep -v "\#" $(switch_builddir)/modules.conf | sed -e "s|^.*/||" | sort | uniq )'
  1709. CONF_DISABLED_MODULES='$$(grep "\#" $(switch_builddir)/modules.conf | grep -v "\#\#" | sed -e "s|^.*/||" | sort | uniq )'
  1710. OUR_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-all ; done )"; echo $$mods )'
  1711. OUR_CLEAN_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-clean ; done )"; echo $$mods )'
  1712. OUR_INSTALL_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-install ; done)"; echo $$mods )'
  1713. OUR_UNINSTALL_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-uninstall ; done)"; echo $$mods )'
  1714. OUR_DISABLED_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-all ; done )"; echo $$mods )'
  1715. OUR_DISABLED_CLEAN_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-clean ; done )"; echo $$mods )'
  1716. OUR_DISABLED_INSTALL_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-install ; done)"; echo $$mods )'
  1717. OUR_DISABLED_UNINSTALL_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-uninstall ; done)"; echo $$mods )'
  1718. #AM_MAKEFLAGS='"OUR_MODULES=$(OUR_MODS)" "OUR_CLEAN_MODULES=$(OUR_CLEAN_MODS)" "OUR_INSTALL_MODULES=$(OUR_INSTALL_MODS)" "OUR_UNINSTALL_MODULES=$(OUR_UNINSTALL_MODS)" "OUR_DISABLED_MODULES=$(OUR_DISABLED_MODS)" "OUR_DISABLED_CLEAN_MODULES=$(OUR_DISABLED_CLEAN_MODS)" "OUR_DISABLED_INSTALL_MODULES=$(OUR_DISABLED_INSTALL_MODS)" "OUR_DISABLED_UNINSTALL_MODULES=$(OUR_DISABLED_UNINSTALL_MODS)" `test -n "$(VERBOSE)" || echo -s`'
  1719. #AM_MAKEFLAGS='`test -n "$(VERBOSE)" || echo -s`'
  1720. AC_SUBST(LIBTOOL)
  1721. AC_SUBST(TOUCH_TARGET)
  1722. AC_SUBST(CONF_DISABLED_MODULES)
  1723. AC_SUBST(CONF_MODULES)
  1724. AC_SUBST(OUR_MODS)
  1725. AC_SUBST(OUR_CLEAN_MODS)
  1726. AC_SUBST(OUR_INSTALL_MODS)
  1727. AC_SUBST(OUR_UNINSTALL_MODS)
  1728. AC_SUBST(OUR_DISABLED_MODS)
  1729. AC_SUBST(OUR_DISABLED_CLEAN_MODS)
  1730. AC_SUBST(OUR_DISABLED_INSTALL_MODS)
  1731. AC_SUBST(OUR_DISABLED_UNINSTALL_MODS)
  1732. AC_SUBST(AM_MAKEFLAGS)
  1733. ac_configure_args="$ac_configure_args --with-modinstdir=${modulesdir} CONFIGURE_CFLAGS='$CFLAGS $CPPFLAGS' CONFIGURE_CXXFLAGS='$CXXFLAGS $CPPFLAGS' CONFIGURE_LDFLAGS='$LDFLAGS' "
  1734. # --prefix='$prefix' --exec_prefix='$exec_prefix' --libdir='$libdir' --libexecdir='$libexecdir' --bindir='$bindir' --sbindir='$sbindir' \
  1735. # --localstatedir='$localstatedir' --datadir='$datadir'"
  1736. # Run configure in all the subdirs
  1737. AC_CONFIG_SUBDIRS([libs/srtp])
  1738. if test "$use_system_apr" != "yes"; then
  1739. AC_CONFIG_SUBDIRS([libs/apr])
  1740. fi
  1741. if test "$use_system_aprutil" != "yes"; then
  1742. AC_CONFIG_SUBDIRS([libs/apr-util])
  1743. fi
  1744. AC_CONFIG_SUBDIRS([libs/iksemel])
  1745. AC_CONFIG_SUBDIRS([libs/libdingaling])
  1746. AC_CONFIG_SUBDIRS([libs/sofia-sip])
  1747. AC_CONFIG_SUBDIRS([libs/freetdm])
  1748. AC_CONFIG_SUBDIRS([libs/unimrcp])
  1749. AC_CONFIG_SUBDIRS([libs/tiff-4.0.2])
  1750. AC_CONFIG_SUBDIRS([libs/spandsp])
  1751. if test "x${enable_zrtp}" = "xyes"; then
  1752. AC_CONFIG_SUBDIRS([libs/libzrtp])
  1753. fi
  1754. case $host in
  1755. *-openbsd*|*-netbsd*)
  1756. # libtool won't link static libs against shared ones on NetBSD/OpenBSD unless we tell it not to be stupid
  1757. AC_CONFIG_COMMANDS([hacklibtool], [cp libtool libtool.orig && sed -e "s/deplibs_check_method=.*/deplibs_check_method=pass_all/g" libtool.orig > libtool])
  1758. ;;
  1759. esac
  1760. AC_OUTPUT
  1761. ##
  1762. ## Configuration summary
  1763. ##
  1764. echo
  1765. echo "-------------------------- FreeSWITCH configuration --------------------------"
  1766. echo ""
  1767. echo " Locations:"
  1768. echo ""
  1769. echo " prefix: ${prefix}"
  1770. echo " exec_prefix: ${exec_prefix}"
  1771. echo " bindir: ${bindir}"
  1772. echo " confdir: ${confdir}"
  1773. echo " libdir: ${libdir}"
  1774. echo " datadir: ${datadir}"
  1775. echo " localstatedir: ${localstatedir}"
  1776. echo " includedir: ${includedir}"
  1777. echo ""
  1778. echo " certsdir: ${certsdir}"
  1779. echo " dbdir: ${dbdir}"
  1780. echo " grammardir: ${grammardir}"
  1781. echo " htdocsdir: ${htdocsdir}"
  1782. echo " fontsdir: ${fontsdir}"
  1783. echo " logfiledir: ${logfiledir}"
  1784. echo " modulesdir: ${modulesdir}"
  1785. echo " pkgconfigdir: ${pkgconfigdir}"
  1786. echo " recordingsdir: ${recordingsdir}"
  1787. echo " imagesdir: ${imagesdir}"
  1788. echo " runtimedir: ${runtimedir}"
  1789. echo " scriptdir: ${scriptdir}"
  1790. echo " soundsdir: ${soundsdir}"
  1791. echo " storagedir: ${storagedir}"
  1792. echo " cachedir: ${cachedir}"
  1793. echo ""
  1794. echo "------------------------------------------------------------------------------"