@@ -45,24 +45,6 @@ function Ubuntu_prepare()
45
45
fi
46
46
fi
47
47
fi
48
-
49
- # cross build for arm, install the cross build tool chain.
50
- if [ $SRS_ARM_UBUNTU12 = YES ]; then
51
- $SrsArmCC --help > /dev/null 2>&1 ; ret=$? ; if [[ 0 -ne $ret ]]; then
52
- echo " Installing gcc-arm-linux-gnueabi g++-arm-linux-gnueabi."
53
- require_sudoer " sudo apt-get install -y --force-yes gcc-arm-linux-gnueabi g++-arm-linux-gnueabi"
54
- sudo apt-get install -y --force-yes gcc-arm-linux-gnueabi g++-arm-linux-gnueabi; ret=$? ; if [[ 0 -ne $ret ]]; then return $ret ; fi
55
- echo " The gcc-arm-linux-gnueabi g++-arm-linux-gnueabi are installed."
56
- fi
57
- fi
58
-
59
- # cross build for mips, user must installed the tool chain.
60
- if [ $SRS_MIPS_UBUNTU12 = YES ]; then
61
- $SrsArmCC --help > /dev/null 2>&1 ; ret=$? ; if [[ 0 -ne $ret ]]; then
62
- echo " You must install the tool chain: $SrsArmCC "
63
- return 2
64
- fi
65
- fi
66
48
67
49
OS_IS_UBUNTU=YES
68
50
echo " Installing tools for Ubuntu."
@@ -168,12 +150,6 @@ function Centos_prepare()
168
150
if [[ ! -f /etc/redhat-release ]]; then
169
151
return 0;
170
152
fi
171
-
172
- # cross build for arm, install the cross build tool chain.
173
- if [ $SRS_CROSS_BUILD = YES ]; then
174
- echo " CentOS doesn't support crossbuild for arm/mips, please use Ubuntu instead."
175
- return 1
176
- fi
177
153
178
154
OS_IS_CENTOS=YES
179
155
echo " Installing tools for Centos."
@@ -291,12 +267,6 @@ function OSX_prepare()
291
267
fi
292
268
return 0;
293
269
fi
294
-
295
- # cross build for arm, install the cross build tool chain.
296
- if [ $SRS_CROSS_BUILD = YES ]; then
297
- echo " OSX doesn't support crossbuild for arm/mips, please use Ubuntu instead."
298
- return 1
299
- fi
300
270
301
271
OS_IS_OSX=YES
302
272
echo " Installing tools for OSX."
@@ -455,37 +425,19 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
455
425
_ST_EXTRA_CFLAGS=" $_ST_EXTRA_CFLAGS -DMD_VALGRIND"
456
426
fi
457
427
# Patched ST from https://github.com/ossrs/state-threads/tree/srs
458
- if [ $SRS_CROSS_BUILD = YES ]; then
459
- # ok, arm specified, if the flag filed does not exists, need to rebuild.
460
- if [[ -f ${SRS_OBJS} /_flag.st.cross.build.tmp && -f ${SRS_OBJS} /st/libst.a ]]; then
461
- echo " The state-threads for arm is ok." ;
462
- else
463
- echo " Building state-threads for arm." ;
464
- (
465
- rm -rf ${SRS_OBJS} /state-threads-1.9.1 && cd ${SRS_OBJS} &&
466
- tar xf ../3rdparty/state-threads-1.9.1.tar.gz && cd state-threads-1.9.1 && chmod +w * &&
467
- patch -p0 < ../../3rdparty/patches/6.st.osx10.14.build.patch &&
468
- make ${_ST_MAKE} CC=${SrsArmCC} AR=${SrsArmAR} LD=${SrsArmLD} RANDLIB=${SrsArmRANDLIB} EXTRA_CFLAGS=" ${_ST_EXTRA_CFLAGS} " &&
469
- cd .. && rm -f st && ln -sf state-threads-1.9.1/obj st &&
470
- rm -f state-threads && ln -sf state-threads-1.9.1 state-threads &&
471
- cd .. && touch ${SRS_OBJS} /_flag.st.cross.build.tmp
472
- )
473
- fi
428
+ if [[ ! -f ${SRS_OBJS} /_flag.st.cross.build.tmp && -f ${SRS_OBJS} /st/libst.a ]]; then
429
+ echo " The state-threads is ok." ;
474
430
else
475
- if [[ ! -f ${SRS_OBJS} /_flag.st.cross.build.tmp && -f ${SRS_OBJS} /st/libst.a ]]; then
476
- echo " The state-threads is ok." ;
477
- else
478
- echo " Building state-threads." ;
479
- (
480
- rm -rf ${SRS_OBJS} /state-threads-1.9.1 && cd ${SRS_OBJS} &&
481
- tar xf ../3rdparty/state-threads-1.9.1.tar.gz && cd state-threads-1.9.1 && chmod +w * &&
482
- patch -p0 < ../../3rdparty/patches/6.st.osx10.14.build.patch &&
483
- make ${_ST_MAKE} EXTRA_CFLAGS=" ${_ST_EXTRA_CFLAGS} " &&
484
- cd .. && rm -f st && ln -sf state-threads-1.9.1/obj st &&
485
- rm -f state-threads && ln -sf state-threads-1.9.1 state-threads &&
486
- cd .. && rm -f ${SRS_OBJS} /_flag.st.cross.build.tmp
487
- )
488
- fi
431
+ echo " Building state-threads." ;
432
+ (
433
+ rm -rf ${SRS_OBJS} /state-threads-1.9.1 && cd ${SRS_OBJS} &&
434
+ tar xf ../3rdparty/state-threads-1.9.1.tar.gz && cd state-threads-1.9.1 && chmod +w * &&
435
+ patch -p0 < ../../3rdparty/patches/6.st.osx10.14.build.patch &&
436
+ make ${_ST_MAKE} EXTRA_CFLAGS=" ${_ST_EXTRA_CFLAGS} " &&
437
+ cd .. && rm -f st && ln -sf state-threads-1.9.1/obj st &&
438
+ rm -f state-threads && ln -sf state-threads-1.9.1 state-threads &&
439
+ cd .. && rm -f ${SRS_OBJS} /_flag.st.cross.build.tmp
440
+ )
489
441
fi
490
442
# check status
491
443
ret=$? ; if [[ $ret -ne 0 ]]; then echo " Build state-threads failed, ret=$ret " ; exit $ret ; fi
@@ -508,7 +460,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
508
460
mkdir -p ${SRS_OBJS} /nginx
509
461
fi
510
462
# make nginx
511
- __SRS_BUILD_NGINX=NO; if [ $SRS_CROSS_BUILD = NO ] ; then if [ $ SRS_NGINX = YES ]; then __SRS_BUILD_NGINX=YES; fi fi
463
+ __SRS_BUILD_NGINX=NO; if [ $SRS_NGINX = YES ]; then __SRS_BUILD_NGINX=YES; fi
512
464
if [ $__SRS_BUILD_NGINX = YES ]; then
513
465
if [[ -f ${SRS_OBJS} /nginx/sbin/nginx ]]; then
514
466
echo " The nginx-1.5.7 is ok." ;
615
567
# ####################################################################################
616
568
# extra configure options
617
569
CONFIGURE_TOOL=" ./config"
618
- if [ $SRS_CROSS_BUILD = YES ]; then
619
- CONFIGURE_TOOL=" ./Configure linux-armv4"
620
- fi
621
570
if [ $SRS_OSX = YES ]; then
622
571
CONFIGURE_TOOL=" ./Configure darwin64-` uname -m` -cc"
623
572
fi
@@ -635,39 +584,19 @@ if [ $SRS_SSL = YES ]; then
635
584
if [ $SRS_USE_SYS_SSL = YES ]; then
636
585
echo " Warning: Use system libssl, without compiling openssl."
637
586
else
638
- # check the cross build flag file, if flag changed, need to rebuild the st.
639
- if [ $SRS_CROSS_BUILD = YES ]; then
640
- # ok, arm specified, if the flag filed does not exists, need to rebuild.
641
- if [[ -f ${SRS_OBJS} /_flag.ssl.cross.build.tmp && -f ${SRS_OBJS} /openssl/lib/libssl.a ]]; then
642
- echo " The openssl-1.1.0e for arm is ok." ;
643
- else
644
- echo " Building openssl-1.1.0e for ARM." ;
645
- (
646
- rm -rf ${SRS_OBJS} /openssl-1.1.0e && cd ${SRS_OBJS} &&
647
- unzip -q ../3rdparty/openssl-1.1.0e.zip && cd openssl-1.1.0e &&
648
- $CONFIGURE_TOOL --prefix=` pwd` /_release -no-shared no-asm no-threads $OPENSSL_HOTFIX &&
649
- make CC=${SrsArmCC} GCC=${SrsArmGCC} AR=" ${SrsArmAR} r" \
650
- LD=${SrsArmLD} LINK=${SrsArmGCC} RANDLIB=${SrsArmRANDLIB} &&
651
- make install_sw &&
652
- cd .. && rm -rf openssl && ln -sf openssl-1.1.0e/_release openssl &&
653
- cd .. && touch ${SRS_OBJS} /_flag.ssl.cross.build.tmp
654
- )
655
- fi
587
+ # cross build not specified, if exists flag, need to rebuild for no-arm platform.
588
+ if [[ ! -f ${SRS_OBJS} /_flag.ssl.cross.build.tmp && -f ${SRS_OBJS} /openssl/lib/libssl.a ]]; then
589
+ echo " Openssl-1.1.0e is ok." ;
656
590
else
657
- # cross build not specified, if exists flag, need to rebuild for no-arm platform.
658
- if [[ ! -f ${SRS_OBJS} /_flag.ssl.cross.build.tmp && -f ${SRS_OBJS} /openssl/lib/libssl.a ]]; then
659
- echo " Openssl-1.1.0e is ok." ;
660
- else
661
- echo " Building openssl-1.1.0e." ;
662
- (
663
- rm -rf ${SRS_OBJS} /openssl-1.1.0e && cd ${SRS_OBJS} &&
664
- unzip -q ../3rdparty/openssl-1.1.0e.zip && cd openssl-1.1.0e &&
665
- $CONFIGURE_TOOL --prefix=` pwd` /_release -no-shared no-threads $OPENSSL_HOTFIX &&
666
- make && make install_sw &&
667
- cd .. && rm -rf openssl && ln -sf openssl-1.1.0e/_release openssl &&
668
- cd .. && rm -f ${SRS_OBJS} /_flag.ssl.cross.build.tmp
669
- )
670
- fi
591
+ echo " Building openssl-1.1.0e." ;
592
+ (
593
+ rm -rf ${SRS_OBJS} /openssl-1.1.0e && cd ${SRS_OBJS} &&
594
+ unzip -q ../3rdparty/openssl-1.1.0e.zip && cd openssl-1.1.0e &&
595
+ $CONFIGURE_TOOL --prefix=` pwd` /_release -no-shared no-threads $OPENSSL_HOTFIX &&
596
+ make && make install_sw &&
597
+ cd .. && rm -rf openssl && ln -sf openssl-1.1.0e/_release openssl &&
598
+ cd .. && rm -f ${SRS_OBJS} /_flag.ssl.cross.build.tmp
599
+ )
671
600
fi
672
601
# check status
673
602
ret=$? ; if [[ $ret -ne 0 ]]; then echo " Build openssl-1.1.0e failed, ret=$ret " ; exit $ret ; fi
0 commit comments