build_live555.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/bash
  2. CWD="$( cd "$( dirname "$0" )" && pwd )"
  3. PACKAGE_NAME=live
  4. LIVE555_INST_DIR=${CWD}/../3rdparty/live555
  5. LIVE555_CONFIG=linux-with-shared-libraries
  6. export CC=$1 # c compiler
  7. export CXX=$2 # cxx compiler
  8. if [ -f "$LIVE555_INST_DIR/include/liveMedia/liveMedia.hh" ];then
  9. if [ -f "$LIVE555_INST_DIR/lib/libliveMedia.so" ] || [ -f "$LIVE555_INST_DIR/lib/libliveMedia.a" ];then
  10. echo "live555 has been built and installed already"
  11. exit 0
  12. fi
  13. fi
  14. if [ -d ${LIVE555_INST_DIR} ]; then
  15. rm -rf "${LIVE555_INST_DIR}"
  16. fi
  17. SRC_TYPE=0
  18. if [ -d ${CWD}/${PACKAGE_NAME} ]; then
  19. SRC_TYPE=1
  20. elif [ -f ${CWD}/${PACKAGE_NAME}.tar.gz ]; then
  21. SRC_TYPE=2
  22. else
  23. echo "<<<you need download latest live555 by download_live.sh>>>"
  24. exit 0
  25. fi
  26. if [ ${SRC_TYPE} = 2 ]; then
  27. tar xf "${CWD}/${PACKAGE_NAME}.tar.gz" -C ${CWD}
  28. fi
  29. cd ${CWD}/${PACKAGE_NAME}
  30. sed -i '/COMPILE_OPTS =/ s/$/ -DRTP_PAYLOAD_MAX_SIZE=8192 -DALLOW_SERVER_PORT_REUSE=1 -DALLOW_RTSP_SERVER_PORT_REUSE=1 -DNO_OPENSSL=1/' ./config.${LIVE555_CONFIG}
  31. sed -i 's/ -lssl -lcrypto//g' ./config.${LIVE555_CONFIG}
  32. ./genMakefiles ${LIVE555_CONFIG}
  33. make
  34. if [ $? = 0 ]; then
  35. echo "build ${PACKAGE_NAME} done"
  36. make install PREFIX=${LIVE555_INST_DIR}
  37. echo "install ${PACKAGE_NAME} done"
  38. fi
  39. make clean
  40. cd ${CWD}
  41. if [ ${SRC_TYPE} = 2 ]; then
  42. rm -rf ${CWD}/${PACKAGE_NAME}
  43. fi