configure.ac 79 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167
  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.10.6-dev], bugs@freeswitch.org)
  6. AC_SUBST(SWITCH_VERSION_MAJOR, [1])
  7. AC_SUBST(SWITCH_VERSION_MINOR, [10])
  8. AC_SUBST(SWITCH_VERSION_MICRO, [6-dev])
  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 -ffast-math)
  361. APR_ADDTO(SWITCH_AM_CXXFLAGS, -fPIC -ffast-math)
  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 -ffast-math)
  365. APR_ADDTO(SWITCH_AM_CXXFLAGS, -fPIC -ffast-math)
  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. case "${ax_cv_c_compiler_vendor}" in
  397. sun)
  398. VISIBILITY_FLAG=-xldscope=hidden
  399. ;;
  400. *)
  401. VISIBILITY_FLAG=-fvisibility=hidden
  402. ;;
  403. esac
  404. AC_SUBST(VISIBILITY_FLAG)
  405. #
  406. # gcc visibility cflag checks
  407. #
  408. AC_ARG_ENABLE([visibility],
  409. [AS_HELP_STRING([--disable-visibility], [Disable or enable API visibility support (default: use if available)])],
  410. [enable_visibility="${enableval}"],
  411. [enable_visibility="detect"]
  412. )
  413. HAVE_VISIBILITY="no"
  414. if test "x${enable_visibility}" != "xno" ; then
  415. case "${ax_cv_c_compiler_vendor}" in
  416. gnu)
  417. save_CFLAGS="${CFLAGS}"
  418. CFLAGS="${CFLAGS} -fvisibility=hidden"
  419. AC_MSG_CHECKING([whether the compiler supports -fvisibility=hidden])
  420. AC_COMPILE_IFELSE(
  421. [AC_LANG_PROGRAM(
  422. [int foo __attribute__ ((visibility("default")));],
  423. [;]
  424. )],
  425. [AC_MSG_RESULT([yes])
  426. APR_ADDTO([SWITCH_AM_CFLAGS], [-fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DCJSON_API_VISIBILITY=1 -DHAVE_VISIBILITY=1])
  427. APR_ADDTO([SWITCH_AM_CXXFLAGS], [-fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DCJSON_API_VISIBILITY=1 -DHAVE_VISIBILITY=1])
  428. HAVE_VISIBILITY="yes"],
  429. [AC_MSG_RESULT([no])]
  430. )
  431. CFLAGS="${save_CFLAGS}"
  432. ;;
  433. sun)
  434. # save_CFLAGS="${CFLAGS}"
  435. # CFLAGS="${CFLAGS} -xldscope=hidden"
  436. # AC_MSG_CHECKING([whether the compiler supports -xldscope=hidden])
  437. # AC_COMPILE_IFELSE(
  438. # [AC_LANG_PROGRAM(
  439. # [int foo __attribute__ ((visibility("default")));],
  440. # [;]
  441. # )],
  442. #
  443. # [AC_MSG_RESULT([yes])
  444. # APR_ADDTO([SWITCH_AM_CFLAGS], [-xldscope=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1])
  445. # APR_ADDTO([SWITCH_AM_CXXFLAGS], [-xldscope=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1])
  446. # HAVE_VISIBILITY="yes"],
  447. #
  448. # [AC_MSG_RESULT([no])]
  449. # )
  450. # CFLAGS="${save_CFLAGS}"
  451. ;;
  452. *)
  453. if test "x${enable_visibility}" = "xyes" ; then
  454. AC_MSG_ERROR([Non-GNU / SUN compilers are currently unsupported])
  455. else
  456. AC_MSG_WARN([Non-GNU / SUN compilers are currently unsupported])
  457. fi
  458. ;;
  459. esac
  460. #
  461. # visibility explicitly requested but not supported by this compiler => error
  462. #
  463. if test "x${enable_visibility}" = "xyes" -a "x${HAVE_VISIBILITY}" = "xno" ; then
  464. AC_MSG_ERROR([API visibility not supported by this compiler])
  465. fi
  466. fi
  467. # Enable debugging (default: on)
  468. # (rename option if the default is changed)
  469. AC_ARG_ENABLE(debug,
  470. [AC_HELP_STRING([--disable-debug],[build without debug information])],[enable_debug="$enableval"],[enable_debug="yes"])
  471. if test "${enable_debug}" = "yes"; then
  472. AC_DEFINE([DEBUG],[],[Enable extra debugging.])
  473. saved_CFLAGS="$CFLAGS"
  474. CFLAGS=
  475. AX_CFLAGS_WARN_ALL_ANSI
  476. SWITCH_ANSI_CFLAGS=$CFLAGS
  477. CFLAGS="$saved_CFLAGS"
  478. if test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
  479. if test "$ac_cv_gcc_supports_w_no_unused_result" = yes; then
  480. APR_ADDTO(SWITCH_AM_CFLAGS, -Wno-unused-result)
  481. fi
  482. APR_ADDTO(SWITCH_AM_CFLAGS, -g -ggdb)
  483. export DEBUG_CFLAGS="-g -ggdb"
  484. fi
  485. fi
  486. AC_ARG_ENABLE(libyuv,
  487. [AC_HELP_STRING([--disable-libyuv],[build without libyuv])],[enable_libyuv="$enableval"],[enable_libyuv="yes"])
  488. AM_CONDITIONAL([ENABLE_LIBYUV],[test "${enable_libyuv}" = "yes"])
  489. AC_ARG_ENABLE(libvpx,
  490. [AC_HELP_STRING([--disable-libvpx],[build without libvpx])],[enable_libvpx="$enableval"],[enable_libvpx="yes"])
  491. AM_CONDITIONAL([ENABLE_LIBVPX],[test "${enable_libvpx}" = "yes"])
  492. AC_ARG_ENABLE(cpp,
  493. [AC_HELP_STRING([--disable-cpp],[build without cpp code])],[enable_cpp="$enableval"],[enable_cpp="yes"])
  494. AM_CONDITIONAL([ENABLE_CPP],[test "${enable_cpp}" = "yes"])
  495. AM_CONDITIONAL([DISABLE_CC],[test "${disable_cc}" = "yes"])
  496. AC_ARG_ENABLE([system-xmlrpc-c],
  497. [AS_HELP_STRING([--enable-system-xmlrpc-c],
  498. [use system lib for xmlrpc-c])],,
  499. [enable_xmlrpcc="no"])
  500. if test "${enable_xmlrpcc}" = "yes" ; then
  501. SYS_XMLRPC_CFLAGS=`xmlrpc-c-config --cflags`
  502. SYS_XMLRPC_LDFLAGS=`xmlrpc-c-config --libs`
  503. fi
  504. AC_SUBST(SYS_XMLRPC_CFLAGS)
  505. AC_SUBST(SYS_XMLRPC_LDFLAGS)
  506. AM_CONDITIONAL([SYSTEM_XMLRPCC],[test "${enable_xmlrpcc}" = "yes"])
  507. for luaversion in luajit lua5.2 lua-5.2 lua52 lua5.1 lua-5.1 lua; do
  508. PKG_CHECK_MODULES([LUA],[${luaversion}],[have_lua=yes],[have_lua=no])
  509. if test ${have_lua} = yes; then
  510. break
  511. fi
  512. done
  513. if test x"${LUA_LIBS}" = x"" ; then
  514. LUA_LIBS="-llua"
  515. fi
  516. AC_ARG_ENABLE(srtp,
  517. [AC_HELP_STRING([--disable-srtp],[build without srtp support])],[enable_srtp="$enableval"],[enable_srtp="yes"])
  518. AM_CONDITIONAL([ENABLE_SRTP],[test "${enable_srtp}" = "yes"])
  519. have_openal=no
  520. AC_CHECK_LIB(openal, alMidiGainSOFT, [have_openal="yes"])
  521. AM_CONDITIONAL([HAVE_OPENAL],[test "${have_openal}" = "yes"])
  522. AC_ARG_ENABLE(zrtp,
  523. [AS_HELP_STRING([--enable-zrtp], [Compile with zrtp Support])],,[enable_zrtp="no"])
  524. if test "x$enable_zrtp" = "xyes" ; then
  525. LIBS="-lpthread $LIBS"
  526. APR_ADDTO(SWITCH_AM_CFLAGS, -DENABLE_ZRTP)
  527. fi
  528. PA_LIBS=
  529. PKG_CHECK_MODULES(JACK, jack, have_jack=yes, have_jack=no)
  530. if test "x$have_jack" = "xyes" ; then
  531. PA_LIBS+=$JACK_LIBS
  532. fi
  533. AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no)
  534. if test "x$have_alsa" = "xyes" ; then
  535. PA_LIBS+=-lasound
  536. fi
  537. AC_SUBST(PA_LIBS)
  538. AM_CONDITIONAL([ENABLE_ZRTP],[test "x$enable_zrtp" != "xno"])
  539. AM_CONDITIONAL([WANT_DEBUG],[test "${enable_debug}" = "yes"])
  540. AC_ARG_ENABLE(core-odbc-support,
  541. [AS_HELP_STRING([--enable-core-odbc-support], [Compile with ODBC Support (default is optional)])],,[enable_core_odbc_support="optional"])
  542. if ! test "$enable_core_odbc_support" = "no"; then
  543. AX_LIB_ODBC
  544. if test "$ac_cv_found_odbc" = "yes" ; then
  545. enable_core_odbc_support="yes"
  546. elif test "$enable_core_odbc_support" = "yes"; then
  547. AC_MSG_ERROR([no usable libodbc; please install unixodbc devel package or equivalent])
  548. else
  549. enable_core_odbc_support="no"
  550. fi
  551. fi
  552. CHECK_LIBUUID
  553. SWITCH_AM_LDFLAGS="$LIBUUID_LIBS $SWITCH_AM_LDFLAGS"
  554. SWITCH_AM_CFLAGS="$LIBUUID_CFLAGS $SWITCH_AM_CFLAGS"
  555. AC_ARG_ENABLE(core-pgsql-pkgconfig,
  556. [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"])
  557. path_remove () {
  558. echo "$1" | tr ':' '\n' | grep -Fxv "$2" | tr '\n' ':' | sed 's/:$//'
  559. }
  560. path_push_unique () {
  561. x="$(eval echo \$$1)"
  562. x="$(path_remove "$x" "$2")"
  563. if test -z "$x"; then
  564. eval export $1="$2"
  565. else
  566. eval export $1="$2:$x"
  567. fi
  568. }
  569. AC_PATH_PROG([PG_CONFIG], [pg_config], [no])
  570. AC_PATH_PROG([PKG_CONFIG], [pkg-config], [no])
  571. case $host in
  572. *-darwin*)
  573. path_push_unique PKG_CONFIG_PATH /usr/local/opt/libpq/lib/pkgconfig
  574. ;;
  575. esac
  576. if test "$PKG_CONFIG" = "no" \
  577. || test x"$enable_core_pgsql_pkgconfig" = x"no" \
  578. || ! pkg-config libpq; then
  579. if test "$PG_CONFIG" != "no"; then
  580. AC_MSG_CHECKING([for PostgreSQL libraries via pg_config])
  581. POSTGRESQL_CFLAGS="-I`$PG_CONFIG --includedir`"
  582. POSTGRESQL_LIBDIR="-L`$PG_CONFIG --libdir`"
  583. POSTGRESQL_LDFLAGS="-L`$PG_CONFIG --libdir` -lpq"
  584. POSTGRESQL_VERSION=`$PG_CONFIG --version | awk '{ print $NF }'`
  585. POSTGRESQL_MAJOR_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $1 }'`
  586. POSTGRESQL_MINOR_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $2 }'`
  587. POSTGRESQL_PATCH_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $3 }'`
  588. fi
  589. else
  590. AC_MSG_CHECKING([for PostgreSQL libraries via pkg_config])
  591. POSTGRESQL_CFLAGS="`$PKG_CONFIG --cflags libpq`"
  592. POSTGRESQL_LIBDIR="`$PKG_CONFIG libpq --libs-only-L`"
  593. POSTGRESQL_LDFLAGS="`$PKG_CONFIG --libs libpq`"
  594. POSTGRESQL_VERSION="`$PKG_CONFIG --modversion libpq`"
  595. POSTGRESQL_MAJOR_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f1 | sed 's/^\([[0-9]]*\)[[^0-9]].*/\1/'`"
  596. POSTGRESQL_MINOR_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f2 | sed 's/^\([[0-9]]*\)[[^0-9]].*/\1/'`"
  597. POSTGRESQL_PATCH_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f3 | sed 's/^\([[0-9]]*\)[[^0-9]].*/\1/'`"
  598. test -n "$POSTGRESQL_PATCH_VERSION" || POSTGRESQL_PATCH_VERSION=0
  599. fi
  600. AC_MSG_RESULT([$POSTGRESQL_LIBDIR])
  601. AC_DEFINE_UNQUOTED([POSTGRESQL_VERSION], "${POSTGRESQL_VERSION}", [Specifies the version of PostgreSQL we are linking against])
  602. AC_DEFINE_UNQUOTED([POSTGRESQL_MAJOR_VERSION], ${POSTGRESQL_MAJOR_VERSION}, [Specifies the version of PostgreSQL we are linking against])
  603. AC_DEFINE_UNQUOTED([POSTGRESQL_MINOR_VERSION], ${POSTGRESQL_MINOR_VERSION}, [Specifies the version of PostgreSQL we are linking against])
  604. AC_DEFINE_UNQUOTED([POSTGRESQL_PATCH_VERSION], ${POSTGRESQL_PATCH_VERSION}, [Specifies the version of PostgreSQL we are linking against])
  605. have_libpq=no
  606. AC_CHECK_LIB([pq], [PQgetvalue], [have_libpq="yes"])
  607. AM_CONDITIONAL([HAVE_PGSQL],[test "${have_libpq}" = "yes"])
  608. AC_SUBST([POSTGRESQL_CFLAGS], [$POSTGRESQL_CFLAGS])
  609. AC_SUBST([POSTGRESQL_LDFLAGS], [$POSTGRESQL_LDFLAGS])
  610. AC_SUBST([POSTGRESQL_LIBDIR], [$POSTGRESQL_LIBDIR])
  611. PKG_CHECK_MODULES([MARIADB], [libmariadb >= 3.0.9],[
  612. AM_CONDITIONAL([HAVE_MARIADB],[true])],[
  613. PKG_CHECK_MODULES([MARIADB], [mariadb >= 3.0.9],[
  614. AM_CONDITIONAL([HAVE_MARIADB],[true])],[
  615. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MARIADB],[false])
  616. ])
  617. ])
  618. PKG_CHECK_MODULES([SPANDSP], [spandsp >= 3.0],[
  619. AM_CONDITIONAL([HAVE_SPANDSP],[true])],[
  620. AC_MSG_ERROR([no usable spandsp; please install spandsp3 devel package or equivalent])
  621. ])
  622. PKG_CHECK_MODULES([SOFIA_SIP], [sofia-sip-ua >= 1.12.12],[
  623. AM_CONDITIONAL([HAVE_SOFIA_SIP],[true])],[
  624. AC_MSG_ERROR([no usable sofia-sip; please install sofia-sip-ua devel package or equivalent])
  625. ])
  626. AC_ARG_ENABLE(deprecated-core-db-events,
  627. [AS_HELP_STRING([--enable-deprecated-core-db-events], [Keep deprecated core db events])],,[enable_deprecated_core_db_events="no"])
  628. if test x"$enable_deprecated_core_db_events" = x"yes" ; then
  629. AC_DEFINE([SWITCH_DEPRECATED_CORE_DB], [1], [Define to 1 to enable deprecated core db events])
  630. fi
  631. ESL_LDFLAGS=
  632. PLATFORM_CORE_LDFLAGS=
  633. PLATFORM_CORE_LIBS=
  634. # tweak platform specific flags
  635. case "$host" in
  636. *darwin*)
  637. # Common Apple Darwin settings
  638. APR_ADDTO(SWITCH_AM_CFLAGS, -DMACOSX)
  639. APR_REMOVEFROM(SWITCH_AM_CFLAGS, -fPIC)
  640. APR_ADDTO(CPPFLAGS, -I/usr/local/opt/openssl/include)
  641. APR_ADDTO(LDFLAGS, -L/usr/local/opt/openssl/lib)
  642. if test "x$enable_core_odbc_support" != "xno"; then
  643. APR_ADDTO([PLATFORM_CORE_LDFLAGS], [--framework CoreFoundation])
  644. fi
  645. APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl])
  646. # Get OSX and clang version
  647. osxvrm=`sw_vers -productVersion` # Get version.release.modlevel
  648. osxrel=`echo $osxvrm | cut -d. -f2` # Get release only
  649. clangvers="`clang -v 2>&1 >/dev/null | grep version | sed -e 's/.*version \([[0-9]]*\).*$/\1/'`"
  650. if test "$clangvers" -ge 6; then # Xcode 6 drops std lib search, add it to clang
  651. APR_ADDTO(LDFLAGS, -L/usr/local/lib)
  652. APR_ADDTO(CPPFLAGS, -I/usr/local/include)
  653. fi
  654. if test "$clangvers" -ge 4; then # Xcode 4 / 10.7 and up
  655. APR_ADDTO(CFLAGS, -Wno-deprecated-declarations)
  656. fi
  657. if test "$osxrel" -ge 6; then # 10.6 and up
  658. APR_ADDTO(CFLAGS, -pipe -no-cpp-precomp)
  659. APR_ADDTO(LDFLAGS, -pipe -bind_at_load)
  660. APR_ADDTO(CXXFLAGS, -pipe)
  661. fi
  662. ;;
  663. *-solaris2*)
  664. if test "${enable_64}" = "yes"; then
  665. APR_ADDTO(CPPFLAGS, [-I/opt/64/include])
  666. APR_ADDTO(LDFLAGS, [-L/opt/64/lib -Wl,-rpath,/opt/64/lib])
  667. APR_ADDTO(SWITCH_AM_CFLAGS, [-I/opt/64/include])
  668. APR_ADDTO(SWITCH_AM_LDFLAGS, [-L/opt/64/lib -Wl,-rpath,/opt/64/lib])
  669. else
  670. APR_ADDTO(CPPFLAGS, [-I/opt/include])
  671. APR_ADDTO(LDFLAGS, [-L/opt/lib -Wl,-rpath,/opt/lib])
  672. APR_ADDTO(SWITCH_AM_CFLAGS, [-I/opt/include])
  673. APR_ADDTO(SWITCH_AM_LDFLAGS, [-L/opt/lib -Wl,-rpath,/opt/lib])
  674. fi
  675. APR_ADDTO(SWITCH_AM_CFLAGS, -DPATH_MAX=2048 -D__EXTENSIONS__)
  676. APR_ADDTO(SWITCH_AM_LDFLAGS, -lsendfile -lresolv -lsocket -lnsl -luuid)
  677. APR_ADDTO(ESL_LDFLAGS, -lnsl -lsocket)
  678. APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl -lcrypt -lrt -lsendfile -lresolv -lsocket -lnsl -luuid])
  679. ;;
  680. *dragonfly*)
  681. APR_ADDTO(CPPFLAGS, -I/usr/local/include)
  682. APR_ADDTO(LDFLAGS, -L/usr/local/lib)
  683. APR_ADDTO(SWITCH_AM_CFLAGS, -I/usr/local/include)
  684. ;;
  685. *openbsd*)
  686. APR_ADDTO(CPPFLAGS, -I/usr/local/include)
  687. APR_ADDTO(LDFLAGS, -L/usr/local/lib -ltermcap)
  688. APR_ADDTO(SWITCH_AM_CFLAGS, -I/usr/local/include)
  689. ;;
  690. *netbsd*)
  691. APR_ADDTO(CPPFLAGS, -I/usr/pkg/include)
  692. APR_ADDTO(LDFLAGS, [-L/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib])
  693. APR_ADDTO(SWITCH_AM_CFLAGS, -I/usr/pkg/include)
  694. ;;
  695. *bsd*)
  696. APR_ADDTO(CPPFLAGS, -I/usr/local/include)
  697. APR_ADDTO(LDFLAGS, -L/usr/local/lib)
  698. APR_ADDTO(SWITCH_AM_CFLAGS, -I/usr/local/include)
  699. APR_ADDTO([PLATFORM_CORE_LIBS], [-lcrypt -lrt])
  700. ;;
  701. *linux*)
  702. APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl -lcrypt -lrt])
  703. ;;
  704. esac
  705. APR_REMOVEFROM(SWITCH_AM_CXXFLAGS, -std=c99)
  706. # check for usable system MD5 library
  707. AS_CASE([$host],
  708. [*-solaris2*], [AC_CHECK_LIB(md5, MD5Init)],
  709. [*-freebsd*], [AC_CHECK_LIB(md, MD5Init)],
  710. [*-openbsd*|*-netbsd*], [AC_CHECK_FUNCS([MD5Init])])
  711. AC_CHECK_LIB(z, inflateReset, have_libz=yes, AC_MSG_ERROR([no usable zlib; please install zlib devel package or equivalent]))
  712. if test "x$have_libz" = "xyes" ; then
  713. APR_ADDTO([PLATFORM_CORE_LIBS], [-lz])
  714. fi
  715. PKG_CHECK_MODULES([MPG123], [libmpg123 >= 1.16.0],[
  716. AM_CONDITIONAL([HAVE_MPG123],[true])],[
  717. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MPG123],[false])])
  718. PKG_CHECK_MODULES([AMR], [opencore-amrnb >= 0.1.0],[
  719. AM_CONDITIONAL([HAVE_AMR],[true])],[
  720. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AMR],[false])])
  721. PKG_CHECK_MODULES([AMRWB], [opencore-amrwb >= 0.1.0 vo-amrwbenc >= 0.1.0],[
  722. AM_CONDITIONAL([HAVE_AMRWB],[true])],[
  723. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AMRWB],[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. saved_CFLAGS="$CFLAGS"
  921. # Next check added for Xcode 5 and systems with clang 5 llvm 3.3 or above, extended offset must be off
  922. AC_CACHE_CHECK([whether compiler supports -Wextended-offsetof], [ac_cv_clang_extended_offsetof], [
  923. CFLAGS="$CFLAGS -Wno-extended-offsetof"
  924. AC_TRY_COMPILE([],[return 0;],[ac_cv_clang_extended_offsetof=yes],[ac_cv_clang_extended_offsetof=no])
  925. ])
  926. AC_MSG_RESULT($ac_cv_clang_extended_offsetof)
  927. if test x"$ac_cv_clang_extended_offsetof" = xyes; then
  928. APR_ADDTO(CFLAGS, -Wno-extended-offsetof)
  929. fi
  930. CFLAGS="$saved_CFLAGS"
  931. fi
  932. # Tested and fixed lot of modules, but some are untested. Will be added back when the core team decide it ready
  933. # Untested modules : mod_osp mod_soundtouch mod_sangoma_codec mod_dingaling mod_opal mod_h323 mod_khomp
  934. # mod_unimrcp mod_cepstral mod_erlang_event mod_snmp mod_perl mod_java mod_managed
  935. #
  936. #saved_CFLAGS="$CFLAGS"
  937. #AC_CACHE_CHECK([whether compiler supports -Wunused-but-set-variable], [ac_cv_gcc_unused_but_set_variable], [
  938. #CFLAGS="$CFLAGS -Wunused-but-set-variable"
  939. #AC_TRY_COMPILE([],[return 0;],[ac_cv_gcc_unused_but_set_variable=yes],[ac_cv_gcc_unused_but_set_variable=no])
  940. #])
  941. #AC_MSG_RESULT($ac_cv_gcc_unused_but_set_variable)
  942. #if test x"$ac_cv_gcc_unused_but_set_variable" = xyes; then
  943. # APR_ADDTO(SWITCH_ANSI_CFLAGS, -Wunused-but-set-variable)
  944. #fi
  945. #CFLAGS="$saved_CFLAGS"
  946. AC_C_BIGENDIAN(AC_DEFINE([SWITCH_BYTE_ORDER],__BIG_ENDIAN,[Big Endian]),AC_DEFINE([SWITCH_BYTE_ORDER],__LITTLE_ENDIAN,[Little Endian]))
  947. # Checks for integer size
  948. AC_CHECK_SIZEOF(char, 1)
  949. AC_CHECK_SIZEOF(int, 4)
  950. AC_CHECK_SIZEOF(long, 4)
  951. AC_CHECK_SIZEOF(short, 2)
  952. AC_CHECK_SIZEOF(long long, 8)
  953. AC_TYPE_SIZE_T
  954. AC_CHECK_TYPE(ssize_t, int)
  955. # Checks for pointer size
  956. AC_CHECK_SIZEOF(void*, 4)
  957. if test "x$ac_cv_sizeof_voidp" != "x"; then
  958. voidp_size=$ac_cv_sizeof_voidp
  959. else
  960. AC_ERROR([Cannot determine size of void*])
  961. fi
  962. if test "$ac_cv_sizeof_short" = "2"; then
  963. short_value=short
  964. fi
  965. if test "$ac_cv_sizeof_int" = "4"; then
  966. int_value=int
  967. fi
  968. if test "$ac_cv_sizeof_int" = "8"; then
  969. int64_t_fmt='#define SWITCH_INT64_T_FMT "d"'
  970. uint64_t_fmt='#define SWITCH_UINT64_T_FMT "u"'
  971. int64_value="int"
  972. long_value=int
  973. elif test "$ac_cv_sizeof_long" = "8"; then
  974. int64_t_fmt='#define SWITCH_INT64_T_FMT "ld"'
  975. uint64_t_fmt='#define SWITCH_UINT64_T_FMT "lu"'
  976. int64_value="long"
  977. long_value=long
  978. case "$host" in
  979. *pc-solaris2*)
  980. ;;
  981. sparc-*-solaris2*)
  982. ;;
  983. *-solaris2*|*apple-darwin*|*-openbsd*)
  984. if test "$ac_cv_sizeof_long_long" = "8"; then
  985. int64_t_fmt='#define SWITCH_INT64_T_FMT "lld"'
  986. uint64_t_fmt='#define SWITCH_UINT64_T_FMT "llu"'
  987. int64_value="long long"
  988. long_value="long long"
  989. fi
  990. ;;
  991. esac
  992. elif test "$ac_cv_sizeof_long_long" = "8"; then
  993. int64_t_fmt='#define SWITCH_INT64_T_FMT "lld"'
  994. uint64_t_fmt='#define SWITCH_UINT64_T_FMT "llu"'
  995. int64_value="long long"
  996. long_value="long long"
  997. elif test "$ac_cv_sizeof_longlong" = "8"; then
  998. int64_t_fmt='#define SWITCH_INT64_T_FMT "qd"'
  999. uint64_t_fmt='#define SWITCH_UINT64_T_FMT "qu"'
  1000. int64_value="__int64"
  1001. long_value="__int64"
  1002. else
  1003. AC_ERROR([could not detect a 64-bit integer type])
  1004. fi
  1005. if test "$ac_cv_type_size_t" = "yes"; then
  1006. size_t_value="size_t"
  1007. else
  1008. size_t_value="switch_int32_t"
  1009. fi
  1010. if test "$ac_cv_type_ssize_t" = "yes"; then
  1011. ssize_t_value="ssize_t"
  1012. else
  1013. ssize_t_value="switch_int32_t"
  1014. fi
  1015. APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], ssize_t, 8)
  1016. if test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_int"; then
  1017. ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "d"'
  1018. elif test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_long"; then
  1019. ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
  1020. else
  1021. ssize_t_fmt='#error Can not determine the proper size for ssize_t'
  1022. fi
  1023. APR_CHECK_SIZEOF_EXTENDED([#include <stddef.h>], size_t, 8)
  1024. if test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_int"; then
  1025. size_t_fmt='#define SWITCH_SIZE_T_FMT "d"'
  1026. elif test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_long"; then
  1027. size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
  1028. else
  1029. size_t_fmt='#define SWITCH_SIZE_T_FMT "zu"'
  1030. fi
  1031. # Basically, we have tried to figure out the correct format strings
  1032. # for SWITCH types which vary between platforms, but we don't always get
  1033. # it right. If you find that we don't get it right for your platform,
  1034. # you can override our decision below.
  1035. # NOTE: borrowed much of this logic from apr.
  1036. case $host in
  1037. s390*linux*)
  1038. # uniquely, the 31-bit Linux/s390 uses "unsigned long int"
  1039. # for size_t rather than "unsigned int":
  1040. size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
  1041. ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
  1042. ;;
  1043. *-os2*)
  1044. size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
  1045. ;;
  1046. *-openbsd*)
  1047. size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
  1048. ;;
  1049. *aix4*|*aix5*)
  1050. ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
  1051. size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
  1052. ;;
  1053. *beos*)
  1054. ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
  1055. size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
  1056. ;;
  1057. *apple-darwin*)
  1058. ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
  1059. size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
  1060. ;;
  1061. esac
  1062. AC_SUBST(voidp_size)
  1063. AC_SUBST(short_value)
  1064. AC_SUBST(int_value)
  1065. AC_SUBST(long_value)
  1066. AC_SUBST(int64_value)
  1067. AC_SUBST(size_t_value)
  1068. AC_SUBST(ssize_t_value)
  1069. AC_SUBST(int64_t_fmt)
  1070. AC_SUBST(uint64_t_fmt)
  1071. AC_SUBST(ssize_t_fmt)
  1072. AC_SUBST(size_t_fmt)
  1073. case $host in
  1074. *-openbsd*)
  1075. # OpenBSD's gunzip and friends don't like -d because its redundant, only gzip does
  1076. AC_PATH_PROGS(ZCAT, gzip)
  1077. ;;
  1078. *)
  1079. AC_PATH_PROGS(ZCAT, gunzip gzcat gzip zcat)
  1080. ;;
  1081. esac
  1082. AC_PATH_PROGS(BZIP, bzip2)
  1083. AC_PATH_PROGS(XZ, xz)
  1084. AC_PATH_PROGS(TAR, gtar tar)
  1085. AC_PATH_PROGS(WGET, wget)
  1086. AC_PATH_PROGS(CURL, curl)
  1087. GETLIB="cd $switch_srcdir/libs && ${SHELL} $switch_builddir/build/getlib.sh"
  1088. AC_SUBST(GETLIB)
  1089. GETG729="cd $switch_srcdir/libs && ${SHELL} $switch_builddir/build/getg729.sh"
  1090. AC_SUBST(GETG729)
  1091. GETSOUNDS="${SHELL} $switch_builddir/build/getsounds.sh"
  1092. AC_SUBST(GETSOUNDS)
  1093. case $host in
  1094. *-darwin*)
  1095. path_push_unique PKG_CONFIG_PATH /usr/local/opt/curl/lib/pkgconfig
  1096. path_push_unique PKG_CONFIG_PATH /usr/local/opt/sqlite/lib/pkgconfig/
  1097. path_push_unique PKG_CONFIG_PATH /usr/local/opt/ldns/lib/pkgconfig/
  1098. path_push_unique PKG_CONFIG_PATH /usr/local/opt/portaudio/lib/pkgconfig/
  1099. path_push_unique PKG_CONFIG_PATH /usr/local/opt/ffmpeg/lib/pkgconfig/
  1100. ;;
  1101. esac
  1102. if ! (test -x "$PKG_CONFIG" || test -x "$(which pkg-config)"); then
  1103. AC_MSG_ERROR([You need to install pkg-config to configure FreeSWITCH.])
  1104. fi
  1105. # temporary workaround for Debian libldns-dev package bug
  1106. if test "$cross_compiling" != "yes" && test -f /usr/lib/pkg-config/libldns.pc; then
  1107. path_push_unique PKG_CONFIG_PATH /usr/lib/pkg-config
  1108. fi
  1109. module_enabled() {
  1110. grep -v -e "\#" -e "^\$" modules.conf | sed 's/|.*//' | sed -e "s|^.*/||" | grep "^${1}\$" >/dev/null
  1111. }
  1112. AC_ARG_WITH(png,
  1113. [AS_HELP_STRING([--without-png],
  1114. [disable support for libpng])],
  1115. [with_png="$withval"],
  1116. [with_png="yes"])
  1117. if test "$with_png" = "yes"; then
  1118. PKG_CHECK_MODULES([LIBPNG], [libpng >= 1.6.16],[
  1119. AM_CONDITIONAL([HAVE_PNG],[true])],[
  1120. PKG_CHECK_MODULES([LIBPNG], [libpng16 >= 1.6.16],[
  1121. AM_CONDITIONAL([HAVE_PNG],[true])],[
  1122. PKG_CHECK_MODULES([LIBPNG], [libpng >= 1.2.49],[
  1123. AM_CONDITIONAL([HAVE_PNG],[true])],[
  1124. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_PNG],[false])])])])
  1125. else
  1126. AM_CONDITIONAL([HAVE_PNG],[false])
  1127. fi
  1128. AC_ARG_WITH(freetype,
  1129. [AS_HELP_STRING([--without-freetype],
  1130. [disable support for freetype])],
  1131. [with_freetype="$withval"],
  1132. [with_freetype="yes"])
  1133. if test "$with_freetype" = "yes"; then
  1134. PKG_CHECK_MODULES([FREETYPE], [freetype2 >= 2.4.9],[
  1135. AM_CONDITIONAL([HAVE_FREETYPE],[true])],[
  1136. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_FREETYPE],[false])])
  1137. else
  1138. AM_CONDITIONAL([HAVE_FREETYPE],[false])
  1139. fi
  1140. PKG_CHECK_MODULES([GUMBO], [gumbo >= 0.10.1],[
  1141. AM_CONDITIONAL([HAVE_GUMBO],[true])],[
  1142. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_GUMBO],[false])])
  1143. PKG_CHECK_MODULES([FVAD], [libfvad >= 1.0],[
  1144. AM_CONDITIONAL([HAVE_FVAD],[true])],[
  1145. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_FVAD],[false])])
  1146. PKG_CHECK_MODULES([TPL], [libtpl >= 1.5],[
  1147. AC_DEFINE([HAVE_LIBTPL],[1],[Define to 1 if you have libtpl])],[
  1148. AC_MSG_RESULT([no])])
  1149. PKG_CHECK_MODULES([SQLITE], [sqlite3 >= 3.6.20])
  1150. PKG_CHECK_MODULES([CURL], [libcurl >= 7.19])
  1151. PKG_CHECK_MODULES([PCRE], [libpcre >= 7.8])
  1152. PKG_CHECK_MODULES([SPEEX], [speex >= 1.2rc1 speexdsp >= 1.2rc1])
  1153. PKG_CHECK_MODULES([YAML], [yaml-0.1 >= 0.1.4],[
  1154. AM_CONDITIONAL([HAVE_YAML],[true])],[
  1155. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_YAML],[false])])
  1156. PKG_CHECK_MODULES([PORTAUDIO], [portaudio-2.0 >= 19],[
  1157. AM_CONDITIONAL([HAVE_PORTAUDIO],[true])],[
  1158. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_PORTAUDIO],[false])])
  1159. PKG_CHECK_MODULES([LDNS], [libldns-fs >= 1.6.6],[
  1160. AM_CONDITIONAL([HAVE_LDNS],[true])],[
  1161. PKG_CHECK_MODULES([LDNS], [libldns >= 1.6.6],[
  1162. AM_CONDITIONAL([HAVE_LDNS],[true])],[
  1163. AC_CHECK_LIB([ldns], [ldns_str2rdf_a], [LDNS_LIBS=-lldns])
  1164. AS_IF([test -z "$LDNS_LIBS"],[
  1165. if module_enabled mod_enum; then
  1166. AC_MSG_ERROR([You need to either install libldns-dev or disable mod_enum in modules.conf])
  1167. else
  1168. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_LDNS],[false])
  1169. fi],[
  1170. AM_CONDITIONAL([HAVE_LDNS],[true])])])])
  1171. PKG_CHECK_MODULES([SNDFILE], [sndfile >= 1.0.20],[
  1172. AM_CONDITIONAL([HAVE_SNDFILE],[true])],[
  1173. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SNDFILE],[false])])
  1174. PKG_CHECK_MODULES([MPG123], [libmpg123 >= 1.16.0],[
  1175. AM_CONDITIONAL([HAVE_MPG123],[true])],[
  1176. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MPG123],[false])])
  1177. PKG_CHECK_MODULES([SHOUT], [shout >= 2.2.2],[
  1178. AM_CONDITIONAL([HAVE_SHOUT],[true])],[
  1179. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SHOUT],[false])])
  1180. mp3lame=false
  1181. AC_CHECK_LIB([mp3lame], [lame_init],[
  1182. AC_CHECK_HEADER([lame/lame.h],[
  1183. mp3lame=true
  1184. AC_SUBST([MP3LAME_LIBS], [-lmp3lame])
  1185. AC_SUBST([MP3LAME_CFLAGS], [$CPPFLAGS])])])
  1186. AM_CONDITIONAL([HAVE_MP3LAME],[$mp3lame])
  1187. PKG_CHECK_MODULES([AVCODEC], [libavcodec >= 53.35.0],[
  1188. AM_CONDITIONAL([HAVE_AVCODEC],[true])],[
  1189. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AVCODEC],[false])])
  1190. PKG_CHECK_MODULES([X264], [x264 >= 0.142.2431],[
  1191. AM_CONDITIONAL([HAVE_X264],[true])],[
  1192. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_X264],[false])])
  1193. PKG_CHECK_MODULES([AVFORMAT], [libavformat >= 53.21.1],[
  1194. AM_CONDITIONAL([HAVE_AVFORMAT],[true])],[
  1195. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AVFORMAT],[false])])
  1196. PKG_CHECK_MODULES([AVUTIL], [libavutil >= 54.3.0],[
  1197. AM_CONDITIONAL([HAVE_AVUTIL],[true])],[
  1198. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AVUTIL],[false])])
  1199. PKG_CHECK_MODULES([AVRESAMPLE], [libavresample >= 2.1.0],[
  1200. AM_CONDITIONAL([HAVE_AVRESAMPLE],[true])],[
  1201. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AVRESAMPLE],[false])])
  1202. PKG_CHECK_MODULES([SWRESAMPLE], [libswresample >= 2.1.0],[
  1203. AM_CONDITIONAL([HAVE_SWRESAMPLE],[true])],[
  1204. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SWRESAMPLE],[false])])
  1205. PKG_CHECK_MODULES([SWSCALE], [libswscale >= 3.0.0],[
  1206. AM_CONDITIONAL([HAVE_SWSCALE],[true])],[
  1207. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SWSCALE],[false])])
  1208. PKG_CHECK_MODULES([VLC], [libvlc >= 2.1.0],[
  1209. AM_CONDITIONAL([HAVE_VLC],[true])],[
  1210. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_VLC],[false])])
  1211. PKG_CHECK_MODULES([OPENCV], [opencv >= 2.4.5],[
  1212. AM_CONDITIONAL([HAVE_OPENCV],[true])],[
  1213. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_OPENCV],[false])])
  1214. PKG_CHECK_MODULES([OPUSFILE_DECODE], [opusfile >= 0.5],[
  1215. AM_CONDITIONAL([HAVE_OPUSFILE_DECODE],[true])],[
  1216. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_OPUSFILE_DECODE],[false])])
  1217. PKG_CHECK_MODULES([OPUSFILE_ENCODE], [libopusenc >= 0.1],[
  1218. AM_CONDITIONAL([HAVE_OPUSFILE_ENCODE],[true])],[
  1219. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_OPUSFILE_ENCODE],[false])])
  1220. PKG_CHECK_MODULES([MAGICK], [ImageMagick >= 6.0.0],[
  1221. AM_CONDITIONAL([HAVE_MAGICK],[true])],[
  1222. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MAGICK],[false])])
  1223. PKG_CHECK_MODULES([MAGICK7], [ImageMagick >= 7.0.0],[
  1224. AM_CONDITIONAL([HAVE_MAGICK7],[true])],[
  1225. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MAGICK7],[false])])
  1226. PKG_CHECK_MODULES([SILK], [silk >= 1.0.8],[
  1227. AM_CONDITIONAL([HAVE_SILK],[true])],[
  1228. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SILK],[false])])
  1229. PKG_CHECK_MODULES([BROADVOICE], [broadvoice >= 0.1.0],[
  1230. AM_CONDITIONAL([HAVE_BROADVOICE],[true])],[
  1231. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_BROADVOICE],[false])])
  1232. PKG_CHECK_MODULES([ILBC], [ilbc2 >= 0.0.1],[
  1233. AM_CONDITIONAL([HAVE_ILBC],[true])],[
  1234. PKG_CHECK_MODULES([ILBC], [ilbc >= 0.0.1],[
  1235. AM_CONDITIONAL([HAVE_ILBC],[true])],[
  1236. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_ILBC],[false])])])
  1237. PKG_CHECK_MODULES([G7221], [g722_1 >= 0.2.0],[
  1238. AM_CONDITIONAL([HAVE_G7221],[true])],[
  1239. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_G7221],[false])])
  1240. codec2="true"
  1241. PKG_CHECK_MODULES([CODEC2], [codec2 >= 0.5],[],[
  1242. AC_CHECK_LIB([codec2], [codec2_create],[
  1243. AC_CHECK_HEADERS([codec2/codec2.h],[
  1244. CODEC2_LIBS="-lcodec2"
  1245. CODEC2_CFLAGS=""
  1246. ], [
  1247. codec2="false"
  1248. if module_enabled mod_codec2; then
  1249. AC_MSG_ERROR([You must install libcodec2-dev to build mod_codec2])
  1250. else
  1251. AC_MSG_RESULT([no])
  1252. fi
  1253. ])
  1254. ])
  1255. ])
  1256. AM_CONDITIONAL([HAVE_CODEC2],[$codec2])
  1257. PKG_CHECK_MODULES([OPUS], [opus >= 1.1],[
  1258. AM_CONDITIONAL([HAVE_OPUS],[true])],[
  1259. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_OPUS],[false])])
  1260. PKG_CHECK_MODULES([SOUNDTOUCH], [soundtouch >= 1.7.0],[
  1261. AM_CONDITIONAL([HAVE_SOUNDTOUCH],[true])],[
  1262. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SOUNDTOUCH],[false])])
  1263. flite="true"
  1264. PKG_CHECK_MODULES([FLITE], [flite >= 2],[],[
  1265. AC_CHECK_LIB([flite], [flite_init],[
  1266. AC_CHECK_HEADERS([flite/flite.h],[
  1267. FLITE_LIBS="-lflite -lflite_cmu_grapheme_lang -lflite_cmu_grapheme_lex -lflite_cmu_indic_lang -lflite_cmu_indic_lex -lflite_cmulex -lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal16 -lflite_cmu_us_kal -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish"
  1268. FLITE_CFLAGS=""
  1269. ], [
  1270. flite="false"
  1271. if module_enabled mod_flite; then
  1272. AC_MSG_ERROR([You must install libflite-dev to build mod_flite])
  1273. else
  1274. AC_MSG_RESULT([no])
  1275. fi
  1276. ])
  1277. ])
  1278. ])
  1279. AM_CONDITIONAL([HAVE_FLITE],[$flite])
  1280. PKG_CHECK_MODULES([MONGOC], [libmongoc-1.0 >= 1.0.8],[
  1281. AM_CONDITIONAL([HAVE_MONGOC],[true])],[
  1282. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MONGOC],[false])])
  1283. PKG_CHECK_MODULES([MEMCACHED], [libmemcached >= 0.31],[
  1284. AM_CONDITIONAL([HAVE_MEMCACHED],[true])
  1285. MEMCACHED_LIBS="${MEMCACHED_LIBS} -lpthread"
  1286. save_LIBS="${LIBS}"
  1287. save_CPPFLAGS="${CPPFLAGS}"
  1288. LIBS="${MEMCACHED_LIBS}"
  1289. CPPFLAGS="${MEMCACHED_CFLAGS}"
  1290. AC_CHECK_FUNCS([memcached_server_name memcached_stat_execute])
  1291. AC_CHECK_TYPES([memcached_instance_st*],,, [[#include <libmemcached/memcached.h>]])
  1292. LIBS="${save_LIBS}"
  1293. CPPFLAGS="${save_CPPFLAGS}"
  1294. ],[
  1295. AC_MSG_RESULT([no])
  1296. AM_CONDITIONAL([HAVE_MEMCACHED],[false])
  1297. ])
  1298. PKG_CHECK_MODULES([V8FS_STATIC], [v8-6.1_static >= 6.1.298],[
  1299. AM_CONDITIONAL([HAVE_V8FS],[true])],[
  1300. PKG_CHECK_MODULES([V8FS_STATIC], [v8fs_static >= 6.1.298],[
  1301. AM_CONDITIONAL([HAVE_V8FS],[true])],[
  1302. PKG_CHECK_MODULES([V8FS_STATIC], [v8 >= 6.1.298],[
  1303. AM_CONDITIONAL([HAVE_V8FS],[true])],[
  1304. if module_enabled mod_v8; then
  1305. AC_MSG_ERROR([You need to either install libv8-6.1-dev (>= 6.1.298), libv8fs-dev (>= 6.1.298) or disable mod_v8 in modules.conf])
  1306. else
  1307. AC_MSG_RESULT([no])
  1308. AM_CONDITIONAL([HAVE_V8FS],[false])
  1309. fi
  1310. ])
  1311. ])
  1312. ])
  1313. PKG_CHECK_MODULES([KS], [libks >= 1.1.0],[
  1314. AM_CONDITIONAL([HAVE_KS],[true])],[
  1315. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_KS],[false])])
  1316. PKG_CHECK_MODULES([SIGNALWIRE_CLIENT], [signalwire_client >= 1.0.0],[
  1317. AM_CONDITIONAL([HAVE_SIGNALWIRE_CLIENT],[true])],[
  1318. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SIGNALWIRE_CLIENT],[false])])
  1319. PKG_CHECK_MODULES([AMQP], [librabbitmq >= 0.5.2],[
  1320. AM_CONDITIONAL([HAVE_AMQP],[true])],[
  1321. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AMQP],[false])])
  1322. PKG_CHECK_MODULES([H2O], [libh2o-evloop >= 0.11.0],[
  1323. AM_CONDITIONAL([HAVE_H2O],[true])],[
  1324. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_H2O],[false])])
  1325. PKG_CHECK_MODULES([BROTLIENC], [libbrotlienc >= 0.1.0],[
  1326. AM_CONDITIONAL([HAVE_BROTLIENC],[true])],[
  1327. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_BROTLIENC],[false])])
  1328. PKG_CHECK_MODULES([BROTLIDEC], [libbrotlidec >= 0.1.0],[
  1329. AM_CONDITIONAL([HAVE_BROTLIDEC],[true])],[
  1330. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_BROTLIDEC],[false])])
  1331. PKG_CHECK_MODULES([TAP], [tap >= 0.1.0],[
  1332. AM_CONDITIONAL([HAVE_TAP],[true])],[
  1333. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_TAP],[false])])
  1334. PKG_CHECK_MODULES([SMPP34], [libsmpp34 >= 1.10],[
  1335. AM_CONDITIONAL([HAVE_SMPP34],[true])],[
  1336. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SMPP34],[false])])
  1337. PKG_CHECK_MODULES([HIREDIS], [hiredis >= 0.10.0],[
  1338. AM_CONDITIONAL([HAVE_HIREDIS],[true])],[
  1339. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_HIREDIS],[false])])
  1340. AC_ARG_ENABLE(core-libedit-support,
  1341. [AS_HELP_STRING([--disable-core-libedit-support], [Compile without libedit Support])])
  1342. AS_IF([test "x$enable_core_libedit_support" != "xno"],[
  1343. PKG_CHECK_MODULES([LIBEDIT], [libedit >= 2.11],,[
  1344. AC_MSG_RESULT([no])
  1345. AC_CHECK_LIB([edit], [el_line], [LIBEDIT_LIBS=-ledit])
  1346. AC_CHECK_LIB([edit], [el_cursor], [ac_cv_has_el_cursor=yes])
  1347. AC_CHECK_HEADER([histedit.h], [], [unset LIBEDIT_LIBS])
  1348. AS_IF([test "x$LIBEDIT_LIBS" = "x"], [
  1349. AC_MSG_ERROR([You need to either install libedit-dev (>= 2.11) or configure with --disable-core-libedit-support])
  1350. ])])])
  1351. dnl ---------------------------------------------------------------------------
  1352. dnl - OpenLDAP SDK
  1353. dnl ---------------------------------------------------------------------------
  1354. AC_CHECK_LIB(ldap, ldap_search, with_ldap=yes)
  1355. dnl Check for other libraries we need to link with to get the main routines.
  1356. test "$with_ldap" != "yes" && { AC_CHECK_LIB(ldap, ldap_open, [with_ldap=yes with_ldap_lber=yes], , -llber) }
  1357. test "$with_ldap" != "yes" && { AC_CHECK_LIB(ldap, ldap_open, [with_ldap=yes with_ldap_lber=yes with_ldap_krb=yes], , -llber -lkrb) }
  1358. 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) }
  1359. test "$with_ldap_lber" != "yes" && { AC_CHECK_LIB(lber, ber_pvt_opt_on, with_ldap_lber=yes) }
  1360. if test "$with_ldap" = "yes"; then
  1361. if test "$with_ldap_des" = "yes" ; then
  1362. OPENLDAP_LIBS="${OPENLDAP_LIBS} -ldes"
  1363. fi
  1364. if test "$with_ldap_krb" = "yes" ; then
  1365. OPENLDAP_LIBS="${OPENLDAP_LIBS} -lkrb"
  1366. fi
  1367. if test "$with_ldap_lber" = "yes" ; then
  1368. OPENLDAP_LIBS="${OPENLDAP_LIBS} -llber"
  1369. fi
  1370. OPENLDAP_LIBS="${OPENLDAP_LIBS} -lldap"
  1371. fi
  1372. AM_CONDITIONAL([HAVE_LDAP],[test "x$with_ldap" = "xyes"])
  1373. AC_SUBST(OPENLDAP_LIBS)
  1374. AS_IF([test "x$enable_core_libedit_support" != "xno"], [
  1375. # If making changes here, don't forget to run autoheader and
  1376. # update libs/esl/src/include/esl_config_auto.h.in manually.
  1377. AC_DEFINE([HAVE_LIBEDIT], [1], [Define to 1 if you have libedit is available])
  1378. if test x$ac_cv_has_el_cursor = xyes; then
  1379. AC_DEFINE([HAVE_EL_CURSOR], [1], [Define to 1 if you have libedit el_cursor support])
  1380. fi
  1381. save_LIBS="${LIBS}"
  1382. save_CPPFLAGS="${CPPFLAGS}"
  1383. LIBS="${LIBEDIT_LIBS}"
  1384. CPPFLAGS="${LIBEDIT_CFLAGS}"
  1385. AC_CHECK_DECLS([EL_PROMPT_ESC, EL_REFRESH],,, [[#include <histedit.h>]])
  1386. AC_CHECK_FUNCS([el_wset])
  1387. LIBS="${save_LIBS}"
  1388. CPPFLAGS="${save_CPPFLAGS}"
  1389. ])
  1390. SAC_OPENSSL
  1391. if test x$HAVE_OPENSSL = x1; then
  1392. openssl_CFLAGS="$openssl_CFLAGS -DHAVE_OPENSSL";
  1393. APR_ADDTO(SWITCH_AM_CFLAGS, -DHAVE_OPENSSL)
  1394. 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]))
  1395. 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]))
  1396. AC_CHECK_LIB(ssl, DTLSv1_2_method, AC_DEFINE_UNQUOTED(HAVE_OPENSSL_DTLSv1_2_method, 1, [DTLS version 1.2 is available]))
  1397. else
  1398. AC_MSG_ERROR([OpenSSL >= 1.0.1e and associated developement headers required])
  1399. fi
  1400. AX_CHECK_JAVA
  1401. AM_CONDITIONAL([HAVE_ODBC],[test "x$enable_core_odbc_support" != "xno"])
  1402. AM_CONDITIONAL([HAVE_MYSQL],[test "$found_mysql" = "yes"])
  1403. #
  1404. # perl checks
  1405. #
  1406. AC_CHECK_PROG(PERL,perl,[ac_cv_have_perl=yes],[ac_cv_have_perl=no])
  1407. # -a "x$ac_cv_have_EXTERN_h" != "xno"
  1408. if test "x$ac_cv_have_perl" != "xno"; then
  1409. PERL=perl
  1410. PERL_SITEDIR="`$PERL -MConfig -e 'print $Config{archlib}'`"
  1411. PERL_LIBDIR="-L`$PERL -MConfig -e 'print $Config{archlib}'`/CORE"
  1412. PERL_LIBS="`$PERL -MConfig -e 'print $Config{libs}'`"
  1413. PERL_CFLAGS="-w -DMULTIPLICITY `$PERL -MExtUtils::Embed -e ccopts | sed -e 's|-arch x86_64 -arch i386||'` -DEMBED_PERL"
  1414. PERL_LDFLAGS="`$PERL -MExtUtils::Embed -e ldopts| sed -e 's|-arch x86_64 -arch i386||'`"
  1415. PERL_INC="`$PERL -MExtUtils::Embed -e perl_inc`"
  1416. save_CFLAGS="$CFLAGS"
  1417. CFLAGS="$PERL_CFLAGS"
  1418. AC_CHECK_HEADER([EXTERN.h], [ac_cv_have_EXTERN_h=yes], [ac_cv_have_EXTERN_h=no], [[#include <EXTERN.h>
  1419. # include <perl.h>]])
  1420. CFLAGS="$save_CFLAGS"
  1421. save_LDFLAGS="$LDFLAGS"
  1422. LDFLAGS="$PERL_LDFLAGS"
  1423. AC_CHECK_LIB([perl], [perl_alloc], ac_cv_use_libperl=yes, ac_cv_use_libperl=no)
  1424. LDFLAGS="$save_LDFLAGS"
  1425. AC_SUBST(PERL_SITEDIR)
  1426. AC_SUBST(PERL_LIBDIR)
  1427. AC_SUBST(PERL_LIBS)
  1428. AC_SUBST(PERL_CFLAGS)
  1429. AC_SUBST(PERL_LDFLAGS)
  1430. AC_SUBST(PERL_INC)
  1431. fi
  1432. 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"])
  1433. #
  1434. # php checks
  1435. #
  1436. AC_CHECK_PROG(PHP,php,[ac_cv_have_php=yes],[ac_cv_have_php=no])
  1437. AC_CHECK_PROG(PHP_CONFIG,php-config,[ac_cv_have_php_config=yes],[ac_cv_have_php_config=no])
  1438. AM_CONDITIONAL([HAVE_PHP],[test "x$ac_cv_have_php" != "xno" -a "x$ac_cv_have_php_config" != "xno"])
  1439. if test "x$ac_cv_have_php" != "xno" -a "x$ac_cv_have_php_config" != "xno"; then
  1440. PHP=php
  1441. PHP_CONFIG=php-config
  1442. PHP_LDFLAGS="`$PHP_CONFIG --ldflags`"
  1443. PHP_LIBS="`$PHP_CONFIG --libs | sed -r 's/ ?-l(bz2|pcre2-8|xml2|gssapi_krb5|krb5|k5crypto|com_err|history|z|readline|gmp|ssl|crypto|argon2|sodium)//g'`"
  1444. PHP_EXT_DIR="`$PHP_CONFIG --extension-dir`"
  1445. PHP_INC_DIR="`$PHP -r 'echo ini_get("include_path");' | cut -d: -f2`"
  1446. PHP_INI_DIR="`$PHP_CONFIG --configure-options | tr " " "\n" | grep -- --with-config-file-scan-dir | cut -f2 -d=`"
  1447. PHP_CFLAGS="`$PHP_CONFIG --includes`"
  1448. AC_SUBST(PHP_LDFLAGS)
  1449. AC_SUBST(PHP_LIBS)
  1450. AC_SUBST(PHP_EXT_DIR)
  1451. AC_SUBST(PHP_INC_DIR)
  1452. AC_SUBST(PHP_INI_DIR)
  1453. AC_SUBST(PHP_CFLAGS)
  1454. fi
  1455. #
  1456. # Python checks for mod_python
  1457. #
  1458. AC_ARG_WITH(
  1459. [python],
  1460. [AS_HELP_STRING([--with-python], [Use system provided version of python (default: try)])],
  1461. [with_python="$withval"],
  1462. [with_python="try"]
  1463. )
  1464. if test "$with_python" != "no"
  1465. then
  1466. save_CFLAGS="$CFLAGS"
  1467. save_LIBS="$LIBS"
  1468. if test "$with_python" != "yes" -a "$with_python" != "try" ; then
  1469. AC_MSG_CHECKING([for python])
  1470. if test ! -x "$with_python" ; then
  1471. AC_MSG_ERROR([Specified python does not exist or is not executable: $with_python])
  1472. fi
  1473. AC_MSG_RESULT([$with_python])
  1474. AC_SUBST([PYTHON], ["$with_python"])
  1475. else
  1476. AC_PATH_PROG([PYTHON], ["python"], ["no"], ["$PATH:/usr/bin:/usr/local/bin"])
  1477. fi
  1478. if test "$PYTHON" != "no" ; then
  1479. AC_MSG_CHECKING([python version])
  1480. PYTHON_VER="`$PYTHON -V 2>&1 | cut -d' ' -f2`"
  1481. if test -z "$PYTHON_VER" ; then
  1482. AC_MSG_ERROR([Unable to detect python version])
  1483. fi
  1484. AC_MSG_RESULT([$PYTHON_VER])
  1485. AC_MSG_CHECKING([for python distutils])
  1486. python_result="`$PYTHON -c 'import distutils;' 2>&1`"
  1487. if test -z "$python_result" ; then
  1488. python_has_distutils="yes"
  1489. else
  1490. python_has_distutils="no"
  1491. fi
  1492. AC_MSG_RESULT([$python_has_distutils])
  1493. if test "$python_has_distutils" != "no" ; then
  1494. AC_MSG_CHECKING([location of site-packages])
  1495. PYTHON_SITE_DIR="`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_python_lib(0));'`"
  1496. if test -z "$PYTHON_SITE_DIR" ; then
  1497. AC_MSG_ERROR([Unable to detect python site-packages path])
  1498. elif test ! -d "$PYTHON_SITE_DIR" ; then
  1499. AC_MSG_ERROR([Path $PYTHON_SITE_DIR returned by python does not exist!])
  1500. fi
  1501. AC_MSG_RESULT([$PYTHON_SITE_DIR])
  1502. AC_SUBST([PYTHON_SITE_DIR], [$PYTHON_SITE_DIR])
  1503. #
  1504. # python distutils found, get settings from python directly
  1505. #
  1506. 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'`"
  1507. 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));'`"
  1508. PYTHON_LIB="`$PYTHON -c 'from distutils import sysconfig; print(\"python\" + sysconfig.get_config_var(\"VERSION\"));'`"
  1509. PYTHON_LIBDIR="`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_config_var(\"LIBDIR\"));'`"
  1510. # handle python being installed into /usr/local
  1511. AC_MSG_CHECKING([python libdir])
  1512. if test -z "`echo $PYTHON_LIBDIR | grep "/usr/lib"`" ; then
  1513. PYTHON_LDFLAGS="-L$PYTHON_LIBDIR $PYTHON_LDFLAGS"
  1514. LIBS="-L$PYTHON_LIBDIR $LIBS"
  1515. fi
  1516. AC_MSG_RESULT([$PYTHON_LIBDIR])
  1517. # check libpython
  1518. AC_CHECK_LIB([$PYTHON_LIB], [main], [has_libpython="yes"], [has_libpython="no"])
  1519. if test "$has_libpython" = "no" ; then
  1520. AS_IF([test "$with_python" = "try"],
  1521. [AC_MSG_WARN([$PYTHON_LIB is unusable])],
  1522. [AC_MSG_ERROR([$PYTHON_LIB is unusable])]
  1523. )
  1524. fi
  1525. # check whether system libpython is usable and has threads support
  1526. CFLAGS="$PYTHON_CFLAGS"
  1527. LIBS="$PYTHON_LDFLAGS"
  1528. AC_CHECK_FUNC([PyThread_init_thread], [python_has_threads="yes"], [python_has_threads="no"])
  1529. if test "$python_has_threads" = "no"; then
  1530. AS_IF([test "$with_python" = "try"],
  1531. [AC_MSG_WARN([Your python lacks threads support, can not build mod_python])],
  1532. [AC_MSG_ERROR([Your python lacks threads support, can not build mod_python])]
  1533. )
  1534. else
  1535. AC_MSG_NOTICE([Your python seems OK, do not forget to enable mod_python in modules.conf])
  1536. AC_SUBST([PYTHON_CFLAGS], [$PYTHON_CFLAGS])
  1537. AC_SUBST([PYTHON_LDFLAGS], [$PYTHON_LDFLAGS])
  1538. fi
  1539. else
  1540. AS_IF([test "$with_python" = "try"],
  1541. [AC_MSG_WARN([Could not find or use python distutils module: $python_result])],
  1542. [AC_MSG_ERROR([Could not find or use python distutils module: $python_result])]
  1543. )
  1544. fi
  1545. LIBS="$save_LIBS"
  1546. CFLAGS="$save_CFLAGS"
  1547. unset python_has_threads
  1548. unset python_has_distutils
  1549. unset python_result
  1550. else
  1551. AS_IF([test "$with_python" = "try"],
  1552. [AC_MSG_WARN([Could not find python, mod_python will not build, use --with-python to specify the location])],
  1553. [AC_MSG_ERROR([Could not find python, use --with-python to specify the location])]
  1554. )
  1555. fi
  1556. else
  1557. AC_MSG_WARN([python support disabled, building mod_python will fail!])
  1558. fi
  1559. #
  1560. # SNMP checks for mod_snmp
  1561. #
  1562. AC_PATH_PROG([NET_SNMP_CONFIG], [net-snmp-config], [no])
  1563. if test "$NET_SNMP_CONFIG" != "no"; then
  1564. AC_MSG_CHECKING([for Net-SNMP libraries via net-snmp-config])
  1565. SNMP_LIBS="`$NET_SNMP_CONFIG --base-agent-libs`"
  1566. else
  1567. # net-snmp-config not in path, fallback to sensible defaults
  1568. SNMP_LIBS="-lnetsnmpmibs -lnetsnmpagent -lnetsnmp"
  1569. fi
  1570. # fix linking error on Solaris patched Net-SNMP
  1571. AS_CASE([$host], [*-solaris2*], [AC_CHECK_LIB([dladm], [dladm_open], [SNMP_LIBS="$SNMP_LIBS -ldladm"])])
  1572. AC_SUBST(SNMP_LIBS)
  1573. CHECK_ERLANG
  1574. # Enable clang address sanitizer bit build
  1575. AC_ARG_ENABLE(address_sanitizer,
  1576. [AC_HELP_STRING([--enable-address-sanitizer],[build with address sanitizer])],
  1577. [enable_address_sanitizer="$enable_address_sanitizer"],
  1578. [enable_address_sanitizer="no"])
  1579. if test "${enable_address_sanitizer}" = "yes"; then
  1580. APR_ADDTO(CFLAGS, -fsanitize=address -fno-omit-frame-pointer -fstack-protector-strong)
  1581. APR_ADDTO(CXXFLAGS, -fsanitize=address -fno-omit-frame-pointer -fstack-protector-strong)
  1582. APR_ADDTO(LDFLAGS, -fsanitize=address)
  1583. fi
  1584. AC_ARG_ENABLE(,
  1585. [AC_HELP_STRING([--enable-pool-sanitizer],[build with sanitizer friendly pool behavior])],
  1586. [enable_pool_sanitizer="$enable_pool_sanitizer"],
  1587. [enable_pool_sanitizer="no"])
  1588. if test "${enable_pool_sanitizer}" = "yes"; then
  1589. APR_ADDTO(CFLAGS, -DDESTROY_POOLS)
  1590. ac_configure_args="$ac_configure_args --enable-pool-debug=yes"
  1591. fi
  1592. # we never use this, and hard setting it will make cross compile work better
  1593. ac_cv_file_dbd_apr_dbd_mysql_c=no
  1594. AC_CONFIG_FILES([Makefile
  1595. build/Makefile
  1596. tests/unit/Makefile
  1597. src/Makefile
  1598. src/mod/Makefile
  1599. src/mod/applications/mod_abstraction/Makefile
  1600. src/mod/applications/mod_avmd/Makefile
  1601. src/mod/applications/mod_bert/Makefile
  1602. src/mod/applications/mod_blacklist/Makefile
  1603. src/mod/applications/mod_callcenter/Makefile
  1604. src/mod/applications/mod_cidlookup/Makefile
  1605. src/mod/applications/mod_cluechoo/Makefile
  1606. src/mod/applications/mod_commands/Makefile
  1607. src/mod/applications/mod_conference/Makefile
  1608. src/mod/applications/mod_curl/Makefile
  1609. src/mod/applications/mod_cv/Makefile
  1610. src/mod/applications/mod_db/Makefile
  1611. src/mod/applications/mod_directory/Makefile
  1612. src/mod/applications/mod_distributor/Makefile
  1613. src/mod/applications/mod_dptools/Makefile
  1614. src/mod/applications/mod_easyroute/Makefile
  1615. src/mod/applications/mod_enum/Makefile
  1616. src/mod/applications/mod_esf/Makefile
  1617. src/mod/applications/mod_esl/Makefile
  1618. src/mod/applications/mod_expr/Makefile
  1619. src/mod/applications/mod_fifo/Makefile
  1620. src/mod/applications/mod_fsk/Makefile
  1621. src/mod/applications/mod_fsv/Makefile
  1622. src/mod/applications/mod_hash/Makefile
  1623. src/mod/applications/mod_hiredis/Makefile
  1624. src/mod/applications/mod_httapi/Makefile
  1625. src/mod/applications/mod_http_cache/Makefile
  1626. src/mod/applications/mod_ladspa/Makefile
  1627. src/mod/applications/mod_lcr/Makefile
  1628. src/mod/applications/mod_limit/Makefile
  1629. src/mod/applications/mod_memcache/Makefile
  1630. src/mod/applications/mod_mongo/Makefile
  1631. src/mod/applications/mod_mp4/Makefile
  1632. src/mod/applications/mod_mp4v2/Makefile
  1633. src/mod/applications/mod_nibblebill/Makefile
  1634. src/mod/applications/mod_oreka/Makefile
  1635. src/mod/applications/mod_osp/Makefile
  1636. src/mod/applications/mod_prefix/Makefile
  1637. src/mod/applications/mod_rad_auth/Makefile
  1638. src/mod/applications/mod_random/Makefile
  1639. src/mod/applications/mod_redis/Makefile
  1640. src/mod/applications/mod_rss/Makefile
  1641. src/mod/applications/mod_skel/Makefile
  1642. src/mod/applications/mod_signalwire/Makefile
  1643. src/mod/applications/mod_sms/Makefile
  1644. src/mod/applications/mod_sms_flowroute/Makefile
  1645. src/mod/applications/mod_snapshot/Makefile
  1646. src/mod/applications/mod_snom/Makefile
  1647. src/mod/applications/mod_sonar/Makefile
  1648. src/mod/applications/mod_soundtouch/Makefile
  1649. src/mod/applications/mod_spandsp/Makefile
  1650. src/mod/applications/mod_spy/Makefile
  1651. src/mod/applications/mod_stress/Makefile
  1652. src/mod/applications/mod_test/Makefile
  1653. src/mod/applications/mod_translate/Makefile
  1654. src/mod/applications/mod_valet_parking/Makefile
  1655. src/mod/applications/mod_vmd/Makefile
  1656. src/mod/applications/mod_voicemail/Makefile
  1657. src/mod/applications/mod_voicemail_ivr/Makefile
  1658. src/mod/asr_tts/mod_cepstral/Makefile
  1659. src/mod/asr_tts/mod_flite/Makefile
  1660. src/mod/asr_tts/mod_pocketsphinx/Makefile
  1661. src/mod/asr_tts/mod_tts_commandline/Makefile
  1662. src/mod/asr_tts/mod_unimrcp/Makefile
  1663. src/mod/codecs/mod_amr/Makefile
  1664. src/mod/codecs/mod_amrwb/Makefile
  1665. src/mod/codecs/mod_b64/Makefile
  1666. src/mod/codecs/mod_bv/Makefile
  1667. src/mod/codecs/mod_clearmode/Makefile
  1668. src/mod/codecs/mod_codec2/Makefile
  1669. src/mod/codecs/mod_com_g729/Makefile
  1670. src/mod/codecs/mod_dahdi_codec/Makefile
  1671. src/mod/codecs/mod_g723_1/Makefile
  1672. src/mod/codecs/mod_g729/Makefile
  1673. src/mod/codecs/mod_h26x/Makefile
  1674. src/mod/codecs/mod_ilbc/Makefile
  1675. src/mod/codecs/mod_isac/Makefile
  1676. src/mod/codecs/mod_mp4v/Makefile
  1677. src/mod/codecs/mod_opus/Makefile
  1678. src/mod/codecs/mod_openh264/Makefile
  1679. src/mod/codecs/mod_sangoma_codec/Makefile
  1680. src/mod/codecs/mod_silk/Makefile
  1681. src/mod/codecs/mod_siren/Makefile
  1682. src/mod/codecs/mod_skel_codec/Makefile
  1683. src/mod/codecs/mod_theora/Makefile
  1684. src/mod/databases/mod_mariadb/Makefile
  1685. src/mod/databases/mod_pgsql/Makefile
  1686. src/mod/dialplans/mod_dialplan_asterisk/Makefile
  1687. src/mod/dialplans/mod_dialplan_directory/Makefile
  1688. src/mod/dialplans/mod_dialplan_xml/Makefile
  1689. src/mod/directories/mod_ldap/Makefile
  1690. src/mod/endpoints/mod_alsa/Makefile
  1691. src/mod/endpoints/mod_dingaling/Makefile
  1692. src/mod/endpoints/mod_gsmopen/Makefile
  1693. src/mod/endpoints/mod_h323/Makefile
  1694. src/mod/endpoints/mod_khomp/Makefile
  1695. src/mod/endpoints/mod_loopback/Makefile
  1696. src/mod/endpoints/mod_opal/Makefile
  1697. src/mod/endpoints/mod_portaudio/Makefile
  1698. src/mod/endpoints/mod_reference/Makefile
  1699. src/mod/endpoints/mod_rtmp/Makefile
  1700. src/mod/endpoints/mod_skinny/Makefile
  1701. src/mod/endpoints/mod_sofia/Makefile
  1702. src/mod/endpoints/mod_unicall/Makefile
  1703. src/mod/endpoints/mod_rtc/Makefile
  1704. src/mod/endpoints/mod_verto/Makefile
  1705. src/mod/event_handlers/mod_amqp/Makefile
  1706. src/mod/event_handlers/mod_cdr_csv/Makefile
  1707. src/mod/event_handlers/mod_cdr_mongodb/Makefile
  1708. src/mod/event_handlers/mod_cdr_pg_csv/Makefile
  1709. src/mod/event_handlers/mod_cdr_sqlite/Makefile
  1710. src/mod/event_handlers/mod_erlang_event/Makefile
  1711. src/mod/event_handlers/mod_event_multicast/Makefile
  1712. src/mod/event_handlers/mod_event_socket/Makefile
  1713. src/mod/event_handlers/mod_event_test/Makefile
  1714. src/mod/event_handlers/mod_fail2ban/Makefile
  1715. src/mod/event_handlers/mod_format_cdr/Makefile
  1716. src/mod/event_handlers/mod_json_cdr/Makefile
  1717. src/mod/event_handlers/mod_kazoo/Makefile
  1718. src/mod/event_handlers/mod_radius_cdr/Makefile
  1719. src/mod/event_handlers/mod_odbc_cdr/Makefile
  1720. src/mod/event_handlers/mod_rayo/Makefile
  1721. src/mod/event_handlers/mod_smpp/Makefile
  1722. src/mod/event_handlers/mod_snmp/Makefile
  1723. src/mod/event_handlers/mod_event_zmq/Makefile
  1724. src/mod/formats/mod_imagick/Makefile
  1725. src/mod/formats/mod_local_stream/Makefile
  1726. src/mod/formats/mod_native_file/Makefile
  1727. src/mod/formats/mod_opusfile/Makefile
  1728. src/mod/formats/mod_png/Makefile
  1729. src/mod/formats/mod_shell_stream/Makefile
  1730. src/mod/formats/mod_shout/Makefile
  1731. src/mod/formats/mod_sndfile/Makefile
  1732. src/mod/formats/mod_ssml/Makefile
  1733. src/mod/formats/mod_tone_stream/Makefile
  1734. src/mod/formats/mod_vlc/Makefile
  1735. src/mod/formats/mod_portaudio_stream/Makefile
  1736. src/mod/languages/mod_java/Makefile
  1737. src/mod/languages/mod_lua/Makefile
  1738. src/mod/languages/mod_managed/Makefile
  1739. src/mod/languages/mod_perl/Makefile
  1740. src/mod/languages/mod_python/Makefile
  1741. src/mod/languages/mod_v8/Makefile
  1742. src/mod/languages/mod_yaml/Makefile
  1743. src/mod/languages/mod_basic/Makefile
  1744. src/mod/loggers/mod_console/Makefile
  1745. src/mod/loggers/mod_graylog2/Makefile
  1746. src/mod/loggers/mod_logfile/Makefile
  1747. src/mod/loggers/mod_syslog/Makefile
  1748. src/mod/loggers/mod_raven/Makefile
  1749. src/mod/say/mod_say_de/Makefile
  1750. src/mod/say/mod_say_en/Makefile
  1751. src/mod/say/mod_say_es/Makefile
  1752. src/mod/say/mod_say_es_ar/Makefile
  1753. src/mod/say/mod_say_fa/Makefile
  1754. src/mod/say/mod_say_fr/Makefile
  1755. src/mod/say/mod_say_he/Makefile
  1756. src/mod/say/mod_say_hr/Makefile
  1757. src/mod/say/mod_say_hu/Makefile
  1758. src/mod/say/mod_say_it/Makefile
  1759. src/mod/say/mod_say_ja/Makefile
  1760. src/mod/say/mod_say_nl/Makefile
  1761. src/mod/say/mod_say_pl/Makefile
  1762. src/mod/say/mod_say_pt/Makefile
  1763. src/mod/say/mod_say_ru/Makefile
  1764. src/mod/say/mod_say_sv/Makefile
  1765. src/mod/say/mod_say_th/Makefile
  1766. src/mod/say/mod_say_zh/Makefile
  1767. src/mod/timers/mod_posix_timer/Makefile
  1768. src/mod/timers/mod_timerfd/Makefile
  1769. src/mod/xml_int/mod_xml_cdr/Makefile
  1770. src/mod/xml_int/mod_xml_curl/Makefile
  1771. src/mod/xml_int/mod_xml_ldap/Makefile
  1772. src/mod/xml_int/mod_xml_radius/Makefile
  1773. src/mod/xml_int/mod_xml_rpc/Makefile
  1774. src/mod/xml_int/mod_xml_scgi/Makefile
  1775. src/mod/applications/mod_av/Makefile
  1776. src/mod/applications/mod_video_filter/Makefile
  1777. src/include/switch_am_config.h
  1778. build/getsounds.sh
  1779. build/getlib.sh
  1780. build/getg729.sh
  1781. build/freeswitch.pc
  1782. build/standalone_module/freeswitch.pc
  1783. build/modmake.rules
  1784. libs/esl/Makefile
  1785. libs/esl/perl/Makefile
  1786. libs/esl/php/Makefile
  1787. libs/xmlrpc-c/include/xmlrpc-c/config.h
  1788. libs/xmlrpc-c/xmlrpc_config.h
  1789. libs/xmlrpc-c/config.mk
  1790. libs/xmlrpc-c/srcdir.mk
  1791. libs/xmlrpc-c/stamp-h
  1792. scripts/gentls_cert])
  1793. AM_CONDITIONAL(ISLINUX, [test `uname -s` = Linux])
  1794. AM_CONDITIONAL(ISMAC, [test `uname -s` = Darwin])
  1795. AM_CONDITIONAL(ISFREEBSD, [test `uname -s` = FreeBSD])
  1796. AM_CONDITIONAL(IS64BITLINUX, [test `uname -m` = x86_64])
  1797. AM_CONDITIONAL(HAVE_G723_1, [ test -d ${switch_srcdir}/libs/libg723_1 ])
  1798. AM_CONDITIONAL(HAVE_G729, [ test -d ${switch_srcdir}/libs/libg729 ])
  1799. #some vars to sub into the Makefile.am's
  1800. #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
  1801. LIBTOOL='$(SHELL) $(switch_builddir)/libtool'
  1802. TOUCH_TARGET='if test -f "$@";then touch "$@";fi;'
  1803. CONF_MODULES='$$(grep -v "\#" $(switch_builddir)/modules.conf | sed "s/|.*//" | sed -e "s|^.*/||" | sort | uniq )'
  1804. CONF_DISABLED_MODULES='$$(grep "\#" $(switch_builddir)/modules.conf | grep -v "\#\#" | sed "s/|.*//" | sed -e "s|^.*/||" | sort | uniq )'
  1805. 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 )'
  1806. 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 )'
  1807. 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 )'
  1808. 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 )'
  1809. OUR_TEST_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-print_tests ; done )"; echo $$mods )'
  1810. OUR_CHECK_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-check ; done )"; echo $$mods )'
  1811. OUR_DISABLED_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-all ; done )"; echo $$mods )'
  1812. OUR_DISABLED_CLEAN_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-clean ; done )"; echo $$mods )'
  1813. OUR_DISABLED_INSTALL_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-install ; done)"; echo $$mods )'
  1814. OUR_DISABLED_UNINSTALL_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-uninstall ; done)"; echo $$mods )'
  1815. #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`'
  1816. #AM_MAKEFLAGS='`test -n "$(VERBOSE)" || echo -s`'
  1817. AC_SUBST(LIBTOOL)
  1818. AC_SUBST(TOUCH_TARGET)
  1819. AC_SUBST(CONF_DISABLED_MODULES)
  1820. AC_SUBST(CONF_MODULES)
  1821. AC_SUBST(OUR_MODS)
  1822. AC_SUBST(OUR_CLEAN_MODS)
  1823. AC_SUBST(OUR_TEST_MODS)
  1824. AC_SUBST(OUR_CHECK_MODS)
  1825. AC_SUBST(OUR_INSTALL_MODS)
  1826. AC_SUBST(OUR_UNINSTALL_MODS)
  1827. AC_SUBST(OUR_DISABLED_MODS)
  1828. AC_SUBST(OUR_DISABLED_CLEAN_MODS)
  1829. AC_SUBST(OUR_DISABLED_INSTALL_MODS)
  1830. AC_SUBST(OUR_DISABLED_UNINSTALL_MODS)
  1831. AC_SUBST(AM_MAKEFLAGS)
  1832. ac_configure_args="$ac_configure_args --with-modinstdir=${modulesdir} CONFIGURE_CFLAGS='$CFLAGS $CPPFLAGS' CONFIGURE_CXXFLAGS='$CXXFLAGS $CPPFLAGS' CONFIGURE_LDFLAGS='$LDFLAGS' "
  1833. # --prefix='$prefix' --exec_prefix='$exec_prefix' --libdir='$libdir' --libexecdir='$libexecdir' --bindir='$bindir' --sbindir='$sbindir' \
  1834. # --localstatedir='$localstatedir' --datadir='$datadir'"
  1835. # Run configure in all the subdirs
  1836. AC_CONFIG_SUBDIRS([libs/srtp])
  1837. if test "$use_system_apr" != "yes"; then
  1838. AC_CONFIG_SUBDIRS([libs/apr])
  1839. fi
  1840. if test "$use_system_aprutil" != "yes"; then
  1841. AC_CONFIG_SUBDIRS([libs/apr-util])
  1842. fi
  1843. AC_CONFIG_SUBDIRS([libs/iksemel])
  1844. AC_CONFIG_SUBDIRS([libs/libdingaling])
  1845. AC_CONFIG_SUBDIRS([libs/freetdm])
  1846. AC_CONFIG_SUBDIRS([libs/unimrcp])
  1847. if test "x${enable_zrtp}" = "xyes"; then
  1848. AC_CONFIG_SUBDIRS([libs/libzrtp])
  1849. fi
  1850. case $host in
  1851. *-openbsd*|*-netbsd*)
  1852. # libtool won't link static libs against shared ones on NetBSD/OpenBSD unless we tell it not to be stupid
  1853. AC_CONFIG_COMMANDS([hacklibtool], [cp libtool libtool.orig && sed -e "s/deplibs_check_method=.*/deplibs_check_method=pass_all/g" libtool.orig > libtool])
  1854. ;;
  1855. esac
  1856. AC_OUTPUT
  1857. ##
  1858. ## Configuration summary
  1859. ##
  1860. echo
  1861. echo "-------------------------- FreeSWITCH configuration --------------------------"
  1862. echo ""
  1863. echo " Locations:"
  1864. echo ""
  1865. echo " prefix: ${prefix}"
  1866. echo " exec_prefix: ${exec_prefix}"
  1867. echo " bindir: ${bindir}"
  1868. echo " confdir: ${confdir}"
  1869. echo " libdir: ${libdir}"
  1870. echo " datadir: ${datadir}"
  1871. echo " localstatedir: ${localstatedir}"
  1872. echo " includedir: ${includedir}"
  1873. echo ""
  1874. echo " certsdir: ${certsdir}"
  1875. echo " dbdir: ${dbdir}"
  1876. echo " grammardir: ${grammardir}"
  1877. echo " htdocsdir: ${htdocsdir}"
  1878. echo " fontsdir: ${fontsdir}"
  1879. echo " logfiledir: ${logfiledir}"
  1880. echo " modulesdir: ${modulesdir}"
  1881. echo " pkgconfigdir: ${pkgconfigdir}"
  1882. echo " recordingsdir: ${recordingsdir}"
  1883. echo " imagesdir: ${imagesdir}"
  1884. echo " runtimedir: ${runtimedir}"
  1885. echo " scriptdir: ${scriptdir}"
  1886. echo " soundsdir: ${soundsdir}"
  1887. echo " storagedir: ${storagedir}"
  1888. echo " cachedir: ${cachedir}"
  1889. echo ""
  1890. echo "------------------------------------------------------------------------------"