winlin

add option --static, to static link for arm

@@ -78,7 +78,7 @@ Supported operating systems and hardware: @@ -78,7 +78,7 @@ Supported operating systems and hardware:
78 1. Simple: also stable enough.<br/> 78 1. Simple: also stable enough.<br/>
79 2. [High-performance](https://github.com/winlinvip/simple-rtmp-server/wiki/Performance): single-thread, async socket, event/st-thread driven.<br/> 79 2. [High-performance](https://github.com/winlinvip/simple-rtmp-server/wiki/Performance): single-thread, async socket, event/st-thread driven.<br/>
80 3. With RTMP edge server, support origin server.<br/> 80 3. With RTMP edge server, support origin server.<br/>
81 -4. NO vod streaming, live streaming only.<br/> 81 +4. RTMP without vod streaming, live streaming only.<br/>
82 5. With multiple processes, support single process.<br/> 82 5. With multiple processes, support single process.<br/>
83 6. Support vhost, support \_\_defaultVhost\_\_.<br/> 83 6. Support vhost, support \_\_defaultVhost\_\_.<br/>
84 7. Support adobe rtmp live streaming.<br/> 84 7. Support adobe rtmp live streaming.<br/>
@@ -30,6 +30,7 @@ SRS_GPROF=RESERVED # gprof @@ -30,6 +30,7 @@ SRS_GPROF=RESERVED # gprof
30 SRS_ARM_UBUNTU12=RESERVED # armhf(v7cpu) built on ubuntu12 30 SRS_ARM_UBUNTU12=RESERVED # armhf(v7cpu) built on ubuntu12
31 # arguments 31 # arguments
32 SRS_JOBS=1 32 SRS_JOBS=1
  33 +SRS_STATIC=RESERVED
33 34
34 ##################################################################################### 35 #####################################################################################
35 # parse options 36 # parse options
@@ -82,6 +83,7 @@ do @@ -82,6 +83,7 @@ do
82 --without-arm-ubuntu12) SRS_ARM_UBUNTU12=NO ;; 83 --without-arm-ubuntu12) SRS_ARM_UBUNTU12=NO ;;
83 84
84 --jobs) SRS_JOBS=${value} ;; 85 --jobs) SRS_JOBS=${value} ;;
  86 + --static) SRS_STATIC=YES ;;
85 87
86 *) 88 *)
87 echo "$0: error: invalid option \"$option\"" 89 echo "$0: error: invalid option \"$option\""
@@ -109,6 +111,8 @@ if [ $SRS_ARM_UBUNTU12 = YES ]; then @@ -109,6 +111,8 @@ if [ $SRS_ARM_UBUNTU12 = YES ]; then
109 if [ $SRS_GPERF_CP = RESERVED ]; then SRS_GPERF_CP=NO; fi 111 if [ $SRS_GPERF_CP = RESERVED ]; then SRS_GPERF_CP=NO; fi
110 if [ $SRS_GPROF = RESERVED ]; then SRS_GPROF=NO; fi 112 if [ $SRS_GPROF = RESERVED ]; then SRS_GPROF=NO; fi
111 if [ $SRS_ARM_UBUNTU12 = RESERVED ]; then SRS_ARM_UBUNTU12=NO; fi 113 if [ $SRS_ARM_UBUNTU12 = RESERVED ]; then SRS_ARM_UBUNTU12=NO; fi
  114 + # for arm, always set to static link.
  115 + SRS_STATIC=YES
112 else 116 else
113 if [ $SRS_HLS = RESERVED ]; then SRS_HLS=YES; fi 117 if [ $SRS_HLS = RESERVED ]; then SRS_HLS=YES; fi
114 if [ $SRS_SSL = RESERVED ]; then SRS_SSL=YES; fi 118 if [ $SRS_SSL = RESERVED ]; then SRS_SSL=YES; fi
@@ -124,6 +128,7 @@ else @@ -124,6 +128,7 @@ else
124 if [ $SRS_GPERF_CP = RESERVED ]; then SRS_GPERF_CP=NO; fi 128 if [ $SRS_GPERF_CP = RESERVED ]; then SRS_GPERF_CP=NO; fi
125 if [ $SRS_GPROF = RESERVED ]; then SRS_GPROF=NO; fi 129 if [ $SRS_GPROF = RESERVED ]; then SRS_GPROF=NO; fi
126 if [ $SRS_ARM_UBUNTU12 = RESERVED ]; then SRS_ARM_UBUNTU12=NO; fi 130 if [ $SRS_ARM_UBUNTU12 = RESERVED ]; then SRS_ARM_UBUNTU12=NO; fi
  131 + if [ $SRS_STATIC = RESERVED ]; then SRS_STATIC=NO; fi
