configure.ac 87 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389
  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.10-dev], bugs@freeswitch.org)
  6. AC_SUBST(SWITCH_VERSION_MAJOR, [1])
  7. AC_SUBST(SWITCH_VERSION_MINOR, [10])
  8. AC_SUBST(SWITCH_VERSION_MICRO, [10-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. LT_INIT([disable-static])
  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.3 lua-5.3 lua53 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, alcLoopbackOpenDeviceSOFT, [have_openal="yes"])
  521. AM_CONDITIONAL([HAVE_OPENAL],[test "${have_openal}" = "yes"])
  522. PA_LIBS=
  523. PKG_CHECK_MODULES(JACK, jack, have_jack=yes, have_jack=no)
  524. if test "x$have_jack" = "xyes" ; then
  525. PA_LIBS+=$JACK_LIBS
  526. fi
  527. AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no)
  528. if test "x$have_alsa" = "xyes" ; then
  529. PA_LIBS+=-lasound
  530. fi
  531. AC_SUBST(PA_LIBS)
  532. AM_CONDITIONAL([WANT_DEBUG],[test "${enable_debug}" = "yes"])
  533. AC_ARG_ENABLE(core-odbc-support,
  534. [AS_HELP_STRING([--enable-core-odbc-support], [Compile with ODBC Support (default is optional)])],,[enable_core_odbc_support="optional"])
  535. if ! test "$enable_core_odbc_support" = "no"; then
  536. AX_LIB_ODBC
  537. if test "$ac_cv_found_odbc" = "yes" ; then
  538. enable_core_odbc_support="yes"
  539. elif test "$enable_core_odbc_support" = "yes"; then
  540. AC_MSG_ERROR([no usable libodbc; please install unixodbc devel package or equivalent])
  541. else
  542. enable_core_odbc_support="no"
  543. fi
  544. fi
  545. CHECK_LIBUUID
  546. SWITCH_AM_LDFLAGS="$LIBUUID_LIBS $SWITCH_AM_LDFLAGS"
  547. SWITCH_AM_CFLAGS="$LIBUUID_CFLAGS $SWITCH_AM_CFLAGS"
  548. AC_ARG_ENABLE(core-pgsql-pkgconfig,
  549. [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"])
  550. path_remove () {
  551. echo "$1" | tr ':' '\n' | grep -Fxv "$2" | tr '\n' ':' | sed 's/:$//'
  552. }
  553. path_push_unique () {
  554. x="$(eval echo \$$1)"
  555. x="$(path_remove "$x" "$2")"
  556. if test -z "$x"; then
  557. eval export $1="$2"
  558. else
  559. eval export $1="$2:$x"
  560. fi
  561. }
  562. AC_PATH_PROG([PG_CONFIG], [pg_config], [no])
  563. AC_PATH_PROG([PKG_CONFIG], [pkg-config], [no])
  564. case $host in
  565. *-darwin*)
  566. path_push_unique PKG_CONFIG_PATH /usr/local/opt/libpq/lib/pkgconfig
  567. path_push_unique PKG_CONFIG_PATH /usr/local/opt/openssl/lib/pkgconfig
  568. ;;
  569. esac
  570. if test "$PKG_CONFIG" = "no" \
  571. || test x"$enable_core_pgsql_pkgconfig" = x"no" \
  572. || ! pkg-config --modversion libpq > /dev/null; then
  573. if test "$PG_CONFIG" != "no"; then
  574. AC_MSG_CHECKING([for PostgreSQL libraries via pg_config])
  575. POSTGRESQL_CFLAGS="-I`$PG_CONFIG --includedir`"
  576. POSTGRESQL_LIBDIR="-L`$PG_CONFIG --libdir`"
  577. POSTGRESQL_LDFLAGS="-L`$PG_CONFIG --libdir` -lpq"
  578. POSTGRESQL_VERSION=`$PG_CONFIG --version | awk '{ print $NF }'`
  579. POSTGRESQL_MAJOR_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $1 }'`
  580. POSTGRESQL_MINOR_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $2 }'`
  581. POSTGRESQL_PATCH_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $3 }'`
  582. fi
  583. else
  584. AC_MSG_CHECKING([for PostgreSQL libraries via pkg_config])
  585. POSTGRESQL_CFLAGS="`$PKG_CONFIG --cflags libpq`"
  586. POSTGRESQL_LIBDIR="`$PKG_CONFIG libpq --libs-only-L`"
  587. POSTGRESQL_LDFLAGS="`$PKG_CONFIG --libs libpq`"
  588. POSTGRESQL_VERSION="`$PKG_CONFIG --modversion libpq`"
  589. POSTGRESQL_MAJOR_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f1 | sed 's/^\([[0-9]]*\)[[^0-9]].*/\1/'`"
  590. POSTGRESQL_MINOR_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f2 | sed 's/^\([[0-9]]*\)[[^0-9]].*/\1/'`"
  591. POSTGRESQL_PATCH_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f3 | sed 's/^\([[0-9]]*\)[[^0-9]].*/\1/'`"
  592. test -n "$POSTGRESQL_PATCH_VERSION" || POSTGRESQL_PATCH_VERSION=0
  593. fi
  594. AC_MSG_RESULT([$POSTGRESQL_LIBDIR])
  595. AC_DEFINE_UNQUOTED([POSTGRESQL_VERSION], "${POSTGRESQL_VERSION}", [Specifies the version of PostgreSQL we are linking against])
  596. AC_DEFINE_UNQUOTED([POSTGRESQL_MAJOR_VERSION], ${POSTGRESQL_MAJOR_VERSION}, [Specifies the version of PostgreSQL we are linking against])
  597. AC_DEFINE_UNQUOTED([POSTGRESQL_MINOR_VERSION], ${POSTGRESQL_MINOR_VERSION}, [Specifies the version of PostgreSQL we are linking against])
  598. AC_DEFINE_UNQUOTED([POSTGRESQL_PATCH_VERSION], ${POSTGRESQL_PATCH_VERSION}, [Specifies the version of PostgreSQL we are linking against])
  599. have_libpq=no
  600. save_LIBS="${LIBS}"
  601. save_CPPFLAGS="${CPPFLAGS}"
  602. LIBS="${POSTGRESQL_LDFLAGS}"
  603. CPPFLAGS="${POSTGRESQL_CFLAGS}"
  604. AC_CHECK_LIB([pq], [PQgetvalue], [have_libpq="yes"])
  605. LIBS="${save_LIBS}"
  606. CPPFLAGS="${save_CPPFLAGS}"
  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.13.15],[
  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. PKG_CHECK_MODULES([STIRSHAKEN], [stirshaken],[
  725. AM_CONDITIONAL([HAVE_STIRSHAKEN],[true])],[
  726. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_STIRSHAKEN],[false])])
  727. AC_CHECK_LIB(apr-1, apr_pool_mutex_set, use_system_apr=yes, use_system_apr=no)
  728. AM_CONDITIONAL([SYSTEM_APR],[test "${use_system_apr}" = "yes"])
  729. save_LIBS="$LIBS"
  730. LIBS=
  731. AC_CHECK_LIB(jpeg, jpeg_std_error,, AC_MSG_ERROR([no usable libjpeg; please install libjpeg devel package or equivalent]))
  732. AC_CHECK_LIB(jbig, jbg_enc_out, have_libjbig=yes, have_libjbig=no)
  733. if test "x$have_libjbig" = "xyes" ; then
  734. SPANDSP_LA_JBIG="-ljbig $LIBS"
  735. AC_SUBST(SPANDSP_LA_JBIG)
  736. fi
  737. LIBS="$save_LIBS"
  738. AC_CHECK_LIB(lzma, lzma_code, have_liblzma=yes, have_liblzma=no)
  739. if test "x$have_liblzma" = "xyes" ; then
  740. SPANDSP_LA_LZMA="-llzma"
  741. AC_SUBST(SPANDSP_LA_LZMA)
  742. fi
  743. AC_CHECK_LIB(resolv, res_init, have_libresolv=yes, have_libresolv=no)
  744. if test "x$have_libresolv" = "xyes" ; then
  745. APR_ADDTO(SWITCH_AM_LDFLAGS, -lresolv)
  746. fi
  747. AC_SUBST(SWITCH_AM_CFLAGS)
  748. AC_SUBST(SWITCH_ANSI_CFLAGS)
  749. AC_SUBST(SWITCH_AM_CXXFLAGS)
  750. AC_SUBST(SWITCH_AM_CPPFLAGS)
  751. AC_SUBST(SWITCH_AM_LDFLAGS)
  752. AC_SUBST(ESL_LDFLAGS)
  753. AC_SUBST(PLATFORM_CORE_LDFLAGS)
  754. AC_SUBST(PLATFORM_CORE_LIBS)
  755. AC_SUBST(SOLINK)
  756. AC_SUBST(LIBTOOL_LIB_EXTEN)
  757. # Checks for header files.
  758. AC_HEADER_DIRENT
  759. AC_HEADER_STDC
  760. 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 sys/time.h])
  761. # Solaris 11 privilege management
  762. AS_CASE([$host],
  763. [*-*-solaris2.11], [AC_CHECK_HEADER([priv.h], [AC_DEFINE([SOLARIS_PRIVILEGES],[1],[Solaris 11 privilege management])])]
  764. )
  765. if test x"$ac_cv_header_wchar_h" = xyes; then
  766. HAVE_WCHAR_H_DEFINE=1
  767. else
  768. HAVE_WCHAR_H_DEFINE=0
  769. fi
  770. AC_SUBST(HAVE_WCHAR_H_DEFINE)
  771. # Needed by Abyss on Solaris:
  772. if test x"$ac_cv_header_sys_filio_h" = xyes; then
  773. HAVE_SYS_FILIO_H_DEFINE=1
  774. else
  775. HAVE_SYS_FILIO_H_DEFINE=0
  776. fi
  777. AC_SUBST(HAVE_SYS_FILIO_H_DEFINE)
  778. # Needed by Abyss on Solaris:
  779. if test x"$ac_cv_header_sys_ioctl_h" = xyes; then
  780. HAVE_SYS_IOCTL_H_DEFINE=1
  781. else
  782. HAVE_SYS_IOCTL_H_DEFINE=0
  783. fi
  784. AC_SUBST(HAVE_SYS_IOCTL_H_DEFINE)
  785. if test x"$ac_cv_header_sys_select_h" = xyes; then
  786. HAVE_SYS_SELECT_H_DEFINE=1
  787. else
  788. HAVE_SYS_SELECT_H_DEFINE=0
  789. fi
  790. AC_SUBST(HAVE_SYS_SELECT_H_DEFINE)
  791. # Checks for typedefs, structures, and compiler characteristics.
  792. AC_C_CONST
  793. AC_C_INLINE
  794. AC_TYPE_SIZE_T
  795. AC_HEADER_TIME
  796. AC_STRUCT_TM
  797. # Checks for library functions.
  798. AC_PROG_GCC_TRADITIONAL
  799. AC_FUNC_MALLOC
  800. AC_TYPE_SIGNAL
  801. AC_FUNC_STRFTIME
  802. AC_CHECK_FUNCS([gethostname vasprintf mmap mlock mlockall usleep getifaddrs timerfd_create getdtablesize posix_openpt poll])
  803. AC_CHECK_FUNCS([sched_setscheduler setpriority setrlimit setgroups initgroups getrusage])
  804. AC_CHECK_FUNCS([wcsncmp setgroups asprintf setenv pselect gettimeofday localtime_r gmtime_r strcasecmp stricmp _stricmp])
  805. # Check availability and return type of strerror_r
  806. # (NOTE: apr-1-config sets -D_GNU_SOURCE at build-time, need to run the check with it too)
  807. save_CPPFLAGS="$CPPFLAGS"
  808. CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
  809. AC_FUNC_STRERROR_R
  810. CPPFLAGS="$save_CPPFLAGS"
  811. AX_HAVE_CPU_SET
  812. AC_CHECK_LIB(rt, clock_gettime, [AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if you have clock_gettime()])])
  813. AC_CHECK_LIB(rt, clock_getres, [AC_DEFINE(HAVE_CLOCK_GETRES, 1, [Define if you have clock_getres()])])
  814. AC_CHECK_LIB(rt, clock_nanosleep, [AC_DEFINE(HAVE_CLOCK_NANOSLEEP, 1, [Define if you have clock_nanosleep()])])
  815. AC_CHECK_LIB(pthread, pthread_setschedparam, [AC_DEFINE(HAVE_PTHREAD_SETSCHEDPARAM, 1, [Define if you have pthread_setschedparam()])])
  816. AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket))
  817. AC_CHECK_FILE(/dev/ptmx, [AC_DEFINE(HAVE_DEV_PTMX, 1, [Define if you have /dev/ptmx])])
  818. AC_CHECK_LIB(util, openpty, [AC_DEFINE(HAVE_OPENPTY, 1, [Define if you have openpty()])])
  819. AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
  820. #include <sys/types.h>
  821. #include <time.h>])
  822. AC_CHECK_MEMBERS([struct tm.tm_zone],,,[
  823. #include <sys/types.h>
  824. #include <time.h>])
  825. AC_CHECK_DECL([RLIMIT_MEMLOCK],
  826. [AC_DEFINE([HAVE_RLIMIT_MEMLOCK],[1],[RLIMIT_MEMLOCK constant for setrlimit])],,
  827. [#ifdef HAVE_SYS_RESOURCE_H
  828. #include <sys/resource.h>
  829. #endif])
  830. AC_CHECK_DECL([SCHED_RR],
  831. [AC_DEFINE([HAVE_SCHED_RR],[1],[SCHED_RR constant for sched_setscheduler])],,
  832. [#ifdef HAVE_SCHED_H
  833. #include <sched.h>
  834. #endif])
  835. AC_CHECK_DECL([SCHED_FIFO],
  836. [AC_DEFINE([HAVE_SCHED_FIFO],[1],[SCHED_FIFO constant for sched_setscheduler])],,
  837. [#ifdef HAVE_SCHED_H
  838. #include <sched.h>
  839. #endif])
  840. #
  841. # use mlockall only on linux (for now; if available)
  842. #
  843. if test "x${ac_cv_func_mlockall}" = "xyes"; then
  844. AC_MSG_CHECKING([whether to use mlockall])
  845. case "$host" in
  846. *-linux-*)
  847. AC_DEFINE([USE_MLOCKALL],[1],[Enable mlockall support])
  848. AC_MSG_RESULT([yes])
  849. USE_MLOCKALL=yes
  850. ;;
  851. *-freebsd*)
  852. APR_ADDTO(SWITCH_AM_CFLAGS, -fPIC)
  853. APR_ADDTO(SWITCH_AM_CXXFLAGS, -fPIC)
  854. AC_MSG_RESULT([no, broken for non-root users])
  855. ;;
  856. *)
  857. AC_MSG_RESULT([no])
  858. ;;
  859. esac
  860. #
  861. # setrlimit prerequisites
  862. #
  863. if test "x${USE_MLOCKALL}" = "xyes" -a \
  864. "x${ac_cv_func_setrlimit}" = "xyes" -a \
  865. "x${ac_cv_have_decl_RLIMIT_MEMLOCK}" = "xyes"
  866. then
  867. AC_DEFINE([USE_SETRLIMIT],[1],[Use setrlimit to disable mlock limit for non-root users])
  868. fi
  869. fi
  870. #
  871. # sched_setcheduler + round-robin scheduler prerequisites
  872. #
  873. if test "x${ac_cv_func_sched_setscheduler}" = "xyes" -a \
  874. "x${ac_cv_have_decl_SCHED_RR}" = "xyes"
  875. then
  876. AC_DEFINE([USE_SCHED_SETSCHEDULER],[1],[Enable round-robin scheduler using sched_setscheduler])
  877. fi
  878. #
  879. # xmlrpc-c checks
  880. #
  881. AC_CHECK_FUNCS(setenv strtoll strtoull strtoq strtouq __strtoll __strtoull)
  882. HAVE_LIBWWW_SSL_DEFINE=0
  883. AC_SUBST(HAVE_LIBWWW_SSL_DEFINE)
  884. DIRECTORY_SEPARATOR="/"
  885. AC_SUBST(DIRECTORY_SEPARATOR)
  886. va_list_is_array=no
  887. AC_MSG_CHECKING(whether va_list is an array)
  888. AC_TRY_COMPILE([
  889. #include <stdarg.h>
  890. ], [va_list list1, list2; list1 = list2;], ,
  891. va_list_is_array=yes)
  892. AC_MSG_RESULT($va_list_is_array)
  893. if test x"$va_list_is_array" = xyes; then
  894. VA_LIST_IS_ARRAY_DEFINE=1
  895. else
  896. VA_LIST_IS_ARRAY_DEFINE=0
  897. fi
  898. AC_SUBST(VA_LIST_IS_ARRAY_DEFINE)
  899. AC_MSG_CHECKING(whether compiler has __attribute__)
  900. AC_TRY_COMPILE(, [int x __attribute__((__unused__));],
  901. compiler_has_attribute=yes,
  902. compiler_has_attribute=no)
  903. AC_MSG_RESULT($compiler_has_attribute)
  904. if test x"$compiler_has_attribute" = xyes; then
  905. ATTR_UNUSED="__attribute__((__unused__))"
  906. else
  907. ATTR_UNUSED=
  908. fi
  909. AC_SUBST(ATTR_UNUSED)
  910. saved_CFLAGS="$CFLAGS"
  911. AC_CACHE_CHECK([whether compiler supports -Wdeclaration-after-statement], [ac_cv_gcc_declaration_after_statement], [
  912. CFLAGS="$CFLAGS -Wdeclaration-after-statement"
  913. AC_TRY_COMPILE([],[return 0;],[ac_cv_gcc_declaration_after_statement=yes],[ac_cv_gcc_declaration_after_statement=no])
  914. ])
  915. AC_MSG_RESULT($ac_cv_gcc_declaration_after_statement)
  916. if test x"$ac_cv_gcc_declaration_after_statement" = xyes; then
  917. APR_ADDTO(SWITCH_ANSI_CFLAGS, -Wdeclaration-after-statement)
  918. fi
  919. CFLAGS="$saved_CFLAGS"
  920. if test "x${ax_cv_c_compiler_vendor}" = "xclang" ; then
  921. saved_CFLAGS="$CFLAGS"
  922. # Next check added for Xcode 5 and systems with clang 5 llvm 3.3 or above, extended offset must be off
  923. AC_CACHE_CHECK([whether compiler supports -Wextended-offsetof], [ac_cv_clang_extended_offsetof], [
  924. CFLAGS="$CFLAGS -Wno-extended-offsetof"
  925. AC_TRY_COMPILE([],[return 0;],[ac_cv_clang_extended_offsetof=yes],[ac_cv_clang_extended_offsetof=no])
  926. ])
  927. AC_MSG_RESULT($ac_cv_clang_extended_offsetof)
  928. if test x"$ac_cv_clang_extended_offsetof" = xyes; then
  929. APR_ADDTO(CFLAGS, -Wno-extended-offsetof)
  930. fi
  931. CFLAGS="$saved_CFLAGS"
  932. fi
  933. # Tested and fixed lot of modules, but some are untested. Will be added back when the core team decide it ready
  934. # Untested modules : mod_osp mod_soundtouch mod_sangoma_codec mod_opal mod_h323 mod_khomp
  935. # mod_cepstral mod_erlang_event mod_snmp mod_perl mod_java mod_managed
  936. #
  937. #saved_CFLAGS="$CFLAGS"
  938. #AC_CACHE_CHECK([whether compiler supports -Wunused-but-set-variable], [ac_cv_gcc_unused_but_set_variable], [
  939. #CFLAGS="$CFLAGS -Wunused-but-set-variable"
  940. #AC_TRY_COMPILE([],[return 0;],[ac_cv_gcc_unused_but_set_variable=yes],[ac_cv_gcc_unused_but_set_variable=no])
  941. #])
  942. #AC_MSG_RESULT($ac_cv_gcc_unused_but_set_variable)
  943. #if test x"$ac_cv_gcc_unused_but_set_variable" = xyes; then
  944. # APR_ADDTO(SWITCH_ANSI_CFLAGS, -Wunused-but-set-variable)
  945. #fi
  946. #CFLAGS="$saved_CFLAGS"
  947. AC_C_BIGENDIAN(AC_DEFINE([SWITCH_BYTE_ORDER],__BIG_ENDIAN,[Big Endian]),AC_DEFINE([SWITCH_BYTE_ORDER],__LITTLE_ENDIAN,[Little Endian]))
  948. # Checks for integer size
  949. AC_CHECK_SIZEOF(char, 1)
  950. AC_CHECK_SIZEOF(int, 4)
  951. AC_CHECK_SIZEOF(long, 4)
  952. AC_CHECK_SIZEOF(short, 2)
  953. AC_CHECK_SIZEOF(long long, 8)
  954. AC_TYPE_SIZE_T
  955. AC_CHECK_TYPE(ssize_t, int)
  956. # Checks for pointer size
  957. AC_CHECK_SIZEOF(void*, 4)
  958. if test "x$ac_cv_sizeof_voidp" != "x"; then
  959. voidp_size=$ac_cv_sizeof_voidp
  960. else
  961. AC_ERROR([Cannot determine size of void*])
  962. fi
  963. if test "$ac_cv_sizeof_short" = "2"; then
  964. short_value=short
  965. fi
  966. if test "$ac_cv_sizeof_int" = "4"; then
  967. int_value=int
  968. fi
  969. if test "$ac_cv_sizeof_int" = "8"; then
  970. int64_t_fmt='#define SWITCH_INT64_T_FMT "d"'
  971. uint64_t_fmt='#define SWITCH_UINT64_T_FMT "u"'
  972. int64_value="int"
  973. long_value=int
  974. elif test "$ac_cv_sizeof_long" = "8"; then
  975. int64_t_fmt='#define SWITCH_INT64_T_FMT "ld"'
  976. uint64_t_fmt='#define SWITCH_UINT64_T_FMT "lu"'
  977. int64_value="long"
  978. long_value=long
  979. case "$host" in
  980. *pc-solaris2*)
  981. ;;
  982. sparc-*-solaris2*)
  983. ;;
  984. *-solaris2*|*apple-darwin*|*-openbsd*)
  985. if test "$ac_cv_sizeof_long_long" = "8"; then
  986. int64_t_fmt='#define SWITCH_INT64_T_FMT "lld"'
  987. uint64_t_fmt='#define SWITCH_UINT64_T_FMT "llu"'
  988. int64_value="long long"
  989. long_value="long long"
  990. fi
  991. ;;
  992. esac
  993. elif test "$ac_cv_sizeof_long_long" = "8"; then
  994. int64_t_fmt='#define SWITCH_INT64_T_FMT "lld"'
  995. uint64_t_fmt='#define SWITCH_UINT64_T_FMT "llu"'
  996. int64_value="long long"
  997. long_value="long long"
  998. elif test "$ac_cv_sizeof_longlong" = "8"; then
  999. int64_t_fmt='#define SWITCH_INT64_T_FMT "qd"'
  1000. uint64_t_fmt='#define SWITCH_UINT64_T_FMT "qu"'
  1001. int64_value="__int64"
  1002. long_value="__int64"
  1003. else
  1004. AC_ERROR([could not detect a 64-bit integer type])
  1005. fi
  1006. if test "$ac_cv_type_size_t" = "yes"; then
  1007. size_t_value="size_t"
  1008. else
  1009. size_t_value="switch_int32_t"
  1010. fi
  1011. if test "$ac_cv_type_ssize_t" = "yes"; then
  1012. ssize_t_value="ssize_t"
  1013. else
  1014. ssize_t_value="switch_int32_t"
  1015. fi
  1016. APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], ssize_t, 8)
  1017. if test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_int"; then
  1018. ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "d"'
  1019. elif test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_long"; then
  1020. ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
  1021. else
  1022. ssize_t_fmt='#error Can not determine the proper size for ssize_t'
  1023. fi
  1024. APR_CHECK_SIZEOF_EXTENDED([#include <stddef.h>], size_t, 8)
  1025. if test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_int"; then
  1026. size_t_fmt='#define SWITCH_SIZE_T_FMT "d"'
  1027. elif test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_long"; then
  1028. size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
  1029. else
  1030. size_t_fmt='#define SWITCH_SIZE_T_FMT "zu"'
  1031. fi
  1032. # Basically, we have tried to figure out the correct format strings
  1033. # for SWITCH types which vary between platforms, but we don't always get
  1034. # it right. If you find that we don't get it right for your platform,
  1035. # you can override our decision below.
  1036. # NOTE: borrowed much of this logic from apr.
  1037. case $host in
  1038. s390*linux*)
  1039. # uniquely, the 31-bit Linux/s390 uses "unsigned long int"
  1040. # for size_t rather than "unsigned int":
  1041. size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
  1042. ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
  1043. ;;
  1044. *-os2*)
  1045. size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
  1046. ;;
  1047. *-openbsd*)
  1048. size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
  1049. ;;
  1050. *aix4*|*aix5*)
  1051. ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
  1052. size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
  1053. ;;
  1054. *beos*)
  1055. ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
  1056. size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
  1057. ;;
  1058. *apple-darwin*)
  1059. ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
  1060. size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
  1061. ;;
  1062. esac
  1063. AC_SUBST(voidp_size)
  1064. AC_SUBST(short_value)
  1065. AC_SUBST(int_value)
  1066. AC_SUBST(long_value)
  1067. AC_SUBST(int64_value)
  1068. AC_SUBST(size_t_value)
  1069. AC_SUBST(ssize_t_value)
  1070. AC_SUBST(int64_t_fmt)
  1071. AC_SUBST(uint64_t_fmt)
  1072. AC_SUBST(ssize_t_fmt)
  1073. AC_SUBST(size_t_fmt)
  1074. case $host in
  1075. *-openbsd*)
  1076. # OpenBSD's gunzip and friends don't like -d because its redundant, only gzip does
  1077. AC_PATH_PROGS(ZCAT, gzip)
  1078. ;;
  1079. *)
  1080. AC_PATH_PROGS(ZCAT, gunzip gzcat gzip zcat)
  1081. ;;
  1082. esac
  1083. AC_PATH_PROGS(BZIP, bzip2)
  1084. AC_PATH_PROGS(XZ, xz)
  1085. AC_PATH_PROGS(TAR, gtar tar)
  1086. AC_PATH_PROGS(WGET, wget)
  1087. AC_PATH_PROGS(CURL, curl)
  1088. GETLIB="cd $switch_srcdir/libs && ${SHELL} $switch_builddir/build/getlib.sh"
  1089. AC_SUBST(GETLIB)
  1090. GETG729="cd $switch_srcdir/libs && ${SHELL} $switch_builddir/build/getg729.sh"
  1091. AC_SUBST(GETG729)
  1092. GETSOUNDS="${SHELL} $switch_builddir/build/getsounds.sh"
  1093. AC_SUBST(GETSOUNDS)
  1094. case $host in
  1095. *-darwin*)
  1096. path_push_unique PKG_CONFIG_PATH /usr/local/opt/curl/lib/pkgconfig
  1097. path_push_unique PKG_CONFIG_PATH /usr/local/opt/sqlite/lib/pkgconfig/
  1098. path_push_unique PKG_CONFIG_PATH /usr/local/opt/ldns/lib/pkgconfig/
  1099. path_push_unique PKG_CONFIG_PATH /usr/local/opt/portaudio/lib/pkgconfig/
  1100. path_push_unique PKG_CONFIG_PATH /usr/local/opt/ffmpeg/lib/pkgconfig/
  1101. ;;
  1102. esac
  1103. if ! (test -x "$PKG_CONFIG" || test -x "$(which pkg-config)"); then
  1104. AC_MSG_ERROR([You need to install pkg-config to configure FreeSWITCH.])
  1105. fi
  1106. # temporary workaround for Debian libldns-dev package bug
  1107. if test "$cross_compiling" != "yes" && test -f /usr/lib/pkg-config/libldns.pc; then
  1108. path_push_unique PKG_CONFIG_PATH /usr/lib/pkg-config
  1109. fi
  1110. module_enabled() {
  1111. grep -v -e "\#" -e "^\$" modules.conf | sed 's/|.*//' | sed -e "s|^.*/||" | grep "^${1}\$" >/dev/null
  1112. }
  1113. AC_ARG_WITH(png,
  1114. [AS_HELP_STRING([--without-png],
  1115. [disable support for libpng])],
  1116. [with_png="$withval"],
  1117. [with_png="yes"])
  1118. if test "$with_png" = "yes"; then
  1119. PKG_CHECK_MODULES([LIBPNG], [libpng >= 1.6.16],[
  1120. AM_CONDITIONAL([HAVE_PNG],[true])],[
  1121. PKG_CHECK_MODULES([LIBPNG], [libpng16 >= 1.6.16],[
  1122. AM_CONDITIONAL([HAVE_PNG],[true])],[
  1123. PKG_CHECK_MODULES([LIBPNG], [libpng >= 1.2.49],[
  1124. AM_CONDITIONAL([HAVE_PNG],[true])],[
  1125. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_PNG],[false])])])])
  1126. else
  1127. AM_CONDITIONAL([HAVE_PNG],[false])
  1128. fi
  1129. AC_ARG_WITH(freetype,
  1130. [AS_HELP_STRING([--without-freetype],
  1131. [disable support for freetype])],
  1132. [with_freetype="$withval"],
  1133. [with_freetype="yes"])
  1134. if test "$with_freetype" = "yes"; then
  1135. PKG_CHECK_MODULES([FREETYPE], [freetype2 >= 2.4.9],[
  1136. AM_CONDITIONAL([HAVE_FREETYPE],[true])],[
  1137. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_FREETYPE],[false])])
  1138. else
  1139. AM_CONDITIONAL([HAVE_FREETYPE],[false])
  1140. fi
  1141. PKG_CHECK_MODULES([GUMBO], [gumbo >= 0.10.1],[
  1142. AM_CONDITIONAL([HAVE_GUMBO],[true])],[
  1143. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_GUMBO],[false])])
  1144. PKG_CHECK_MODULES([FVAD], [libfvad >= 1.0],[
  1145. AM_CONDITIONAL([HAVE_FVAD],[true])],[
  1146. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_FVAD],[false])])
  1147. PKG_CHECK_MODULES([TPL], [libtpl >= 1.5],[
  1148. AC_DEFINE([HAVE_LIBTPL],[1],[Define to 1 if you have libtpl])],[
  1149. AC_MSG_RESULT([no])])
  1150. PKG_CHECK_MODULES([SQLITE], [sqlite3 >= 3.6.20])
  1151. PKG_CHECK_MODULES([CURL], [libcurl >= 7.19])
  1152. PKG_CHECK_MODULES([PCRE], [libpcre >= 7.8])
  1153. PKG_CHECK_MODULES([SPEEX], [speex >= 1.2rc1 speexdsp >= 1.2rc1])
  1154. PKG_CHECK_MODULES([YAML], [yaml-0.1 >= 0.1.4],[
  1155. AM_CONDITIONAL([HAVE_YAML],[true])],[
  1156. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_YAML],[false])])
  1157. PKG_CHECK_MODULES([PORTAUDIO], [portaudio-2.0 >= 19],[
  1158. AM_CONDITIONAL([HAVE_PORTAUDIO],[true])],[
  1159. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_PORTAUDIO],[false])])
  1160. PKG_CHECK_MODULES([LDNS], [libldns-fs >= 1.6.6],[
  1161. AM_CONDITIONAL([HAVE_LDNS],[true])],[
  1162. PKG_CHECK_MODULES([LDNS], [libldns >= 1.6.6],[
  1163. AM_CONDITIONAL([HAVE_LDNS],[true])],[
  1164. AC_CHECK_LIB([ldns], [ldns_str2rdf_a], [LDNS_LIBS=-lldns])
  1165. AS_IF([test -z "$LDNS_LIBS"],[
  1166. if module_enabled mod_enum; then
  1167. AC_MSG_ERROR([You need to either install libldns-dev or disable mod_enum in modules.conf])
  1168. else
  1169. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_LDNS],[false])
  1170. fi],[
  1171. AM_CONDITIONAL([HAVE_LDNS],[true])])])])
  1172. PKG_CHECK_MODULES([SNDFILE], [sndfile >= 1.0.20],[
  1173. AM_CONDITIONAL([HAVE_SNDFILE],[true])],[
  1174. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SNDFILE],[false])])
  1175. PKG_CHECK_MODULES([MPG123], [libmpg123 >= 1.16.0],[
  1176. AM_CONDITIONAL([HAVE_MPG123],[true])],[
  1177. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MPG123],[false])])
  1178. PKG_CHECK_MODULES([SHOUT], [shout >= 2.2.2],[
  1179. AM_CONDITIONAL([HAVE_SHOUT],[true])
  1180. SHOUT_VERSION="`$PKG_CONFIG --modversion shout`"
  1181. SHOUT_MAJOR_VERSION="`echo $SHOUT_VERSION | cut -d. -f1`"
  1182. SHOUT_MINOR_VERSION="`echo $SHOUT_VERSION | cut -d. -f2`"
  1183. SHOUT_PATCH_VERSION="`echo $SHOUT_VERSION | cut -d. -f3`"
  1184. test -n "$SHOUT_PATCH_VERSION" || SHOUT_PATCH_VERSION=0
  1185. AC_MSG_NOTICE([SHOUT version: $SHOUT_VERSION])
  1186. AC_MSG_NOTICE([SHOUT major version: $SHOUT_MAJOR_VERSION])
  1187. AC_MSG_NOTICE([SHOUT minor version: $SHOUT_MINOR_VERSION])
  1188. AC_MSG_NOTICE([SHOUT patch version: $SHOUT_PATCH_VERSION])
  1189. AC_SUBST([SHOUT_VERSION])
  1190. AC_SUBST([SHOUT_MAJOR_VERSION])
  1191. AC_SUBST([SHOUT_MINOR_VERSION])
  1192. AC_SUBST([SHOUT_PATCH_VERSION])
  1193. ],[
  1194. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SHOUT],[false])])
  1195. mp3lame=false
  1196. AC_CHECK_LIB([mp3lame], [lame_init],[
  1197. AC_CHECK_HEADER([lame/lame.h],[
  1198. mp3lame=true
  1199. AC_SUBST([MP3LAME_LIBS], [-lmp3lame])
  1200. AC_SUBST([MP3LAME_CFLAGS], [$CPPFLAGS])])])
  1201. AM_CONDITIONAL([HAVE_MP3LAME],[$mp3lame])
  1202. PKG_CHECK_MODULES([AVCODEC], [libavcodec >= 53.35.0],[
  1203. AM_CONDITIONAL([HAVE_AVCODEC],[true])],[
  1204. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AVCODEC],[false])])
  1205. PKG_CHECK_MODULES([X264], [x264 >= 0.142.2431],[
  1206. AM_CONDITIONAL([HAVE_X264],[true])],[
  1207. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_X264],[false])])
  1208. PKG_CHECK_MODULES([AVFORMAT], [libavformat >= 53.21.1],[
  1209. AM_CONDITIONAL([HAVE_AVFORMAT],[true])],[
  1210. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AVFORMAT],[false])])
  1211. PKG_CHECK_MODULES([AVUTIL], [libavutil >= 54.3.0],[
  1212. AM_CONDITIONAL([HAVE_AVUTIL],[true])],[
  1213. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AVUTIL],[false])])
  1214. PKG_CHECK_MODULES([AVRESAMPLE], [libavresample >= 2.1.0],[
  1215. AM_CONDITIONAL([HAVE_AVRESAMPLE],[true])],[
  1216. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AVRESAMPLE],[false])])
  1217. PKG_CHECK_MODULES([SWRESAMPLE], [libswresample >= 2.1.0],[
  1218. AM_CONDITIONAL([HAVE_SWRESAMPLE],[true])],[
  1219. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SWRESAMPLE],[false])])
  1220. PKG_CHECK_MODULES([SWSCALE], [libswscale >= 3.0.0],[
  1221. AM_CONDITIONAL([HAVE_SWSCALE],[true])],[
  1222. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SWSCALE],[false])])
  1223. PKG_CHECK_MODULES([VLC], [libvlc >= 2.1.0],[
  1224. AM_CONDITIONAL([HAVE_VLC],[true])],[
  1225. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_VLC],[false])])
  1226. PKG_CHECK_MODULES([OPENCV], [opencv >= 2.4.5],[
  1227. AM_CONDITIONAL([HAVE_OPENCV],[true])],[
  1228. PKG_CHECK_MODULES([OPENCV], [opencv4 >= 2.4.5],[
  1229. AM_CONDITIONAL([HAVE_OPENCV],[true])],[
  1230. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_OPENCV],[false])])])
  1231. PKG_CHECK_MODULES([OPUSFILE_DECODE], [opusfile >= 0.5],[
  1232. AM_CONDITIONAL([HAVE_OPUSFILE_DECODE],[true])],[
  1233. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_OPUSFILE_DECODE],[false])])
  1234. PKG_CHECK_MODULES([OPUSFILE_ENCODE], [libopusenc >= 0.1],[
  1235. AM_CONDITIONAL([HAVE_OPUSFILE_ENCODE],[true])],[
  1236. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_OPUSFILE_ENCODE],[false])])
  1237. PKG_CHECK_MODULES([MAGICK], [ImageMagick >= 6.0.0],[
  1238. AM_CONDITIONAL([HAVE_MAGICK],[true])],[
  1239. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MAGICK],[false])])
  1240. PKG_CHECK_MODULES([MAGICK7], [ImageMagick >= 7.0.0],[
  1241. AM_CONDITIONAL([HAVE_MAGICK7],[true])],[
  1242. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MAGICK7],[false])])
  1243. PKG_CHECK_MODULES([SILK], [silk >= 1.0.8],[
  1244. AM_CONDITIONAL([HAVE_SILK],[true])],[
  1245. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SILK],[false])])
  1246. PKG_CHECK_MODULES([BROADVOICE], [broadvoice >= 0.1.0],[
  1247. AM_CONDITIONAL([HAVE_BROADVOICE],[true])],[
  1248. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_BROADVOICE],[false])])
  1249. PKG_CHECK_MODULES([ILBC], [ilbc2 >= 0.0.1],[
  1250. AM_CONDITIONAL([HAVE_ILBC],[true])],[
  1251. PKG_CHECK_MODULES([ILBC], [ilbc >= 0.0.1],[
  1252. AM_CONDITIONAL([HAVE_ILBC],[true])],[
  1253. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_ILBC],[false])])])
  1254. PKG_CHECK_MODULES([G7221], [g722_1 >= 0.2.0],[
  1255. AM_CONDITIONAL([HAVE_G7221],[true])],[
  1256. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_G7221],[false])])
  1257. codec2="true"
  1258. PKG_CHECK_MODULES([CODEC2], [codec2 >= 0.5],[],[
  1259. AC_CHECK_LIB([codec2], [codec2_create],[
  1260. AC_CHECK_HEADERS([codec2/codec2.h],[
  1261. CODEC2_LIBS="-lcodec2"
  1262. CODEC2_CFLAGS=""
  1263. ], [
  1264. codec2="false"
  1265. if module_enabled mod_codec2; then
  1266. AC_MSG_ERROR([You must install libcodec2-dev to build mod_codec2])
  1267. else
  1268. AC_MSG_RESULT([no])
  1269. fi
  1270. ])
  1271. ])
  1272. ])
  1273. AM_CONDITIONAL([HAVE_CODEC2],[$codec2])
  1274. PKG_CHECK_MODULES([OPUS], [opus >= 1.1],[
  1275. AM_CONDITIONAL([HAVE_OPUS],[true])],[
  1276. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_OPUS],[false])])
  1277. PKG_CHECK_MODULES([SOUNDTOUCH], [soundtouch >= 1.7.0],[
  1278. AM_CONDITIONAL([HAVE_SOUNDTOUCH],[true])],[
  1279. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SOUNDTOUCH],[false])])
  1280. flite="true"
  1281. PKG_CHECK_MODULES([FLITE], [flite >= 2],[],[
  1282. AC_CHECK_LIB([flite], [flite_init],[
  1283. AC_CHECK_HEADERS([flite/flite.h],[
  1284. 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"
  1285. FLITE_CFLAGS=""
  1286. ], [
  1287. flite="false"
  1288. if module_enabled mod_flite; then
  1289. AC_MSG_ERROR([You must install libflite-dev to build mod_flite])
  1290. else
  1291. AC_MSG_RESULT([no])
  1292. fi
  1293. ])
  1294. ])
  1295. ])
  1296. AM_CONDITIONAL([HAVE_FLITE],[$flite])
  1297. PKG_CHECK_MODULES([MONGOC], [libmongoc-1.0 >= 1.0.8],[
  1298. AM_CONDITIONAL([HAVE_MONGOC],[true])],[
  1299. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MONGOC],[false])])
  1300. PKG_CHECK_MODULES([MEMCACHED], [libmemcached >= 0.31],[
  1301. AM_CONDITIONAL([HAVE_MEMCACHED],[true])
  1302. MEMCACHED_LIBS="${MEMCACHED_LIBS} -lpthread"
  1303. save_LIBS="${LIBS}"
  1304. save_CPPFLAGS="${CPPFLAGS}"
  1305. LIBS="${MEMCACHED_LIBS}"
  1306. CPPFLAGS="${MEMCACHED_CFLAGS}"
  1307. AC_CHECK_FUNCS([memcached_server_name memcached_stat_execute])
  1308. AC_CHECK_TYPES([memcached_instance_st*],,, [[#include <libmemcached/memcached.h>]])
  1309. LIBS="${save_LIBS}"
  1310. CPPFLAGS="${save_CPPFLAGS}"
  1311. ],[
  1312. AC_MSG_RESULT([no])
  1313. AM_CONDITIONAL([HAVE_MEMCACHED],[false])
  1314. ])
  1315. PKG_CHECK_MODULES([V8FS_STATIC], [v8-6.1_static >= 6.1.298],[
  1316. AM_CONDITIONAL([HAVE_V8FS],[true])],[
  1317. PKG_CHECK_MODULES([V8FS_STATIC], [v8fs_static >= 6.1.298],[
  1318. AM_CONDITIONAL([HAVE_V8FS],[true])],[
  1319. PKG_CHECK_MODULES([V8FS_STATIC], [v8 >= 6.1.298],[
  1320. AM_CONDITIONAL([HAVE_V8FS],[true])],[
  1321. if module_enabled mod_v8; then
  1322. 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])
  1323. else
  1324. AC_MSG_RESULT([no])
  1325. AM_CONDITIONAL([HAVE_V8FS],[false])
  1326. fi
  1327. ])
  1328. ])
  1329. ])
  1330. PKG_CHECK_MODULES([KS], [libks2 >= 2.0.0],[
  1331. AM_CONDITIONAL([HAVE_KS],[true])],[
  1332. PKG_CHECK_MODULES([KS], [libks >= 1.8.2],[
  1333. AM_CONDITIONAL([HAVE_KS],[true])],[
  1334. if module_enabled mod_verto; then
  1335. AC_MSG_ERROR([You need to either install libks2 or libks or disable mod_verto in modules.conf])
  1336. else
  1337. if module_enabled mod_signalwire; then
  1338. AC_MSG_ERROR([You need to either install libks2 or libks or disable mod_signalwire in modules.conf])
  1339. else
  1340. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_KS],[false])
  1341. fi
  1342. fi
  1343. ])
  1344. ])
  1345. PKG_CHECK_MODULES([SIGNALWIRE_CLIENT], [signalwire_client2 >= 2.0.0],[
  1346. AM_CONDITIONAL([HAVE_SIGNALWIRE_CLIENT],[true])],[
  1347. PKG_CHECK_MODULES([SIGNALWIRE_CLIENT], [signalwire_client >= 1.0.0],[
  1348. AM_CONDITIONAL([HAVE_SIGNALWIRE_CLIENT],[true])],[
  1349. if module_enabled mod_signalwire; then
  1350. AC_MSG_ERROR([You need to either install signalwire-client-c2 or signalwire-client-c or disable mod_signalwire in modules.conf])
  1351. else
  1352. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SIGNALWIRE_CLIENT],[false])
  1353. fi
  1354. ])
  1355. ])
  1356. PKG_CHECK_MODULES([AMQP], [librabbitmq >= 0.5.2],[
  1357. AM_CONDITIONAL([HAVE_AMQP],[true])],[
  1358. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AMQP],[false])])
  1359. PKG_CHECK_MODULES([H2O], [libh2o-evloop >= 0.11.0],[
  1360. AM_CONDITIONAL([HAVE_H2O],[true])],[
  1361. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_H2O],[false])])
  1362. PKG_CHECK_MODULES([BROTLIENC], [libbrotlienc >= 0.1.0],[
  1363. AM_CONDITIONAL([HAVE_BROTLIENC],[true])],[
  1364. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_BROTLIENC],[false])])
  1365. PKG_CHECK_MODULES([BROTLIDEC], [libbrotlidec >= 0.1.0],[
  1366. AM_CONDITIONAL([HAVE_BROTLIDEC],[true])],[
  1367. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_BROTLIDEC],[false])])
  1368. PKG_CHECK_MODULES([TAP], [tap >= 0.1.0],[
  1369. AM_CONDITIONAL([HAVE_TAP],[true])],[
  1370. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_TAP],[false])])
  1371. PKG_CHECK_MODULES([SMPP34], [libsmpp34 >= 1.10],[
  1372. AM_CONDITIONAL([HAVE_SMPP34],[true])],[
  1373. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SMPP34],[false])])
  1374. PKG_CHECK_MODULES([HIREDIS], [hiredis >= 0.10.0],[
  1375. AM_CONDITIONAL([HAVE_HIREDIS],[true])],[
  1376. AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_HIREDIS],[false])])
  1377. AC_ARG_ENABLE(core-libedit-support,
  1378. [AS_HELP_STRING([--disable-core-libedit-support], [Compile without libedit Support])])
  1379. AS_IF([test "x$enable_core_libedit_support" != "xno"],[
  1380. PKG_CHECK_MODULES([LIBEDIT], [libedit >= 2.11],,[
  1381. AC_MSG_RESULT([no])
  1382. AC_CHECK_LIB([edit], [el_line], [LIBEDIT_LIBS=-ledit])
  1383. AC_CHECK_LIB([edit], [el_cursor], [ac_cv_has_el_cursor=yes])
  1384. AC_CHECK_HEADER([histedit.h], [], [unset LIBEDIT_LIBS])
  1385. AS_IF([test "x$LIBEDIT_LIBS" = "x"], [
  1386. AC_MSG_ERROR([You need to either install libedit-dev (>= 2.11) or configure with --disable-core-libedit-support])
  1387. ])])])
  1388. AC_ARG_ENABLE(systemd,
  1389. [AS_HELP_STRING([--enable-systemd], [Compile with systemd notify support])])
  1390. AS_IF([test "x$enable_systemd" = "xyes"],[
  1391. PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 219], [
  1392. AC_DEFINE([HAVE_SYSTEMD], [1], [Define to 1 if systemd is available])])
  1393. ])
  1394. AC_SUBST(SYSTEMD_LIBS)
  1395. dnl ---------------------------------------------------------------------------
  1396. dnl - OpenLDAP SDK
  1397. dnl ---------------------------------------------------------------------------
  1398. AC_CHECK_LIB(ldap, ldap_search, with_ldap=yes)
  1399. dnl Check for other libraries we need to link with to get the main routines.
  1400. test "$with_ldap" != "yes" && { AC_CHECK_LIB(ldap, ldap_open, [with_ldap=yes with_ldap_lber=yes], , -llber) }
  1401. test "$with_ldap" != "yes" && { AC_CHECK_LIB(ldap, ldap_open, [with_ldap=yes with_ldap_lber=yes with_ldap_krb=yes], , -llber -lkrb) }
  1402. 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) }
  1403. test "$with_ldap_lber" != "yes" && { AC_CHECK_LIB(lber, ber_pvt_opt_on, with_ldap_lber=yes) }
  1404. if test "$with_ldap" = "yes"; then
  1405. if test "$with_ldap_des" = "yes" ; then
  1406. OPENLDAP_LIBS="${OPENLDAP_LIBS} -ldes"
  1407. fi
  1408. if test "$with_ldap_krb" = "yes" ; then
  1409. OPENLDAP_LIBS="${OPENLDAP_LIBS} -lkrb"
  1410. fi
  1411. if test "$with_ldap_lber" = "yes" ; then
  1412. OPENLDAP_LIBS="${OPENLDAP_LIBS} -llber"
  1413. fi
  1414. OPENLDAP_LIBS="${OPENLDAP_LIBS} -lldap"
  1415. fi
  1416. AM_CONDITIONAL([HAVE_LDAP],[test "x$with_ldap" = "xyes"])
  1417. AC_SUBST(OPENLDAP_LIBS)
  1418. AS_IF([test "x$enable_core_libedit_support" != "xno"], [
  1419. # If making changes here, don't forget to run autoheader and
  1420. # update libs/esl/src/include/esl_config_auto.h.in manually.
  1421. AC_DEFINE([HAVE_LIBEDIT], [1], [Define to 1 if you have libedit is available])
  1422. if test x$ac_cv_has_el_cursor = xyes; then
  1423. AC_DEFINE([HAVE_EL_CURSOR], [1], [Define to 1 if you have libedit el_cursor support])
  1424. fi
  1425. save_LIBS="${LIBS}"
  1426. save_CPPFLAGS="${CPPFLAGS}"
  1427. LIBS="${LIBEDIT_LIBS}"
  1428. CPPFLAGS="${LIBEDIT_CFLAGS}"
  1429. AC_CHECK_DECLS([EL_PROMPT_ESC, EL_REFRESH],,, [[#include <histedit.h>]])
  1430. AC_CHECK_FUNCS([el_wset])
  1431. LIBS="${save_LIBS}"
  1432. CPPFLAGS="${save_CPPFLAGS}"
  1433. ])
  1434. SAC_OPENSSL
  1435. if test x$HAVE_OPENSSL = x1; then
  1436. openssl_CFLAGS="$openssl_CFLAGS -DHAVE_OPENSSL";
  1437. APR_ADDTO(SWITCH_AM_CFLAGS, -DHAVE_OPENSSL)
  1438. 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]))
  1439. 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]))
  1440. AC_CHECK_LIB(ssl, DTLSv1_2_method, AC_DEFINE_UNQUOTED(HAVE_OPENSSL_DTLSv1_2_method, 1, [DTLS version 1.2 is available]))
  1441. else
  1442. AC_MSG_ERROR([OpenSSL >= 1.0.1e and associated developement headers required])
  1443. fi
  1444. AX_CHECK_JAVA
  1445. AM_CONDITIONAL([HAVE_ODBC],[test "x$enable_core_odbc_support" != "xno"])
  1446. AM_CONDITIONAL([HAVE_MYSQL],[test "$found_mysql" = "yes"])
  1447. #
  1448. # perl checks
  1449. #
  1450. AC_CHECK_PROG(PERL,perl,[ac_cv_have_perl=yes],[ac_cv_have_perl=no])
  1451. # -a "x$ac_cv_have_EXTERN_h" != "xno"
  1452. if test "x$ac_cv_have_perl" != "xno"; then
  1453. PERL=perl
  1454. PERL_SITEDIR="`$PERL -MConfig -e 'print $Config{archlib}'`"
  1455. PERL_LIBDIR="-L`$PERL -MConfig -e 'print $Config{archlib}'`/CORE"
  1456. PERL_LIBS="`$PERL -MConfig -e 'print $Config{libs}'`"
  1457. PERL_CFLAGS="-w -DMULTIPLICITY `$PERL -MExtUtils::Embed -e ccopts | sed -e 's|-arch x86_64 -arch i386||'` -DEMBED_PERL"
  1458. PERL_LDFLAGS="`$PERL -MExtUtils::Embed -e ldopts| sed -e 's|-arch x86_64 -arch i386||'`"
  1459. PERL_INC="`$PERL -MExtUtils::Embed -e perl_inc`"
  1460. save_CFLAGS="$CFLAGS"
  1461. CFLAGS="$PERL_CFLAGS"
  1462. AC_CHECK_HEADER([EXTERN.h], [ac_cv_have_EXTERN_h=yes], [ac_cv_have_EXTERN_h=no], [[#include <EXTERN.h>
  1463. # include <perl.h>]])
  1464. CFLAGS="$save_CFLAGS"
  1465. save_LDFLAGS="$LDFLAGS"
  1466. LDFLAGS="$PERL_LDFLAGS"
  1467. AC_CHECK_LIB([perl], [perl_alloc], ac_cv_use_libperl=yes, ac_cv_use_libperl=no)
  1468. LDFLAGS="$save_LDFLAGS"
  1469. AC_SUBST(PERL_SITEDIR)
  1470. AC_SUBST(PERL_LIBDIR)
  1471. AC_SUBST(PERL_LIBS)
  1472. AC_SUBST(PERL_CFLAGS)
  1473. AC_SUBST(PERL_LDFLAGS)
  1474. AC_SUBST(PERL_INC)
  1475. fi
  1476. 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"])
  1477. #
  1478. # php checks
  1479. #
  1480. AC_CHECK_PROG(PHP,php,[ac_cv_have_php=yes],[ac_cv_have_php=no])
  1481. AC_CHECK_PROG(PHP_CONFIG,php-config,[ac_cv_have_php_config=yes],[ac_cv_have_php_config=no])
  1482. AM_CONDITIONAL([HAVE_PHP],[test "x$ac_cv_have_php" != "xno" -a "x$ac_cv_have_php_config" != "xno"])
  1483. if test "x$ac_cv_have_php" != "xno" -a "x$ac_cv_have_php_config" != "xno"; then
  1484. PHP=php
  1485. PHP_CONFIG=php-config
  1486. PHP_LDFLAGS="`$PHP_CONFIG --ldflags`"
  1487. 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'`"
  1488. PHP_EXT_DIR="`$PHP_CONFIG --extension-dir`"
  1489. PHP_INC_DIR="`$PHP -r 'echo ini_get("include_path");' | cut -d: -f2`"
  1490. PHP_INI_DIR="`$PHP_CONFIG --configure-options | tr " " "\n" | grep -- --with-config-file-scan-dir | cut -f2 -d=`"
  1491. PHP_CFLAGS="`$PHP_CONFIG --includes`"
  1492. AC_SUBST(PHP_LDFLAGS)
  1493. AC_SUBST(PHP_LIBS)
  1494. AC_SUBST(PHP_EXT_DIR)
  1495. AC_SUBST(PHP_INC_DIR)
  1496. AC_SUBST(PHP_INI_DIR)
  1497. AC_SUBST(PHP_CFLAGS)
  1498. fi
  1499. #
  1500. # Python checks for mod_python (scroll down to see python3 checks for mod_python3)
  1501. #
  1502. AC_ARG_WITH(
  1503. [python],
  1504. [AS_HELP_STRING([--with-python], [Use system provided version of python (default: try)])],
  1505. [with_python="$withval"],
  1506. [with_python="try"]
  1507. )
  1508. if test "$with_python" != "no"
  1509. then
  1510. save_CFLAGS="$CFLAGS"
  1511. save_LIBS="$LIBS"
  1512. if test "$with_python" != "yes" -a "$with_python" != "try" ; then
  1513. AC_MSG_CHECKING([for python])
  1514. if test ! -x "$with_python" ; then
  1515. AC_MSG_ERROR([Specified python does not exist or is not executable: $with_python])
  1516. fi
  1517. AC_MSG_RESULT([$with_python])
  1518. AC_SUBST([PYTHON], ["$with_python"])
  1519. else
  1520. AC_PATH_PROG([PYTHON], ["python"], ["no"], ["$PATH:/usr/bin:/usr/local/bin"])
  1521. fi
  1522. if test "$PYTHON" != "no" ; then
  1523. AC_MSG_CHECKING([python version])
  1524. PYTHON_VER="`$PYTHON -V 2>&1 | cut -d' ' -f2`"
  1525. if test -z "$PYTHON_VER" ; then
  1526. AC_MSG_ERROR([Unable to detect python version])
  1527. fi
  1528. AC_MSG_RESULT([$PYTHON_VER])
  1529. AC_MSG_CHECKING([for python distutils])
  1530. python_result="`$PYTHON -c 'import distutils;' 2>&1`"
  1531. if test -z "$python_result" ; then
  1532. python_has_distutils="yes"
  1533. else
  1534. python_has_distutils="no"
  1535. fi
  1536. AC_MSG_RESULT([$python_has_distutils])
  1537. if test "$python_has_distutils" != "no" ; then
  1538. AC_MSG_CHECKING([location of site-packages])
  1539. PYTHON_SITE_DIR="`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_python_lib(0));'`"
  1540. if test -z "$PYTHON_SITE_DIR" ; then
  1541. AC_MSG_ERROR([Unable to detect python site-packages path])
  1542. elif test ! -d "$PYTHON_SITE_DIR" ; then
  1543. AC_MSG_ERROR([Path $PYTHON_SITE_DIR returned by python does not exist!])
  1544. fi
  1545. AC_MSG_RESULT([$PYTHON_SITE_DIR])
  1546. AC_SUBST([PYTHON_SITE_DIR], [$PYTHON_SITE_DIR])
  1547. #
  1548. # python distutils found, get settings from python directly
  1549. #
  1550. 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'`"
  1551. 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));'`"
  1552. PYTHON_LIB="`$PYTHON -c 'from distutils import sysconfig; print(\"python\" + sysconfig.get_config_var(\"VERSION\"));'`"
  1553. PYTHON_LIBDIR="`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_config_var(\"LIBDIR\"));'`"
  1554. # handle python being installed into /usr/local
  1555. AC_MSG_CHECKING([python libdir])
  1556. if test -z "`echo $PYTHON_LIBDIR | grep "/usr/lib"`" ; then
  1557. PYTHON_LDFLAGS="-L$PYTHON_LIBDIR $PYTHON_LDFLAGS"
  1558. LIBS="-L$PYTHON_LIBDIR $LIBS"
  1559. fi
  1560. AC_MSG_RESULT([$PYTHON_LIBDIR])
  1561. # check libpython
  1562. AC_CHECK_LIB([$PYTHON_LIB], [main], [has_libpython="yes"], [has_libpython="no"])
  1563. if test "$has_libpython" = "no" ; then
  1564. AS_IF([test "$with_python" = "try"],
  1565. [AC_MSG_WARN([$PYTHON_LIB is unusable])],
  1566. [AC_MSG_ERROR([$PYTHON_LIB is unusable])]
  1567. )
  1568. fi
  1569. # check whether system libpython is usable and has threads support
  1570. CFLAGS="$PYTHON_CFLAGS"
  1571. LIBS="$PYTHON_LDFLAGS"
  1572. AC_CHECK_FUNC([PyThread_init_thread], [python_has_threads="yes"], [python_has_threads="no"])
  1573. if test "$python_has_threads" = "no"; then
  1574. AS_IF([test "$with_python" = "try"],
  1575. [AC_MSG_WARN([Your python lacks threads support, can not build mod_python])],
  1576. [AC_MSG_ERROR([Your python lacks threads support, can not build mod_python])]
  1577. )
  1578. else
  1579. AC_MSG_NOTICE([Your python seems OK, do not forget to enable mod_python in modules.conf])
  1580. AC_SUBST([PYTHON_CFLAGS], [$PYTHON_CFLAGS])
  1581. AC_SUBST([PYTHON_LDFLAGS], [$PYTHON_LDFLAGS])
  1582. fi
  1583. else
  1584. AS_IF([test "$with_python" = "try"],
  1585. [AC_MSG_WARN([Could not find or use python distutils module: $python_result])],
  1586. [AC_MSG_ERROR([Could not find or use python distutils module: $python_result])]
  1587. )
  1588. fi
  1589. LIBS="$save_LIBS"
  1590. CFLAGS="$save_CFLAGS"
  1591. unset python_has_threads
  1592. unset python_has_distutils
  1593. unset python_result
  1594. else
  1595. AS_IF([test "$with_python" = "try"],
  1596. [AC_MSG_WARN([Could not find python, mod_python will not build, use --with-python to specify the location])],
  1597. [AC_MSG_ERROR([Could not find python, use --with-python to specify the location])]
  1598. )
  1599. fi
  1600. else
  1601. AC_MSG_WARN([python support disabled, building mod_python will fail!])
  1602. fi
  1603. #
  1604. # Python3 checks for mod_python3
  1605. #
  1606. AC_ARG_WITH(
  1607. [python3],
  1608. [AS_HELP_STRING([--with-python3], [Use system provided version of python3 (default: try)])],
  1609. [with_python3="$withval"],
  1610. [with_python3="try"]
  1611. )
  1612. if test "$with_python3" != "no"
  1613. then
  1614. save_CFLAGS="$CFLAGS"
  1615. save_LIBS="$LIBS"
  1616. if test "$with_python3" != "yes" -a "$with_python3" != "try" ; then
  1617. AC_MSG_CHECKING([for python3])
  1618. if test ! -x "$with_python3" ; then
  1619. AC_MSG_ERROR([Specified python3 does not exist or is not executable: $with_python3])
  1620. fi
  1621. AC_MSG_RESULT([$with_python3])
  1622. AC_SUBST([PYTHON3], ["$with_python3"])
  1623. else
  1624. AC_PATH_PROG([PYTHON3], ["python3"], ["no"], ["$PATH:/usr/bin:/usr/local/bin"])
  1625. fi
  1626. if test "$PYTHON3" != "no" ; then
  1627. AC_MSG_CHECKING([python3 version])
  1628. PYTHON3_VER="`$PYTHON3 -V 2>&1 | cut -d' ' -f2`"
  1629. if test -z "$PYTHON3_VER" ; then
  1630. AC_MSG_ERROR([Unable to detect python3 version])
  1631. fi
  1632. AC_MSG_RESULT([$PYTHON3_VER])
  1633. AC_MSG_CHECKING([for python3 distutils])
  1634. python3_result="`$PYTHON3 -c 'import distutils;' 2>&1`"
  1635. if test -z "$python3_result" ; then
  1636. python3_has_distutils="yes"
  1637. else
  1638. python3_has_distutils="no"
  1639. fi
  1640. AC_MSG_RESULT([$python3_has_distutils])
  1641. if test "$python3_has_distutils" != "no" ; then
  1642. AC_MSG_CHECKING([location of python3 site-packages])
  1643. PYTHON3_SITE_DIR="`$PYTHON3 -c 'from distutils import sysconfig; print(sysconfig.get_python_lib(0));'`"
  1644. if test -z "$PYTHON3_SITE_DIR" ; then
  1645. AC_MSG_ERROR([Unable to detect python3 site-packages path])
  1646. elif test ! -d "$PYTHON3_SITE_DIR" ; then
  1647. AC_MSG_ERROR([Path $PYTHON3_SITE_DIR returned by python3 does not exist!])
  1648. fi
  1649. AC_MSG_RESULT([$PYTHON3_SITE_DIR])
  1650. AC_SUBST([PYTHON3_SITE_DIR], [$PYTHON3_SITE_DIR])
  1651. #
  1652. # python3 distutils found, get settings from python3 directly
  1653. #
  1654. PYTHON3_CFLAGS="`$PYTHON3 -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'`"
  1655. PYTHON3_LDFLAGS="`$PYTHON3 -c 'from distutils import sysconfig; ldver = sysconfig.get_config_var(\"LDVERSION\"); libs = sysconfig.get_config_var(\"LIBS\").split() + sysconfig.get_config_var(\"SYSLIBS\").split(); libs.append(\"-lpython\" + [[ldver,sysconfig.get_config_var(\"VERSION\")]][[ldver==None]]); print(\" \".join(libs));'`"
  1656. PYTHON3_LIB="`$PYTHON3 -c 'from distutils import sysconfig; ldver = sysconfig.get_config_var(\"LDVERSION\"); print(\"python\" + [[ldver,sysconfig.get_config_var(\"VERSION\")]][[ldver==None]]);'`"
  1657. PYTHON3_LIBDIR="`$PYTHON3 -c 'from distutils import sysconfig; print(sysconfig.get_config_var(\"LIBDIR\"));'`"
  1658. # handle python3 being installed into /usr/local
  1659. AC_MSG_CHECKING([python3 libdir])
  1660. if test -z "`echo $PYTHON3_LIBDIR | grep "/usr/lib"`" ; then
  1661. PYTHON3_LDFLAGS="-L$PYTHON3_LIBDIR $PYTHON3_LDFLAGS"
  1662. LIBS="-L$PYTHON3_LIBDIR $LIBS"
  1663. fi
  1664. AC_MSG_RESULT([$PYTHON3_LIBDIR])
  1665. # check libpython3
  1666. AC_CHECK_LIB([$PYTHON3_LIB], [main], [has_libpython3="yes"], [has_libpython3="no"])
  1667. if test "$has_libpython3" = "no" ; then
  1668. AS_IF([test "$with_python3" = "try"],
  1669. [AC_MSG_WARN([$PYTHON3_LIB is unusable])],
  1670. [AC_MSG_ERROR([$PYTHON3_LIB is unusable])]
  1671. )
  1672. fi
  1673. # check whether system libpython3 is usable and has threads support
  1674. CFLAGS="$PYTHON3_CFLAGS"
  1675. LIBS="$PYTHON3_LDFLAGS"
  1676. AC_CHECK_FUNC([PyThread_init_thread], [python3_has_threads="yes"], [python3_has_threads="no"])
  1677. if test "$python3_has_threads" = "no"; then
  1678. AS_IF([test "$with_python3" = "try"],
  1679. [AC_MSG_WARN([Your python3 lacks threads support, can not build mod_python3])],
  1680. [AC_MSG_ERROR([Your python3 lacks threads support, can not build mod_python3])]
  1681. )
  1682. else
  1683. AC_MSG_NOTICE([Your python3 seems OK, do not forget to enable mod_python3 in modules.conf])
  1684. AC_SUBST([PYTHON3_CFLAGS], [$PYTHON3_CFLAGS])
  1685. AC_SUBST([PYTHON3_LDFLAGS], [$PYTHON3_LDFLAGS])
  1686. fi
  1687. else
  1688. AS_IF([test "$with_python3" = "try"],
  1689. [AC_MSG_WARN([Could not find or use python3 distutils module: $python3_result])],
  1690. [AC_MSG_ERROR([Could not find or use python3 distutils module: $python3_result])]
  1691. )
  1692. fi
  1693. LIBS="$save_LIBS"
  1694. CFLAGS="$save_CFLAGS"
  1695. unset python3_has_threads
  1696. unset python3_has_distutils
  1697. unset python3_result
  1698. else
  1699. AS_IF([test "$with_python3" = "try"],
  1700. [AC_MSG_WARN([Could not find python3, mod_python3 will not build, use --with-python3 to specify the location])],
  1701. [AC_MSG_ERROR([Could not find python3, use --with-python3 to specify the location])]
  1702. )
  1703. fi
  1704. else
  1705. AC_MSG_WARN([python3 support disabled, building mod_python3 will fail!])
  1706. fi
  1707. # pcap lib for unit-testing
  1708. AC_MSG_CHECKING(libpcap)
  1709. AC_CHECK_PROG(HAVE_PCAP_CONFIG,pcap-config,[true],[false])
  1710. if test x"$HAVE_PCAP_CONFIG" = x"true"; then
  1711. AC_MSG_RESULT(yes)
  1712. PCAP_CONFIG=pcap-config
  1713. PCAP_LIBS="`$PCAP_CONFIG --libs`"
  1714. PCAP_CFLAGS="`$PCAP_CONFIG --cflags`"
  1715. AM_CONDITIONAL([HAVE_PCAP], [true])
  1716. else
  1717. AC_MSG_RESULT(no)
  1718. AM_CONDITIONAL([HAVE_PCAP], [false])
  1719. fi
  1720. AC_SUBST([PCAP_CFLAGS])
  1721. AC_SUBST([PCAP_LIBS])
  1722. #
  1723. # SNMP checks for mod_snmp
  1724. #
  1725. AC_PATH_PROG([NET_SNMP_CONFIG], [net-snmp-config], [no])
  1726. if test "$NET_SNMP_CONFIG" != "no"; then
  1727. AC_MSG_CHECKING([for Net-SNMP libraries via net-snmp-config])
  1728. SNMP_LIBS="`$NET_SNMP_CONFIG --base-agent-libs`"
  1729. else
  1730. # net-snmp-config not in path, fallback to sensible defaults
  1731. SNMP_LIBS="-lnetsnmpmibs -lnetsnmpagent -lnetsnmp"
  1732. fi
  1733. # fix linking error on Solaris patched Net-SNMP
  1734. AS_CASE([$host], [*-solaris2*], [AC_CHECK_LIB([dladm], [dladm_open], [SNMP_LIBS="$SNMP_LIBS -ldladm"])])
  1735. AC_SUBST(SNMP_LIBS)
  1736. CHECK_ERLANG
  1737. # Enable clang address sanitizer bit build
  1738. AC_ARG_ENABLE(address_sanitizer,
  1739. [AC_HELP_STRING([--enable-address-sanitizer],[build with address sanitizer])],
  1740. [enable_address_sanitizer="$enable_address_sanitizer"],
  1741. [enable_address_sanitizer="no"])
  1742. if test "${enable_address_sanitizer}" = "yes"; then
  1743. APR_ADDTO(CFLAGS, -fsanitize=address -fno-omit-frame-pointer -fstack-protector-strong)
  1744. APR_ADDTO(CXXFLAGS, -fsanitize=address -fno-omit-frame-pointer -fstack-protector-strong)
  1745. APR_ADDTO(LDFLAGS, -fsanitize=address)
  1746. fi
  1747. # Enable HEAP profiler (requires libgoogle-perftools-dev package)
  1748. AC_ARG_ENABLE(heap_profiler,
  1749. [AC_HELP_STRING([--enable-heap-profiler],[build with google heap profiler])],
  1750. [enable_heap_profiler="$enable_heap_profiler"],
  1751. [enable_heap_profiler="no"])
  1752. # Enable CPU profiler (requires libgoogle-perftools-dev package)
  1753. AC_ARG_ENABLE(cpu_profiler,
  1754. [AC_HELP_STRING([--enable-cpu-profiler],[build with google cpu profiler])],
  1755. [enable_cpu_profiler="$enable_cpu_profiler"],
  1756. [enable_cpu_profiler="no"])
  1757. PKG_CHECK_MODULES([TCMALLOC], [libtcmalloc], [have_tcmalloc=yes], [have_tcmalloc=no])
  1758. if test "${enable_heap_profiler}" = "yes" || test "${enable_cpu_profiler}" = "yes"; then
  1759. if test "x$have_tcmalloc" != "xyes" ; then
  1760. AC_MSG_ERROR([You must install libgoogle-perftools-dev in order to use heap or cpu profiler])
  1761. fi
  1762. fi
  1763. # WARNING: When both enabled you can NOT link them statically and MUST use the special library
  1764. if test "${enable_heap_profiler}" = "yes" && test "${enable_cpu_profiler}" = "yes"; then
  1765. APR_ADDTO(CFLAGS, -ltcmalloc_and_profiler)
  1766. APR_ADDTO(CXXFLAGS, -ltcmalloc_and_profiler)
  1767. APR_ADDTO(LDFLAGS, -ltcmalloc_and_profiler)
  1768. else
  1769. if test "${enable_heap_profiler}" = "yes"; then
  1770. APR_ADDTO(CFLAGS, -ltcmalloc)
  1771. APR_ADDTO(CXXFLAGS, -ltcmalloc)
  1772. APR_ADDTO(LDFLAGS, -ltcmalloc)
  1773. fi
  1774. if test "${enable_cpu_profiler}" = "yes"; then
  1775. APR_ADDTO(CFLAGS, -lprofiler)
  1776. APR_ADDTO(CXXFLAGS, -lprofiler)
  1777. APR_ADDTO(LDFLAGS, -lprofiler)
  1778. fi
  1779. fi
  1780. # Enable fake dlclose
  1781. AC_ARG_ENABLE(fake_dlclose,
  1782. [AC_HELP_STRING([--enable-fake-dlclose],[Do not unload dynamic libraries])],
  1783. [enable_fake_dlclose="$enable_fake_dlclose"],
  1784. [enable_fake_dlclose="no"])
  1785. if test "${enable_fake_dlclose}" = "yes"; then
  1786. APR_ADDTO(SWITCH_AM_CFLAGS, -DHAVE_FAKE_DLCLOSE)
  1787. fi
  1788. AC_ARG_ENABLE(,
  1789. [AC_HELP_STRING([--enable-pool-sanitizer],[build with sanitizer friendly pool behavior])],
  1790. [enable_pool_sanitizer="$enable_pool_sanitizer"],
  1791. [enable_pool_sanitizer="no"])
  1792. if test "${enable_pool_sanitizer}" = "yes"; then
  1793. APR_ADDTO(CFLAGS, -DDESTROY_POOLS)
  1794. ac_configure_args="$ac_configure_args --enable-pool-debug=yes"
  1795. fi
  1796. # we never use this, and hard setting it will make cross compile work better
  1797. ac_cv_file_dbd_apr_dbd_mysql_c=no
  1798. AC_CONFIG_FILES([Makefile
  1799. build/Makefile
  1800. tests/unit/Makefile
  1801. src/Makefile
  1802. src/mod/Makefile
  1803. src/mod/applications/mod_abstraction/Makefile
  1804. src/mod/applications/mod_avmd/Makefile
  1805. src/mod/applications/mod_bert/Makefile
  1806. src/mod/applications/mod_blacklist/Makefile
  1807. src/mod/applications/mod_callcenter/Makefile
  1808. src/mod/applications/mod_cidlookup/Makefile
  1809. src/mod/applications/mod_cluechoo/Makefile
  1810. src/mod/applications/mod_commands/Makefile
  1811. src/mod/applications/mod_conference/Makefile
  1812. src/mod/applications/mod_curl/Makefile
  1813. src/mod/applications/mod_cv/Makefile
  1814. src/mod/applications/mod_db/Makefile
  1815. src/mod/applications/mod_directory/Makefile
  1816. src/mod/applications/mod_distributor/Makefile
  1817. src/mod/applications/mod_dptools/Makefile
  1818. src/mod/applications/mod_easyroute/Makefile
  1819. src/mod/applications/mod_enum/Makefile
  1820. src/mod/applications/mod_esf/Makefile
  1821. src/mod/applications/mod_esl/Makefile
  1822. src/mod/applications/mod_expr/Makefile
  1823. src/mod/applications/mod_fifo/Makefile
  1824. src/mod/applications/mod_fsk/Makefile
  1825. src/mod/applications/mod_fsv/Makefile
  1826. src/mod/applications/mod_hash/Makefile
  1827. src/mod/applications/mod_hiredis/Makefile
  1828. src/mod/applications/mod_httapi/Makefile
  1829. src/mod/applications/mod_http_cache/Makefile
  1830. src/mod/applications/mod_ladspa/Makefile
  1831. src/mod/applications/mod_lcr/Makefile
  1832. src/mod/applications/mod_limit/Makefile
  1833. src/mod/applications/mod_memcache/Makefile
  1834. src/mod/applications/mod_mongo/Makefile
  1835. src/mod/applications/mod_mp4/Makefile
  1836. src/mod/applications/mod_mp4v2/Makefile
  1837. src/mod/applications/mod_nibblebill/Makefile
  1838. src/mod/applications/mod_oreka/Makefile
  1839. src/mod/applications/mod_osp/Makefile
  1840. src/mod/applications/mod_prefix/Makefile
  1841. src/mod/applications/mod_rad_auth/Makefile
  1842. src/mod/applications/mod_random/Makefile
  1843. src/mod/applications/mod_redis/Makefile
  1844. src/mod/applications/mod_rss/Makefile
  1845. src/mod/applications/mod_skel/Makefile
  1846. src/mod/applications/mod_signalwire/Makefile
  1847. src/mod/applications/mod_sms/Makefile
  1848. src/mod/applications/mod_sms_flowroute/Makefile
  1849. src/mod/applications/mod_snapshot/Makefile
  1850. src/mod/applications/mod_snom/Makefile
  1851. src/mod/applications/mod_sonar/Makefile
  1852. src/mod/applications/mod_soundtouch/Makefile
  1853. src/mod/applications/mod_spandsp/Makefile
  1854. src/mod/applications/mod_spy/Makefile
  1855. src/mod/applications/mod_stress/Makefile
  1856. src/mod/applications/mod_test/Makefile
  1857. src/mod/applications/mod_translate/Makefile
  1858. src/mod/applications/mod_valet_parking/Makefile
  1859. src/mod/applications/mod_vmd/Makefile
  1860. src/mod/applications/mod_voicemail/Makefile
  1861. src/mod/applications/mod_voicemail_ivr/Makefile
  1862. src/mod/asr_tts/mod_cepstral/Makefile
  1863. src/mod/asr_tts/mod_flite/Makefile
  1864. src/mod/asr_tts/mod_pocketsphinx/Makefile
  1865. src/mod/asr_tts/mod_tts_commandline/Makefile
  1866. src/mod/codecs/mod_amr/Makefile
  1867. src/mod/codecs/mod_amrwb/Makefile
  1868. src/mod/codecs/mod_b64/Makefile
  1869. src/mod/codecs/mod_bv/Makefile
  1870. src/mod/codecs/mod_clearmode/Makefile
  1871. src/mod/codecs/mod_codec2/Makefile
  1872. src/mod/codecs/mod_com_g729/Makefile
  1873. src/mod/codecs/mod_dahdi_codec/Makefile
  1874. src/mod/codecs/mod_g723_1/Makefile
  1875. src/mod/codecs/mod_g729/Makefile
  1876. src/mod/codecs/mod_h26x/Makefile
  1877. src/mod/codecs/mod_ilbc/Makefile
  1878. src/mod/codecs/mod_isac/Makefile
  1879. src/mod/codecs/mod_mp4v/Makefile
  1880. src/mod/codecs/mod_opus/Makefile
  1881. src/mod/codecs/mod_openh264/Makefile
  1882. src/mod/codecs/mod_sangoma_codec/Makefile
  1883. src/mod/codecs/mod_silk/Makefile
  1884. src/mod/codecs/mod_siren/Makefile
  1885. src/mod/codecs/mod_skel_codec/Makefile
  1886. src/mod/codecs/mod_theora/Makefile
  1887. src/mod/databases/mod_mariadb/Makefile
  1888. src/mod/databases/mod_pgsql/Makefile
  1889. src/mod/dialplans/mod_dialplan_asterisk/Makefile
  1890. src/mod/dialplans/mod_dialplan_directory/Makefile
  1891. src/mod/dialplans/mod_dialplan_xml/Makefile
  1892. src/mod/directories/mod_ldap/Makefile
  1893. src/mod/endpoints/mod_alsa/Makefile
  1894. src/mod/endpoints/mod_gsmopen/Makefile
  1895. src/mod/endpoints/mod_h323/Makefile
  1896. src/mod/endpoints/mod_khomp/Makefile
  1897. src/mod/endpoints/mod_loopback/Makefile
  1898. src/mod/endpoints/mod_opal/Makefile
  1899. src/mod/endpoints/mod_portaudio/Makefile
  1900. src/mod/endpoints/mod_reference/Makefile
  1901. src/mod/endpoints/mod_rtmp/Makefile
  1902. src/mod/endpoints/mod_skinny/Makefile
  1903. src/mod/endpoints/mod_sofia/Makefile
  1904. src/mod/endpoints/mod_unicall/Makefile
  1905. src/mod/endpoints/mod_rtc/Makefile
  1906. src/mod/endpoints/mod_verto/Makefile
  1907. src/mod/event_handlers/mod_amqp/Makefile
  1908. src/mod/event_handlers/mod_cdr_csv/Makefile
  1909. src/mod/event_handlers/mod_cdr_mongodb/Makefile
  1910. src/mod/event_handlers/mod_cdr_pg_csv/Makefile
  1911. src/mod/event_handlers/mod_cdr_sqlite/Makefile
  1912. src/mod/event_handlers/mod_erlang_event/Makefile
  1913. src/mod/event_handlers/mod_event_multicast/Makefile
  1914. src/mod/event_handlers/mod_event_socket/Makefile
  1915. src/mod/event_handlers/mod_event_test/Makefile
  1916. src/mod/event_handlers/mod_fail2ban/Makefile
  1917. src/mod/event_handlers/mod_format_cdr/Makefile
  1918. src/mod/event_handlers/mod_json_cdr/Makefile
  1919. src/mod/event_handlers/mod_kazoo/Makefile
  1920. src/mod/event_handlers/mod_radius_cdr/Makefile
  1921. src/mod/event_handlers/mod_odbc_cdr/Makefile
  1922. src/mod/event_handlers/mod_rayo/Makefile
  1923. src/mod/event_handlers/mod_smpp/Makefile
  1924. src/mod/event_handlers/mod_snmp/Makefile
  1925. src/mod/event_handlers/mod_event_zmq/Makefile
  1926. src/mod/formats/mod_imagick/Makefile
  1927. src/mod/formats/mod_local_stream/Makefile
  1928. src/mod/formats/mod_native_file/Makefile
  1929. src/mod/formats/mod_opusfile/Makefile
  1930. src/mod/formats/mod_png/Makefile
  1931. src/mod/formats/mod_shell_stream/Makefile
  1932. src/mod/formats/mod_shout/Makefile
  1933. src/mod/formats/mod_sndfile/Makefile
  1934. src/mod/formats/mod_ssml/Makefile
  1935. src/mod/formats/mod_tone_stream/Makefile
  1936. src/mod/formats/mod_vlc/Makefile
  1937. src/mod/formats/mod_portaudio_stream/Makefile
  1938. src/mod/languages/mod_java/Makefile
  1939. src/mod/languages/mod_lua/Makefile
  1940. src/mod/languages/mod_managed/Makefile
  1941. src/mod/languages/mod_perl/Makefile
  1942. src/mod/languages/mod_python/Makefile
  1943. src/mod/languages/mod_python3/Makefile
  1944. src/mod/languages/mod_v8/Makefile
  1945. src/mod/languages/mod_yaml/Makefile
  1946. src/mod/languages/mod_basic/Makefile
  1947. src/mod/loggers/mod_console/Makefile
  1948. src/mod/loggers/mod_graylog2/Makefile
  1949. src/mod/loggers/mod_logfile/Makefile
  1950. src/mod/loggers/mod_syslog/Makefile
  1951. src/mod/loggers/mod_raven/Makefile
  1952. src/mod/say/mod_say_de/Makefile
  1953. src/mod/say/mod_say_en/Makefile
  1954. src/mod/say/mod_say_es/Makefile
  1955. src/mod/say/mod_say_es_ar/Makefile
  1956. src/mod/say/mod_say_fa/Makefile
  1957. src/mod/say/mod_say_fr/Makefile
  1958. src/mod/say/mod_say_he/Makefile
  1959. src/mod/say/mod_say_hr/Makefile
  1960. src/mod/say/mod_say_hu/Makefile
  1961. src/mod/say/mod_say_it/Makefile
  1962. src/mod/say/mod_say_ja/Makefile
  1963. src/mod/say/mod_say_nl/Makefile
  1964. src/mod/say/mod_say_pl/Makefile
  1965. src/mod/say/mod_say_pt/Makefile
  1966. src/mod/say/mod_say_ru/Makefile
  1967. src/mod/say/mod_say_sv/Makefile
  1968. src/mod/say/mod_say_th/Makefile
  1969. src/mod/say/mod_say_zh/Makefile
  1970. src/mod/timers/mod_posix_timer/Makefile
  1971. src/mod/timers/mod_timerfd/Makefile
  1972. src/mod/xml_int/mod_xml_cdr/Makefile
  1973. src/mod/xml_int/mod_xml_curl/Makefile
  1974. src/mod/xml_int/mod_xml_ldap/Makefile
  1975. src/mod/xml_int/mod_xml_radius/Makefile
  1976. src/mod/xml_int/mod_xml_rpc/Makefile
  1977. src/mod/xml_int/mod_xml_scgi/Makefile
  1978. src/mod/applications/mod_av/Makefile
  1979. src/mod/applications/mod_video_filter/Makefile
  1980. src/include/switch_am_config.h
  1981. build/getsounds.sh
  1982. build/getlib.sh
  1983. build/getg729.sh
  1984. build/freeswitch.pc
  1985. build/standalone_module/freeswitch.pc
  1986. build/modmake.rules
  1987. libs/esl/Makefile
  1988. libs/esl/perl/Makefile
  1989. libs/esl/php/Makefile
  1990. libs/xmlrpc-c/include/xmlrpc-c/config.h
  1991. libs/xmlrpc-c/xmlrpc_config.h
  1992. libs/xmlrpc-c/config.mk
  1993. libs/xmlrpc-c/srcdir.mk
  1994. libs/xmlrpc-c/stamp-h
  1995. scripts/gentls_cert])
  1996. AM_CONDITIONAL(ISLINUX, [test `uname -s` = Linux])
  1997. AM_CONDITIONAL(ISMAC, [test `uname -s` = Darwin])
  1998. AM_CONDITIONAL(ISFREEBSD, [test `uname -s` = FreeBSD])
  1999. AM_CONDITIONAL(IS64BITLINUX, [test `uname -m` = x86_64])
  2000. AM_CONDITIONAL(HAVE_G723_1, [ test -d ${switch_srcdir}/libs/libg723_1 ])
  2001. AM_CONDITIONAL(HAVE_G729, [ test -d ${switch_srcdir}/libs/libg729 ])
  2002. #some vars to sub into the Makefile.am's
  2003. #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
  2004. LIBTOOL='$(SHELL) $(switch_builddir)/libtool'
  2005. TOUCH_TARGET='if test -f "$@";then touch "$@";fi;'
  2006. CONF_MODULES='$$(grep -v "\#" $(switch_builddir)/modules.conf | sed "s/|.*//" | sed -e "s|^.*/||" | sort | uniq )'
  2007. CONF_DISABLED_MODULES='$$(grep "\#" $(switch_builddir)/modules.conf | grep -v "\#\#" | sed "s/|.*//" | sed "s/\#/\#\//"| sed -e "s|^.*/||" | sort | uniq )'
  2008. 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 )'
  2009. 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 )'
  2010. 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 )'
  2011. 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 )'
  2012. 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 )'
  2013. 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 )'
  2014. OUR_DISABLED_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-all ; done )"; echo $$mods )'
  2015. OUR_DISABLED_CLEAN_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-clean ; done )"; echo $$mods )'
  2016. OUR_DISABLED_INSTALL_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-install ; done)"; echo $$mods )'
  2017. OUR_DISABLED_UNINSTALL_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-uninstall ; done)"; echo $$mods )'
  2018. #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`'
  2019. #AM_MAKEFLAGS='`test -n "$(VERBOSE)" || echo -s`'
  2020. AC_SUBST(LIBTOOL)
  2021. AC_SUBST(TOUCH_TARGET)
  2022. AC_SUBST(CONF_DISABLED_MODULES)
  2023. AC_SUBST(CONF_MODULES)
  2024. AC_SUBST(OUR_MODS)
  2025. AC_SUBST(OUR_CLEAN_MODS)
  2026. AC_SUBST(OUR_TEST_MODS)
  2027. AC_SUBST(OUR_CHECK_MODS)
  2028. AC_SUBST(OUR_INSTALL_MODS)
  2029. AC_SUBST(OUR_UNINSTALL_MODS)
  2030. AC_SUBST(OUR_DISABLED_MODS)
  2031. AC_SUBST(OUR_DISABLED_CLEAN_MODS)
  2032. AC_SUBST(OUR_DISABLED_INSTALL_MODS)
  2033. AC_SUBST(OUR_DISABLED_UNINSTALL_MODS)
  2034. AC_SUBST(AM_MAKEFLAGS)
  2035. ac_configure_args="$ac_configure_args --with-modinstdir=${modulesdir} CONFIGURE_CFLAGS='$CFLAGS $CPPFLAGS' CONFIGURE_CXXFLAGS='$CXXFLAGS $CPPFLAGS' CONFIGURE_LDFLAGS='$LDFLAGS' "
  2036. # --prefix='$prefix' --exec_prefix='$exec_prefix' --libdir='$libdir' --libexecdir='$libexecdir' --bindir='$bindir' --sbindir='$sbindir' \
  2037. # --localstatedir='$localstatedir' --datadir='$datadir'"
  2038. # Run configure in all the subdirs
  2039. AC_CONFIG_SUBDIRS([libs/srtp])
  2040. if test "$use_system_apr" != "yes"; then
  2041. AC_CONFIG_SUBDIRS([libs/apr])
  2042. fi
  2043. AC_CONFIG_SUBDIRS([libs/iksemel])
  2044. case $host in
  2045. *-openbsd*|*-netbsd*)
  2046. # libtool won't link static libs against shared ones on NetBSD/OpenBSD unless we tell it not to be stupid
  2047. AC_CONFIG_COMMANDS([hacklibtool], [cp libtool libtool.orig && sed -e "s/deplibs_check_method=.*/deplibs_check_method=pass_all/g" libtool.orig > libtool])
  2048. ;;
  2049. esac
  2050. AC_OUTPUT
  2051. ##
  2052. ## Configuration summary
  2053. ##
  2054. echo
  2055. echo "-------------------------- FreeSWITCH configuration --------------------------"
  2056. echo ""
  2057. echo " Locations:"
  2058. echo ""
  2059. echo " prefix: ${prefix}"
  2060. echo " exec_prefix: ${exec_prefix}"
  2061. echo " bindir: ${bindir}"
  2062. echo " confdir: ${confdir}"
  2063. echo " libdir: ${libdir}"
  2064. echo " datadir: ${datadir}"
  2065. echo " localstatedir: ${localstatedir}"
  2066. echo " includedir: ${includedir}"
  2067. echo ""
  2068. echo " certsdir: ${certsdir}"
  2069. echo " dbdir: ${dbdir}"
  2070. echo " grammardir: ${grammardir}"
  2071. echo " htdocsdir: ${htdocsdir}"
  2072. echo " fontsdir: ${fontsdir}"
  2073. echo " logfiledir: ${logfiledir}"
  2074. echo " modulesdir: ${modulesdir}"
  2075. echo " pkgconfigdir: ${pkgconfigdir}"
  2076. echo " recordingsdir: ${recordingsdir}"
  2077. echo " imagesdir: ${imagesdir}"
  2078. echo " runtimedir: ${runtimedir}"
  2079. echo " scriptdir: ${scriptdir}"
  2080. echo " soundsdir: ${soundsdir}"
  2081. echo " storagedir: ${storagedir}"
  2082. echo " cachedir: ${cachedir}"
  2083. echo ""
  2084. echo "------------------------------------------------------------------------------"