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