1. 程式人生 > >SRS 編譯安裝坑

SRS 編譯安裝坑

SRS 編譯

start


 
  1. #./objs/srs -c conf/rtmp.conf

kill


 
  1. #ps aux | grep srs | awk {'print $2'} | xargs kill

srs 2.0 release


 
  1. [[email protected]-jinya.epc.baidu.com trunk]# ./configure
  2. ./configure_origion: line 67: syntax error near unexpected token
    `"`dirname $__mfile`"'
  3. ./configure_origion: line 67: ` SRS_MODULES+=("`dirname $__mfile`")'

#將configure 的 += 改為陣列的 XXX=(${XXX[8]} "sdfsf");應該有 4 處


 
  1. [[email protected]-jinya.epc.baidu.com trunk]# make
  2. ...
  3. srs_ingest_flv.c:262: error: for each function it appears in.)
  4. srs_ingest_flv
    .c: In function `re_cleanup':
  5. srs_ingest_flv.c:274: error: `useconds_t' undeclared (first use in this function)
  6. make[3]: *** [objs/srs_ingest_flv] Error 1
  7. make[3]: Leaving directory `/home/forum/srs/trunk/research/librtmp'
  8. make[2]: *** [ssl] Error 2
  9. make[2]: Leaving directory `/home/forum/srs/trunk/research/librtmp'
  10. make[1]: *** [librtmp] Error 2
  11. make[1]: Leaving directory `/home/forum/srs/trunk'
  12. make: *** [default] Error 2
  13. [[email protected] trunk]# vim objs/include/srs_librtmp.h

#加上宣告


 
  1. // typedefs
  2. typedef int64_t useconds_t;
  3. typedef int srs_bool;
  4. ...

20160311

升級make

./configure 
make 
後,make在原始檔夾裡面。cp到 /usr/bin/下面(注意做好備份)

編譯


 
  1. Makefile:3: *** unterminated call to function 'foreach': missing ')'. Stop.

看看是不是有換行,有換行就去掉 
http://stackoverflow.com/questions/18989598/makefile-unterminated-call-to-function-foreach-missing-stop

編譯–with-ffmpeg

編譯第三方庫的時候,從auto/裡面建立ln -sf 到 objs裡 
比如 ffmpeg, 從objs/ffmpeg.src裡面建立的ln 
但是編譯ffmpeg的時候,可能會遇到 disable-asm的情況,請確認是x264 問題還是 ffmpeg問題

fdk-aac編譯不過 
https://github.com/mstorsjo/fdk-aac/issues/6


 
  1. diff --git a/Makefile.am b/Makefile.am
  2. index e995b0a..efa6fcb 100644
  3. --- a/Makefile.am
  4. +++ b/Makefile.am
  5. @@ -13,7 +13,7 @@ AM_CPPFLAGS = \
  6. -I$(top_srcdir)/libPCMutils/include
  7. AM_CXXFLAGS = -fno-exceptions -fno-rtti
  8. -libfdk_aac_la_LINK = $(LINK) $(libfdk_aac_la_LDFLAGS)
  9. +#libfdk_aac_la_LINK = $(LINK) $(libfdk_aac_la_LDFLAGS)
  10. # Mention a dummy pure C file to trigger generation of the $(LINK) variable
  11. nodist_EXTRA_libfdk_aac_la_SOURCES = dummy.c
  12. diff --git a/configure.ac b/configure.ac
  13. index c52d0b9..f489835 100644
  14. --- a/configure.ac
  15. +++ b/configure.ac
  16. @@ -19,7 +19,11 @@ AM_CONDITIONAL(EXAMPLE, test x$example = xyes)
  17. dnl Checks for programs.
  18. AC_PROG_CC
  19. AC_PROG_CXX
  20. -LT_INIT
  21. +
  22. +AM_PROG_CC_C_O
  23. +
  24. +AC_PROG_LIBTOOL
  25. +AC_SUBST(LIBTOOL_DEPS)
  26. AC_CHECK_LIB([m], [sin])