libtorrent安装问题

今天安装libtorrent遇到这个错误,搞了好久,唉!

make[1]: Entering directory `/root/libtorrent/libtorrent-rasterbar-1.0.5/src'  
  CXX      web_connection_base.lo
cc1plus: 错误:无法识别的命令行选项“-ftemplate-depth=120”  
make[1]: *** [web_connection_base.lo] 错误 1  
make[1]: Leaving directory `/root/libtorrent/libtorrent-rasterbar-1.0.5/src'  
make: *** [install-recursive] 错误 1  

找不到原因,扶墙过去看了下,发现这个issue

Please provide any additional information below.  
   I found in configure script this issue:
- this line resulting to gcc error:
   CXXFLAGS="$CXXFLAGS -ftemplate-depth=120"

- error:
   cc1plus: error: unrecognized command line option "-fftemplate-depth=120"

- configure is successful after change to this:
   CXXFLAGS="$CXXFLAGS -ftemplate-depth-120"

然后把configure文件里面-fftemplate-depth=120改成-fftemplate-depth-120,然后重新configure再make又有了新的问题:

/usr/bin/ld: /usr/lib64/libboost_system.a(error_code.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/lib64/libboost_system.a: could not read symbols: Bad value
collect2: ld returned 1 exit status  
make[1]: *** [libtorrent-rasterbar.la] 错误 1  
make[1]: Leaving directory `/root/libtorrent/libtorrent-rasterbar-1.0.5/src'  
make: *** [install-recursive] 错误 1  

重新configure加上--disable-shared的参数就没问题了:

CFLAGS="-fPIC" ./configure --enable-static --enable-shared --disable-geoip --disable-debug --enable-tests --enable-examples --disable-shared