diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh index ffaff4420..91fd9a82d 100755 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -350,10 +350,10 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then ln -sf .src/$file $file; done && # Link source files under .src/xxx, the first child dir. - for dir in `(cd .src && find . -type d|grep '\./'|grep -v Linux|grep -v Darwin)`; do + for dir in `(cd .src && find . -maxdepth 1 -type d|grep '\./'|grep -v Linux|grep -v Darwin)`; do mkdir -p $dir && for file in `(cd .src/$dir && find . -maxdepth 1 -type f ! -name '*.o' ! -name '*.d')`; do - ln -sf .src/$dir/$file $dir/$file; + ln -sf ../.src/$dir/$file $dir/$file; done; done && # Build source code. diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index 549179e98..81b47cdd5 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -596,10 +596,6 @@ function check_option_conflicts() { echo "Don't support building FFMPEG, please use docker https://github.com/ossrs/srs-docker"; exit -1; fi - if [[ $SRS_OSX == YES && $SRS_UTEST == YES ]]; then - echo "Mac does not support utest."; exit -1; - fi - # TODO: FIXME: check more os. __check_ok=YES diff --git a/trunk/auto/setup_variables.sh b/trunk/auto/setup_variables.sh index c144c68f5..7a39fd166 100755 --- a/trunk/auto/setup_variables.sh +++ b/trunk/auto/setup_variables.sh @@ -13,7 +13,7 @@ echo "SRS_WORKDIR: ${SRS_WORKDIR}, SRS_OBJS_DIR: ${SRS_OBJS_DIR}, SRS_OBJS: ${SR # For src object files on each platform. ( mkdir -p ${SRS_OBJS_DIR} && cd ${SRS_OBJS_DIR} && - rm -rf src utest srs research include lib srs_hls_ingester srs_mp4_parser && + rm -rf src utest srs srs_utest research include lib srs_hls_ingester srs_mp4_parser && mkdir -p ${SRS_PLATFORM}/src && ln -sf ${SRS_PLATFORM}/src && mkdir -p ${SRS_PLATFORM}/utest && ln -sf ${SRS_PLATFORM}/utest && mkdir -p ${SRS_PLATFORM}/research && ln -sf ${SRS_PLATFORM}/research && diff --git a/trunk/auto/utest.sh b/trunk/auto/utest.sh index 003e3360b..27bfe0693 100755 --- a/trunk/auto/utest.sh +++ b/trunk/auto/utest.sh @@ -20,9 +20,6 @@ SRS_TRUNK_PREFIX=../../.. # gest dir, relative to objs/utest, it's trunk/objs/gtest GTEST_DIR=${SRS_TRUNK_PREFIX}/${SRS_OBJS_DIR}/gtest -# the extra defines to compile utest. -EXTRA_DEFINES="" - cat << END > ${FILE} # user must run make the ${SRS_OBJS_DIR}/utest dir # at the same dir of Makefile. diff --git a/trunk/configure b/trunk/configure index 880a89aef..90a85ea94 100755 --- a/trunk/configure +++ b/trunk/configure @@ -393,6 +393,11 @@ if [ $SRS_LIBRTMP = YES ]; then MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${PROTOCOL_OBJS[@]} ${LIBS_OBJS[@]}" BUILD_KEY="librtmp" LIB_NAME="lib/srs_librtmp" . auto/libs.sh fi +# For utest on mac. +# @see https://github.com/protocolbuffers/protobuf/issues/51#issuecomment-111044468 +if [[ $SRS_OSX == YES ]]; then + EXTRA_DEFINES="-DGTEST_USE_OWN_TR1_TUPLE=1" +fi # # utest, the unit-test cases of srs, base on gtest1.6 if [ $SRS_UTEST = YES ]; then