From f44b694a1789a6d72a435c1f5ebc4d9ae0a14def Mon Sep 17 00:00:00 2001 From: winlin Date: Mon, 8 Aug 2022 21:39:42 +0800 Subject: [PATCH] For test docker image, use cache eventhough the kernel changed. v5.0.37 --- trunk/Dockerfile | 9 ++++++--- trunk/auto/options.sh | 3 +++ trunk/configure | 4 +++- trunk/src/core/srs_core_version5.hpp | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/trunk/Dockerfile b/trunk/Dockerfile index fa41d7bce..ea55ecdb9 100644 --- a/trunk/Dockerfile +++ b/trunk/Dockerfile @@ -24,9 +24,12 @@ WORKDIR /srs/trunk # Use srs-cache from base image. RUN if [[ -d /usr/local/srs-cache/srs/trunk/objs ]]; then \ - echo "Build from cache of base image" && mkdir -p objs && \ - cp -R /usr/local/srs-cache/srs/trunk/objs/Platform-* objs/ && \ - du -sh objs/*; \ + ./configure --generate-objs=on && \ + SOURCE_DIR=$(ls -d /usr/local/srs-cache/srs/trunk/objs/Platform-*) && \ + TARGET_DIR=$(ls -d objs/Platform-*) && \ + echo "Build from cache, source=$SOURCE_DIR, target=$TARGET_DIR" && \ + rm -rf $TARGET_DIR && mv $SOURCE_DIR $TARGET_DIR && \ + du -sh $TARGET_DIR && ls -lh objs; \ fi # Build and install SRS. diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index 59b1ac994..ced90db07 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -63,6 +63,7 @@ SRS_VALGRIND=NO SRS_BUILD_TAG= # Set the object files tag name. SRS_CLEAN=YES # Whether do "make clean" when configure. SRS_SIMULATOR=NO # Whether enable RTC simulate API. +SRS_GENERATE_OBJS=NO # Whether generate objs and quit. # ################################################################ # Performance options. @@ -173,6 +174,7 @@ Experts: --shared-ffmpeg=on|off Use shared libraries for FFmpeg which is LGPL license. Default: $(value2switch $SRS_SHARED_FFMPEG) --clean=on|off Whether do 'make clean' when configure. Default: $(value2switch $SRS_CLEAN) --simulator=on|off RTC: Whether enable network simulator. Default: $(value2switch $SRS_SIMULATOR) + --generate-objs=on|off RTC: Whether generate objs and quit. Default: $(value2switch $SRS_GENERATE_OBJS) --build-tag= Set the build object directory suffix. Workflow: @@ -287,6 +289,7 @@ function parse_user_option() { --without-rtc) SRS_RTC=NO ;; --rtc) SRS_RTC=$(switch2value $value) ;; --simulator) SRS_SIMULATOR=$(switch2value $value) ;; + --generate-objs) SRS_GENERATE_OBJS=$(switch2value $value) ;; --ffmpeg-fit) SRS_FFMPEG_FIT=$(switch2value $value) ;; --cxx11) SRS_CXX11=$(switch2value $value) ;; diff --git a/trunk/configure b/trunk/configure index 5cfba9c1f..3a8db074d 100755 --- a/trunk/configure +++ b/trunk/configure @@ -29,8 +29,10 @@ BLACK="\\033[0m" # We don't need to cleanup the exists files. rm -f ${SRS_WORKDIR}/${SRS_MAKEFILE} -# create objs +# Create objs and platform directories. mkdir -p ${SRS_OBJS}/${SRS_PLATFORM} +# If only generate objs directory, quit without error. +if [[ $SRS_GENERATE_OBJS == YES ]]; then exit 0; fi # apply user options. . auto/depends.sh diff --git a/trunk/src/core/srs_core_version5.hpp b/trunk/src/core/srs_core_version5.hpp index 58f853e22..6b90b8fe3 100644 --- a/trunk/src/core/srs_core_version5.hpp +++ b/trunk/src/core/srs_core_version5.hpp @@ -9,6 +9,6 @@ #define VERSION_MAJOR 5 #define VERSION_MINOR 0 -#define VERSION_REVISION 35 +#define VERSION_REVISION 37 #endif