活动介绍

centos 安装 gcc-arm-linux-gnueabi

时间: 2023-08-31 08:13:01 浏览: 492
要在CentOS上安装gcc-arm-linux-gnueabi,您可以按照以下步骤进行操作: 1. 首先,确保您的CentOS系统已连接到互联网。 2. 打开终端,并以root用户身份登录。 3. 运行以下命令,更新系统软件包列表: ``` yum update ``` 4. 接下来,安装gcc-arm-linux-gnueabi工具包。运行以下命令: ``` yum install arm-none-linux-gnueabi-gcc ``` 5. 等待安装完成后,您可以通过运行以下命令来验证安装是否成功: ``` arm-none-linux-gnueabi-gcc --version ``` 如果安装成功,将显示gcc-arm-linux-gnueabi的版本信息。 请注意,这是在CentOS上安装gcc-arm-linux-gnueabi的一种方法。具体的步骤可能会因系统版本和配置而有所不同。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [Linux环境中安装指定版本的gcc-aarch64-linux-gnu、gcc-arm-linux-gnueabi工具包](https://blog.csdn.net/L_lurker/article/details/119061540)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* [centos 64bit安装arm-none-linux-gnueabi交叉编译工具链](https://blog.csdn.net/LYX_WIN/article/details/77191167)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
阅读全文

相关推荐

1 #!/bin/bash 2 3 # variables, parent script must set it: 4 # SRS_JOBS: the build jobs. 5 # SrsArmMakeOptions: the arm make options for ubuntu12(armhf, v7cpu) 6 7 ##################################################################################### 8 ##################################################################################### 9 # prepare the depends tools and libraries 10 # DEPENDS: options.sh, only when user options parsed, the depends tools are known. 11 ##################################################################################### 12 ##################################################################################### 13 14 ##################################################################################### 15 # Check OS and CPU architectures. 16 ##################################################################################### 17 if [[ $OS_IS_UBUNTU != YES && $OS_IS_CENTOS != YES && $OS_IS_OSX != YES && $SRS_CYGWIN64 != YES ]]; then 18 if [[ $SRS_CROSS_BUILD != YES && $SRS_GENERIC_LINUX != YES ]]; then 19 echo "Your OS uname -s is not supported." 20 if [[ $(uname -s) == "Linux" ]]; then 21 echo "Please try --generic-linux=on for other Linux systems." 22 fi 23 exit 1 24 fi 25 fi 26 27 # The absolute path of SRS_OBJS, for prefix and PKG_CONFIG_PATH 28 SRS_DEPENDS_LIBS=$(mkdir -p $SRS_OBJS && cd $SRS_OBJS && pwd) 29 echo -n "SRS_JOBS: $SRS_JOBS, SRS_DEPENDS_LIBS: ${SRS_DEPENDS_LIBS}" 30 if [[ ! -z $OS_IS_LINUX ]]; then echo -n ", OS_IS_LINUX: $OS_IS_LINUX"; fi 31 if [[ ! -z $OS_IS_OSX ]]; then echo -n ", OS_IS_OSX: $OS_IS_OSX"; fi 32 if [[ ! -z $OS_IS_CYGWIN ]]; then echo -n ", OS_IS_CYGWIN: $OS_IS_CYGWIN"; fi 33 if [[ ! -z $OS_IS_UBUNTU ]]; then echo -n ", OS_IS_UBUNTU: $OS_IS_UBUNTU"; fi 34 if [[ ! -z $OS_IS_CENTOS ]]; then echo -n ", OS_IS_CENTOS: $OS_IS_CENTOS"; fi 35 if [[ ! -z $SRS_CROSS_BUILD ]]; then echo -n ", SRS_CROSS_BUILD: $SRS_CROSS_BUILD"; fi 36 if [[ ! -z $OS_IS_LOONGARCH64 ]]; then echo -n ", OS_IS_LOONGARCH64: $OS_IS_LOONGARCH64"; fi 37 if [[ ! -z $OS_IS_MIPS64 ]]; then echo -n ", OS_IS_MIPS64: $OS_IS_MIPS64"; fi 38 if [[ ! -z $OS_IS_LOONGSON ]]; then echo -n ", OS_IS_LOONGSON: $OS_IS_LOONGSON"; fi 39 if [[ ! -z $OS_IS_X86_64 ]]; then echo -n ", OS_IS_X86_64: $OS_IS_X86_64"; fi 40 if [[ ! -z $OS_IS_RISCV ]]; then echo -n ", OS_IS_RISCV: $OS_IS_RISCV"; fi 41 echo "" 42 43 ##################################################################################### 44 # Check dependency tools. 45 ##################################################################################### 46 if [[ $SRS_OSX == YES ]]; then 47 brew --version >/dev/null 2>/dev/null; ret=$?; if [[ 0 -ne $ret ]]; then 48 echo "Please install brew at https://brew.sh/"; exit $ret; 49 fi 50 fi 51 # Check perl, which is depended by automake for building libopus etc. 52 perl --version >/dev/null 2>/dev/null; ret=$?; if [[ 0 -ne $ret ]]; then 53 if [[ $OS_IS_CENTOS == YES ]]; then 54 echo "Please install perl by:" 55 echo " yum install -y perl" 56 elif [[ $OS_IS_UBUNTU == YES ]]; then 57 echo "Please install perl by:" 58 echo " apt install -y perl" 59 else 60 echo "Please install perl" 61 fi 62 exit $ret; 63 fi 64 gcc --version >/dev/null 2>/dev/null; ret=$?; if [[ 0 -ne $ret ]]; then 65 if [[ $OS_IS_CENTOS == YES ]]; then 66 echo "Please install gcc by:" 67 echo " yum install -y gcc" 68 elif [[ $OS_IS_UBUNTU == YES ]]; then 69 echo "Please install gcc by:" 70 echo " apt install -y gcc" 71 else 72 echo "Please install gcc" 73 fi 74 exit $ret; 75 fi 76 g++ --version >/dev/null 2>/dev/null; ret=$?; if [[ 0 -ne $ret ]]; then 77 if [[ $OS_IS_CENTOS == YES ]]; then 78 echo "Please install g++ by:" 79 echo " yum install -y gcc-c++" 80 elif [[ $OS_IS_UBUNTU == YES ]]; then 81 echo "Please install g++ by:" 82 echo " apt install -y g++" 83 else 84 echo "Please install gcc-c++" 85 fi 86 exit $ret; 87 fi 88 make --version >/dev/null 2>/dev/null; ret=$?; if [[ 0 -ne $ret ]]; then 89 if [[ $OS_IS_CENTOS == YES ]]; then 90 echo "Please install make by:" 91 echo " yum install -y make" 92 elif [[ $OS_IS_UBUNTU == YES ]]; then 93 echo "Please install make by:" 94 echo " apt install -y make" 95 else 96 echo "Please install make" 97 fi 98 exit $ret; 99 fi 100 patch --version >/dev/null 2>/dev/null; ret=$?; if [[ 0 -ne $ret ]]; then 101 if [[ $OS_IS_CENTOS == YES ]]; then 102 echo "Please install patch by:" 103 echo " yum install -y patch" 104 elif [[ $OS_IS_UBUNTU == YES ]]; then 105 echo "Please install patch by:" 106 echo " apt install -y patch" 107 else 108 echo "Please install patch" 109 fi 110 exit $ret; 111 fi 112 unzip -v >/dev/null 2>/dev/null; ret=$?; if [[ 0 -ne $ret ]]; then 113 if [[ $OS_IS_CENTOS == YES ]]; then 114 echo "Please install unzip by:" 115 echo " yum install -y unzip" 116 elif [[ $OS_IS_UBUNTU == YES ]]; then 117 echo "Please install unzip by:" 118 echo " apt install -y unzip" 119 else 120 echo "Please install unzip" 121 fi 122 exit $ret; 123 fi 124 automake --version >/dev/null 2>/dev/null; ret=$?; if [[ 0 -ne $ret ]]; then 125 if [[ $OS_IS_CENTOS == YES ]]; then 126 echo "Please install automake by:" 127 echo " yum install -y automake" 128 elif [[ $OS_IS_UBUNTU == YES ]]; then 129 echo "Please install automake by:" 130 echo " apt install -y automake" 131 else 132 echo "Please install automake" 133 fi 134 exit $ret; 135 fi 136 if [[ $SRS_VALGRIND == YES ]]; then 137 valgrind --version >/dev/null 2>/dev/null; ret=$?; if [[ 0 -ne $ret ]]; then 138 echo "Please install valgrind"; exit $ret; 139 fi 140 if [[ ! -f /usr/include/valgrind/valgrind.h ]]; then 141 echo "Please install valgrind-dev"; exit $ret; 142 fi 143 fi 144 # Check tclsh, which is depended by SRT. 145 if [[ $SRS_SRT == YES ]]; then 146 tclsh <<< "exit" >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 147 if [[ $OS_IS_CENTOS == YES ]]; then 148 echo "Please install tclsh by:" 149 echo " yum install -y tcl" 150 elif [[ $OS_IS_UBUNTU == YES ]]; then 151 echo "Please install tclsh by:" 152 echo " apt install -y tclsh" 153 else 154 echo "Please install tclsh" 155 fi 156 exit $ret; 157 fi 158 cmake --version >/dev/null 2>/dev/null; ret=$?; if [[ 0 -ne $ret ]]; then 159 if [[ $OS_IS_CENTOS == YES ]]; then 160 echo "Please install cmake by:" 161 echo " yum install -y cmake" 162 elif [[ $OS_IS_UBUNTU == YES ]]; then 163 echo "Please install cmake by:" 164 echo " apt install -y cmake" 165 else 166 echo "Please install cmake" 167 fi 168 exit $ret; 169 fi 170 fi 171 pkg-config --version >/dev/null 2>/dev/null; ret=$?; if [[ 0 -ne $ret ]]; then 172 echo "Please install pkg-config"; exit $ret; 173 fi 174 which ls >/dev/null 2>/dev/null; ret=$?; if [[ 0 -ne $ret ]]; then 175 if [[ $OS_IS_CENTOS == YES ]]; then 176 echo "Please install which by:" 177 echo " yum install -y which" 178 elif [[ $OS_IS_UBUNTU == YES ]]; then 179 echo "Please install which by:" 180 echo " apt install -y which" 181 else 182 echo "Please install which" 183 fi 184 exit $ret; 185 fi 186 187 ##################################################################################### 188 # Try to load cache if exists /usr/local/srs-cache 189 ##################################################################################### 190 # Use srs-cache from base image. See https://github.com/ossrs/dev-docker/blob/ubuntu20-cache/Dockerfile 191 # Note that the cache for cygwin is not under /usr/local, but copy to objs instead. 192 if [[ -d /usr/local/srs-cache/srs/trunk/objs && $(pwd) != "/usr/local/srs-cache/srs/trunk" && $SRS_BUILD_CACHE == YES ]]; then 193 SOURCE_DIR=$(ls -d /usr/local/srs-cache/srs/trunk/objs/Platform-SRS${SRS_MAJOR}-* 2>/dev/null|head -n 1) 194 if [[ -d $SOURCE_DIR ]]; then 195 TARGET_DIR=${SRS_OBJS}/${SRS_PLATFORM} && 196 echo "Build from cache, source=$SOURCE_DIR, target=$TARGET_DIR" && 197 rm -rf $TARGET_DIR && mkdir -p ${SRS_OBJS} && cp -R $SOURCE_DIR $TARGET_DIR && 198 du -sh /usr/local/srs-cache/srs/trunk/objs/Platform-* && 199 du -sh /usr/local/srs-cache/srs/trunk/objs/Platform-*/* && 200 du -sh objs/Platform-* && 201 ls -lh objs 202 fi 203 fi 204 205 ##################################################################################### 206 # Check for address sanitizer, see https://github.com/google/sanitizers 207 ##################################################################################### 208 if [[ $SRS_SANITIZER == YES && $OS_IS_X86_64 == YES ]]; then 209 echo 'int main() { return 0; }' > ${SRS_OBJS}/test_sanitizer.c && 210 gcc -fsanitize=address -fno-omit-frame-pointer -g -O0 ${SRS_OBJS}/test_sanitizer.c \ 211 -o ${SRS_OBJS}/test_sanitizer 1>/dev/null 2>&1; 212 ret=$?; rm -rf ${SRS_OBJS}/test_sanitizer* 213 if [[ $ret -ne 0 ]]; then 214 echo "Please install libasan, see https://github.com/google/sanitizers"; 215 if [[ $OS_IS_CENTOS == YES ]]; then echo " sudo yum install -y libasan"; fi 216 exit $ret; 217 fi 218 fi 219 220 if [[ $SRS_SANITIZER == YES && $OS_IS_X86_64 == YES && $SRS_SANITIZER_STATIC == NO ]]; then 221 echo 'int main() { return 0; }' > ${SRS_OBJS}/test_sanitizer.c && 222 gcc -fsanitize=address -fno-omit-frame-pointer -static-libasan -g -O0 ${SRS_OBJS}/test_sanitizer.c \ 223 -o ${SRS_OBJS}/test_sanitizer 1>/dev/null 2>&1; 224 ret=$?; rm -rf ${SRS_OBJS}/test_sanitizer* 225 if [[ $ret -eq 0 ]]; then 226 echo "link static-libasan" 227 SRS_SANITIZER_STATIC=YES 228 fi 229 fi 230 231 if [[ $SRS_SANITIZER == YES && $OS_IS_X86_64 == YES && $SRS_SANITIZER_LOG == NO ]]; then 232 echo "#include <sanitizer/asan_interface.h>" > ${SRS_OBJS}/test_sanitizer.c && 233 echo "int main() { return 0; }" >> ${SRS_OBJS}/test_sanitizer.c && 234 gcc -fsanitize=address -fno-omit-frame-pointer -g -O0 ${SRS_OBJS}/test_sanitizer.c \ 235 -o ${SRS_OBJS}/test_sanitizer 1>/dev/null 2>&1; 236 ret=$?; rm -rf ${SRS_OBJS}/test_sanitizer* 237 if [[ $ret -eq 0 ]]; then 238 echo "libasan api found ok!"; 239 SRS_SANITIZER_LOG=YES 240 fi 241 fi 242 243 ##################################################################################### 244 # state-threads 245 ##################################################################################### 246 # check the cross build flag file, if flag changed, need to rebuild the st. 247 _ST_MAKE=linux-debug && _ST_OBJ="LINUX_uname -r_DBG" 248 # Always alloc on heap, @see https://github.com/ossrs/srs/issues/509#issuecomment-719931676 249 _ST_EXTRA_CFLAGS="-DMALLOC_STACK" 250 # For valgrind to detect memory issues. 251 if [[ $SRS_VALGRIND == YES ]]; then 252 _ST_EXTRA_CFLAGS="$_ST_EXTRA_CFLAGS -DMD_VALGRIND" 253 fi 254 # for osx, use darwin for st, donot use epoll. 255 if [[ $SRS_OSX == YES ]]; then 256 _ST_MAKE=darwin-debug && _ST_OBJ="DARWIN_uname -r_DBG" 257 fi 258 # for windows/cygwin 259 if [[ $SRS_CYGWIN64 = YES ]]; then 260 _ST_MAKE=cygwin64-debug && _ST_OBJ="CYGWIN64_uname -s_DBG" 261 fi 262 # For Ubuntu, the epoll detection might be fail. 263 if [[ $OS_IS_UBUNTU == YES ]]; then 264 _ST_EXTRA_CFLAGS="$_ST_EXTRA_CFLAGS -DMD_HAVE_EPOLL" 265 fi 266 # Whether enable debug stats. 267 if [[ $SRS_DEBUG_STATS == YES ]]; then 268 _ST_EXTRA_CFLAGS="$_ST_EXTRA_CFLAGS -DDEBUG_STATS" 269 fi 270 # Pass the global extra flags. 271 if [[ $SRS_EXTRA_FLAGS != '' ]]; then 272 _ST_EXTRA_CFLAGS="$_ST_EXTRA_CFLAGS $SRS_EXTRA_FLAGS" 273 fi 274 # Whether link as .so 275 if [[ $SRS_SHARED_ST == YES ]]; then 276 _ST_STATIC_ONLY=no; 277 else 278 _ST_STATIC_ONLY=yes; 279 fi 280 # The final args to make st. 281 _ST_MAKE_ARGS="${_ST_MAKE} STATIC_ONLY=${_ST_STATIC_ONLY}" 282 _ST_MAKE_ARGS="${_ST_MAKE_ARGS} CC=${SRS_TOOL_CC} AR=${SRS_TOOL_AR} LD=${SRS_TOOL_LD} RANDLIB=${SRS_TOOL_RANDLIB}" 283 # Patched ST from https://github.com/ossrs/state-threads/tree/srs 284 if [[ -f ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/st/libst.a ]]; then 285 rm -rf ${SRS_OBJS}/st && cp -rf ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/st ${SRS_OBJS}/ && 286 echo "The state-threads is ok." 287 else 288 echo "Building state-threads." && 289 rm -rf ${SRS_OBJS}/${SRS_PLATFORM}/st-srs ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/st ${SRS_OBJS}/st && 290 cp -rf ${SRS_WORKDIR}/3rdparty/st-srs ${SRS_OBJS}/${SRS_PLATFORM}/ && 291 env EXTRA_CFLAGS="${_ST_EXTRA_CFLAGS}" make -C ${SRS_OBJS}/${SRS_PLATFORM}/st-srs ${_ST_MAKE_ARGS} && 292 mkdir -p ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/st && 293 cp -f ${SRS_OBJS}/${SRS_PLATFORM}/st-srs/${_ST_OBJ}/st.h ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/st/ && 294 cp -f ${SRS_OBJS}/${SRS_PLATFORM}/st-srs/${_ST_OBJ}/libst.a ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/st/ && 295 cp -rf ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/st ${SRS_OBJS}/ && 296 echo "The state-threads is ok." 297 fi 298 # check status 299 ret=$?; if [[ $ret -ne 0 ]]; then echo "Build state-threads failed, ret=$ret"; exit $ret; fi 300 301 ##################################################################################### 302 # nginx for HLS, nginx-1.5.0 303 ##################################################################################### 304 function write_nginx_html5() 305 { 306 cat<<END > ${html_file} 307 310 END 311 } 312 # create the nginx dir, for http-server if not build nginx 313 mkdir -p ${SRS_OBJS}/nginx 314 315 # the demo dir. 316 # create forward dir 317 mkdir -p ${SRS_OBJS}/nginx/html/live && 318 html_file=${SRS_OBJS}/nginx/html/live/livestream.html && hls_stream=livestream.m3u8 && write_nginx_html5 && 319 320 # copy players to nginx html dir. 321 rm -rf ${SRS_OBJS}/nginx/html/players && 322 cp -rf $SRS_WORKDIR/research/players ${SRS_OBJS}/nginx/html/ && 323 324 # for favicon.ico 325 rm -rf ${SRS_OBJS}/nginx/html/favicon.ico && 326 cp -f $SRS_WORKDIR/research/api-server/static-dir/favicon.ico ${SRS_OBJS}/nginx/html/favicon.ico && 327 328 # For srs-console. 329 rm -rf ${SRS_OBJS}/nginx/html/console && 330 cp -rf $SRS_WORKDIR/research/console ${SRS_OBJS}/nginx/html/ && 331 332 # For SRS signaling. 333 rm -rf ${SRS_OBJS}/nginx/html/demos && 334 cp -rf $SRS_WORKDIR/3rdparty/signaling/www/demos ${SRS_OBJS}/nginx/html/ && 335 336 # For home page index.html 337 rm -rf ${SRS_OBJS}/nginx/html/index.html && 338 cp -f $SRS_WORKDIR/research/api-server/static-dir/index.html ${SRS_OBJS}/nginx/html/index.html && 339 340 # nginx.html to detect whether nginx is alive 341 echo "Nginx is ok." > ${SRS_OBJS}/nginx/html/nginx.html 342 343 # check status 344 ret=$?; if [[ $ret -ne 0 ]]; then echo "Build web pages failed, ret=$ret"; exit $ret; fi 345 346 ##################################################################################### 347 # Generate default self-sign certificate for HTTPS server, test only. 348 ##################################################################################### 349 if [[ ! -f $SRS_WORKDIR/conf/server.key || ! -f $SRS_WORKDIR/conf/server.crt ]]; then 350 openssl genrsa -out $SRS_WORKDIR/conf/server.key 2048 && 351 openssl req -new -x509 -key $SRS_WORKDIR/conf/server.key -out $SRS_WORKDIR/conf/server.crt -days 3650 \ 352 -subj "/C=CN/ST=Beijing/L=Beijing/O=Me/OU=Me/CN=ossrs.net" && 353 echo "Generate test-only self-sign certificate files" 354 fi 355 356 ##################################################################################### 357 # openssl, for rtmp complex handshake and HLS encryption. 358 ##################################################################################### 359 if [[ $SRS_SSL == YES && $SRS_USE_SYS_SSL == YES ]]; then 360 echo "Warning: Use system libssl, without compiling openssl." 361 fi 362 # @see http://www.openssl.org/news/secadv/20140407.txt 363 # Affected users should upgrade to OpenSSL 1.1.0e. Users unable to immediately 364 # upgrade can alternatively recompile OpenSSL with -DOPENSSL_NO_HEARTBEATS. 365 if [[ $SRS_SSL == YES && $SRS_USE_SYS_SSL != YES ]]; then 366 OPENSSL_OPTIONS="-no-shared -no-threads -DOPENSSL_NO_HEARTBEATS" 367 OPENSSL_CONFIG="./config" 368 # https://stackoverflow.com/questions/15539062/cross-compiling-of-openssl-for-linux-arm-v5te-linux-gnueabi-toolchain 369 if [[ $SRS_CROSS_BUILD == YES ]]; then 370 OPENSSL_CONFIG="./Configure linux-generic32" 371 if [[ $SRS_CROSS_BUILD_ARCH == "arm" ]]; then OPENSSL_CONFIG="./Configure linux-armv4"; fi 372 if [[ $SRS_CROSS_BUILD_ARCH == "aarch64" ]]; then OPENSSL_CONFIG="./Configure linux-aarch64"; fi 373 if [[ $SRS_CROSS_BUILD_ARCH == "mipsel" ]]; then OPENSSL_CONFIG="./Configure linux-mips32"; fi 374 elif [[ ! -f ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/openssl/lib/libssl.a ]]; then 375 # Try to use exists libraries. 376 if [[ -f /usr/local/ssl/lib/libssl.a && $SRS_SSL_LOCAL == NO ]]; then 377 (mkdir -p ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/openssl/lib && cd ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/openssl/lib && 378 cp /usr/local/ssl/lib/libssl.a . && cp /usr/local/ssl/lib/libcrypto.a . && 379 mkdir -p /usr/local/ssl/lib/pkgconfig && cp -rf /usr/local/ssl/lib/pkgconfig .) 380 (mkdir -p ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/openssl/include && cd ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/openssl/include && 381 cp -rf /usr/local/ssl/include/openssl .) 382 fi 383 # Warning if not use the system ssl. 384 if [[ -f /usr/local/ssl/lib/libssl.a && $SRS_SSL_LOCAL == YES ]]; then 385 echo "Warning: Local openssl is on, ignore system openssl" 386 fi 387 fi 388 # Patch for loongarch mips64, disable ASM for build failed message as bellow: 389 # Error: opcode not supported on this processor: mips3 (mips3) 390 if [[ $OS_IS_MIPS64 == YES ]]; then OPENSSL_CONFIG="./Configure linux64-mips64"; fi 391 if [[ $OS_IS_LOONGSON == YES ]]; then OPENSSL_OPTIONS="$OPENSSL_OPTIONS -no-asm"; fi 392 # For RTC, we should use ASM to improve performance, not a little improving. 393 if [[ $SRS_RTC == NO || $SRS_NASM == NO ]]; then 394 OPENSSL_OPTIONS="$OPENSSL_OPTIONS -no-asm" 395 echo "Warning: NASM is off, performance is hurt" 396 fi 397 # Mac OS X can have issues (its often a neglected platform). 398 # @see https://wiki.openssl.org/index.php/Compilation_and_Installation 399 if [[ $SRS_OSX == YES ]]; then 400 export KERNEL_BITS=64; 401 fi 402 # Use 1.0 if required. 403 if [[ $SRS_SSL_1_0 == YES ]]; then 404 OPENSSL_AR="$SRS_TOOL_AR -r" # For openssl 1.0, MUST specifies the args for ar or build faild. 405 OPENSSL_CANDIDATE="openssl-OpenSSL_1_0_2u" && 406 OPENSSL_UNZIP="tar xf ${SRS_WORKDIR}/3rdparty/$OPENSSL_CANDIDATE.tar.gz -C ${SRS_OBJS}/${SRS_PLATFORM}" 407 else 408 OPENSSL_AR="$SRS_TOOL_AR" 409 OPENSSL_CANDIDATE="openssl-1.1-fit" && 410 OPENSSL_UNZIP="cp -R ${SRS_WORKDIR}/3rdparty/$OPENSSL_CANDIDATE ${SRS_OBJS}/${SRS_PLATFORM}/" 411 fi 412 # 413 # https://wiki.openssl.org/index.php/Compilation_and_Installation#Configure_Options 414 # Already defined: -no-shared -no-threads -no-asm 415 # Should enable: -no-dtls -no-dtls1 -no-ssl3 416 # Might able to disable: -no-ssl2 -no-comp -no-idea -no-hw -no-engine -no-dso -no-err -no-nextprotoneg -no-psk -no-srp -no-ec2m -no-weak-ssl-ciphers 417 # Note that we do not disable more features, because no file could be removed. 418 #OPENSSL_OPTIONS="$OPENSSL_OPTIONS -no-ssl2 -no-comp -no-idea -no-hw -no-engine -no-dso -no-err -no-nextprotoneg -no-psk -no-srp -no-ec2m -no-weak-ssl-ciphers" 419 # 420 # cross build not specified, if exists flag, need to rebuild for no-arm platform. 421 if [[ -f ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/openssl/lib/libssl.a ]]; then 422 rm -rf ${SRS_OBJS}/openssl && cp -rf ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/openssl ${SRS_OBJS}/ && 423 echo "The $OPENSSL_CANDIDATE is ok." 424 else 425 echo "Building $OPENSSL_CANDIDATE." && 426 rm -rf ${SRS_OBJS}/${SRS_PLATFORM}/${OPENSSL_CANDIDATE} ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/openssl \ 427 ${SRS_OBJS}/openssl && 428 ${OPENSSL_UNZIP} && 429 ( 430 cd ${SRS_OBJS}/${SRS_PLATFORM}/${OPENSSL_CANDIDATE} && 431 chmod +x ./config ./Configure && 432 ${OPENSSL_CONFIG} --prefix=${SRS_DEPENDS_LIBS}/${SRS_PLATFORM}/3rdparty/openssl $OPENSSL_OPTIONS 433 ) && 434 make -C ${SRS_OBJS}/${SRS_PLATFORM}/${OPENSSL_CANDIDATE} CC=${SRS_TOOL_CC} AR="${OPENSSL_AR}" \ 435 LD=${SRS_TOOL_LD} RANDLIB=${SRS_TOOL_RANDLIB} ${SRS_JOBS} && 436 make -C ${SRS_OBJS}/${SRS_PLATFORM}/${OPENSSL_CANDIDATE} install_sw && 437 cp -rf ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/openssl ${SRS_OBJS}/ && 438 echo "The $OPENSSL_CANDIDATE is ok." 439 fi 440 # check status 441 ret=$?; if [[ $ret -ne 0 ]]; then echo "Build $OPENSSL_CANDIDATE failed, ret=$ret"; exit $ret; fi 442 fi 443 444 ##################################################################################### 445 # srtp 446 ##################################################################################### 447 if [[ $SRS_RTC == YES && $SRS_USE_SYS_SRTP == YES ]]; then 448 echo "Warning: Use system libsrtp, without compiling srtp." 449 fi 450 if [[ $SRS_RTC == YES && $SRS_USE_SYS_SRTP == NO ]]; then 451 SRTP_OPTIONS="" 452 # To eliminate warnings, see https://stackoverflow.com/a/34208904/17679565 453 # was built for newer macOS version (11.6) than being linked (11.0) 454 if [[ $SRS_OSX == YES ]]; then 455 export MACOSX_DEPLOYMENT_TARGET=11.0 456 echo "Set MACOSX_DEPLOYMENT_TARGET to avoid warnings" 457 fi 458 # If use ASM for SRTP, we enable openssl(with ASM). 459 if [[ $SRS_SRTP_ASM == YES ]]; then 460 SRTP_OPTIONS="--enable-openssl" 461 SRTP_CONFIGURE="env PKG_CONFIG_PATH=${SRS_DEPENDS_LIBS}/openssl/lib/pkgconfig ./configure" 462 else 463 SRTP_OPTIONS="--disable-openssl" 464 SRTP_CONFIGURE="./configure" 465 fi 466 if [[ $SRS_CROSS_BUILD == YES ]]; then 467 SRTP_OPTIONS="$SRTP_OPTIONS --host=$SRS_CROSS_BUILD_HOST" 468 fi 469 if [[ $OS_IS_LOONGARCH64 == YES ]]; then 470 SRTP_OPTIONS="$SRTP_OPTIONS --build=loongarch64-unknown-linux-gnu" 471 fi 472 # Copy and patch source files, then build and install libsrtp. 473 if [[ -f ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/srtp2/lib/libsrtp2.a ]]; then 474 rm -rf ${SRS_OBJS}/srtp2 && 475 cp -rf ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/srtp2 ${SRS_OBJS} && 476 echo "The libsrtp-2-fit is ok." 477 else 478 echo "Building libsrtp-2-fit." 479 rm -rf ${SRS_OBJS}/${SRS_PLATFORM}/libsrtp-2-fit ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/srtp2 \ 480 ${SRS_OBJS}/srtp2 && 481 cp -rf ${SRS_WORKDIR}/3rdparty/libsrtp-2-fit ${SRS_OBJS}/${SRS_PLATFORM}/ && 482 # For cygwin64, the patch is not available, so use sed instead. 483 if [[ $SRS_CYGWIN64 == YES ]]; then 484 sed -i 's/char bit_string/static char bit_string/g' ${SRS_OBJS}/${SRS_PLATFORM}/libsrtp-2-fit/crypto/math/datatypes.c 485 else 486 patch -p0 ${SRS_OBJS}/${SRS_PLATFORM}/libsrtp-2-fit/crypto/math/datatypes.c ${SRS_WORKDIR}/3rdparty/patches/srtp/gcc10-01.patch 487 fi && 488 # Patch the cpu arch guessing for RISCV. 489 if [[ $OS_IS_RISCV == YES ]]; then 490 patch -p0 ${SRS_OBJS}/${SRS_PLATFORM}/libsrtp-2-fit/config.guess ${SRS_WORKDIR}/3rdparty/patches/srtp/config.guess-02.patch 491 fi && 492 ( 493 cd ${SRS_OBJS}/${SRS_PLATFORM}/libsrtp-2-fit && 494 $SRTP_CONFIGURE ${SRTP_OPTIONS} --prefix=${SRS_DEPENDS_LIBS}/${SRS_PLATFORM}/3rdparty/srtp2 495 ) && 496 # Sometimes it might fail because autoconf failed to generate crypto/include.config.h 497 if [[ $SRS_CYGWIN64 == YES ]]; then 498 SRS_PATCH_SOURCE=${SRS_WORKDIR}/3rdparty/patches/srtp/cygwin-crypto-include-config.h 499 if [[ $SRS_SRTP_ASM == YES ]]; then 500 SRS_PATCH_SOURCE=${SRS_WORKDIR}/3rdparty/patches/srtp/cygwin-gcm-crypto-include-config.h 501 fi 502 grep -q 'HAVE_UINT64_T 1' ${SRS_OBJS}/${SRS_PLATFORM}/libsrtp-2-fit/crypto/include/config.h || 503 cp -f $SRS_PATCH_SOURCE ${SRS_OBJS}/${SRS_PLATFORM}/libsrtp-2-fit/crypto/include/config.h 504 fi && 505 make -C ${SRS_OBJS}/${SRS_PLATFORM}/libsrtp-2-fit ${SRS_JOBS} && 506 make -C ${SRS_OBJS}/${SRS_PLATFORM}/libsrtp-2-fit install && 507 cp -rf ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/srtp2 ${SRS_OBJS}/ && 508 echo "The libsrtp-2-fit is ok." 509 fi 510 ret=$?; if [[ $ret -ne 0 ]]; then echo "Build libsrtp failed, ret=$ret"; exit $ret; fi 511 fi 512 513 ##################################################################################### 514 # libopus, for WebRTC to transcode AAC with Opus. 515 ##################################################################################### 516 # For cross build, we use opus of FFmpeg, so we don't build the libopus. 517 if [[ $SRS_RTC == YES && $SRS_USE_SYS_FFMPEG != YES && $SRS_FFMPEG_OPUS != YES ]]; then 518 # Only build static libraries if no shared FFmpeg. 519 if [[ $SRS_SHARED_FFMPEG != YES ]]; then 520 OPUS_OPTIONS="--disable-shared --disable-doc" 521 fi 522 if [[ $OS_IS_LOONGARCH64 == YES ]]; then 523 OPUS_OPTIONS="$OPUS_OPTIONS --build=loongarch64-unknown-linux-gnu" 524 fi 525 if [[ -f ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/opus/lib/libopus.a ]]; then 526 rm -rf ${SRS_OBJS}/opus && cp -rf ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/opus ${SRS_OBJS}/ && 527 echo "The opus-1.3.1 is ok." 528 else 529 echo "Building opus-1.3.1." && 530 rm -rf ${SRS_OBJS}/${SRS_PLATFORM}/opus-1.3.1 ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/opus ${SRS_OBJS}/opus && 531 tar xf ${SRS_WORKDIR}/3rdparty/opus-1.3.1.tar.gz -C ${SRS_OBJS}/${SRS_PLATFORM} && 532 ( 533 # Opus requires automake 1.15, and fails for automake 1.16+, so we run autoreconf to fix it. 534 cd ${SRS_OBJS}/${SRS_PLATFORM}/opus-1.3.1 && autoreconf && 535 ./configure --prefix=${SRS_DEPENDS_LIBS}/${SRS_PLATFORM}/3rdparty/opus --enable-static $OPUS_OPTIONS 536 ) && 537 make -C ${SRS_OBJS}/${SRS_PLATFORM}/opus-1.3.1 ${SRS_JOBS} && 538 make -C ${SRS_OBJS}/${SRS_PLATFORM}/opus-1.3.1 install && 539 cp -rf ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/opus ${SRS_OBJS}/ && 540 echo "The opus-1.3.1 is ok." 541 fi 542 if [ ! -f ${SRS_OBJS}/opus/lib/libopus.a ]; then echo "Build opus-1.3.1 failed."; exit -1; fi 543 fi 544 545 ##################################################################################### 546 # ffmpeg-fit, for WebRTC to transcode AAC with Opus. 547 ##################################################################################### 548 if [[ $SRS_FFMPEG_FIT == YES && $SRS_USE_SYS_FFMPEG == YES ]]; then 549 echo "Warning: Use system ffmpeg, without compiling ffmpeg." 550 fi 551 if [[ $SRS_FFMPEG_FIT == YES && $SRS_USE_SYS_FFMPEG == NO ]]; then 552 FFMPEG_CONFIGURE="env SRS_FFMPEG_FIT=on" 553 if [[ $SRS_FFMPEG_OPUS != YES ]]; then 554 FFMPEG_CONFIGURE="$FFMPEG_CONFIGURE PKG_CONFIG_PATH=${SRS_DEPENDS_LIBS}/opus/lib/pkgconfig" 555 fi 556 FFMPEG_CONFIGURE="$FFMPEG_CONFIGURE ./configure" 557 558 # Disable all features, note that there are still some options need to be disabled. 559 FFMPEG_OPTIONS="--disable-everything" 560 # Disable all asm for FFmpeg, to compatible with ARM CPU. 561 FFMPEG_OPTIONS="$FFMPEG_OPTIONS --disable-asm --disable-x86asm --disable-inline-asm" 562 # Only build static libraries if no shared FFmpeg. 563 if [[ $SRS_SHARED_FFMPEG == YES ]]; then 564 FFMPEG_OPTIONS="$FFMPEG_OPTIONS --enable-shared" 565 fi 566 # For loongson/mips64, disable mips64r6, or build failed. 567 if [[ $OS_IS_MIPS64 == YES && $OS_IS_LOONGSON == YES ]]; then FFMPEG_OPTIONS="$FFMPEG_OPTIONS --disable-mips64r6"; fi 568 # For cross-build. 569 if [[ $SRS_CROSS_BUILD == YES ]]; then 570 FFMPEG_OPTIONS="$FFMPEG_OPTIONS --enable-cross-compile --target-os=linux --disable-pthreads" 571 FFMPEG_OPTIONS="$FFMPEG_OPTIONS --arch=$SRS_CROSS_BUILD_ARCH"; 572 if [[ $SRS_CROSS_BUILD_CPU != "" ]]; then FFMPEG_OPTIONS="$FFMPEG_OPTIONS --cpu=$SRS_CROSS_BUILD_CPU"; fi 573 FFMPEG_OPTIONS="$FFMPEG_OPTIONS --cross-prefix=$SRS_CROSS_BUILD_PREFIX" 574 FFMPEG_OPTIONS="$FFMPEG_OPTIONS --cc=${SRS_TOOL_CC} --cxx=${SRS_TOOL_CXX} --ar=${SRS_TOOL_AR} --ld=${SRS_TOOL_LD}" 575 fi 576 # For audio codec opus, use FFmpeg native one, or external libopus. 577 if [[ $SRS_FFMPEG_OPUS == YES ]]; then 578 # TODO: FIXME: Note that the audio might be corrupted, see https://github.com/ossrs/srs/issues/3140 579 FFMPEG_OPTIONS="$FFMPEG_OPTIONS --enable-decoder=opus --enable-encoder=opus" 580 else 581 FFMPEG_OPTIONS="$FFMPEG_OPTIONS --enable-decoder=libopus --enable-encoder=libopus --enable-libopus" 582 fi 583 # Disable features of ffmpeg. 584 FFMPEG_OPTIONS="$FFMPEG_OPTIONS --disable-avdevice --disable-avformat --disable-swscale --disable-postproc --disable-avfilter --disable-network" 585 FFMPEG_OPTIONS="$FFMPEG_OPTIONS --disable-dwt --disable-error-resilience --disable-lsp --disable-lzo --disable-faan --disable-pixelutils" 586 FFMPEG_OPTIONS="$FFMPEG_OPTIONS --disable-hwaccels --disable-devices --disable-audiotoolbox --disable-videotoolbox --disable-cuvid" 587 FFMPEG_OPTIONS="$FFMPEG_OPTIONS --disable-d3d11va --disable-dxva2 --disable-ffnvcodec --disable-nvdec --disable-nvenc --disable-v4l2-m2m --disable-vaapi" 588 FFMPEG_OPTIONS="$FFMPEG_OPTIONS --disable-vdpau --disable-appkit --disable-coreimage --disable-avfoundation --disable-securetransport --disable-iconv" 589 FFMPEG_OPTIONS="$FFMPEG_OPTIONS --disable-lzma --disable-sdl2" 590 # Enable FFmpeg native AAC encoder and decoder. 591 FFMPEG_OPTIONS="$FFMPEG_OPTIONS --enable-decoder=aac --enable-decoder=aac_fixed --enable-decoder=aac_latm --enable-encoder=aac" 592 # Enable FFmpeg native MP3 decoder, which depends on dct. 593 FFMPEG_OPTIONS="$FFMPEG_OPTIONS --enable-decoder=mp3 --enable-dct" 594 595 if [[ -f ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/ffmpeg/lib/libavcodec.a ]]; then 596 rm -rf ${SRS_OBJS}/ffmpeg && cp -rf ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/ffmpeg ${SRS_OBJS}/ && 597 echo "The ffmpeg-4-fit is ok." 598 else 599 echo "Building ffmpeg-4-fit." && 600 rm -rf ${SRS_OBJS}/${SRS_PLATFORM}/ffmpeg-4-fit ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/ffmpeg \ 601 ${SRS_OBJS}/ffmpeg && 602 cp -rf ${SRS_WORKDIR}/3rdparty/ffmpeg-4-fit ${SRS_OBJS}/${SRS_PLATFORM}/ && 603 ( 604 cd ${SRS_OBJS}/${SRS_PLATFORM}/ffmpeg-4-fit && 605 $FFMPEG_CONFIGURE --prefix=${SRS_DEPENDS_LIBS}/${SRS_PLATFORM}/3rdparty/ffmpeg \ 606 --pkg-config=pkg-config --pkg-config-flags='--static' --extra-libs='-lpthread' --extra-libs='-lm' \ 607 ${FFMPEG_OPTIONS} 608 ) && 609 # See https://www.laoyuyu.me/2019/05/23/android/clang_compile_ffmpeg/ 610 if [[ $SRS_CROSS_BUILD == YES ]]; then 611 sed -i -e 's/#define getenv(x) NULL/\/\*#define getenv(x) NULL\*\//g' ${SRS_OBJS}/${SRS_PLATFORM}/ffmpeg-4-fit/config.h && 612 sed -i -e 's/#define HAVE_GMTIME_R 0/#define HAVE_GMTIME_R 1/g' ${SRS_OBJS}/${SRS_PLATFORM}/ffmpeg-4-fit/config.h && 613 sed -i -e 's/#define HAVE_LOCALTIME_R 0/#define HAVE_LOCALTIME_R 1/g' ${SRS_OBJS}/${SRS_PLATFORM}/ffmpeg-4-fit/config.h && 614 # For MIPS, which fail with: 615 # ./libavutil/libm.h:54:32: error: static declaration of 'cbrt' follows non-static declaration 616 # /root/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/include/math.h:163:13: note: previous declaration of 'cbrt' was here 617 if [[ $SRS_CROSS_BUILD_ARCH == "mipsel" || $SRS_CROSS_BUILD_ARCH == "arm" || $SRS_CROSS_BUILD_ARCH == "aarch64" ]]; then 618 sed -i -e 's/#define HAVE_CBRT 0/#define HAVE_CBRT 1/g' ${SRS_OBJS}/${SRS_PLATFORM}/ffmpeg-4-fit/config.h && 619 sed -i -e 's/#define HAVE_CBRTF 0/#define HAVE_CBRTF 1/g' ${SRS_OBJS}/${SRS_PLATFORM}/ffmpeg-4-fit/config.h && 620 sed -i -e 's/#define HAVE_COPYSIGN 0/#define HAVE_COPYSIGN 1/g' ${SRS_OBJS}/${SRS_PLATFORM}/ffmpeg-4-fit/config.h && 621 sed -i -e 's/#define HAVE_ERF 0/#define HAVE_ERF 1/g' ${SRS_OBJS}/${SRS_PLATFORM}/ffmpeg-4-fit/config.h && 622 sed -i -e 's/#define HAVE_HYPOT 0/#define HAVE_HYPOT 1/g' ${SRS_OBJS}/${SRS_PLATFORM}/ffmpeg-4-fit/config.h && 623 sed -i -e 's/#define HAVE_RINT 0/#define HAVE_RINT 1/g' ${SRS_OBJS}/${SRS_PLATFORM}/ffmpeg-4-fit/config.h && 624 sed -i -e 's/#define HAVE_LRINT 0/#define HAVE_LRINT 1/g' ${SRS_OBJS}/${SRS_PLATFORM}/ffmpeg-4-fit/config.h && 625 sed -i -e 's/#define HAVE_LRINTF 0/#define HAVE_LRINTF 1/g' ${SRS_OBJS}/${SRS_PLATFORM}/ffmpeg-4-fit/config.h && 626 sed -i -e 's/#define HAVE_ROUND 0/#define HAVE_ROUND 1/g' ${SRS_OBJS}/${SRS_PLATFORM}/ffmpeg-4-fit/config.h && 627 sed -i -e 's/#define HAVE_ROUNDF 0/#define HAVE_ROUNDF 1/g' ${SRS_OBJS}/${SRS_PLATFORM}/ffmpeg-4-fit/config.h && 628 sed -i -e 's/#define HAVE_TRUNC 0/#define HAVE_TRUNC 1/g' ${SRS_OBJS}/${SRS_PLATFORM}/ffmpeg-4-fit/config.h && 629 sed -i -e 's/#define HAVE_TRUNCF 0/#define HAVE_TRUNCF 1/g' ${SRS_OBJS}/${SRS_PLATFORM}/ffmpeg-4-fit/config.h && 630 echo "FFmpeg sed ok" 631 fi 632 fi && 633 make -C ${SRS_OBJS}/${SRS_PLATFORM}/ffmpeg-4-fit ${SRS_JOBS} && 634 make -C ${SRS_OBJS}/${SRS_PLATFORM}/ffmpeg-4-fit install && 635 cp -rf ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/ffmpeg ${SRS_OBJS}/ && 636 echo "The ffmpeg-4-fit is ok." 637 fi 638 # check status 639 ret=$?; if [[ $ret -ne 0 ]]; then echo "Build ffmpeg-4-fit failed, ret=$ret"; exit $ret; fi 640 fi 641 642 ##################################################################################### 643 # live transcoding, ffmpeg-4.1, x264-core157, lame-3.99.5, libaacplus-2.0.2. 644 ##################################################################################### 645 # Guess where is the ffmpeg. 646 SYSTEMP_FFMPEG_BIN=which ffmpeg 647 # Always link the ffmpeg tools if exists. 648 if [[ -f $SYSTEMP_FFMPEG_BIN && ! -f ${SRS_OBJS}/ffmpeg/bin/ffmpeg ]]; then 649 mkdir -p ${SRS_OBJS}/ffmpeg/bin && 650 cp -f $SYSTEMP_FFMPEG_BIN ${SRS_OBJS}/ffmpeg/bin/ 651 fi 652 if [[ $SRS_FFMPEG_TOOL == YES ]]; then 653 if [[ -f ${SRS_OBJS}/ffmpeg/bin/ffmpeg ]]; then 654 cp -f $SYSTEMP_FFMPEG_BIN ${SRS_OBJS}/ffmpeg/bin/ && 655 echo "ffmpeg-4.1 is ok."; 656 else 657 echo -e "${RED}Error: No FFmpeg found at /usr/local/bin/ffmpeg${BLACK}" 658 echo -e "${RED} Please copy it from srs-docker${BLACK}" 659 echo -e "${RED} or download from http://ffmpeg.org/download.html${BLACK}" 660 echo -e "${RED} or disable it by --without-ffmpeg${BLACK}" 661 exit -1; 662 fi 663 fi 664 665 ##################################################################################### 666 # SRT module, https://github.com/ossrs/srs/issues/1147#issuecomment-577469119 667 ##################################################################################### 668 if [[ $SRS_SRT == YES && $SRS_USE_SYS_SRT == YES ]]; then 669 echo "Warning: Use system libsrt, without compiling srt." 670 fi 671 if [[ $SRS_SRT == YES && $SRS_USE_SYS_SRT == NO ]]; then 672 # Always disable c++11 for libsrt, because only the srt-app requres it. 673 LIBSRT_OPTIONS="--enable-apps=0 --enable-static=1 --enable-c++11=0" 674 if [[ $SRS_SHARED_SRT == YES ]]; then 675 LIBSRT_OPTIONS="$LIBSRT_OPTIONS --enable-shared=1" 676 else 677 LIBSRT_OPTIONS="$LIBSRT_OPTIONS --enable-shared=0" 678 fi 679 # For windows build, over cygwin 680 if [[ $SRS_CYGWIN64 == YES ]]; then 681 LIBSRT_OPTIONS="$LIBSRT_OPTIONS --cygwin-use-posix" 682 fi 683 # For cross-build. 684 if [[ $SRS_CROSS_BUILD == YES ]]; then 685 TOOL_GCC_REALPATH=$(realpath $(which $SRS_TOOL_CC)) 686 SRT_COMPILER_PREFIX=$(echo $TOOL_GCC_REALPATH |sed 's/-gcc.*$/-/') 687 LIBSRT_OPTIONS="$LIBSRT_OPTIONS --with-compiler-prefix=$SRT_COMPILER_PREFIX" 688 fi 689 690 if [[ -f ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/srt/lib/libsrt.a ]]; then 691 rm -rf ${SRS_OBJS}/srt && cp -rf ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/srt ${SRS_OBJS}/ && 692 echo "libsrt-1-fit is ok." 693 else 694 if [[ $SRS_USE_SYS_SSL != YES && ! -d ${SRS_OBJS}/openssl/lib/pkgconfig ]]; then 695 echo "OpenSSL pkgconfig no found, build srt-1-fit failed." 696 exit -1 697 fi 698 echo "Build srt-1-fit" && 699 rm -rf ${SRS_OBJS}/${SRS_PLATFORM}/srt-1-fit ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/srt ${SRS_OBJS}/srt && 700 cp -rf ${SRS_WORKDIR}/3rdparty/srt-1-fit ${SRS_OBJS}/${SRS_PLATFORM}/ && 701 patch -p0 -R ${SRS_OBJS}/${SRS_PLATFORM}/srt-1-fit/srtcore/api.cpp ${SRS_WORKDIR}/3rdparty/patches/srt/api.cpp-01.patch && 702 ( 703 cd ${SRS_OBJS}/${SRS_PLATFORM}/srt-1-fit && 704 env PKG_CONFIG_PATH=${SRS_DEPENDS_LIBS}/openssl/lib/pkgconfig \ 705 ./configure --prefix=${SRS_DEPENDS_LIBS}/${SRS_PLATFORM}/3rdparty/srt $LIBSRT_OPTIONS 706 ) && 707 make -C ${SRS_OBJS}/${SRS_PLATFORM}/srt-1-fit ${SRS_JOBS} && 708 make -C ${SRS_OBJS}/${SRS_PLATFORM}/srt-1-fit install && 709 # If exists lib64 of libsrt, copy it to lib 710 if [[ -d ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/srt/lib64 ]]; then 711 cp -rf ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/srt/lib64 ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/srt/lib 712 fi && 713 cp -rf ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/srt ${SRS_OBJS}/ && 714 echo "libsrt-1-fit is ok." 715 fi 716 ret=$?; if [[ $ret -ne 0 ]]; then echo "Build srt-1-fit failed, ret=$ret"; exit $ret; fi 717 fi 718 719 ##################################################################################### 720 # build utest code 721 ##################################################################################### 722 if [[ $SRS_UTEST == YES ]]; then 723 if [[ -f ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/gtest/googletest/include/gtest/gtest.h ]]; then 724 rm -rf ${SRS_OBJS}/gtest && cp -rf ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/gtest ${SRS_OBJS}/ && 725 echo "The gtest-fit is ok." 726 else 727 echo "Build gtest-fit" && 728 rm -rf ${SRS_OBJS}/${SRS_PLATFORM}gtest-fit ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/gtest ${SRS_OBJS}/gtest && 729 cp -rf ${SRS_WORKDIR}/3rdparty/gtest-fit ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/gtest && 730 cp -rf ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/gtest ${SRS_OBJS}/ && 731 echo "The gtest-fit is ok." 732 fi 733 # check status 734 ret=$?; if [[ $ret -ne 0 ]]; then echo "Build gtest-1.6.0 failed, ret=$ret"; exit $ret; fi 735 fi 736 737 ##################################################################################### 738 # build gperf code 739 ##################################################################################### 740 if [[ $SRS_GPERF == YES ]]; then 741 if [[ -f ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/gperf/bin/pprof ]]; then 742 rm -rf ${SRS_OBJS}/gperf && cp -rf ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/gperf ${SRS_OBJS}/ && 743 cp -f ${SRS_OBJS}/gperf/bin/pprof ${SRS_OBJS}/ && 744 echo "The gperftools-2-fit is ok." 745 else 746 echo "Build gperftools-2-fit" && 747 rm -rf ${SRS_OBJS}/${SRS_PLATFORM}/gperftools-2-fit ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/gperf \ 748 ${SRS_OBJS}/gperf ${SRS_OBJS}/pprof && 749 cp -rf ${SRS_WORKDIR}/3rdparty/gperftools-2-fit ${SRS_OBJS}/${SRS_PLATFORM}/ && 750 ( 751 cd ${SRS_OBJS}/${SRS_PLATFORM}/gperftools-2-fit && 752 ./configure --prefix=${SRS_DEPENDS_LIBS}/${SRS_PLATFORM}/3rdparty/gperf --enable-frame-pointers 753 ) && 754 make -C ${SRS_OBJS}/${SRS_PLATFORM}/gperftools-2-fit ${SRS_JOBS} && 755 make -C ${SRS_OBJS}/${SRS_PLATFORM}/gperftools-2-fit install && 756 cp -rf ${SRS_OBJS}/${SRS_PLATFORM}/3rdparty/gperf ${SRS_OBJS}/ && 757 cp -f ${SRS_OBJS}/gperf/bin/pprof ${SRS_OBJS}/ && 758 echo "The gperftools-2-fit is ok." 759 fi 760 # check status 761 ret=$?; if [[ $ret -ne 0 ]]; then echo "Build gperftools-2-fit failed, ret=$ret"; exit $ret; fi 762 fi 分析一下这个脚本都是什么功能 如果我想新增一个能编译app/srs_app_jwt.cpp的功能怎么添加,请帮我添加

最新推荐

recommend-type

婚纱摄影公司网络推广人员工作绩效说明.docx

婚纱摄影公司网络推广人员工作绩效说明.docx
recommend-type

VC图像编程全面资料及程序汇总

【标题】:"精通VC图像编程资料全览" 【知识点】: VC即Visual C++,是微软公司推出的一个集成开发环境(IDE),专门用于C++语言的开发。VC图像编程涉及到如何在VC++开发环境中处理和操作图像。在VC图像编程中,开发者通常会使用到Windows API中的GDI(图形设备接口)或GDI+来进行图形绘制,以及DirectX中的Direct2D或DirectDraw进行更高级的图形处理。 1. GDI(图形设备接口): - GDI是Windows操作系统提供的一套应用程序接口,它允许应用程序通过设备无关的方式绘制图形。 - 在VC图像编程中,主要使用CDC类(设备上下文类)来调用GDI函数进行绘制,比如绘制线条、填充颜色、显示文本等。 - CDC类提供了很多函数,比如`MoveTo`、`LineTo`、`Rectangle`、`Ellipse`、`Polygon`等,用于绘制基本的图形。 - 对于图像处理,可以使用`StretchBlt`、`BitBlt`、`TransparentBlt`等函数进行图像的位块传输。 2. GDI+: - GDI+是GDI的后继技术,提供了更丰富的图形处理功能。 - GDI+通过使用`Graphics`类来提供图像的绘制、文本的渲染、图像的处理和颜色管理等功能。 - GDI+引入了对矢量图形、渐变色、复杂的文本格式和坐标空间等更高级的图形处理功能。 - `Image`类是GDI+中用于图像操作的基础类,通过它可以进行图像的加载、保存、旋转、缩放等操作。 3. DirectX: - DirectX是微软推出的一系列API集合,用于在Windows平台上进行高性能多媒体编程。 - DirectX中的Direct2D是用于硬件加速的二维图形API,专门用于UI元素和简单的图形渲染。 - DirectDraw主要用于硬件加速的位图操作,比如全屏游戏开发中的画面渲染。 4. 位图操作: - 在VC图像编程中,位图操作是一个重要的部分。需要了解如何加载、保存和处理位图(BMP)文件。 - 可以使用位图文件格式的解析,来访问位图的像素数据,进行像素级别的图像处理和修改。 5. 高级图像处理技术: - 包括图像滤镜、图像转换、图像压缩和解压缩技术。 - 需要掌握一些图像处理算法,比如卷积、FFT(快速傅里叶变换)、DCT(离散余弦变换)等。 - 了解图像的色彩空间转换,比如RGB到YUV的转换,这在视频处理中非常重要。 6. 图像库的使用: - 除了直接使用API进行图像处理之外,还可以使用开源的图像处理库,如OpenCV。 - OpenCV是一个跨平台的计算机视觉和机器学习软件库,它提供了很多高级的图像处理功能。 【压缩包子文件的文件名称列表】: VC++ 文件名称列表显示为"VC++",这表明文件包中可能包含了Visual C++的项目、源代码文件、动态链接库(DLLs)、编译器设置、链接器设置等。如果要使用这些文件进行VC图像编程,需要确保Visual C++开发环境已经安装并且配置好,同时需要安装好所有依赖的库和工具。 要开始VC图像编程,开发者需要具备C++编程基础,熟悉Windows编程概念,并且对图形学有一定的了解。掌握VC图像编程技巧,对于进行桌面应用程序开发、图像处理软件开发以及游戏开发等都是至关重要的。
recommend-type

Pokemmo响应速度翻倍:多线程处理的高级技巧

# 摘要 多线程处理是提高软件并发性能和响应速度的关键技术,本文从基础概念与优势出发,深入探讨了多线程的实现机制,包括线程模型、调度算法、编程关键技术、线程安全性最佳实践、死锁预防与处理等方面。通
recommend-type

人名列表滚动抽奖

<think>嗯,用户想实现一个滚动抽奖功能,需要前端动画效果和随机选择逻辑。首先,我得考虑前端怎么实现滚动效果。可能用CSS动画或者JavaScript的requestAnimationFrame?比如,使用CSS的@keyframes来控制位移,或者用JS动态更新样式。然后,随机选择算法,可能需要确保公平性,比如用Fisher-Yates洗牌算法,或者用Math.random()来生成随机索引。然后,用户可能需要平滑的滚动动画,比如先快速滚动,然后逐渐减速,最后停在选中的人名上。这可能需要设置定时器,逐步改变位置,或者使用CSS过渡效果。另外,还要考虑性能,避免页面卡顿,可能需要使用硬件加
recommend-type

一站式JSF开发环境:即解压即用JAR包

标题:“jsf开发完整JAR包”所指的知识点: 1. JSF全称JavaServer Faces,是Java EE(现EE4J)规范之一,用于简化Java Web应用中基于组件的用户界面构建。JSF提供了一种模型-视图-控制器(MVC)架构的实现,使得开发者可以将业务逻辑与页面表示分离。 2. “开发完整包”意味着这个JAR包包含了JSF开发所需的所有类库和资源文件。通常来说,一个完整的JSF包会包含核心的JSF库,以及一些可选的扩展库,例如PrimeFaces、RichFaces等,这些扩展库提供了额外的用户界面组件。 3. 在一个项目中使用JSF,开发者无需单独添加每个必要的JAR文件到项目的构建路径中。因为打包成一个完整的JAR包后,所有这些依赖都被整合在一起,极大地方便了开发者的部署工作。 4. “解压之后就可以直接导入工程中使用”表明这个JAR包是一个可执行的归档文件,可能是一个EAR包或者一个可直接部署的Java应用包。解压后,开发者只需将其内容导入到他们的IDE(如Eclipse或IntelliJ IDEA)中,或者将其放置在Web应用服务器的正确目录下,就可以立即进行开发。 描述中所指的知识点: 1. “解压之后就可以直接导入工程中使用”说明这个JAR包是预先配置好的,它可能包含了所有必要的配置文件,例如web.xml、faces-config.xml等,这些文件是JSF项目运行所必需的。 2. 直接使用意味着减少了开发者配置环境和处理依赖的时间,有助于提高开发效率。 标签“jsf jar包”所指的知识点: 1. 标签指明了JAR包的内容是专门针对JSF框架的。因此,这个JAR包包含了JSF规范所定义的API以及可能包含的具体实现,比如Mojarra或MyFaces。 2. “jar包”是一种Java平台的归档文件格式,用于聚合多个文件到一个文件中。在JSF开发中,JAR文件经常被用来打包和分发库或应用程序。 文件名称列表“jsf”所指的知识点: 1. “jsf”文件名可能意味着这是JSF开发的核心库,它应该包含了所有核心的JavaServer Faces类文件以及资源文件。 2. 如果是使用特定版本的JSF,例如“jsf-2.2.jar”,则表明文件内包含了对应版本的JSF实现。这种情况下,开发者必须确认他们所使用的Web服务器或应用程序服务器支持该版本的JSF。 3. 文件名称也可能是“jsf-components.jar”、“jsf-impl.jar”等,表明这个JAR包是JSF的一个子模块或特定功能组件。例如,“jsf-components.jar”可能包含了一系列用于在JSF应用中使用的自定义组件。 4. 对于开发者而言,了解文件名称中所蕴含的信息非常重要,因为这将决定他们需要下载哪些JAR包来满足特定项目的需求。 综合以上信息,开发者在使用JSF进行Java Web应用开发时,会通过一个预先配置好的JAR包来快速地搭建和启动项目。这样做不仅简化了项目初始化的过程,也使得开发者能够更加聚焦于业务逻辑的实现和界面设计,而不必深究底层框架配置的细节。
recommend-type

Pokemmo内存优化揭秘:专家教你如何降低50%资源消耗

# 摘要 本文综述了Pokemmo游戏的内存优化方法,从内存管理基础出发,探讨内存使用效率的影响因素,并介绍了性能监控与分析工具。在内存优化实践技巧章节中,详细讨论了代码层面的优化、数据结构和算法选择对内存效率的影响,并通过案例分析展示了实际的优化过程。针对Pokemmo游戏特点,分析了内存消耗特性并提出了特定优化技术。最后,本文展望了未来内存管理技术的发展方向,以及游戏开发中面临的新挑战,为Pokemmo及类似游戏提供了优化建议。 # 关键字 内存优化;内存管理;性能监控;数据结构;算法效率;游戏开发 参考资源链接:[Pokemmo必备资源包:四种ROM与汉化补丁](https://we
recommend-type

直接访问子路由是吧

<think>我们正在使用Vue2,因此需要参考VueRouterv3的文档(因为Vue2对应VueRouterv3,Vue3对应VueRouterv4)。用户的问题是:如何配置路由以支持直接访问子路由?即,在Vue2中,我们希望直接通过URL访问嵌套的子路由(例如:/parent/child),而不仅仅是先访问父路由再导航到子路由。根据之前的回答和引用,我们已经知道:1.在父路由的配置中,使用`children`数组来定义子路由。2.子路由的`path`不能以斜杠开头(例如:'child'而不是'/child'),这样它就会基于父路由的路径进行拼接。3.在父组件的模板中放置`<router-
recommend-type

C++函数库查询辞典使用指南与功能介绍

标题中提到的“C++函数库查询辞典”指的是一个参考工具书或者是一个软件应用,专门用来查询C++编程语言中提供的标准库中的函数。C++是一种静态类型、编译式、通用编程语言,它支持多种编程范式,包括过程化、面向对象和泛型编程。C++标准库是一组包含函数、类、迭代器和模板的库,它为C++程序员提供标准算法和数据结构。 描述中提供的内容并没有给出实际的知识点,只是重复了标题的内容,并且有一串无关的字符“sdfsdfsdffffffffffffffffff”,因此这部分内容无法提供有价值的信息。 标签“C++ 函数库 查询辞典”强调了该工具的用途,即帮助开发者查询C++的标准库函数。它可能包含每个函数的详细说明、语法、使用方法、参数说明以及示例代码等,是学习和开发过程中不可或缺的参考资源。 文件名称“c++函数库查询辞典.exe”表明这是一个可执行程序。在Windows操作系统中,以“.exe”结尾的文件通常是可执行程序。这意味着用户可以通过双击或者命令行工具来运行这个程序,进而使用其中的查询功能查找C++标准库中各类函数的详细信息。 详细知识点如下: 1. C++标准库的组成: C++标准库由多个组件构成,包括输入输出流(iostream)、算法(algorithm)、容器(container)、迭代器(iterator)、字符串处理(string)、数值计算(numeric)、本地化(locale)等。 2. 输入输出流(iostream)库: 提供输入输出操作的基本功能。使用诸如iostream、fstream、sstream等头文件中的类和对象(如cin, cout, cerr等)来实现基本的输入输出操作。 3. 算法(algorithm)库: 包含对容器进行操作的大量模板函数,如排序(sort)、查找(find)、拷贝(copy)等。 4. 容器(container)库: 提供各种数据结构,如向量(vector)、列表(list)、队列(queue)、映射(map)等。 5. 迭代器(iterator): 迭代器提供了一种方法来访问容器中的元素,同时隐藏了容器的内部结构。 6. 字符串处理(string)库: C++标准库中的字符串类提供了丰富的功能用于处理字符串。 7. 数值计算(numeric)库: 提供数值计算所需的函数和类,比如对复数的支持和数值算法。 8. 本地化(locale)库: 提供本地化相关的功能,比如日期、时间的格式化显示以及字符的本地化比较。 9. 错误处理和异常: C++通过throw、try、catch关键字和标准异常类提供了一套异常处理机制。 10. 智能指针: C++11及其后续版本提供了智能指针(如unique_ptr、shared_ptr、weak_ptr)来自动管理动态分配的内存。 11. lambda表达式: 在C++11中引入,允许临时创建匿名函数对象。 12. C++11新特性: 包括范围for循环、移动语义、类内初始化器、auto类型推导等。 使用C++函数库查询辞典的用户可能需要对C++的基础知识有一定的掌握,例如变量、数据类型、控制结构、函数以及面向对象的概念等。了解C++标准库的结构和内容能够帮助程序员有效地利用库函数进行软件开发,提高编程效率并减少重复造轮子的工作。 总结来说,一个C++函数库查询辞典工具对于C++程序员来说是一个非常有用的资源,它能够提供快速查找标准库函数的能力,帮助程序员更高效地解决问题和进行学习。同时,随着C++标准的不断更新,例如C++11、C++14、C++17和C++20,函数库查询辞典也会不断地更新以包含新的特性,这对于紧跟技术发展的开发者来说尤为重要。
recommend-type

【bat脚本安全最佳实践】:保护你的系统与脚本安全的黄金法则

# 摘要 本文旨在全面阐述BAT脚本的基础知识、安全编写原则、审查与优化方法以及在企业环境中的安全应用。通过深入分析脚本安全基础、常见安全陷阱及脚本的权限管理,文章提出了安全编写的具体实践和预防措施。本文详细介绍了脚本安全审查流程、代码优化、错误处理和安全更新维护策略。在企业应用方面,探讨了企业安全政策制定、脚本审计和版本控制以及外部威胁的防范措施。通过案例分析,总结了脚本
recommend-type

IIC抽电

<think>首先,用户的问题是:“请问IIC电路供电问题”。这看起来是关于IIC(Inter-IntegratedCircuit)总线的电源供应问题。IIC是一种串行通信总线,常用于微控制器和外设之间的通信。从系统级指令:-所有行内数学表达式必须使用$...$格式。-独立公式必须使用$$...$$格式并单独成段。-使用中文回答。-生成相关问题。-回答中引用的段落末尾自然地添加引用标识。-回答结构清晰,帮助用户逐步解决问题。参考提供的引用:-引用[1]提到IIC总线注意事项,包括热插拔问题和电源干扰。-引用[2]是关于IIC原理的代码片段。-引用[3]讨论实时时钟RTC,提到PCF85063A