嵌入式常用库

ARM-LINUX下一些常用库的移植  

2010-04-28 10:51:47|  分类: arm-linux|举报|字号 订阅

 
 

一些库在各个项目经常重用.如jpeg,freetype,iconv 等.每次大型项目均会反复重用.因此按照原来项目规范,一般都放在项目libs目录下,但后来发现,每个项目都做重复操作.也完全没有必要.因为现在是将其归纲到一个comm_lib公用信息.

 

以下是常用库的ARM-Linux移植,我是放在/home/hxy/common_lib 目录下.按到移植规范,输出在 output/arm-linux下,库本身在 libs 下面.

 

以下是常见库的移植.在这里留作教学和备份用.

 

通用类

 

1.zlib库移植

  •  

     下载

     

  •  

    解压 tar xvzf zlib-1.2.3.tar.gz

     

  •  

    cd zlib-1.2.3

     

  •  

    生成Makefile(注意zlib只能静态,动态分开编译,因此要生成两次Makefile和两次编译和安装)

     

    •  

      生成静态库 CC=arm-linux-gcc CPP="arm-linux-gcc -E" AR="arm-linux-ar rc" RANLIB=arm-linux-ranlib ./configure --prefix=$PWD/../../output/arm-linux

       

    •  

      生成动态库 CC=arm-linux-gcc CPP="arm-linux-gcc -E" AR="arm-linux-ar rc" RANLIB=arm-linux-ranlib ./configure --shared  --prefix=$PWD/../../output/arm-linux

       

  •  

    编译 make

     

  •  

    安装 make install

     

 

 

 

图像类

 

1.jpeg库,用于jpeg图像处理

  •  

       ftp://ftp.nz.debian.org/gentoo/distfiles/jpegsrc.v6b.tar.gz

     

  •  

    解压 tar xvzf jpegsrc.v6b.tar.gz

     

  •  

    cd jpeg-6b

     

  •  

    生成Makefile

     

    •  

       ./configure --enable-shared  --enable-static --host=arm-linux --prefix=$PWD/../../output/arm-linux

       

  •  

    编译 make

     

  •  

    安装 make install

     

    •  

      注意这个库的安装程序有BUG,不会自动创建发布的lib,include,man等,因此要手工创建,要不先把其它库做好,再安装这个库

       

    • mkdir -p /home/hxy/common_lib/output/arm-linux/include
    • mkdir -p /home/hxy/common_lib/output/arm-linux/lib
    • mkdir -p /home/hxy/common_lib/output/arm-linux/man/man1 

 

2.png 用于PNG图像显示

 

3.tiff库 ,(tiff格式显示)

  •  

      官网 http://www.libtiff.org

     

  •  

    下载 http://dl.maptools.org/dl/libtiff/tiff-3.8.2.tar.gz

     

  •  

    解压 tar xvzf tiff-3.8.2.tar.gz

     

  •  

    cd tiff-3.8.2

     

  •  

    生成makefile

     

  •  

    ./configure  --host=arm-linux --enable-shared  --enable-static --enable-jpeg --enable-zlib --prefix=$PWD/../../output/arm-linux

     

  •  

    编译 make

     

  •  

    安装 make install

     

 

 

音频类

 

 

2.mad

  •  

         官网 http://www.underbit.com/products/mad/

     

  •  

    解压 tar xvzf libmad-0.15.1b.tar.gz

     

  •  

    cd libmad-0.15.1b

     

  •  

    生成Makefile(标准)

     

    •  

       ./configure  --host=arm-linux --enable-shared  --enable-static --prefix=$PWD/../../output/arm-linux

       

  •  

    去掉Makefile中-fforce-mem

     

    •  

      因为arm-linux-gcc不认识这个选项,编译提示 error: unrecognized command line option "-fforce-mem"

       

  •  

    编译make

     

  •  

    安装 make install

     

 

3.id3tag:读取mp3信息

 

 官网 http://www.underbit.com/products/mad/

  •  

    解压 tar xvzf libid3tag-0.15.1b.tar.gz

     

  •  

    cd libid3tag-0.15.1b

     

  •  

    生成Makefile(标准)

     

    •  

       ./configure  --host=arm-linux --enable-shared  --enable-static --prefix=$PWD/../../output/arm-linux

       

    •  

      编译 make

       

    •  

      安装 make install

       

     

    4.ogg  一种音频解码格式

    •  

         

       

    •  

       解压 tar xvzf libogg-1.1.4.tar.gz

       

    •  

      cd libogg-1.1.4

       

    •  

      生成Makefile (标准)

       

      •  

           ./configure  --host=arm-linux --enable-shared  --enable-static --prefix=$PWD/../../output/arm-linux

         

    •  

      编译make

       

    •  

      安装 make install

       

     

     

     

     

     

    文字编码类

    1.iconv库 用于文字编码转换

    •  

      主页 :http://www.gnu.org/software/libiconv     

       

    •  

      下载:http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz

       

    •  

      解压 tar xvzf libiconv-1.13.1.tar.gz

       

    •  

       cd libiconv-1.13.1

       

    •  

      生成Makefile (标准)

       

      •  

           ./configure  --host=arm-linux --enable-shared  --enable-static --prefix=$PWD/../../output/arm-linux

         

    •  

      编译make

       

    •  

      安装 make install

       

       

     

          

     

    2. freetype:开源高质理字体显示函数库

    •  

          主页:http://www.freetype.org/

       

    •  

      下载:http://ftp.twaren.net/Unix/NonGNU/freetype/freetype-2.3.11.tar.gz

       

    •  

      解压 tar xvzf freetype-2.3.11.tar.gz

       

    •  

      cd freetype-2.3.11

       

    •  

      生成Makefile (标准)

       

      •  

           ./configure  --host=arm-linux --enable-shared  --enable-static --prefix=$PWD/../../output/arm-linux

         

    •  

      编译make

       

    •  

      安装 make install

       

       

     

     

    3.

posted @ 2014-09-28 11:42  甲午大桃花  阅读(332)  评论(0编辑  收藏  举报