1 AC_INIT(include/opal/manager.h)
5 dnl ########################################################################
6 dnl set the OPAL directory to the current directory
11 dnl ########################################################################
12 dnl set the PREFIX accordingly
13 if test "x$prefix" = "xNONE"; then
14 INSTALLPREFIX="/usr/local"
16 INSTALLPREFIX="${prefix}"
19 AC_SUBST(INSTALLPREFIX)
21 dnl ########################################################################
22 dnl set LIBDIR accordingly
27 dnl ########################################################################
28 dnl extract the OPAL version
29 MAJOR_VERSION=`cat ${OPALDIR}/version.h | grep MAJOR_VERSION | cut -f3 -d' '`
30 MINOR_VERSION=`cat ${OPALDIR}/version.h | grep MINOR_VERSION | cut -f3 -d' '`
31 BUILD_NUMBER=`cat ${OPALDIR}/version.h | grep BUILD_NUMBER | cut -f3 -d' '`
32 OPAL_VERSION="${MAJOR_VERSION}.${MINOR_VERSION}.${BUILD_NUMBER}"
33 AC_DEFINE_UNQUOTED(OPAL_MAJOR, ${MAJOR_VERSION})
34 AC_DEFINE_UNQUOTED(OPAL_MINOR, ${MINOR_VERSION})
35 AC_DEFINE_UNQUOTED(OPAL_BUILD, ${BUILD_NUMBER})
36 AC_DEFINE_UNQUOTED(OPAL_VERSION, "$OPAL_VERSION")
39 dnl ########################################################################
40 dnl look for ptlib, use a preference order of explicit PWLIBDIR, directory
41 dnl at same level, home directory, /usr/local or /usr.
43 if test "${PWLIBDIR:-unset}" != "unset" ; then
44 AC_CHECK_FILE(${PWLIBDIR}/version.h, HAS_PTLIB=1)
46 if test "${HAS_PTLIB:-unset}" = "unset" ; then
47 AC_CHECK_FILE(${OPALDIR}/../pwlib/version.h, HAS_PTLIB=1)
48 if test "${HAS_PTLIB:-unset}" != "unset" ; then
49 PWLIBDIR="${OPALDIR}/../pwlib"
51 AC_CHECK_FILE(${HOME}/pwlib/include/ptlib.h, HAS_PTLIB=1)
52 if test "${HAS_PTLIB:-unset}" != "unset" ; then
53 PWLIBDIR="${HOME}/pwlib"
55 AC_CHECK_FILE(/usr/local/include/ptlib.h, HAS_PTLIB=1)
56 if test "${HAS_PTLIB:-unset}" != "unset" ; then
57 AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/local/bin)
59 AC_CHECK_FILE(/usr/include/ptlib.h, HAS_PTLIB=1)
60 if test "${HAS_PTLIB:-unset}" != "unset" ; then
61 AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/share/pwlib/make/)
68 if test "${HAS_PTLIB:-unset}" = "unset" ; then
69 echo "Cannot find pwlib - please install or set PWLIBDIR and try again"
73 if test "${PWLIBDIR:-unset}" = "unset" ; then
74 if test "${PTLIB_CONFIG:-unset}" = "unset" ; then
75 echo "Cannot find ptlib-config - please install and try again"
78 PWLIBDIR=`$PTLIB_CONFIG --prefix`
81 if test "x$PWLIBDIR" = "x/usr" -o "x$PWLIBDIR" = "x/usr/"; then
82 PWLIBDIR="/usr/share/pwlib/"
84 if test "x$PWLIBDIR" = "x/usr/local" -o "x$PWLIBDIR" = "x/usr/"; then
85 PWLIBDIR="/usr/local/share/pwlib/"
88 echo "PWLib prefix set to.... $PWLIBDIR"
93 dnl ########################################################################
94 dnl Look for G.729 codec
96 dnl MSWIN_DISPLAY vag729,Voice Age G.729A
97 dnl MSWIN_CHECK_FILE vag729,va_g729a.h,VOICE_AGE_G729A=1
98 dnl MSWIN_DIR_SYMBOL vag729,VOICE_AGE_DIR
99 dnl MSWIN_CHECK_DIR vag729,..\va_g729\
100 dnl MSWIN_CHECK_DIR vag729,..\external\va_g729
101 dnl MSWIN_CHECK_DIR vag729,\va_g729
102 dnl MSWIN_CHECK_DIR vag729,c:\va_g729
105 dnl ########################################################################
106 dnl Look for system libspeex
109 AC_ARG_ENABLE(localspeex,
110 [ --enable-localspeex use local version of Speex library rather than system version],
111 localspeex=$enableval)
113 if test "${localspeex}" = "yes" ; then
114 AC_MSG_NOTICE(Forcing use of local Speex sources)
115 elif test "${localspeex}" = "no" ; then
116 AC_MSG_NOTICE(Forcing use of system Speex library)
117 AC_DEFINE(OPAL_SYSTEM_SPEEX, 1)
118 AC_SUBST(OPAL_SYSTEM_SPEEX, 1)
120 AC_CHECK_LIB(speex, speex_encoder_destroy, SPEEX=1)
121 if test "x$SPEEX" = "x"; then
122 AC_MSG_NOTICE(Forcing use of local Speex library)
124 AC_MSG_CHECKING(system Speex version)
127 #include <speex_header.h>
129 int main(int argc,char *argv[])
132 speex_init_header(&header, 1, 1, &speex_nb_mode);
133 printf("%s\n", header.speex_version);
136 cc -o t t.c -lspeex > /dev/null 2>&1
137 if test \! -x t ; then
138 AC_MSG_RESULT(cannot determine - using library version)
142 AC_MSG_RESULT($SYSVER)
143 AC_MSG_CHECKING(library Speex version)
144 LIBVER=`grep "#define VERSION" ./src/codec/speex/libspeex/misc.h | sed -e 's/^.*[Ss][Pp][Ee][Ee][Xx]\-//' -e 's/\"//'`
145 AC_MSG_RESULT($LIBVER)
146 AC_MSG_CHECKING(Speex versions)
151 @lib = split /\./, \$libver;
155 @sys = split /\./, \$sysver;
161 print "comparing " . @sys[\$i] . " and " . @lib[\$i] . "\n";
162 if (\@sys[\$i] < @lib[\$i]) {
171 SPEEX=`perl t.pl $SYSVER $LIBVER`
173 if test "x$SPEEX" = "x" ; then
174 AC_MSG_RESULT(library version is more recent)
176 AC_MSG_RESULT(system version is more recent)
177 AC_DEFINE(OPAL_SYSTEM_SPEEX, 1)
178 AC_SUBST(OPAL_SYSTEM_SPEEX, 1)
185 dnl ########################################################################
186 dnl check if SIP, H.323 and IAX2 are enabled
188 dnl MSWIN_DISPLAY sip,SIP support
189 dnl MSWIN_DEFINE sip,OPAL_SIP
193 [ --disable-sip disable SIP protocol support],
195 AC_MSG_CHECKING(SIP protocol)
196 if test "$sip" = "yes" ; then
197 AC_SUBST(OPAL_SIP, 1)
199 AC_MSG_RESULT(enabled)
201 AC_SUBST(OPAL_SIP, 0)
202 AC_MSG_RESULT(disabled)
205 dnl MSWIN_DISPLAY h323,H.323 support
206 dnl MSWIN_DEFINE h323,OPAL_H323
210 [ --disable-h323 disable H.323 protocol support],
212 AC_MSG_CHECKING(H.323 protocol)
213 if test "$h323" = "yes" ; then
214 AC_SUBST(OPAL_H323, 1)
216 AC_MSG_RESULT(enabled)
218 AC_SUBST(OPAL_H323, 0)
219 AC_MSG_RESULT(disabled)
221 AC_SUBST(OPAL_H323, $OPAL_H323)
223 dnl MSWIN_DISPLAY iax2,IAX2 support
224 dnl MSWIN_DEFINE iax2,OPAL_IAX2
228 [ --disable-iax disable IAX2 protocol support],
230 AC_MSG_CHECKING(IAX2 protocol)
231 if test "$iax" = "yes" ; then
232 AC_SUBST(OPAL_IAX2, 1)
234 AC_MSG_RESULT(enabled)
236 AC_SUBST(OPAL_IAX2, 0)
237 AC_MSG_RESULT(disabled)
240 dnl ########################################################################
242 dnl Quicknet xJACK cards
244 dnl MSWIN_DISPLAY ixj,Quicknet Internet xJACK cards
245 dnl MSWIN_DEFINE ixj,HAS_IXJ
248 AC_CHECK_HEADERS(linux/telephony.h sys/telephony.h /usr/local/include/sys/telephony.h, HAS_IXJ=1)
249 if test "x$HAS_IXJ" != "x" ; then
250 AC_DEFINE(HAS_IXJ, 1)
256 dnl ########################################################################
260 dnl MSWIN_DISPLAY vblaster,Voice Blaster
261 dnl MSWIN_DEFINE vblaster,HAS_VBLASTER
264 dnl ########################################################################
266 dnl VoiceTronics VPB card
268 dnl MSWIN_DISPLAY vpb,VoiceTronics VPB
269 dnl MSWIN_CHECK_FILE vpb,src\vpbapi.h,HAS_VPB=1
270 dnl MSWIN_DIR_SYMBOL vpb,VPB_DIR
271 dnl MSWIN_CHECK_DIR vpb,..\vpb-driver\
272 dnl MSWIN_CHECK_DIR vpb,..\external\vpb-driver
273 dnl MSWIN_CHECK_DIR vpb,\vpb-driver
274 dnl MSWIN_CHECK_DIR vpb,c:\vpb-driver
277 dnl ########################################################################
278 dnl output make directives
285 dnl ########################################################################
286 dnl output header file
288 AC_CONFIG_FILES(opal_inc.mak)
289 AC_CONFIG_FILES(Makefile)
290 AC_CONFIG_HEADERS(include/opal/buildopts.h)