setup_variables.sh 1.2 KB

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. # when options parsed, setup some variables, then build the depends.
  3. OS_KERNEL_NAME=$(uname -s)
  4. OS_KERNRL_RELEASE=$(uname -r|awk -F '-' '{print $1}')
  5. OS_PREFIX="Platform"
  6. # Build platform cache.
  7. SRS_PLATFORM="${OS_PREFIX}-${OS_KERNEL_NAME}-${OS_KERNRL_RELEASE}"
  8. if [[ ${SRS_BUILD_TAG} != "" ]]; then
  9. SRS_PLATFORM="${SRS_PLATFORM}-${SRS_BUILD_TAG}"
  10. fi
  11. # Use isolate cache for different SRS version.
  12. SRS_PLATFORM="${SRS_PLATFORM}-SRS3"
  13. echo "SRS_WORKDIR: ${SRS_WORKDIR}, SRS_OBJS_DIR: ${SRS_OBJS_DIR}, SRS_OBJS: ${SRS_OBJS}, SRS_PLATFORM: ${SRS_PLATFORM}"
  14. # For src object files on each platform.
  15. (
  16. mkdir -p ${SRS_OBJS_DIR} && cd ${SRS_OBJS_DIR} &&
  17. rm -rf src utest srs srs_utest research include lib srs_hls_ingester srs_mp4_parser &&
  18. mkdir -p ${SRS_PLATFORM}/src && ln -sf ${SRS_PLATFORM}/src &&
  19. mkdir -p ${SRS_PLATFORM}/utest && ln -sf ${SRS_PLATFORM}/utest &&
  20. mkdir -p ${SRS_PLATFORM}/research && ln -sf ${SRS_PLATFORM}/research &&
  21. mkdir -p ${SRS_PLATFORM}/include && ln -sf ${SRS_PLATFORM}/include &&
  22. mkdir -p ${SRS_PLATFORM}/lib && ln -sf ${SRS_PLATFORM}/lib
  23. )
  24. echo "Fast cleanup, if need to do full cleanup, please use: make clean"