127 fi 132 fi
128 133
129 # parse the jobs for make 134 # parse the jobs for make
@@ -176,6 +181,7 @@ if [ $help = yes ]; then @@ -176,6 +181,7 @@ if [ $help = yes ]; then
176 --without-gprof do not build srs with gprof(GNU profile tool). 181 --without-gprof do not build srs with gprof(GNU profile tool).
177 --without-arm-ubuntu12 do not build srs on ubuntu12 for armhf(v7cpu). 182 --without-arm-ubuntu12 do not build srs on ubuntu12 for armhf(v7cpu).
178 183
  184 + --static whether add '-static' to link options. always set this option for arm.
179 --jobs[=N] Allow N jobs at once; infinite jobs with no arg. 185 --jobs[=N] Allow N jobs at once; infinite jobs with no arg.
180 used for make in the configure, for example, to make ffmpeg. 186 used for make in the configure, for example, to make ffmpeg.
181 187
@@ -259,5 +265,6 @@ if [ $SRS_GPERF_MP = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-gmp"; el @@ -259,5 +265,6 @@ if [ $SRS_GPERF_MP = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-gmp"; el
259 if [ $SRS_GPERF_CP = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-gcp"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-gcp"; fi 265 if [ $SRS_GPERF_CP = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-gcp"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-gcp"; fi
260 if [ $SRS_GPROF = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-gprof"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-gprof"; fi 266 if [ $SRS_GPROF = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-gprof"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-gprof"; fi
261 if [ $SRS_ARM_UBUNTU12 = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-arm-ubuntu12"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-arm-ubuntu12"; fi 267 if [ $SRS_ARM_UBUNTU12 = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-arm-ubuntu12"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-arm-ubuntu12"; fi
  268 +if [ $SRS_STATIC = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --static"; fi
262 SRS_CONFIGURE="${SRS_CONFIGURE} ${SRS_JOBS}" 269 SRS_CONFIGURE="${SRS_CONFIGURE} ${SRS_JOBS}"
263 echo "regenerate config: ${SRS_CONFIGURE}" 270 echo "regenerate config: ${SRS_CONFIGURE}"
@@ -317,7 +317,7 @@ if [ $SRS_SSL = YES ]; then LibSSLRoot="${SRS_OBJS}/openssl/include"; LibSSLfile @@ -317,7 +317,7 @@ if [ $SRS_SSL = YES ]; then LibSSLRoot="${SRS_OBJS}/openssl/include"; LibSSLfile
317 LibGperfRoot=""; LibGperfFile="" 317 LibGperfRoot=""; LibGperfFile=""
318 if [ $SRS_GPERF = YES ]; then LibGperfRoot="${SRS_OBJS}/gperf/include"; LibGperfFile="${SRS_OBJS}/gperf/lib/libtcmalloc_and_profiler.a"; fi 318 if [ $SRS_GPERF = YES ]; then LibGperfRoot="${SRS_OBJS}/gperf/include"; LibGperfFile="${SRS_OBJS}/gperf/lib/libtcmalloc_and_profiler.a"; fi
319 # the link options, always use static link 319 # the link options, always use static link
320 -SrsLinkOptions="-static" 320 +SrsLinkOptions="-ldl"; if [ $SRS_STATIC = YES ]; then SrsLinkOptions="${SrsLinkOptions} -static"; fi
321 321
322 ##################################################################################### 322 #####################################################################################
323 # Modules, compile each module, then link to binary 323 # Modules, compile each module, then link to binary