1 AC_INIT(include/opal/manager.h)
6 dnl this must be updated for every minor revision, and for
7 dnl builds when and as necessary
9 REQUIRED_PWLIB_MINOR=11
10 REQUIRED_PWLIB_BUILD=0
12 dnl ########################################################################
13 dnl set the OPAL directory to the current directory
18 dnl ########################################################################
19 dnl set the PREFIX accordingly
20 if test "x$prefix" = "xNONE"; then
21 INSTALLPREFIX="/usr/local"
23 INSTALLPREFIX="${prefix}"
26 AC_SUBST(INSTALLPREFIX)
28 dnl ########################################################################
29 dnl set LIBDIR accordingly
34 dnl ########################################################################
35 dnl extract the OPAL version
37 dnl MSWIN_DISPLAY version,Version
38 dnl MSWIN_VERSION version,OPAL_MAJOR=MAJOR_VERSION
39 dnl MSWIN_VERSION version,OPAL_MINOR=MINOR_VERSION
40 dnl MSWIN_VERSION version,OPAL_BUILD=BUILD_NUMBER
41 dnl MSWIN_VERSION version,OPAL_VERSION=VERSION
43 MAJOR_VERSION=`cat ${OPALDIR}/version.h | grep MAJOR_VERSION | cut -f3 -d' '`
44 MINOR_VERSION=`cat ${OPALDIR}/version.h | grep MINOR_VERSION | cut -f3 -d' '`
45 BUILD_NUMBER=`cat ${OPALDIR}/version.h | grep BUILD_NUMBER | cut -f3 -d' '`
46 OPAL_VERSION="${MAJOR_VERSION}.${MINOR_VERSION}.${BUILD_NUMBER}"
47 AC_DEFINE_UNQUOTED(OPAL_MAJOR, ${MAJOR_VERSION})
48 AC_DEFINE_UNQUOTED(OPAL_MINOR, ${MINOR_VERSION})
49 AC_DEFINE_UNQUOTED(OPAL_BUILD, ${BUILD_NUMBER})
50 AC_DEFINE_UNQUOTED(OPAL_VERSION, "$OPAL_VERSION")
53 dnl ########################################################################
54 dnl look for ptlib, use a preference order of explicit PWLIBDIR, directory
55 dnl at same level, home directory, /usr/local or /usr.
57 if test "${PWLIBDIR:-unset}" != "unset" ; then
58 AC_CHECK_FILE(${PWLIBDIR}/version.h, HAS_PTLIB=1)
60 if test "${HAS_PTLIB:-unset}" = "unset" ; then
61 AC_CHECK_FILE(${OPALDIR}/../pwlib/version.h, HAS_PTLIB=1)
62 if test "${HAS_PTLIB:-unset}" != "unset" ; then
63 PWLIBDIR="${OPALDIR}/../pwlib"
65 AC_CHECK_FILE(${HOME}/pwlib/include/ptlib.h, HAS_PTLIB=1)
66 if test "${HAS_PTLIB:-unset}" != "unset" ; then
67 PWLIBDIR="${HOME}/pwlib"
69 AC_CHECK_FILE(/usr/local/include/ptlib.h, HAS_PTLIB=1)
70 if test "${HAS_PTLIB:-unset}" != "unset" ; then
71 AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/local/bin)
73 AC_CHECK_FILE(/usr/include/ptlib.h, HAS_PTLIB=1)
74 if test "${HAS_PTLIB:-unset}" != "unset" ; then
75 AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/share/pwlib/make/)
82 if test "${HAS_PTLIB:-unset}" = "unset" ; then
83 echo "Cannot find pwlib - please install or set PWLIBDIR and try again"
87 if test "${PWLIBDIR:-unset}" = "unset" ; then
88 if test "${PTLIB_CONFIG:-unset}" = "unset" ; then
89 echo "Cannot find ptlib-config - please install and try again"
92 PWLIBDIR=`$PTLIB_CONFIG --prefix`
95 if test "x$PWLIBDIR" = "x/usr" -o "x$PWLIBDIR" = "x/usr/"; then
96 PWLIBDIR="/usr/share/pwlib/"
98 if test "x$PWLIBDIR" = "x/usr/local" -o "x$PWLIBDIR" = "x/usr/"; then
99 PWLIBDIR="/usr/local/share/pwlib/"
103 echo "PWLib prefix set to.... $PWLIBDIR"
105 if test "${PWLIBDIR:-unset}" = "unset" ; then
106 PWVERSION=`$PTLIB_CONFIG --version`
107 PW_MAJOR_VERSION=`echo $PW_VERSION | cut -d'.' -f1`
108 PW_MINOR_VERSION=`echo $PW_VERSION | cut -d'.' -f2`
109 PW_BUILD_NUMBER=`echo $PW_VERSION | cut -d'.' -f3`
112 PW_MAJOR_VERSION=`cat ${PWLIBDIR}/version.h | grep MAJOR_VERSION | cut -f3 -d' '`
113 PW_MINOR_VERSION=`cat ${PWLIBDIR}/version.h | grep MINOR_VERSION | cut -f3 -d' '`
114 PW_BUILD_NUMBER=`cat ${PWLIBDIR}/version.h | grep BUILD_NUMBER | cut -f3 -d' '`
115 PWVERSION="${PW_MAJOR_VERSION}.${PW_MINOR_VERSION}.${PW_BUILD_NUMBER}"
118 AC_ARG_ENABLE(versioncheck,
119 [ --disable-versioncheck disable PWLib version check],
120 PWLIB_VERSION_CHECK=$enableval)
122 AC_MSG_CHECKING(Checking PWLib version ${PWVERSION})
123 if test "${PWLIB_VERSION_CHECK}x" = "nox" ; then
124 AC_MSG_RESULT(check disabled)
126 if test $PW_MAJOR_VERSION -lt $REQUIRED_PWLIB_MAJOR ; then
127 AC_MSG_RESULT(Major version less than required $REQUIRED_PWLIB_MAJOR)
130 if test $PW_MINOR_VERSION -lt $REQUIRED_PWLIB_MINOR ; then
131 AC_MSG_RESULT(Minor version less than required $REQUIRED_PWLIB_MINOR)
134 if test $PW_BUILD_NUMBER -lt $REQUIRED_PWLIB_BUILD ; then
135 AC_MSG_RESULT(Build version less than required $REQUIRED_PWLIB_BUILD)
143 dnl ########################################################################
144 dnl get the gcc version
146 if test x$GXX = xyes ; then
148 gcc_version=`$CXX -dumpversion`
149 AC_MSG_NOTICE(gcc version is $gcc_version);
150 GXX_MAJOR=`echo $gcc_version | sed 's/\..*$//'`
151 GXX_MINOR=[`echo $gcc_version | sed -e 's/[0-9][0-9]*\.//' -e 's/\..*$//'`]
152 GXX_PATCH=[`echo $gcc_version | sed -e 's/[0-9][0-9]*\.[0-9][0-9]*\.//' -e 's/\..*$//'`]
154 dnl cannot compile for less than gcc 3
155 AC_MSG_CHECKING(checking if gcc version is valid)
156 if test ${GXX_MAJOR} -lt 3 ; then
158 AC_MSG_ERROR([OPAL requires gcc version 3 or later])
165 dnl ########################################################################
166 dnl Look for system libspeex
168 AC_ARG_ENABLE(localspeex,
169 [ --enable-localspeex use local version of Speex library rather than system version],
170 localspeex=$enableval)
172 AC_CHECK_SIZEOF(short)
174 AC_CHECK_SIZEOF(long)
175 AC_CHECK_SIZEOF(long long)
178 $ac_cv_sizeof_short) SIZE16="short";;
179 $ac_cv_sizeof_int) SIZE16="int";;
183 $ac_cv_sizeof_int) SIZE32="int";;
184 $ac_cv_sizeof_long) SIZE32="long";;
185 $ac_cv_sizeof_short) SIZE32="short";;
192 OPAL_HAVE_SPEEX_SPEEX_H=
193 AC_CHECK_HEADERS("speex.h", OPAL_HAVE_SPEEX_H=1)
194 if test "${OPAL_HAVE_SPEEX_H}x" != "x" ; then
195 AC_DEFINE(OPAL_HAVE_SPEEX_H)
197 AC_CHECK_HEADERS("speex/speex.h", OPAL_HAVE_SPEEX_SPEEX_H=1)
198 if test "${OPAL_HAVE_SPEEX_SPEEX_H}x" != "x" ; then
199 AC_DEFINE(OPAL_HAVE_SPEEX_SPEEX_H)
203 if test "${localspeex}" = "yes" ; then
204 AC_MSG_NOTICE(Forcing use of OPAL Speex sources)
205 elif test "${localspeex}" = "no" ; then
206 AC_MSG_NOTICE(Forcing use of system Speex library)
207 AC_DEFINE(OPAL_SYSTEM_SPEEX, 1)
208 AC_SUBST(OPAL_SYSTEM_SPEEX, 1)
210 AC_CHECK_LIB(speex, speex_encoder_destroy, SPEEX=1)
211 if test "${SPEEX}x" != "x" ; then
212 AC_CHECK_LIB(speex, speex_encode_int, SPEEX=1, unset SPEEX)
214 if test "x$SPEEX" = "x" -o \( "${OPAL_HAVE_SPEEX_H}x" = "x" -a "${OPAL_HAVE_SPEEX_SPEEX_H}x" = "x" \); then
215 AC_MSG_NOTICE(Forcing use of OPAL Speex library)
217 AC_MSG_CHECKING(system Speex version)
218 if test "${OPAL_HAVE_SPEEX_H}x" != "x" ; then
219 echo "#include <speex.h>" > t.c
220 echo "#include <speex_header.h>" >> t.c
222 echo "#include <speex/speex.h>" > t.c
223 echo "#include <speex/speex_header.h>" >> t.c
227 int main(int argc,char *argv[])
230 speex_init_header(&header, 1, 1, &speex_nb_mode);
231 printf("%s\n", header.speex_version);
234 cc -o t t.c -lspeex > /dev/null 2>&1
235 if test \! -x t ; then
236 AC_MSG_RESULT(cannot determine - using OPAL version)
239 AC_MSG_RESULT($SYSVER)
240 AC_MSG_CHECKING(library Speex version)
241 LIBVER=`grep "#define SPEEX_VERSION" ./src/codec/speex/libspeex/misc.h | sed -e 's/^.*[Ss][Pp][Ee][Ee][Xx]\-//' -e 's/\"//' -e 's/\/.*//'`
242 AC_MSG_RESULT($LIBVER)
243 AC_MSG_CHECKING(Speex versions)
248 @lib = split /\./, \$libver;
252 @sys = split /\./, \$sysver;
258 if (@sys[\$i] < @lib[\$i]) {
267 SPEEX=`perl t.pl $SYSVER $LIBVER`
269 if test "x$SPEEX" = "x0" ; then
270 AC_MSG_RESULT(OPAL version is more recent)
272 AC_MSG_RESULT(system version is more recent)
273 AC_DEFINE(OPAL_SYSTEM_SPEEX, 1)
274 AC_SUBST(OPAL_SYSTEM_SPEEX, 1)
275 AC_MSG_CHECKING(Speex noise type)
276 if test "${OPAL_HAVE_SPEEX_H}x" != "x" ; then
277 echo "#include <speex.h>" > t.c
278 echo "#include <speex_preprocess.h>" >> t.c
280 echo "#include <speex/speex.h>" > t.c
281 echo "#include <speex/speex_preprocess.h>" >> t.c
285 int main(int argc,char *argv[])
287 struct SpeexPreprocessState *st;
290 speex_preprocess(st, x, echo);
294 cc -Werror -o t t.c -lspeex > /dev/null 2>&1
295 if test \! -x t ; then
296 AC_MSG_RESULT(spx_int32_t)
299 AC_DEFINE(OPAL_SPEEX_FLOAT_NOISE)
307 AC_SUBST(OPAL_HAVE_SPEEX_SPEEX_H)
309 dnl ########################################################################
310 dnl enable audio, video, SIP, H.323 and IAX
312 dnl MSWIN_DISPLAY audio,Audio
313 dnl MSWIN_DEFINE audio,OPAL_AUDIO
314 AC_SUBST(OPAL_AUDIO, 1)
315 AC_DEFINE(OPAL_AUDIO)
318 dnl MSWIN_DISPLAY video,Video
319 dnl MSWIN_DEFINE video,OPAL_VIDEO
320 AC_SUBST(OPAL_VIDEO, 1)
321 AC_DEFINE(OPAL_VIDEO)
324 dnl MSWIN_DISPLAY sip,SIP support
325 dnl MSWIN_DEFINE sip,OPAL_SIP
329 [ --disable-sip disable SIP protocol support],
331 AC_MSG_CHECKING(SIP protocol)
332 if test "$sip" = "yes" ; then
333 AC_SUBST(OPAL_SIP, 1)
335 AC_MSG_RESULT(enabled)
337 AC_MSG_RESULT(disabled)
341 dnl MSWIN_DISPLAY h323,H.323 support
342 dnl MSWIN_DEFINE h323,OPAL_H323
346 [ --disable-h323 disable H.323 protocol support],
348 AC_MSG_CHECKING(H.323 protocol)
349 if test "$h323" = "yes" ; then
350 AC_SUBST(OPAL_H323, 1)
352 AC_MSG_RESULT(enabled)
354 AC_SUBST(OPAL_H323, 0)
355 AC_MSG_RESULT(disabled (T.38 also disabled))
358 AC_SUBST(OPAL_H323, $OPAL_H323)
361 dnl MSWIN_DISPLAY iax2,IAX2 support
362 dnl MSWIN_DEFINE iax2,OPAL_IAX2
366 [ --disable-iax disable IAX2 protocol support],
368 AC_MSG_CHECKING(IAX2 protocol)
369 if test "$iax" = "yes" ; then
370 AC_SUBST(OPAL_IAX2, 1)
372 AC_MSG_RESULT(enabled)
374 AC_MSG_RESULT(disabled)
377 dnl MSWIN_DISPLAY h224,H.224 support
378 dnl MSWIN_DEFINE h224,OPAL_H224
382 [ --disable-h224 disable H.224 protocol support],
384 AC_MSG_CHECKING(H224 protocol)
385 if test "$h224" = "yes" ; then
386 AC_SUBST(OPAL_H224, 1)
388 AC_MSG_RESULT(enabled)
390 AC_MSG_RESULT(disabled)
393 dnl ########################################################################
397 dnl MSWIN_DISPLAY t38,T.38
398 dnl MSWIN_DEFINE t38,OPAL_T38FAX
399 dnl MSWIN_IF_FEATURE t38,h323
402 if test "$t38" = "yes" ; then
404 [ --disable-t38 disable T.38 protocol support],
406 AC_MSG_CHECKING(T.38 protocol)
407 if test "$t38" = "yes" ; then
408 AC_SUBST(OPAL_T38FAX, 1)
409 AC_DEFINE(OPAL_T38FAX)
410 AC_MSG_RESULT(enabled)
412 AC_MSG_RESULT(disabled)
417 dnl ########################################################################
421 dnl MSWIN_DISPLAY h460,H.460
422 dnl MSWIN_DEFINE h460,H323_H460
425 [ --disable-h460 disable H.460])
426 if test "${enable_h460}x" = "x" ; then
429 if test "$enable_h460" == "yes" ; then
431 AC_DEFINE(H323_H460, 1)
434 AC_MSG_NOTICE(Disabling H.460)
438 dnl ########################################################################
440 dnl Quicknet xJACK cards
442 dnl MSWIN_DISPLAY ixj,Quicknet Internet xJACK cards
443 dnl MSWIN_DEFINE ixj,HAS_IXJ
446 AC_CHECK_HEADERS(linux/telephony.h sys/telephony.h /usr/local/include/sys/telephony.h, HAS_IXJ=1)
447 if test "x$HAS_IXJ" != "x" ; then
448 AC_MSG_CHECKING(if ixjuser.h actually compiles)
449 AC_TRY_COMPILE([#include <linux/ixjuser.h>],
450 [int main(int ac,char **av) { return 0; }], HAS_IXJ=1, HAS_IXJ=)
451 if test "x$HAS_IXJ" != "x" ; then
453 AC_DEFINE(HAS_IXJ, 1)
462 dnl ########################################################################
466 dnl MSWIN_DISPLAY vblaster,Voice Blaster
467 dnl MSWIN_DEFINE vblaster,HAS_VBLASTER
469 dnl ########################################################################
471 dnl LID, used for vpb, dialogic etc ...
473 AC_DEFINE(OPAL_LID, 1)
477 dnl ########################################################################
479 dnl VoiceTronics VPB card
481 dnl MSWIN_DISPLAY vpb,Voicetronix vpb support
482 dnl MSWIN_CHECK_FILE vpb,src\vpbapi.h,HAS_VPB=1
483 dnl MSWIN_DIR_SYMBOL vpb,VPB_DIR
484 dnl MSWIN_CHECK_DIR vpb,..\vpb-driver\
485 dnl MSWIN_CHECK_DIR vpb,..\external\vpb-driver
486 dnl MSWIN_CHECK_DIR vpb,\vpb-driver
487 dnl MSWIN_CHECK_DIR vpb,c:\vpb-driver
491 [ --enable-vpb enable voicetronix vpb],
493 AC_MSG_CHECKING(Voicetronix vpb)
494 if test "$vpb" = "yes" ; then
497 AC_MSG_RESULT(enabled)
498 AC_SUBST(OPAL_LID, 1)
502 AC_MSG_RESULT(disabled)
505 dnl ########################################################################
507 dnl Sangoma libraries
510 OLD_CPPFLAGS=$CPPFLAGS
514 AC_CHECK_HEADERS(/usr/local/include/libpri.h, HAS_SANGOMA=1)
515 if test "x$HAS_SANGOMA" != "x" ; then
516 AC_CHECK_HEADERS(/usr/local/include/libsangoma.h, HAS_SANGOMA=1)
517 if test "x$HAS_SANGOMA" != "x" ; then
518 AC_CHECK_LIB(pri, pri_new_cb, HAS_SANGOMA=1)
519 if test "x$HAS_SANGOMA" = "x" ; then
520 AC_MSG_NOTICE(*** If the latest libri is installed in /usr/local/lib, ensure it is not obscured by an older version in /usr/lib)
522 AC_CHECK_LIB(sangoma, sangoma_create_socket, HAS_SANGOMA=1)
523 if test "x$HAS_SANGOMA" != "x" ; then
524 AC_DEFINE(HAS_SANGOMA, 1)
530 AC_SUBST(HAS_SANGOMA)
532 CPPFLAGS=$OLD_CPPFLAGS
534 dnl ########################################################################
539 dnl MSWIN_DISPLAY libsrtp,Cisco libSRTP support
540 dnl MSWIN_CHECK_FILE libsrtp,include\srtp.h,HAS_LIBSRTP=1
541 dnl MSWIN_DIR_SYMBOL libsrtp,LIBSRTP_DIR
542 dnl MSWIN_CHECK_DIR libsrtp,.\srtp
543 dnl MSWIN_CHECK_DIR libsrtp,..\external\srtp
544 dnl MSWIN_CHECK_DIR libsrtp,c:\libs
547 dnl ########################################################################
548 dnl output make directives
555 dnl ########################################################################
556 dnl Output configured files
558 AC_CONFIG_SUBDIRS(plugins)
560 dnl ########################################################################
561 dnl output header file
563 AC_CONFIG_FILES(opal_inc.mak)
564 AC_CONFIG_FILES(Makefile)
565 AC_CONFIG_HEADERS(include/opal/buildopts.h)
567 AC_OUTPUT(src/codec/speex/libspeex/speex_config_types.h)