1 AC_DEFUN([AST_CHECK_PWLIB_PLATFORM], [
4 linux*) PWLIB_OSTYPE=linux ;
6 freebsd* ) PWLIB_OSTYPE=FreeBSD ;
8 openbsd* ) PWLIB_OSTYPE=OpenBSD ;
9 ENDLDLIBS="-lossaudio" ;
11 netbsd* ) PWLIB_OSTYPE=NetBSD ;
12 ENDLDLIBS="-lossaudio" ;
14 solaris* | sunos* ) PWLIB_OSTYPE=solaris ;
16 darwin* ) PWLIB_OSTYPE=Darwin ;
18 beos*) PWLIB_OSTYPE=beos ;
19 STDCCFLAGS="$STDCCFLAGS -D__BEOS__"
21 cygwin*) PWLIB_OSTYPE=cygwin ;
23 mingw*) PWLIB_OSTYPE=mingw ;
24 STDCCFLAGS="$STDCCFLAGS -mms-bitfields" ;
25 ENDLDLIBS="-lwinmm -lwsock32 -lsnmpapi -lmpr -lcomdlg32 -lgdi32 -lavicap32" ;
27 * ) PWLIB_OSTYPE="$host_os" ;
28 AC_MSG_WARN("OS $PWLIB_OSTYPE not recognized - proceed with caution!") ;
34 x86 | i686 | i586 | i486 | i386 ) PWLIB_MACHTYPE=x86
37 x86_64) PWLIB_MACHTYPE=x86_64 ;
42 alpha | alphaev56 | alphaev6 | alphaev67 | alphaev7) PWLIB_MACHTYPE=alpha ;
46 sparc ) PWLIB_MACHTYPE=sparc ;
49 powerpc ) PWLIB_MACHTYPE=ppc ;
52 ppc ) PWLIB_MACHTYPE=ppc ;
55 powerpc64 ) PWLIB_MACHTYPE=ppc64 ;
60 ppc64 ) PWLIB_MACHTYPE=ppc64 ;
65 ia64) PWLIB_MACHTYPE=ia64 ;
69 s390x) PWLIB_MACHTYPE=s390x ;
74 s390) PWLIB_MACHTYPE=s390 ;
77 * ) PWLIB_MACHTYPE="$host_cpu";
78 AC_MSG_WARN("CPU $PWLIB_MACHTYPE not recognized - proceed with caution!") ;;
81 PWLIB_PLATFORM="${PWLIB_OSTYPE}_${PWLIB_MACHTYPE}"
83 AC_SUBST([PWLIB_PLATFORM])
86 AC_DEFUN([AST_CHECK_PWLIB], [
90 if test "${PWLIBDIR:-unset}" != "unset" ; then
91 AC_CHECK_HEADER(${PWLIBDIR}/version.h, HAS_PWLIB=1, )
93 if test "${HAS_PWLIB:-unset}" = "unset" ; then
94 if test "${OPENH323DIR:-unset}" != "unset"; then
95 AC_CHECK_HEADER(${OPENH323DIR}/../pwlib/version.h, HAS_PWLIB=1, )
97 if test "${HAS_PWLIB:-unset}" != "unset" ; then
98 PWLIBDIR="${OPENH323DIR}/../pwlib"
100 AC_CHECK_HEADER(${HOME}/pwlib/include/ptlib.h, HAS_PWLIB=1, )
101 if test "${HAS_PWLIB:-unset}" != "unset" ; then
102 PWLIBDIR="${HOME}/pwlib"
104 AC_CHECK_HEADER(/usr/local/include/ptlib.h, HAS_PWLIB=1, )
105 if test "${HAS_PWLIB:-unset}" != "unset" ; then
106 AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/local/bin$PATH_SEPARATOR/usr/local/share/pwlib/make)
107 PWLIB_INCDIR="/usr/local/include"
108 PWLIB_LIBDIR=`${PTLIB_CONFIG} --pwlibdir 2>/dev/null`
109 if test "${PWLIB_LIBDIR:-unset}" = "unset"; then
110 PWLIB_LIBDIR=`${PTLIB_CONFIG} --ptlibdir 2>/dev/null`
112 if test "${PWLIB_LIBDIR:-unset}" = "unset"; then
113 if test "x$LIB64" != "x"; then
114 PWLIB_LIBDIR="/usr/local/lib64"
116 PWLIB_LIBDIR="/usr/local/lib"
119 PWLIB_LIB=`${PTLIB_CONFIG} --ldflags --libs`
120 PWLIB_LIB="-L${PWLIB_LIBDIR} `echo ${PWLIB_LIB}`"
122 AC_CHECK_HEADER(/usr/include/ptlib.h, HAS_PWLIB=1, )
123 if test "${HAS_PWLIB:-unset}" != "unset" ; then
124 AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/bin$PATH_SEPARATOR/usr/share/pwlib/make)
125 PWLIB_INCDIR="/usr/include"
126 PWLIB_LIBDIR=`${PTLIB_CONFIG} --pwlibdir 2>/dev/null`
127 if test "${PWLIB_LIBDIR:-unset}" = "unset"; then
128 PWLIB_LIBDIR=`${PTLIB_CONFIG} --ptlibdir 2>/dev/null`
130 if test "${PWLIB_LIBDIR:-unset}" = "unset"; then
131 if test "x$LIB64" != "x"; then
132 PWLIB_LIBDIR="/usr/lib64"
134 PWLIB_LIBDIR="/usr/lib"
137 PWLIB_LIB=`${PTLIB_CONFIG} --ldflags --libs`
138 PWLIB_LIB="-L${PWLIB_LIBDIR} `echo ${PWLIB_LIB}`"
145 #if test "${HAS_PWLIB:-unset}" = "unset" ; then
146 # echo "Cannot find pwlib - please install or set PWLIBDIR and try again"
150 if test "${HAS_PWLIB:-unset}" != "unset" ; then
151 if test "${PWLIBDIR:-unset}" = "unset" ; then
152 if test "${PTLIB_CONFIG:-unset}" != "unset" ; then
153 PWLIBDIR=`$PTLIB_CONFIG --prefix`
155 echo "Cannot find ptlib-config - please install and try again"
160 if test "x$PWLIBDIR" = "x/usr" -o "x$PWLIBDIR" = "x/usr/"; then
161 PWLIBDIR="/usr/share/pwlib"
162 PWLIB_INCDIR="/usr/include"
163 if test "x$LIB64" != "x"; then
164 PWLIB_LIBDIR="/usr/lib64"
166 PWLIB_LIBDIR="/usr/lib"
169 if test "x$PWLIBDIR" = "x/usr/local" -o "x$PWLIBDIR" = "x/usr/"; then
170 PWLIBDIR="/usr/local/share/pwlib"
171 PWLIB_INCDIR="/usr/local/include"
172 if test "x$LIB64" != "x"; then
173 PWLIB_LIBDIR="/usr/local/lib64"
175 PWLIB_LIBDIR="/usr/local/lib"
179 if test "${PWLIB_INCDIR:-unset}" = "unset"; then
180 PWLIB_INCDIR="${PWLIBDIR}/include"
182 if test "${PWLIB_LIBDIR:-unset}" = "unset"; then
183 PWLIB_LIBDIR="${PWLIBDIR}/lib"
187 AC_SUBST([PWLIB_INCDIR])
188 AC_SUBST([PWLIB_LIBDIR])
193 AC_DEFUN([AST_CHECK_PWLIB_VERSION], [
194 if test "x$7" != "x"; then
200 if test "${HAS_$2:-unset}" != "unset"; then
201 $2_VERSION=`grep "$VNAME" ${$2_INCDIR}/$3 | sed -e 's/[[[:space:]]]\{1,\}/ /g' | cut -f3 -d ' ' | sed -e 's/"//g'`
202 $2_MAJOR_VERSION=`echo ${$2_VERSION} | cut -f1 -d.`
203 $2_MINOR_VERSION=`echo ${$2_VERSION} | cut -f2 -d.`
204 $2_BUILD_NUMBER=`echo ${$2_VERSION} | cut -f3 -d.`
205 $2_VER=$((${$2_MAJOR_VERSION}*10000+${$2_MINOR_VERSION}*100+${$2_BUILD_NUMBER}))
206 $2_REQ=$(($4*10000+$5*100+$6))
207 if test "x$10" = "x"; then
210 $2_MAX=$(($8*10000+$9*100+$10))
213 AC_MSG_CHECKING(if $1 version ${$2_VERSION} is compatible with chan_h323)
214 if test ${$2_VER} -lt ${$2_REQ}; then
218 if test ${$2_VER} -gt ${$2_MAX}; then
228 AC_DEFUN([AST_CHECK_PWLIB_BUILD], [
229 if test "${HAS_$2:-unset}" != "unset"; then
230 AC_MSG_CHECKING($1 installation validity)
232 saved_cppflags="${CPPFLAGS}"
234 if test "${$2_LIB:-unset}" != "unset"; then
235 LIBS="${LIBS} ${$2_LIB} $7"
237 LIBS="${LIBS} -L${$2_LIBDIR} -l${PLATFORM_$2} $7"
239 CPPFLAGS="${CPPFLAGS} -I${$2_INCDIR} $6"
244 [AC_LANG_PROGRAM([$4],[$5])],
256 CPPFLAGS="${saved_cppflags}"
258 if test "${ac_cv_lib_$2}" = "yes"; then
259 if test "${$2_LIB:-undef}" = "undef"; then
260 if test "${$2_LIBDIR}" != "" -a "${$2_LIBDIR}" != "/usr/lib"; then
261 $2_LIB="-L${$2_LIBDIR} -l${PLATFORM_$2}"
263 $2_LIB="-l${PLATFORM_$2}"
266 if test "${$2_INCDIR}" != "" -a "${$2_INCDIR}" != "/usr/include"; then
267 $2_INCLUDE="-I${$2_INCDIR}"
270 AC_DEFINE([HAVE_$2], 1, [$3])