configure.ac 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. dnl
  2. dnl Autoconf configuration file for UniMRCP.
  3. dnl
  4. dnl Use ./bootstrap to produce a configure script.
  5. dnl
  6. AC_PREREQ(2.59)
  7. AC_INIT([unimrcp],[1.2.0])
  8. AC_CONFIG_AUX_DIR([build])
  9. AC_CONFIG_MACRO_DIR([build/acmacros])
  10. dnl Set ac_macro_dir variable manually for autoconf 2.61 and above.
  11. ac_macro_dir="build/acmacros"
  12. AC_SUBST(ac_aux_dir)
  13. AC_SUBST(ac_macro_dir)
  14. dnl Include m4 macros for libtool 2.
  15. sinclude(build/acmacros/libtool.m4)
  16. sinclude(build/acmacros/ltoptions.m4)
  17. sinclude(build/acmacros/ltsugar.m4)
  18. sinclude(build/acmacros/ltversion.m4)
  19. sinclude(build/acmacros/lt~obsolete.m4)
  20. AC_PREFIX_DEFAULT(/usr/local/unimrcp)
  21. dnl Define the directory layout.
  22. APR_ENABLE_LAYOUT(classic, [plugindir logdir vardir])
  23. AC_SUBST(plugindir)
  24. AC_SUBST(logdir)
  25. AC_SUBST(vardir)
  26. dnl Reparse the configure arguments.
  27. APR_PARSE_ARGUMENTS
  28. dnl Generate ./config.nice to reuse ./configure command-line.
  29. APR_CONFIG_NICE(config.nice)
  30. AM_INIT_AUTOMAKE([no-define nostdinc foreign subdir-objects])
  31. dnl Enable silent build rules available since automake 1.11.
  32. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  33. dnl Set default language.
  34. AC_LANG_C
  35. AC_PROG_CC
  36. AC_PROG_CXX
  37. AM_PROG_CC_C_O
  38. AC_PROG_INSTALL
  39. dnl Skip detection of Fortran.
  40. m4_undefine([AC_PROG_F77])
  41. m4_defun([AC_PROG_F77],[])
  42. AC_PROG_LIBTOOL
  43. dnl Do not use autoconf generated compiler DEFS.
  44. rm confdefs.h
  45. touch confdefs.h
  46. dnl Check for C compiler vendor.
  47. AX_COMPILER_VENDOR
  48. dnl Search for pkg-config.
  49. AC_PATH_PROG(PKG_CONFIG, pkg-config)
  50. dnl Get version information.
  51. get_version="$srcdir/build/get-version.sh"
  52. version_hdr="$srcdir/build/uni_version.h"
  53. plugin_version_hdr="$srcdir/libs/mrcp-engine/include/mrcp_engine_plugin.h"
  54. UNI_DOTTED_VERSION="`$get_version all $version_hdr UNI`"
  55. UNI_LT_VERSION="-version-info `$get_version libtool $version_hdr UNI`"
  56. PLUGIN_LT_VERSION="-version-info `$get_version libtool $plugin_version_hdr PLUGIN`"
  57. AC_SUBST(UNI_DOTTED_VERSION)
  58. AC_SUBST(UNI_LT_VERSION)
  59. AC_SUBST(PLUGIN_LT_VERSION)
  60. echo "UniMRCP Version: ${UNI_DOTTED_VERSION}"
  61. dnl Check for the APR and APR-util libraries.
  62. UNIMRCP_CHECK_APR
  63. dnl Check for the Sofia-SIP library.
  64. UNIMRCP_CHECK_SOFIA
  65. dnl Enable inter-library dependencies.
  66. AC_ARG_ENABLE(interlib-deps,
  67. [AC_HELP_STRING([--disable-interlib-deps ],[disable inter-library dependencies (might break builds)])],
  68. [enable_interlib_deps="$enableval"],
  69. [enable_interlib_deps="yes"])
  70. AC_MSG_NOTICE([enable inter-library dependencies: $enable_interlib_deps])
  71. if test "${enable_interlib_deps}" = "yes"; then
  72. link_all_deplibs=yes
  73. link_all_deplibs_CXX=yes
  74. else
  75. link_all_deplibs=no
  76. link_all_deplibs_CXX=no
  77. fi
  78. dnl Enable maintainer mode.
  79. AC_ARG_ENABLE(maintainer-mode,
  80. [AC_HELP_STRING([--enable-maintainer-mode ],[turn on debugging and compile time warnings])],
  81. [enable_maintainer_mode="$enableval"],
  82. [enable_maintainer_mode="no"])
  83. AC_MSG_NOTICE([enable maintainer mode: $enable_maintainer_mode])
  84. if test "${enable_maintainer_mode}" != "no"; then
  85. APR_ADDTO(CFLAGS,-g)
  86. if test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
  87. APR_ADDTO(CFLAGS,-Wall -Werror)
  88. fi
  89. fi
  90. dnl UniMRCP client library.
  91. AC_ARG_ENABLE(client-lib,
  92. [AC_HELP_STRING([--disable-client-lib ],[exclude unimrcpclient lib from build])],
  93. [enable_client_lib="$enableval"],
  94. [enable_client_lib="yes"])
  95. AM_CONDITIONAL([UNIMRCP_CLIENT_LIB],[test "${enable_client_lib}" = "yes"])
  96. dnl Sample UniMRCP client application in C.
  97. AC_ARG_ENABLE(client-app,
  98. [AC_HELP_STRING([--disable-client-app ],[exclude sample unimrcpclient app from build])],
  99. [enable_client_app="$enableval"],
  100. [enable_client_app="yes"])
  101. AM_CONDITIONAL([UNIMRCP_CLIENT_APP],[test "${enable_client_lib}" = "yes" && test "${enable_client_app}" = "yes"])
  102. dnl Sample UniMRCP client application in C++.
  103. AC_ARG_ENABLE(umc,
  104. [AC_HELP_STRING([--disable-umc ],[exclude sample unimrcpclient C++ app from build])],
  105. [enable_umc="$enableval"],
  106. [enable_umc="yes"])
  107. AM_CONDITIONAL([UMC],[test "${enable_client_lib}" = "yes" && test "${enable_umc}" = "yes"])
  108. dnl Miscellaneous ASR client library and application.
  109. AC_ARG_ENABLE(asr-client,
  110. [AC_HELP_STRING([--disable-asr-client ],[exclude misc ASR client lib and app from build])],
  111. [enable_asr_client="$enableval"],
  112. [enable_asr_client="yes"])
  113. AM_CONDITIONAL([ASR_CLIENT],[test "${enable_client_lib}" = "yes" && test "${enable_asr_client}" = "yes"])
  114. AM_CONDITIONAL([COMMON_CLIENT_DATA],[test "${enable_client_app}" = "yes" || test "${enable_umc}" = "yes" ||test "${enable_asr_client}" = "yes"])
  115. dnl UniMRCP server library.
  116. AC_ARG_ENABLE(server-lib,
  117. [AC_HELP_STRING([--disable-server-lib ],[exclude unimrcpserver lib from build])],
  118. [enable_server_lib="$enableval"],
  119. [enable_server_lib="yes"])
  120. AM_CONDITIONAL([UNIMRCP_SERVER_LIB],[test "${enable_server_lib}" = "yes"])
  121. dnl UniMRCP server application.
  122. AC_ARG_ENABLE(server-app,
  123. [AC_HELP_STRING([--disable-server-app ],[exclude unimrcpserver app from build])],
  124. [enable_server_app="$enableval"],
  125. [enable_server_app="yes"])
  126. AM_CONDITIONAL([UNIMRCP_SERVER_APP],[test "${enable_server_lib}" = "yes" && test "${enable_server_app}" = "yes"])
  127. dnl Demo synthesizer plugin.
  128. UNI_PLUGIN_ENABLED(demosynth)
  129. AM_CONDITIONAL([DEMOSYNTH_PLUGIN],[test "${enable_demosynth_plugin}" = "yes"])
  130. dnl Demo recognizer plugin.
  131. UNI_PLUGIN_ENABLED(demorecog)
  132. AM_CONDITIONAL([DEMORECOG_PLUGIN],[test "${enable_demorecog_plugin}" = "yes"])
  133. dnl Demo verifier plugin.
  134. UNI_PLUGIN_ENABLED(demoverifier)
  135. AM_CONDITIONAL([DEMOVERIFIER_PLUGIN],[test "${enable_demoverifier_plugin}" = "yes"])
  136. dnl Recorder plugin.
  137. UNI_PLUGIN_ENABLED(recorder)
  138. AM_CONDITIONAL([RECORDER_PLUGIN],[test "${enable_recorder_plugin}" = "yes"])
  139. dnl Enable test suites.
  140. AC_ARG_ENABLE(test-suites,
  141. [AC_HELP_STRING([--enable-test-suites ],[build test suites])],
  142. [enable_test_suites="$enableval"],
  143. [enable_test_suites="no"])
  144. # Enable clang address sanitizer bit build
  145. AC_ARG_ENABLE(address_sanitizer,
  146. [AC_HELP_STRING([--enable-address-sanitizer],[build with address sanitizer])],
  147. [enable_address_sanitizer="$enable_address_sanitizer"],
  148. [enable_address_sanitizer="no"])
  149. if test "${enable_address_sanitizer}" = "yes"; then
  150. APR_ADDTO(CFLAGS, -fsanitize=address -fno-omit-frame-pointer)
  151. APR_ADDTO(CXXFLAGS, -fsanitize=address -fno-omit-frame-pointer)
  152. APR_ADDTO(LDFLAGS, -fsanitize=address)
  153. fi
  154. AM_CONDITIONAL([TEST_SUITES],[test "${enable_test_suites}" != "no"])
  155. AM_CONDITIONAL(ISMAC, [test `uname -s` = Darwin])
  156. AC_CONFIG_FILES([
  157. Makefile
  158. libs/Makefile
  159. libs/apr-toolkit/Makefile
  160. libs/mpf/Makefile
  161. libs/mrcp/Makefile
  162. libs/mrcp-signaling/Makefile
  163. libs/mrcpv2-transport/Makefile
  164. libs/mrcp-engine/Makefile
  165. libs/mrcp-server/Makefile
  166. libs/mrcp-client/Makefile
  167. libs/uni-rtsp/Makefile
  168. modules/Makefile
  169. modules/mrcp-sofiasip/Makefile
  170. modules/mrcp-unirtsp/Makefile
  171. plugins/Makefile
  172. plugins/mrcp-recorder/Makefile
  173. plugins/demo-synth/Makefile
  174. plugins/demo-recog/Makefile
  175. plugins/demo-verifier/Makefile
  176. platforms/Makefile
  177. platforms/libunimrcp-server/Makefile
  178. platforms/libunimrcp-client/Makefile
  179. platforms/unimrcp-server/Makefile
  180. platforms/unimrcp-client/Makefile
  181. platforms/libasr-client/Makefile
  182. platforms/asr-client/Makefile
  183. platforms/umc/Makefile
  184. tests/Makefile
  185. tests/apttest/Makefile
  186. tests/mpftest/Makefile
  187. tests/mrcptest/Makefile
  188. tests/rtsptest/Makefile
  189. tests/strtablegen/Makefile
  190. build/Makefile
  191. build/pkgconfig/Makefile
  192. build/pkgconfig/unimrcpclient.pc
  193. build/pkgconfig/unimrcpserver.pc
  194. build/pkgconfig/unimrcpplugin.pc
  195. conf/Makefile
  196. data/Makefile
  197. docs/doxygen.conf
  198. ])
  199. AC_OUTPUT
  200. echo
  201. echo '****************************** REPORT ******************************'
  202. echo
  203. echo UniMRCP version............... : $UNI_DOTTED_VERSION
  204. echo
  205. echo APR version................... : $apr_version
  206. echo APR-util version.............. : $apu_version
  207. echo Sofia-SIP version............. : $sofia_version
  208. echo
  209. echo Compiler...................... : $CC
  210. echo Compiler flags................ : $CFLAGS
  211. echo Preprocessor definitions...... : $CPPFLAGS
  212. echo Linker flags.................. : $LDFLAGS
  213. echo
  214. echo UniMRCP client lib............ : $enable_client_lib
  215. echo Sample UniMRCP client app..... : $enable_client_app
  216. echo Sample UMC C++ client app..... : $enable_umc
  217. echo Misc ASR client lib and app... : $enable_asr_client
  218. echo
  219. echo UniMRCP server lib............ : $enable_server_lib
  220. echo UniMRCP server app............ : $enable_server_app
  221. echo
  222. echo Demo synthesizer plugin....... : $enable_demosynth_plugin
  223. echo Demo recognizer plugin........ : $enable_demorecog_plugin
  224. echo Demo verifier plugin.......... : $enable_demoverifier_plugin
  225. echo Recorder plugin............... : $enable_recorder_plugin
  226. echo
  227. echo Installation layout........... : $layout_name
  228. echo Installation directory........ : $prefix
  229. echo
  230. echo '********************************************************************'