ast_check_openh323.m4 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. AC_DEFUN([AST_CHECK_OPENH323], [
  2. OPENH323_INCDIR=
  3. OPENH323_LIBDIR=
  4. AC_LANG_PUSH([C++])
  5. if test "${OPENH323DIR:-unset}" != "unset" ; then
  6. AC_CHECK_HEADER(${OPENH323DIR}/version.h, HAS_OPENH323=1, )
  7. fi
  8. if test "${HAS_OPENH323:-unset}" = "unset" ; then
  9. AC_CHECK_HEADER(${PWLIBDIR}/../openh323/version.h, OPENH323DIR="${PWLIBDIR}/../openh323"; HAS_OPENH323=1, )
  10. if test "${HAS_OPENH323:-unset}" != "unset" ; then
  11. OPENH323DIR="${PWLIBDIR}/../openh323"
  12. saved_cppflags="${CPPFLAGS}"
  13. CPPFLAGS="${CPPFLAGS} -I${PWLIB_INCDIR}/openh323 -I${PWLIB_INCDIR}"
  14. AC_CHECK_HEADER(${OPENH323DIR}/include/h323.h, , OPENH323_INCDIR="${PWLIB_INCDIR}/openh323"; OPENH323_LIBDIR="${PWLIB_LIBDIR}", [#include <ptlib.h>])
  15. CPPFLAGS="${saved_cppflags}"
  16. else
  17. saved_cppflags="${CPPFLAGS}"
  18. CPPFLAGS="${CPPFLAGS} -I${HOME}/openh323/include -I${PWLIB_INCDIR}"
  19. AC_CHECK_HEADER(${HOME}/openh323/include/h323.h, HAS_OPENH323=1, , [#include <ptlib.h>])
  20. CPPFLAGS="${saved_cppflags}"
  21. if test "${HAS_OPENH323:-unset}" != "unset" ; then
  22. OPENH323DIR="${HOME}/openh323"
  23. else
  24. saved_cppflags="${CPPFLAGS}"
  25. CPPFLAGS="${CPPFLAGS} -I/usr/local/include/openh323 -I${PWLIB_INCDIR}"
  26. AC_CHECK_HEADER(/usr/local/include/openh323/h323.h, HAS_OPENH323=1, , [#include <ptlib.h>])
  27. CPPFLAGS="${saved_cppflags}"
  28. if test "${HAS_OPENH323:-unset}" != "unset" ; then
  29. OPENH323DIR="/usr/local/share/openh323"
  30. OPENH323_INCDIR="/usr/local/include/openh323"
  31. if test "x$LIB64" != "x" && test -d "/usr/local/lib64"; then
  32. OPENH323_LIBDIR="/usr/local/lib64"
  33. else
  34. OPENH323_LIBDIR="/usr/local/lib"
  35. fi
  36. else
  37. saved_cppflags="${CPPFLAGS}"
  38. CPPFLAGS="${CPPFLAGS} -I/usr/include/openh323 -I${PWLIB_INCDIR}"
  39. AC_CHECK_HEADER(/usr/include/openh323/h323.h, HAS_OPENH323=1, , [#include <ptlib.h>])
  40. CPPFLAGS="${saved_cppflags}"
  41. if test "${HAS_OPENH323:-unset}" != "unset" ; then
  42. OPENH323DIR="/usr/share/openh323"
  43. OPENH323_INCDIR="/usr/include/openh323"
  44. if test "x$LIB64" != "x" && test -d "/usr/local/lib64"; then
  45. OPENH323_LIBDIR="/usr/lib64"
  46. else
  47. OPENH323_LIBDIR="/usr/lib"
  48. fi
  49. fi
  50. fi
  51. fi
  52. fi
  53. fi
  54. if test "${HAS_OPENH323:-unset}" != "unset" ; then
  55. if test "${OPENH323_INCDIR:-unset}" = "unset"; then
  56. OPENH323_INCDIR="${OPENH323DIR}/include"
  57. fi
  58. if test "${OPENH323_LIBDIR:-unset}" = "unset"; then
  59. OPENH323_LIBDIR="${OPENH323DIR}/lib"
  60. fi
  61. OPENH323_LIBDIR="`cd ${OPENH323_LIBDIR}; pwd`"
  62. OPENH323_INCDIR="`cd ${OPENH323_INCDIR}; pwd`"
  63. OPENH323DIR="`cd ${OPENH323DIR}; pwd`"
  64. AC_SUBST([OPENH323DIR])
  65. AC_SUBST([OPENH323_INCDIR])
  66. AC_SUBST([OPENH323_LIBDIR])
  67. fi
  68. AC_LANG_POP([C++])
  69. ])
  70. AC_DEFUN([AST_CHECK_OPENH323_BUILD], [
  71. if test "${HAS_OPENH323:-unset}" != "unset"; then
  72. AC_MSG_CHECKING(OpenH323 build option)
  73. OPENH323_SUFFIX=
  74. prefixes="h323_${PWLIB_PLATFORM}_ h323_ openh323"
  75. for pfx in $prefixes; do
  76. #files=`ls -l /usr/local/lib/lib${pfx}*.so* 2>/dev/null`
  77. files=`ls -l ${OPENH323_LIBDIR}/lib${pfx}*.so* 2>/dev/null`
  78. if test -z "$files"; then
  79. # check the default location
  80. files=`ls -l /usr/local/lib/lib${pfx}*.so* 2>/dev/null`
  81. fi
  82. libfile=
  83. if test -n "$files"; then
  84. for f in $files; do
  85. if test -f $f -a ! -L $f; then
  86. libfile=`basename $f`
  87. break;
  88. fi
  89. done
  90. fi
  91. if test -n "$libfile"; then
  92. OPENH323_PREFIX=$pfx
  93. break;
  94. fi
  95. done
  96. if test "${libfile:-unset}" != "unset"; then
  97. OPENH323_SUFFIX=`eval "echo ${libfile} | sed -e 's/lib${OPENH323_PREFIX}\(@<:@^.@:>@*\)\..*/\1/'"`
  98. fi
  99. case "${OPENH323_SUFFIX}" in
  100. n)
  101. OPENH323_BUILD="notrace";;
  102. r)
  103. OPENH323_BUILD="opt";;
  104. d)
  105. OPENH323_BUILD="debug";;
  106. *)
  107. if test "${OPENH323_PREFIX:-undef}" = "openh323"; then
  108. notrace=`eval "grep NOTRACE ${OPENH323DIR}/openh323u.mak | grep = | sed -e 's/@<:@A-Z0-9_@:>@*@<:@ @:>@*=@<:@ @:>@*//'"`
  109. if test "x$notrace" = "x"; then
  110. notrace="0"
  111. fi
  112. if test "$notrace" -ne 0; then
  113. OPENH323_BUILD="notrace"
  114. else
  115. OPENH323_BUILD="opt"
  116. fi
  117. OPENH323_LIB="-l${OPENH323_PREFIX}"
  118. else
  119. OPENH323_BUILD="notrace"
  120. fi
  121. ;;
  122. esac
  123. AC_MSG_RESULT(${OPENH323_BUILD})
  124. AC_SUBST([OPENH323_SUFFIX])
  125. AC_SUBST([OPENH323_BUILD])
  126. fi
  127. ])