Assured that if no expiry time is specified for REGISTER, the endpoint default is...
[opal.git] / configure.ac
bloba8b890a079c0fa659abbdfb008b138d657e0dad7
1 AC_INIT(include/opal/manager.h)
3 AC_PROG_CC
4 AC_PROG_CXX
6 h323=yes
7 t38=yes
8 h224=yes
9 h450=yes
10 h460=yes
11 sip=yes
12 iax=yes
13 audio=yes
14 video=yes
15 rfc4175=yes
17 dnl this must be updated for every minor revision, and for
18 dnl builds when and as necessary
19 REQUIRED_PWLIB_MAJOR=1
20 REQUIRED_PWLIB_MINOR=11
21 REQUIRED_PWLIB_BUILD=0
23 dnl ########################################################################
24 dnl set the OPAL directory to the current directory
26 OPALDIR=`pwd`
27 AC_SUBST(OPALDIR)
29 dnl ########################################################################
30 dnl set the PREFIX accordingly
31 if test "x$prefix" = "xNONE"; then
32    INSTALLPREFIX="/usr/local"
33 else
34    INSTALLPREFIX="${prefix}"
37 AC_SUBST(INSTALLPREFIX)
39 dnl ########################################################################
40 dnl set LIBDIR accordingly
41 LIBDIR="${libdir}"
43 AC_SUBST(LIBDIR)
45 dnl ########################################################################
46 dnl extract the OPAL version
48 dnl MSWIN_DISPLAY version,Version
49 dnl MSWIN_VERSION version,OPAL_MAJOR=MAJOR_VERSION
50 dnl MSWIN_VERSION version,OPAL_MINOR=MINOR_VERSION
51 dnl MSWIN_VERSION version,OPAL_BUILD=BUILD_NUMBER
52 dnl MSWIN_VERSION version,OPAL_VERSION=VERSION
54 MAJOR_VERSION=`cat ${OPALDIR}/version.h | grep MAJOR_VERSION | cut -f3 -d' '`
55 MINOR_VERSION=`cat ${OPALDIR}/version.h | grep MINOR_VERSION | cut -f3 -d' '`
56 BUILD_NUMBER=`cat ${OPALDIR}/version.h | grep BUILD_NUMBER | cut -f3 -d' '`
57 OPAL_VERSION="${MAJOR_VERSION}.${MINOR_VERSION}.${BUILD_NUMBER}"
58 AC_DEFINE_UNQUOTED(OPAL_MAJOR,   ${MAJOR_VERSION})
59 AC_DEFINE_UNQUOTED(OPAL_MINOR,   ${MINOR_VERSION})
60 AC_DEFINE_UNQUOTED(OPAL_BUILD,   ${BUILD_NUMBER})
61 AC_DEFINE_UNQUOTED(OPAL_VERSION, "$OPAL_VERSION")
63 AC_MSG_NOTICE(Opal version is ${OPAL_VERSION});
65 #use to set the version in opal.pc
66 AC_SUBST(OPAL_VERSION)
68 dnl ########################################################################
69 dnl look for ptlib, use a preference order of explicit PWLIBDIR, directory
70 dnl at same level, home directory, /usr/local or /usr.
72 if test "${PWLIBDIR:-unset}" != "unset" ; then
73   AC_CHECK_FILE(${PWLIBDIR}/version.h, HAS_PTLIB=1)
75 if test "${HAS_PTLIB:-unset}" = "unset" ; then
76   AC_CHECK_FILE(${OPALDIR}/../pwlib/version.h, HAS_PTLIB=1)
77   if test "${HAS_PTLIB:-unset}" != "unset" ; then
78     PWLIBDIR="${OPALDIR}/../pwlib"
79   else
80     AC_CHECK_FILE(${HOME}/pwlib/include/ptlib.h, HAS_PTLIB=1)
81     if test "${HAS_PTLIB:-unset}" != "unset" ; then
82       PWLIBDIR="${HOME}/pwlib"
83     else
84       AC_CHECK_FILE(/usr/local/include/ptlib.h, HAS_PTLIB=1)
85       if test "${HAS_PTLIB:-unset}" != "unset" ; then
86         AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/local/bin)
87       else
88         AC_CHECK_FILE(/usr/include/ptlib.h, HAS_PTLIB=1)
89         if test "${HAS_PTLIB:-unset}" != "unset" ; then
90           AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/share/pwlib/make/)
91         else
92           AC_CHECK_FILE(${prefix}/include/ptlib.h, HAS_PTLIB=1)
93           if test "${HAS_PTLIB:-unset}" != "unset" ; then
94             AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , ${prefix}/bin)
95           fi
96         fi
97       fi
98     fi
99   fi
102 if test "${HAS_PTLIB:-unset}" = "unset" ; then
103   AC_MSG_ERROR("Cannot find pwlib - please install or set PWLIBDIR and try again")
106 if test "${PWLIBDIR:-unset}" = "unset" ; then
107   if test "${PTLIB_CONFIG:-unset}" = "unset" ; then
108     AC_MSG_ERROR("Cannot find ptlib-config - please install and try again")
109   fi
110   PWLIBDIR=`$PTLIB_CONFIG --prefix`
113 if test "x$PWLIBDIR" = "x/usr" -o "x$PWLIBDIR" = "x/usr/"; then
114   PWLIBDIR="/usr/share/pwlib/"
116 if test "x$PWLIBDIR" = "x/usr/local" -o "x$PWLIBDIR" = "x/usr/"; then
117   PWLIBDIR="/usr/local/share/pwlib/"
119 if test "x$PWLIBDIR" = "x${prefix}"; then
120   PWLIBDIR="${prefix}/share/pwlib/"
122 AC_SUBST(PWLIBDIR)
124 echo "PWLib prefix set to.... $PWLIBDIR"
126 if test "${PWLIBDIR:-unset}" = "unset" ; then
127   PWVERSION=`$PTLIB_CONFIG --version`
128   PW_MAJOR_VERSION=`echo $PW_VERSION | cut -d'.' -f1`
129   PW_MINOR_VERSION=`echo $PW_VERSION | cut -d'.' -f2`
130   PW_BUILD_NUMBER=`echo $PW_VERSION | cut -d'.' -f3`
131   
132 else
133   PW_MAJOR_VERSION=`cat ${PWLIBDIR}/version.h | grep MAJOR_VERSION | cut -f3 -d' '`
134   PW_MINOR_VERSION=`cat ${PWLIBDIR}/version.h | grep MINOR_VERSION | cut -f3 -d' '`
135   PW_BUILD_NUMBER=`cat ${PWLIBDIR}/version.h | grep BUILD_NUMBER | cut -f3 -d' '`
136   PWVERSION="${PW_MAJOR_VERSION}.${PW_MINOR_VERSION}.${PW_BUILD_NUMBER}"
139 AC_ARG_ENABLE(versioncheck,
140                 [  --disable-versioncheck    disable PWLib version check],
141                 PWLIB_VERSION_CHECK=$enableval)
143 AC_MSG_CHECKING(Checking PWLib version ${PWVERSION})
144 if test "${PWLIB_VERSION_CHECK}x" = "nox" ; then
145   AC_MSG_RESULT(check disabled)
146 else
147   if test $PW_MAJOR_VERSION -lt $REQUIRED_PWLIB_MAJOR ; then
148     AC_MSG_ERROR(Major version less than required $REQUIRED_PWLIB_MAJOR)
149   fi
150   if test $PW_MINOR_VERSION -lt $REQUIRED_PWLIB_MINOR ; then
151     AC_MSG_ERROR(Minor version less than required $REQUIRED_PWLIB_MINOR)
152   fi
153   if test $PW_BUILD_NUMBER -lt $REQUIRED_PWLIB_BUILD ; then
154     AC_MSG_ERROR(Build version less than required $REQUIRED_PWLIB_BUILD)
155   fi
156   AC_MSG_RESULT(ok)
159 AC_SUBST(PWLIBDIR)
161 dnl ########################################################################
162 dnl get the gcc version
164 if test x$GXX = xyes ; then
165   USE_GCC=yes
166   gcc_version=`$CXX -dumpversion`
167   AC_MSG_NOTICE(gcc version is $gcc_version);
168   GXX_MAJOR=`echo $gcc_version | sed 's/\..*$//'`
169   GXX_MINOR=[`echo $gcc_version | sed -e 's/[0-9][0-9]*\.//' -e 's/\..*$//'`]
170   GXX_PATCH=[`echo $gcc_version | sed -e 's/[0-9][0-9]*\.[0-9][0-9]*\.//' -e 's/\..*$//'`]
172   dnl cannot compile for less than gcc 3
173   AC_MSG_CHECKING(checking if gcc version is valid)
174   if test ${GXX_MAJOR} -lt 3 ; then
175     AC_MSG_RESULT(no)
176     AC_MSG_ERROR([OPAL requires gcc version 3 or later])
177   else
178     AC_MSG_RESULT(yes)
179   fi
182 dnl ########################################################################
183 dnl check for BSR instruction
185 AC_MSG_CHECKING(for working bit scan intrinsic)
186 BSR_TEST_SRC="
187 #include <stdlib.h>
188 int main(int argc, char* argv[]) {
189 #ifdef __GNUC__
190         unsigned int val = 0x00000FF0;
191         if (__builtin_clz(val) == 20)
192                 exit(0);
193 #endif
194         exit(1);
196 AC_TRY_RUN($BSR_TEST_SRC, GCC_HAS_CLZ=1, GCC_HAS_CLZ=0, GCC_HAS_CLZ=1)
197 if test "${GCC_HAS_CLZ}" = "1" ; then
198         AC_MSG_RESULT(yes)
199         AC_DEFINE(GCC_HAS_CLZ, 1)
200         GCC_HAS_CLZ=1
201 else
202         AC_MSG_RESULT(no)
204 AC_SUBST(GCC_HAS_CLZ)
207 dnl ########################################################################
208 dnl Look for system libspeex
209 localspeex="xxx"
210 AC_ARG_ENABLE(localspeex,
211        [  --enable-localspeex     use local version of Speex library rather than system version],
212        localspeex=$enableval)
214 AC_CHECK_SIZEOF(short)
215 AC_CHECK_SIZEOF(int)
216 AC_CHECK_SIZEOF(long)
217 AC_CHECK_SIZEOF(long long)
219 case 2 in
220         $ac_cv_sizeof_short) SIZE16="short";;
221         $ac_cv_sizeof_int) SIZE16="int";;
222 esac
224 case 4 in
225         $ac_cv_sizeof_int) SIZE32="int";;
226         $ac_cv_sizeof_long) SIZE32="long";;
227         $ac_cv_sizeof_short) SIZE32="short";;
228 esac
230 AC_SUBST(SIZE16)
231 AC_SUBST(SIZE32)
233 OPAL_HAVE_SPEEX_H=
234 OPAL_HAVE_SPEEX_SPEEX_H=
235 AC_CHECK_HEADERS("speex.h", OPAL_HAVE_SPEEX_H=1)
236 if test "${OPAL_HAVE_SPEEX_H}x" != "x" ; then
237   AC_DEFINE(OPAL_HAVE_SPEEX_H)
238 else
239   AC_CHECK_HEADERS("speex/speex.h", OPAL_HAVE_SPEEX_SPEEX_H=1)
240   if test "${OPAL_HAVE_SPEEX_SPEEX_H}x" != "x" ; then
241     AC_DEFINE(OPAL_HAVE_SPEEX_SPEEX_H)
242   fi
245 if test "${localspeex}" = "yes" ; then
246   AC_MSG_NOTICE(Forcing use of OPAL Speex sources)
247 elif test "${localspeex}" = "no" ; then
248   AC_MSG_NOTICE(Forcing use of system Speex library)
249   AC_DEFINE(OPAL_SYSTEM_SPEEX, 1)
250   AC_SUBST(OPAL_SYSTEM_SPEEX, 1)
251 else
252   AC_CHECK_LIB(speex, speex_encoder_destroy, SPEEX=1)
253   if test "${SPEEX}x" != "x" ; then
254     AC_CHECK_LIB(speex, speex_encode_int, SPEEX=1, unset SPEEX)
255   fi
256   if test "x$SPEEX" = "x" -o \( "${OPAL_HAVE_SPEEX_H}x" = "x" -a "${OPAL_HAVE_SPEEX_SPEEX_H}x" = "x" \); then
257     AC_MSG_NOTICE(Forcing use of OPAL Speex library)
258   else
259     AC_MSG_CHECKING(system Speex version)
260     if test "${OPAL_HAVE_SPEEX_H}x" != "x" ; then
261       echo "#include <speex.h>" > t.c 
262       echo "#include <speex_header.h>" >> t.c
263     else
264       echo "#include <speex/speex.h>" > t.c 
265       echo "#include <speex/speex_header.h>" >> t.c
266     fi
267     cat >> t.c <<C_FILE
268     #include <stdio.h>
269     int main(int argc,char *argv[])
270     {
271       SpeexHeader header;
272       speex_init_header(&header, 1, 1, &speex_nb_mode);
273       printf("%s\n", header.speex_version);
274     }
275 C_FILE
276     cc -o t t.c -lspeex > /dev/null 2>&1
277     if test \! -x t ; then
278       AC_MSG_RESULT(cannot determine - using OPAL version)
279     else
280       SYSVER=`./t`
281       AC_MSG_RESULT($SYSVER)
282       AC_MSG_CHECKING(OPAL Speex version)
283       LIBVER=`grep "#define SPEEX_VERSION" ./src/codec/speex/libspeex/misc.h | sed -e 's/^.*[Ss][Pp][Ee][Ee][Xx]\-//' -e 's/\"//' -e 's/\/.*//'`
284       AC_MSG_RESULT($LIBVER)
285       AC_MSG_CHECKING(Speex versions)
286       cat > t.pl <<P_FILE
287       [
288       \$sysver = @ARGV[0];
289       \$libver = @ARGV[1];
290       @lib = split /\./, \$libver;
291       while (@lib < 3) {
292         @lib[0+@lib] = "0";
293       }
294       @sys = split /\./, \$sysver;
295       while (@sys < 3) {
296         @sys[0+@sys] = "0";
297       }
298       \$i = 0;
299       while (\$i < 3) {
300         if (@sys[\$i] < @lib[\$i]) {
301           print "0";
302           exit;
303         }
304         \$i++;
305       }
306       print "1";
307       ]
308 P_FILE
309       SPEEX=`perl t.pl $SYSVER $LIBVER`
310       rm t.pl
311       if test "x$SPEEX" = "x0" ; then
312         AC_MSG_RESULT(OPAL version is more recent)
313       else
314         AC_MSG_RESULT(system version is more recent)
315         AC_DEFINE(OPAL_SYSTEM_SPEEX, 1)
316         AC_SUBST(OPAL_SYSTEM_SPEEX, 1)
317         AC_MSG_CHECKING(Speex noise type)
318         if test "${OPAL_HAVE_SPEEX_H}x" != "x" ; then
319           echo "#include <speex.h>" > t.c
320           echo "#include <speex_preprocess.h>" >> t.c
321         else
322           echo "#include <speex/speex.h>" > t.c
323           echo "#include <speex/speex_preprocess.h>" >> t.c
324         fi
325         cat >> t.c <<C_FILE
326           #include <stdio.h>
327           int main(int argc,char *argv[])
328           {
329              struct SpeexPreprocessState *st;
330              spx_int16_t *x;
331              float *echo;
332              speex_preprocess(st, x, echo);
333           }
334 C_FILE
335         rm -f t
336         cc -Werror -o t t.c -lspeex > /dev/null 2>&1
337         if test \! -x t ; then
338           AC_MSG_RESULT(spx_int32_t)
339         else
340           AC_MSG_RESULT(float)
341           AC_DEFINE(OPAL_SPEEX_FLOAT_NOISE)
342         fi
343       fi
344     fi
345     rm -f t t.c
346   fi
349 AC_SUBST(OPAL_HAVE_SPEEX_SPEEX_H)
351 dnl ########################################################################
352 dnl enable audio, video, SIP, H.323 and IAX
354 dnl MSWIN_DISPLAY audio,Audio
355 dnl MSWIN_DEFINE  audio,OPAL_AUDIO
357 AC_ARG_ENABLE(audio,
358        [  --disable-audio         disable audio codec support],
359        audio=$enableval)
360 AC_MSG_CHECKING(audio codec support)
361 if test "$audio" = "yes" ; then
362   AC_SUBST(OPAL_AUDIO, 1)
363   AC_DEFINE(OPAL_AUDIO)
364   AC_MSG_RESULT(enabled)
365 else
366   AC_MSG_RESULT(disabled)
370 dnl MSWIN_DISPLAY video,Video
371 dnl MSWIN_DEFINE  video,OPAL_VIDEO
374 AC_ARG_ENABLE(video,
375        [  --disable-video         disable video codec support],
376        video=$enableval)
377 AC_MSG_CHECKING(video device support)
378 if test "$video" = "yes" ; then
379   AC_SUBST(OPAL_VIDEO, 1)
380   AC_DEFINE(OPAL_VIDEO)
381   AC_MSG_RESULT(enabled)
382 else
383   AC_MSG_RESULT(disabled)
384   rfc4175=no
388 dnl MSWIN_DISPLAY sip,SIP support
389 dnl MSWIN_DEFINE  sip,OPAL_SIP
391 AC_ARG_ENABLE(sip,
392        [  --disable-sip           disable SIP protocol support],
393        sip=$enableval)
394 AC_MSG_CHECKING(SIP protocol)
395 if test "$sip" = "yes" ; then
396   AC_SUBST(OPAL_SIP, 1)
397   AC_DEFINE(OPAL_SIP)
398   AC_MSG_RESULT(enabled)
399 else
400   AC_MSG_RESULT(disabled)
404 dnl MSWIN_DISPLAY h323,H.323 support
405 dnl MSWIN_DEFINE  h323,OPAL_H323
407 AC_ARG_ENABLE(h323,
408        [  --disable-h323          disable H.323 protocol support],
409        h323=$enableval)
410 AC_MSG_CHECKING(H.323 protocol)
411 if test "$h323" = "yes" ; then
412   AC_SUBST(OPAL_H323, 1)
413   AC_DEFINE(OPAL_H323)
414   AC_MSG_RESULT(enabled)
415 else
416   AC_SUBST(OPAL_H323, 0)
417   AC_MSG_RESULT(disabled (T.38, H.224, H.460 also disabled))
418   h224=no
419   h460=no
421 AC_SUBST(OPAL_H323, $OPAL_H323)
423 dnl ########################################################################
425 dnl IAX
427 dnl MSWIN_DISPLAY iax2,IAX2 support
428 dnl MSWIN_DEFINE  iax2,OPAL_IAX2
430 AC_ARG_ENABLE(iax,
431        [  --disable-iax           disable IAX2 protocol support],
432        iax=$enableval)
433 AC_MSG_CHECKING(IAX2 protocol)
434 if test "$iax" = "yes" ; then
435   AC_SUBST(OPAL_IAX2, 1)
436   AC_DEFINE(OPAL_IAX2)
437   AC_MSG_RESULT(enabled)
438 else
439   AC_MSG_RESULT(disabled)
442 dnl ########################################################################
444 dnl H.224
446 dnl MSWIN_DISPLAY h224,H.224 support
447 dnl MSWIN_DEFINE  h224,OPAL_H224
449 AC_ARG_ENABLE(h224,
450                 [  --disable-h224          disable H.224 protocol support],
451                 h224=$enableval)
452 AC_MSG_CHECKING(H224 protocol)
453 if test "$h224" = "yes" ; then
454   AC_SUBST(OPAL_H224, 1)
455   AC_DEFINE(OPAL_H224)
456   AC_MSG_RESULT(enabled)
457 else
458   AC_MSG_RESULT(disabled)
461 dnl ########################################################################
463 dnl T.38
465 dnl MSWIN_DISPLAY    t38,T.38
466 dnl MSWIN_DEFINE     t38,OPAL_T38FAX
468 if test "$t38" = "yes" ; then
469   AC_ARG_ENABLE(t38,
470          [  --disable-t38           disable T.38 protocol support],
471          t38=$enableval)
472   AC_MSG_CHECKING(T.38 protocol)
473   if test "$t38" = "yes" ; then
474     AC_SUBST(OPAL_T38FAX, 1)
475     AC_DEFINE(OPAL_T38FAX)
476     AC_MSG_RESULT(enabled)
477   else
478     AC_MSG_RESULT(disabled)
479   fi
483 dnl ########################################################################
485 dnl H.450
487 dnl MSWIN_DISPLAY    h450,H.450
488 dnl MSWIN_DEFINE     h450,OPAL_H450
489 dnl MSWIN_IF_FEATURE h450,h323
491 OPAL_450=
492 if test "$h450" = "yes" ; then
493   AC_ARG_ENABLE(h450,
494          [  --disable-h450          disable H.450],
495          h450=$enableval)
496   AC_MSG_CHECKING(H.450 support)
497   if test "$h450" = "yes" ; then
498     AC_SUBST(OPAL_H450, 1)
499     AC_DEFINE(OPAL_H450)
500     AC_MSG_RESULT(enabled)
501   else
502     AC_MSG_RESULT(disabled)
503   fi
507 dnl ########################################################################
509 dnl H.460
511 dnl MSWIN_DISPLAY    h460,H.460
512 dnl MSWIN_DEFINE     h460,OPAL_H460
513 dnl MSWIN_IF_FEATURE h460,h323
515 OPAL_460=
516 if test "$h460" = "yes" ; then
517   AC_ARG_ENABLE(h460,
518          [  --disable-h460          disable H.460],
519          h460=$enableval)
520   AC_MSG_CHECKING(H.460 support)
521   if test "$h460" = "yes" ; then
522     AC_SUBST(OPAL_H460, 1)
523     AC_DEFINE(OPAL_H460)
524     AC_MSG_RESULT(enabled)
525   else
526     AC_MSG_RESULT(disabled)
527   fi
531 dnl ########################################################################
533 dnl LID, used for vpb, dialogic etc ...
535 dnl MSWIN_DISPLAY lids,Line Interface Device
536 dnl MSWIN_DEFINE  lids,OPAL_LID
538 OPAL_LID=
539 lid=yes
540 if test "$lid" = "yes" ; then
541   AC_ARG_ENABLE(lid,
542          [  --disable-lid           disable LID support],
543          lid=$enableval)
544   AC_MSG_CHECKING(LID support)
545   if test "$lid" = "yes" ; then
546     AC_DEFINE(OPAL_LID, 1)
547     OPAL_LID=1
548     AC_MSG_RESULT(enabled)
549   else
550     AC_MSG_RESULT(disabled)
551   fi
553 AC_SUBST(OPAL_LID)
555 dnl ########################################################################
557 dnl IVR
559 dnl MSWIN_DISPLAY ivr,IVR support
560 dnl MSWIN_DEFINE  ivr,OPAL_IVR
562 ivr=yes
563 if test "$ivr" = "yes" ; then
564   AC_ARG_ENABLE(ivr,
565          [  --disable-ivr           disable IVR support],
566          ivr=$enableval)
567   AC_MSG_CHECKING(IVR support)
568   if test "$ivr" = "yes" ; then
569     AC_DEFINE(OPAL_IVR, 1)
570     OPAL_IVR=1
571     AC_MSG_RESULT(enabled)
572   else
573     AC_MSG_RESULT(disabled)
574   fi
576 AC_SUBST(OPAL_IVR)
579 dnl ########################################################################
581 dnl RFC4175
583 dnl MSWIN_DISPLAY rfc4175,RFC4175 Raw Video support
584 dnl MSWIN_DEFINE  rfc4175,OPAL_RFC4175
586 if test "$rfc4175" = "yes" ; then
587   AC_ARG_ENABLE(rfc4175,
588          [  --disable-rfc4175       disable RFC4175 support],
589          rfc4175=$enableval)
590   AC_MSG_CHECKING(RFC4175 codec)
591   if test "$rfc4175" = "yes" ; then
592     AC_DEFINE(OPAL_RFC4175, 1)
593     OPAL_RFC4175=1
594     AC_MSG_RESULT(enabled)
595   else
596     AC_MSG_RESULT(disabled)
597   fi
599 AC_SUBST(OPAL_RFC4175)
601 dnl ########################################################################
603 dnl ZRTP from Phil Zimmermann
604 dnl 
606 dnl MSWIN_DISPLAY     libzrtp,ZRTP/SRTP support
607 dnl MSWIN_CHECK_FILE  libzrtp,include\zrtp_types.h,HAS_LIBZRTP=1
608 dnl MSWIN_DIR_SYMBOL  libzrtp,LIBZRTP_DIR
609 dnl MSWIN_CHECK_DIR   libsrtp,.\srtp_win32k
610 dnl MSWIN_CHECK_DIR   libzrtp,.\zrtp
611 dnl MSWIN_CHECK_DIR   libzrtp,..\external\zrtp
612 dnl MSWIN_CHECK_DIR   libzrtp,c:\libs
614 HAS_LIBZRTP=
615 dnl AC_MSG_CHECKING(for libZRTP)
616 dnl AC_TRY_COMPILE([#include "srtp/srtp.h"],
617 dnl  [int main(int argc, char *argv[]) { crypto_policy_t p; p.cipher_key_len = SRTP_MASTER_KEY_LEN; return 0; }],
618 dnl  HAS_LIBSRTP=1)
619 dnl if test "${HAS_LIBSRTP}" = "1" ; then
620 dnl   AC_MSG_RESULT(yes)
621 dnl   AC_DEFINE(HAS_LIBSRTP, 1)
622 dnl   HAS_LIBSRTP=1
623 dnl   OPAL_SRTP=1
624 dnl else
625 dnl   AC_MSG_RESULT(no)
626 dnl fi
627 AC_SUBST(OPAL_ZRTP)
628 AC_SUBST(HAS_LIBZRTP)
631 dnl ########################################################################
633 dnl Cisco libSRTP
634 dnl 
636 dnl MSWIN_DISPLAY     libsrtp,Cisco libSRTP support
637 dnl MSWIN_IF_FEATURE  libsrtp,!libzrtp
638 dnl MSWIN_CHECK_FILE  libsrtp,include\srtp.h,HAS_LIBSRTP=1
639 dnl MSWIN_DIR_SYMBOL  libsrtp,LIBSRTP_DIR
640 dnl MSWIN_CHECK_DIR   libsrtp,.\srtp
641 dnl MSWIN_CHECK_DIR   libsrtp,..\external\srtp
642 dnl MSWIN_CHECK_DIR   libsrtp,c:\libs
644 HAS_LIBSRTP=
645 AC_MSG_CHECKING(for libSRTP)
646 AC_TRY_COMPILE([#include "srtp/srtp.h"],
647  [int main(int argc, char *argv[]) { crypto_policy_t p; p.cipher_key_len = SRTP_MASTER_KEY_LEN; return 0; }],
648  HAS_LIBSRTP=1)
649 if test "${HAS_LIBSRTP}" = "1" ; then
650   AC_MSG_RESULT(yes)
651   AC_DEFINE(HAS_LIBSRTP, 1)
652   HAS_LIBSRTP=1
653   OPAL_SRTP=1
654 else
655   AC_MSG_RESULT(no)
657 AC_SUBST(OPAL_SRTP)
658 AC_SUBST(HAS_LIBSRTP)
659 dnl ########################################################################
660 dnl output make directives
662 AC_SUBST(STDCCFLAGS)
663 AC_SUBST(LDFLAGS)
664 AC_SUBST(ENDLDLIBS)
665 AC_PROG_INSTALL
667 dnl ########################################################################
668 dnl Output configured files
670 AC_CONFIG_SUBDIRS(plugins)
672 dnl ########################################################################
673 dnl output header file
675 AC_CONFIG_FILES(opal_inc.mak)
676 AC_CONFIG_FILES(Makefile)
677 AC_CONFIG_HEADERS(include/opal/buildopts.h)
678 AC_CONFIG_FILES(opal.pc)
679 AC_CONFIG_FILES(opal.spec)
680 AC_CONFIG_FILES(opal_cfg.dxy)
682 AC_OUTPUT(src/codec/speex/libspeex/speex_config_types.h)