configure.m4 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. #
  2. # If this file is changed, be sure to run ASTTOPDIR/bootstrap.sh
  3. # before committing.
  4. #
  5. AC_DEFUN([_PJPROJECT_CONFIGURE],
  6. [
  7. if test "${ac_mandatory_list#*PJPROJECT*}" != "$ac_mandatory_list" ; then
  8. AC_MSG_ERROR(--with-pjproject and --with-pjproject-bundled can't both be specified)
  9. fi
  10. ac_mandatory_list="$ac_mandatory_list PJPROJECT"
  11. PJPROJECT_DIR="${ac_top_build_prefix}third-party/pjproject"
  12. AC_MSG_CHECKING(for embedded pjproject (may have to download))
  13. AC_MSG_RESULT(configuring)
  14. if test "x${DOWNLOAD_TO_STDOUT}" = "x" ; then
  15. AC_MSG_ERROR(A download utility (wget, curl, or fetch) is required to download bundled pjproject)
  16. fi
  17. if test "${BZIP2}" = ":" ; then
  18. AC_MSG_ERROR(bzip2 is required to extract the pjproject tar file)
  19. fi
  20. if test "${TAR}" = ":" ; then
  21. AC_MSG_ERROR(tar is required to extract the pjproject tar file)
  22. fi
  23. if test "${PATCH}" = ":" ; then
  24. AC_MSG_ERROR(patch is required to configure bundled pjproject)
  25. fi
  26. if test "${SED}" = ":" ; then
  27. AC_MSG_ERROR(sed is required to configure bundled pjproject)
  28. fi
  29. if test "${NM}" = ":" ; then
  30. AC_MSG_ERROR(nm is required to build bundled pjproject)
  31. fi
  32. if test "${MD5}" = ":" ; then
  33. AC_MSG_ERROR(md5sum is required to build bundled pjproject)
  34. fi
  35. if test "${CAT}" = ":" ; then
  36. AC_MSG_ERROR(cat is required to build bundled pjproject)
  37. fi
  38. if test "${CUT}" = ":" ; then
  39. AC_MSG_ERROR(cut is required to build bundled pjproject)
  40. fi
  41. if test "${GREP}" = ":" ; then
  42. AC_MSG_ERROR(grep is required to build bundled pjproject)
  43. fi
  44. AC_ARG_VAR([PJPROJECT_CONFIGURE_OPTS],[Additional configure options to pass to bundled pjproject])
  45. this_host=$(./config.sub $(./config.guess))
  46. if test "$build" != "$this_host" ; then
  47. PJPROJECT_CONFIGURE_OPTS+=" --build=$build_alias"
  48. fi
  49. if test "$host" != "$this_host" ; then
  50. PJPROJECT_CONFIGURE_OPTS+=" --host=$host_alias"
  51. fi
  52. # This was a copy of the autoconf generated code from the root ./configure.
  53. # Hopefully, when you read this, the code is still the same.
  54. if test "${with_ssl+set}" = set; then :
  55. case $with_ssl in
  56. n|no)
  57. PJPROJECT_CONFIGURE_OPTS+=" --disable-ssl"
  58. ;;
  59. y|ye|yes)
  60. # This is the default value in PJProject and means "autodetect".
  61. # In Asterisk, "./configure --with-ssl" means "must be present".
  62. PJPROJECT_CONFIGURE_OPTS+=" --enable-ssl"
  63. ;;
  64. *)
  65. PJPROJECT_CONFIGURE_OPTS+=" --with-ssl=${with_ssl}"
  66. ;;
  67. esac
  68. fi
  69. export TAR PATCH SED NM EXTERNALS_CACHE_DIR AST_DOWNLOAD_CACHE DOWNLOAD_TO_STDOUT DOWNLOAD_TIMEOUT DOWNLOAD MD5 CAT CUT GREP
  70. export NOISY_BUILD AST_DEVMODE
  71. ${GNU_MAKE} --quiet --no-print-directory -C ${PJPROJECT_DIR} \
  72. PJPROJECT_CONFIGURE_OPTS="$PJPROJECT_CONFIGURE_OPTS" \
  73. EXTERNALS_CACHE_DIR="${EXTERNALS_CACHE_DIR:-${AST_DOWNLOAD_CACHE}}" \
  74. configure
  75. if test $? -ne 0 ; then
  76. AC_MSG_RESULT(failed)
  77. AC_MSG_NOTICE(Unable to configure ${PJPROJECT_DIR})
  78. AC_MSG_ERROR(Re-run the ./configure command with 'NOISY_BUILD=yes' appended to see error details.)
  79. fi
  80. AC_MSG_CHECKING(for bundled pjproject)
  81. PJPROJECT_INCLUDE=$(${GNU_MAKE} --quiet --no-print-directory -C ${PJPROJECT_DIR} PJPROJECT_CONFIGURE_OPTS="$PJPROJECT_CONFIGURE_OPTS" EXTERNALS_CACHE_DIR="${EXTERNALS_CACHE_DIR:-${AST_DOWNLOAD_CACHE}}" echo_cflags)
  82. PJPROJECT_CFLAGS="$PJPROJECT_INCLUDE"
  83. PBX_PJPROJECT=1
  84. AC_DEFINE([HAVE_PJPROJECT], 1, [Define if your system has PJPROJECT])
  85. AC_DEFINE([HAVE_PJPROJECT_BUNDLED], 1, [Define if your system has PJPROJECT_BUNDLED])
  86. AC_DEFINE([HAVE_PJSIP_DLG_CREATE_UAS_AND_INC_LOCK], 1, [Define if your system has pjsip_dlg_create_uas_and_inc_lock declared.])
  87. AC_DEFINE([HAVE_PJ_TRANSACTION_GRP_LOCK], 1, [Define if your system has pjsip_tsx_create_uac2 declared.])
  88. AC_DEFINE([HAVE_PJSIP_REPLACE_MEDIA_STREAM], 1, [Define if your system has PJSIP_REPLACE_MEDIA_STREAM declared])
  89. AC_DEFINE([HAVE_PJSIP_GET_DEST_INFO], 1, [Define if your system has pjsip_get_dest_info declared.])
  90. AC_DEFINE([HAVE_PJ_SSL_CERT_LOAD_FROM_FILES2], 1, [Define if your system has pj_ssl_cert_load_from_files2 declared.])
  91. AC_DEFINE([HAVE_PJSIP_EXTERNAL_RESOLVER], 1, [Define if your system has pjsip_endpt_set_ext_resolver declared.])
  92. AC_DEFINE([HAVE_PJSIP_TLS_TRANSPORT_PROTO], 1, [Define if your system has PJSIP_TLS_TRANSPORT_PROTO])
  93. AC_DEFINE([HAVE_PJSIP_EVSUB_GRP_LOCK], 1, [Define if your system has PJSIP_EVSUB_GRP_LOCK])
  94. AC_DEFINE([HAVE_PJSIP_INV_SESSION_REF], 1, [Define if your system has PJSIP_INV_SESSION_REF])
  95. AC_DEFINE([HAVE_PJSIP_AUTH_CLT_DEINIT], 1, [Define if your system has pjsip_auth_clt_deinit declared.])
  96. AC_DEFINE([HAVE_PJSIP_TSX_LAYER_FIND_TSX2], 1, [Define if your system has pjsip_tsx_layer_find_tsx2 declared.])
  97. AC_DEFINE([HAVE_PJSIP_INV_ACCEPT_MULTIPLE_SDP_ANSWERS], 1, [Define if your system has HAVE_PJSIP_INV_ACCEPT_MULTIPLE_SDP_ANSWERS declared.])
  98. AC_DEFINE([HAVE_PJSIP_ENDPOINT_COMPACT_FORM], 1, [Define if your system has HAVE_PJSIP_ENDPOINT_COMPACT_FORM declared.])
  99. AC_SUBST([PJPROJECT_BUNDLED])
  100. AC_SUBST([PJPROJECT_DIR])
  101. AC_SUBST([PBX_PJPROJECT])
  102. AC_SUBST([PJPROJECT_LIB])
  103. AC_SUBST([PJPROJECT_INCLUDE])
  104. AC_MSG_RESULT(yes)
  105. ])
  106. AC_DEFUN([PJPROJECT_CONFIGURE],
  107. [
  108. if test "$PJPROJECT_BUNDLED" = "yes" ; then
  109. _PJPROJECT_CONFIGURE()
  110. fi
  111. ])