1 AC_DEFUN([AST_CHECK_PWLIB], [
5 if test "${PWLIBDIR:-unset}" != "unset" ; then
6 AC_CHECK_HEADER(${PWLIBDIR}/version.h, HAS_PWLIB=1, )
8 if test "${HAS_PWLIB:-unset}" = "unset" ; then
9 if test "${OPENH323DIR:-unset}" != "unset"; then
10 AC_CHECK_HEADER(${OPENH323DIR}/../pwlib/version.h, HAS_PWLIB=1, )
12 if test "${HAS_PWLIB:-unset}" != "unset" ; then
13 PWLIBDIR="${OPENH323DIR}/../pwlib"
15 AC_CHECK_HEADER(${HOME}/pwlib/include/ptlib.h, HAS_PWLIB=1, )
16 if test "${HAS_PWLIB:-unset}" != "unset" ; then
17 PWLIBDIR="${HOME}/pwlib"
19 AC_CHECK_HEADER(/usr/local/include/ptlib.h, HAS_PWLIB=1, )
20 if test "${HAS_PWLIB:-unset}" != "unset" ; then
21 AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/local/bin)
22 if test "${PTLIB_CONFIG:-unset}" = "unset" ; then
23 AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/local/share/pwlib/make)
25 PWLIB_INCDIR="/usr/local/include"
26 PWLIB_LIBDIR=`${PTLIB_CONFIG} --pwlibdir`
27 if test "${PWLIB_LIBDIR:-unset}" = "unset"; then
28 if test "x$LIB64" != "x"; then
29 PWLIB_LIBDIR="/usr/local/lib64"
31 PWLIB_LIBDIR="/usr/local/lib"
34 PWLIB_LIB=`${PTLIB_CONFIG} --ldflags --libs`
35 PWLIB_LIB="-L${PWLIB_LIBDIR} `echo ${PWLIB_LIB}`"
37 AC_CHECK_HEADER(/usr/include/ptlib.h, HAS_PWLIB=1, )
38 if test "${HAS_PWLIB:-unset}" != "unset" ; then
39 AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/share/pwlib/make)
40 PWLIB_INCDIR="/usr/include"
41 PWLIB_LIBDIR=`${PTLIB_CONFIG} --pwlibdir`
42 if test "${PWLIB_LIBDIR:-unset}" = "unset"; then
43 if test "x$LIB64" != "x"; then
44 PWLIB_LIBDIR="/usr/lib64"
46 PWLIB_LIBDIR="/usr/lib"
49 PWLIB_LIB=`${PTLIB_CONFIG} --ldflags --libs`
50 PWLIB_LIB="-L${PWLIB_LIBDIR} `echo ${PWLIB_LIB}`"
57 #if test "${HAS_PWLIB:-unset}" = "unset" ; then
58 # echo "Cannot find pwlib - please install or set PWLIBDIR and try again"
62 if test "${HAS_PWLIB:-unset}" != "unset" ; then
63 if test "${PWLIBDIR:-unset}" = "unset" ; then
64 if test "${PTLIB_CONFIG:-unset}" != "unset" ; then
65 PWLIBDIR=`$PTLIB_CONFIG --prefix`
67 echo "Cannot find ptlib-config - please install and try again"
72 if test "x$PWLIBDIR" = "x/usr" -o "x$PWLIBDIR" = "x/usr/"; then
73 PWLIBDIR="/usr/share/pwlib"
74 PWLIB_INCDIR="/usr/include"
75 if test "x$LIB64" != "x"; then
76 PWLIB_LIBDIR="/usr/lib64"
78 PWLIB_LIBDIR="/usr/lib"
81 if test "x$PWLIBDIR" = "x/usr/local" -o "x$PWLIBDIR" = "x/usr/"; then
82 PWLIBDIR="/usr/local/share/pwlib"
83 PWLIB_INCDIR="/usr/local/include"
84 if test "x$LIB64" != "x"; then
85 PWLIB_LIBDIR="/usr/local/lib64"
87 PWLIB_LIBDIR="/usr/local/lib"
91 if test "${PWLIB_INCDIR:-unset}" = "unset"; then
92 PWLIB_INCDIR="${PWLIBDIR}/include"
94 if test "${PWLIB_LIBDIR:-unset}" = "unset"; then
95 PWLIB_LIBDIR="${PWLIBDIR}/lib"
99 AC_SUBST([PWLIB_INCDIR])
100 AC_SUBST([PWLIB_LIBDIR])
105 AC_DEFUN([AST_CHECK_PWLIB_VERSION], [
106 if test "${HAS_$2:-unset}" != "unset"; then
107 $2_VERSION=`grep "$2_VERSION" ${$2_INCDIR}/$3 | sed -e 's/[[[:space:]]]\{1,\}/ /g' | cut -f3 -d ' ' | sed -e 's/"//g'`
108 $2_MAJOR_VERSION=`echo ${$2_VERSION} | cut -f1 -d.`
109 $2_MINOR_VERSION=`echo ${$2_VERSION} | cut -f2 -d.`
110 $2_BUILD_NUMBER=`echo ${$2_VERSION} | cut -f3 -d.`
111 let $2_VER=${$2_MAJOR_VERSION}*10000+${$2_MINOR_VERSION}*100+${$2_BUILD_NUMBER}
112 let $2_REQ=$4*10000+$5*100+$6
114 AC_MSG_CHECKING(if $1 version ${$2_VERSION} is compatible with chan_h323)
115 if test ${$2_VER} -lt ${$2_REQ}; then
124 AC_DEFUN([AST_CHECK_PWLIB_BUILD], [
125 if test "${HAS_$2:-unset}" != "unset"; then
126 AC_MSG_CHECKING($1 installation validity)
128 saved_cppflags="${CPPFLAGS}"
130 if test "${$2_LIB:-unset}" != "unset"; then
131 LIBS="${LIBS} ${$2_LIB} $7"
133 LIBS="${LIBS} -L${$2_LIBDIR} -l${PLATFORM_$2} $7"
135 CPPFLAGS="${CPPFLAGS} -I${$2_INCDIR} $6"
140 [AC_LANG_PROGRAM([$4],[$5])],
152 CPPFLAGS="${saved_cppflags}"
154 if test "${ac_cv_lib_$2}" = "yes"; then
155 if test "${$2_LIB:-undef}" = "undef"; then
156 if test "${$2_LIBDIR}" != "" -a "${$2_LIBDIR}" != "/usr/lib"; then
157 $2_LIB="-L${$2_LIBDIR} -l${PLATFORM_$2}"
159 $2_LIB="-l${PLATFORM_$2}"
162 if test "${$2_INCDIR}" != "" -a "${$2_INCDIR}" != "/usr/include"; then
163 $2_INCLUDE="-I${$2_INCDIR}"
166 AC_DEFINE([HAVE_$2], 1, [$3])