Wednesday, October 7, 2015



Sử dụng thư viện transmission-2.84 làm chương trình BitTorrent Downloader

Thư viện phụ thuộc:
- curl
- zlib
- openssl
- libevent
- boost

Cross các thư viện trên theo hướng dẫn.

Build transmission-2.84
  export PATH=$PATH:/opt/FriendlyARM/toolschain/4.4.3/bin  
  export CROSS=arm-none-linux-gnueabi-    
  export HOST=arm-none-linux-gnueabi    
     
  DEPEND_LIB_DIR=/path/to/dependent/install   
  export CFLAGS=-I${DEPEND_LIB_DIR}/include   
  export CPPFLAGS=-I${DEPEND_LIB_DIR}/include   
  export LDFLAGS=-L${DEPEND_LIB_DIR}/lib   
  export PKG_CONFIG_PATH=${DEPEND_LIB_DIR}/lib/pkgconfig   
  export LD_LIBRARY_PATH=${DEPEND_LIB_DIR}/lib   
  export PATH=$PATH:${DEPEND_LIB_DIR}/bin:${DEPEND_LIB_DIR}/sbin   
     
  export PREFIX=/friendlyarm    
  ./configure --prefix=${PREFIX} --host=${HOST} CC=${CROSS}gcc  \  
                --without-gtk --disable-libnotify \  
                --disable-mac --disable-wx \  
                --disable-beos --enable-utp \  
                --disable-nls --enable-inotify \  
                --enable-utp --enable-lightweight \  
                --enable-cli --enable-daemon  
      
  make    
  make install    


 #run transmission on board 
 DEPEND_LIB_DIR=/path/to/dependent/install   
 export CFLAGS=-I${DEPEND_LIB_DIR}/include   
 export CPPFLAGS=-I${DEPEND_LIB_DIR}/include   
 export LDFLAGS=-L${DEPEND_LIB_DIR}/lib   
 export PKG_CONFIG_PATH=${DEPEND_LIB_DIR}/lib/pkgconfig   
 export LD_LIBRARY_PATH=${DEPEND_LIB_DIR}/lib   
 export PATH=$PATH:${DEPEND_LIB_DIR}/bin:${DEPEND_LIB_DIR}/sbin   
    
 transmission-daemon  
 transmission-remote 127.0.0.1:9091 -a the_torrent_file.torrent  
 transmission-remote 127.0.0.1:9091 -l -si  
   
 => /Downloads and /.config/transmission are created  
   
   
 transmission-cli the_torrent_file.torrent  
   
 http://127.0.0.1:9091/transmission/web  

Leave a Reply

Subscribe to Posts | Subscribe to Comments

- Copyright © Lập trình hệ thống nhúng Linux . Powered by Luong Duy Ninh -