背景

这是以前编译及使用模块的一些记录,现在编译基本都是使用Buildroot,能很好的解决依赖问题。

zlib & madplay

报错:
audio: /dev/dsp: No such file or directory:
madplay是基于以前的oss建构的

<*>OSS Mixer API
<*>OSS PCM (digital audio) API

编译:

export CC=arm-linux-gcc
./configure --prefix=/home/xxx/dd/madpalyer/out
#libid3tag libmad madplay:
./configure --host=arm-linux --prefix=/home/xxx/dd/madpalyer/out --disable-debugging --disable-shared --enable-static CPPFLAGS=-I/home/xxx/dd/madpalyer/out/include LDFLAGS=-L/home/xxx/dd/madpalyer/out/lib

使用:

export TERM=vt100
export TERMINFO=/mnt/flash/usr/share/terminfo
#mkdir /usr/share/terminfo/v -p

export LD_LIBRARY_PATH=/mnt/sd/madplay/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/mnt/flash/app/lib:/mnt/sd/vienna/lib:$LD_LIBRARY_PATH
./madplay -o wave:- x.mp3 | ../aplay

zbar:

编译:

./configure --host=arm-hisiv300-linux --enable-shared --enable-static --without-jpeg --without-gtk --without-qt --disable-video --without-imagemagick --without-python 

报错:
../libtool: eval: line 950: syntax error near unexpected token |

export NM=nm And then execute ./configure again.

libiconv:

./configure --host=arm-hisiv300-linux --enable-shared --enable-static
make CROSS_COMPILE=arm-hisiv300-linux- ARCH=arm

Valgrind:

编译配置:

./configure --host=arm-poky-linux-gnueabi --prefix=/home/xxx/valgrind

  • 错误:
    checking for a supported CPU… no (arm)
    configure: error: Unsupported host architecture. Sorry:
    解决:
    configure脚本里
    case “${host_cpu}” in
    armv7*)改成armv7*|arm)
  • 错误:
    valgrind: failed to start tool ‘memcheck’ for platform ‘arm-linux’: No such file or directory”
    解决:

–prefix=/opt/valgrind指定的目录要与开发板上放置的目录一致,不然运行valgrind时可能会出现“valgrind: failed to start tool ‘memcheck’ for platform ‘arm-linux’: No such file or directory”错误

  • 错误:
    valgrind: failed to start tool ‘memcheck’ for platform ‘arm-linux’: Permission denied
    解决:
    export VALGRIND_LIB=”/home/xxx/valgrind”
    chmod -R +x /home/xxx/valgrind

Jrtplib

  • 错误:
    Can’t retrieve login name
    解决:
    方法1:export LOGNAME=root
    方法2:修改源码RTPSession.cpp
    char *logname = getenv( "LOGNAME" );                                      
      if( 0 = = logname )                                                        
      {                                                                     
        printf( "Can't getenv LOGNAME, we will use \"root\" instead\n" );             
        strncpy( ( char * )buffer, "root", *bufferlength );                            
      }                                                                     
      else                                                                   
      {                                                                      
        strncpy( ( char * )buffer, logname, *bufferlength );                          
      }

    libjpeg-9c:

    编译配置:
    ./configure --prefix=/home/xxx/dd/AppCode/NAS-8921/sdk/jpeg-9c/out  --host=arm-linux  CC=arm-linux-gcc --enable-shared --enable-static
    
    ./configure --prefix=/home/xxx/dd/AppCode/NAS-8921/sdk/freetype-2.9.1/out  --host=arm-linux  CC=arm-linux-gcc --enable-shared --enable-static
    
    ./configure --prefix=/home/xxx/dd/AppCode/NAS-8921/sdk/libiconv-1.15/out  --host=arm-linux  CC=arm-linux-gcc --enable-shared --enable-static

    dropbear(SSH):

    编译配置:
    ./configure --prefix=/home/xxx/dd/dropbear-arm --host=arm-poky-linux-gnueabi  --with-zlib=/home/xxx/rootfs_9031/ 
    source
    修改Makefile

openssh:

编译配置:

./configure --host=arm-poky-linux-gnueabi --with-libs --with-zlib=/home/xxx/rootfs_9031/ --with-ssl-dir=/home/xxx/rootfs_9031/ --disable-etc-default-login 

lighttpd:

编译配置:

make distclean
./configure --prefix=/home/xxx/dd/lighttpd-1.4.58/out --host=arm-poky-linux-gnueabi --build=aarch64-linux-gnu --disable-FEATURE --enable-shared --disable-static --disable-lfs --disable-ipv6 --without-PACKAGE --without-valgrind --without-openssl --without-kerberos5 --with-pcre --without-zlib --without-bzip2 --without-lua
make 
make install
  • lighttpd交叉编译后执行加载plugin报dlopen错误?
    启动时,加上-m参数,默认查找插件库(mod_*.so)的路径为prefix/lib
    lighttpd -m /PathToLib -f /var/www/lighttpd.conf