sofia-sip.m4 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. dnl
  2. dnl UNIMRCP_CHECK_SOFIA
  3. dnl
  4. dnl This macro attempts to find the Sofia-SIP library and
  5. dnl set corresponding variables on exit.
  6. dnl
  7. AC_DEFUN([UNIMRCP_CHECK_SOFIA],
  8. [
  9. AC_MSG_NOTICE([Sofia SIP library configuration])
  10. AC_MSG_CHECKING([for Sofia-SIP])
  11. AC_ARG_WITH(sofia-sip,
  12. [ --with-sofia-sip=PATH prefix for installed Sofia-SIP,
  13. path to Sofia-SIP source/build tree,
  14. or the full path to Sofia-SIP pkg-config],
  15. [sofia_path=$withval],
  16. [sofia_path="/usr/local"]
  17. )
  18. found_sofia="no"
  19. if test -n "$PKG_CONFIG"; then
  20. dnl Check for installed Sofia-SIP
  21. for dir in $sofia_path ; do
  22. sofia_config_path=$dir/lib/pkgconfig/sofia-sip-ua.pc
  23. if test -f "$sofia_config_path" && $PKG_CONFIG $sofia_config_path > /dev/null 2>&1; then
  24. found_sofia="yes"
  25. break
  26. fi
  27. done
  28. dnl Check for full path to Sofia-SIP pkg-config file
  29. if test "$found_sofia" != "yes" && test -f "$sofia_path" && $PKG_CONFIG $sofia_path > /dev/null 2>&1 ; then
  30. found_sofia="yes"
  31. sofia_config_path=$sofia_path
  32. fi
  33. if test "$found_sofia" = "yes" ; then
  34. UNIMRCP_SOFIA_INCLUDES="`$PKG_CONFIG --cflags $sofia_config_path`"
  35. UNIMRCP_SOFIA_LIBS="`$PKG_CONFIG --libs $sofia_config_path`"
  36. sofia_version="`$PKG_CONFIG --modversion $sofia_config_path`"
  37. fi
  38. fi
  39. if test "$found_sofia" != "yes" ; then
  40. dnl Check for path to Sofia-SIP source/build tree
  41. for dir in $sofia_path ; do
  42. sofia_uadir="$dir/libsofia-sip-ua"
  43. if test -d "$sofia_uadir"; then
  44. found_sofia="yes"
  45. sofia_abs_uadir="`cd $sofia_uadir && pwd`"
  46. UNIMRCP_SOFIA_INCLUDES="-I$sofia_abs_uadir -I$sofia_abs_uadir/bnf -I$sofia_abs_uadir/features -I$sofia_abs_uadir/http -I$sofia_abs_uadir/ipt -I$sofia_abs_uadir/iptsec -I$sofia_abs_uadir/msg -I$sofia_abs_uadir/nea -I$sofia_abs_uadir/nta -I$sofia_abs_uadir/nth -I$sofia_abs_uadir/nua -I$sofia_abs_uadir/sdp -I$sofia_abs_uadir/sip -I$sofia_abs_uadir/soa -I$sofia_abs_uadir/sresolv -I$sofia_abs_uadir/stun -I$sofia_abs_uadir/su -I$sofia_abs_uadir/tport -I$sofia_abs_uadir/url"
  47. UNIMRCP_SOFIA_LIBS="$sofia_abs_uadir/libsofia-sip-ua.la"
  48. sofia_version="`sed -n 's/#define SOFIA_SIP_VERSION.* "\(.*\)"/\1/p' $sofia_uadir/features/sofia-sip/sofia_features.h`"
  49. break
  50. fi
  51. done
  52. fi
  53. if test $found_sofia != "yes" ; then
  54. if test -n "$PKG_CONFIG"; then
  55. AC_MSG_ERROR(Cannot find Sofia-SIP - looked for sofia-config and libsofia-sip-ua in $sofia_path)
  56. else
  57. AC_MSG_ERROR(Cannot find Sofia-SIP - pkg-config not available, looked for libsofia-sip-ua in $sofia_path)
  58. fi
  59. else
  60. AC_MSG_RESULT([$found_sofia])
  61. AC_MSG_RESULT([$sofia_version])
  62. case "$host" in
  63. *darwin*)
  64. UNIMRCP_SOFIA_LIBS="$UNIMRCP_SOFIA_LIBS -framework CoreFoundation -framework SystemConfiguration"
  65. ;;
  66. esac
  67. AC_SUBST(UNIMRCP_SOFIA_INCLUDES)
  68. AC_SUBST(UNIMRCP_SOFIA_LIBS)
  69. fi
  70. ])