2
0

buildopal.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/bin/sh
  2. if [ -z "$1" ]; then
  3. INSTALLDIR=/usr/local
  4. else
  5. INSTALLDIR="$1"
  6. fi
  7. if [ -z `which svn` ]; then
  8. echo "Need SVN installed!"
  9. exit 1
  10. fi
  11. uname -a | grep -qi bsd && MAKE=gmake || MAKE=make
  12. #Locate our script, then go up one directory to be in FreeSWITCH root
  13. cd `dirname $0`
  14. cd ..
  15. FS_DIR=`pwd`
  16. export PKG_CONFIG_PATH=$INSTALLDIR/lib/pkgconfig
  17. # Version and patch for PTLib and OPAL. These are almost always in lock
  18. # step so should be the same unless you really know what you are doing!
  19. # The PATCH should be set to a specific"snapshot release" when things
  20. # are nice and stable. But right now comment them out for using trunk.
  21. #VERSION=10
  22. #PATCH=7
  23. if [ -z "$VERSION" ]; then
  24. PTLIB_VERSION=trunk
  25. OPAL_VERSION=trunk
  26. elif [ -z "$PATCH" ]; then
  27. PTLIB_VERSION=branches/v2_$VERSION
  28. OPAL_VERSION=branches/v3_$VERSION
  29. else
  30. PTLIB_VERSION=tags/v2_${VERSION}_$PATCH
  31. OPAL_VERSION=tags/v3_${VERSION}_$PATCH
  32. fi
  33. cd $FS_DIR/libs
  34. svn co https://svn.code.sf.net/p/opalvoip/code/ptlib/$PTLIB_VERSION ptlib
  35. cd $FS_DIR/libs/ptlib
  36. # LDAP disabled due to conflict wit libs in spidermonkey
  37. ./configure --disable-plugins --disable-openldap --prefix=$INSTALLDIR
  38. ${MAKE}
  39. sudo ${MAKE} install
  40. cd $FS_DIR/libs
  41. svn co https://svn.code.sf.net/p/opalvoip/code/opal/$OPAL_VERSION opal
  42. cd $FS_DIR/libs/opal
  43. ./configure --disable-plugins --prefix=$INSTALLDIR
  44. $MAKE
  45. sudo $MAKE install
  46. echo "======================================"
  47. echo "PTLib/OPAL build and install completed"
  48. echo "======================================"
  49. cd $FS_DIR
  50. $MAKE mod_opal-install