libjpeg的交叉编译
来源:互联网 发布:长沙最新cnc编程招聘 编辑:程序博客网 时间:2024/06/10 17:38
http://blog.csdn.net/ypist/article/details/8190966
从http://www.ijg.org/files/网站下载lib库的源文件.
开工:
- tar -xzvf jpeg-6b.tar.gz
- cd jpeg-6b
- mkdir /opt/jpeg/jpeg-6b-release
- ./configure CC=mipsel-linux-gcc --prefix=/opt/jpeg/jpeg-6b-release --enable-shared --enable-static --host=mipsel-linux
- mkdir /opt/jpeg/jpeg-6b-release/bin
- mkdir /opt/jpeg/jpeg-6b-release/include
- mkdir /opt/jpeg/jpeg-6b-release/lib
- mkdir /opt/jpeg/jpeg-6b-release/man
- mkdir /opt/jpeg/jpeg-6b-release/man/man1
- make
tar -xzvf jpeg-6b.tar.gzcd jpeg-6bmkdir /opt/jpeg/jpeg-6b-release./configure CC=mipsel-linux-gcc --prefix=/opt/jpeg/jpeg-6b-release --enable-shared --enable-static --host=mipsel-linuxmkdir /opt/jpeg/jpeg-6b-release/binmkdir /opt/jpeg/jpeg-6b-release/includemkdir /opt/jpeg/jpeg-6b-release/libmkdir /opt/jpeg/jpeg-6b-release/manmkdir /opt/jpeg/jpeg-6b-release/man/man1make
=================================================
出错:
- [root@localhost jpeg-6b]# make
- ./libtool --mode=compile mipsel-linux-gcc -O2 -I. -c ./jcapimin.c
- make: ./libtool: Command not found
- make: *** [jcapimin.lo] Error 127
[root@localhost jpeg-6b]# make./libtool --mode=compile mipsel-linux-gcc -O2 -I. -c ./jcapimin.cmake: ./libtool: Command not foundmake: *** [jcapimin.lo] Error 127
所以,我们得先安装 libtool工具。
=================================================
从http://download.chinaunix.net/download/0007000/6039.shtml下载
得到: libtool-2.4.2.tar.xz
放到我们的Linux系统中:
网上说,tar.xz文件解压 有2中办法:
方式1:
tar xvfJ ***.tar.xz
方式2:
xz -d ***.tar.xz
tar -xvf ***.tar
我用方法1尝试,报错:
- [root@localhost jpeg]# tar xvfJ libtool-2.4.2.tar.xz
- tar: invalid option -- J
- Try `tar --help' or `tar --usage' for more information.
- [root@localhost jpeg]# tar xvfj libtool-2.4.2.tar.xz
- bzip2: (stdin) is not a bzip2 file.
- tar: Child returned status 2
- tar: Error exit delayed from previous errors
[root@localhost jpeg]# tar xvfJ libtool-2.4.2.tar.xztar: invalid option -- JTry `tar --help' or `tar --usage' for more information.[root@localhost jpeg]# tar xvfj libtool-2.4.2.tar.xzbzip2: (stdin) is not a bzip2 file.tar: Child returned status 2tar: Error exit delayed from previous errors
于是,我采用方法2:
[root@localhost jpeg]# xz -d libtool-2.4.2.tar.xz
bash: xz: command not found
好吧, 我去给你安装个xz工具,从 http://tukaani.org/xz/xz-4.999.9beta.tar.bz2
上面下载得到 xz-4.999.9beta.tar.bz2。
1、tar -jxvf xz-4.999.9beta.tar.bz2
2、cd xz-4.999.9beta
3、./configure --prefix=/
4、make && make install
OK, 去之前的目录,然后 xz -d libtool-2.4.2.tar.xz
得到: libtool-2.4.2.tar
然后:tar -xvf libtool-2.4.2.tar
得到: libtool-2.4.2 文件夹。
$ cd libtool-2.2.4/
- [root@localhost libtool-2.4.2]# ./configure CC=mipsel-linux-gcc --host=mipsel-linux --build=mipsel-linux --prefix=/opt/jpeg/libtool-release
- ## ------------------------- ##
- ## Configuring libtool 2.4.2 ##
- ## ------------------------- ##
- checking for a BSD-compatible install... /usr/bin/install -c
- checking whether build environment is sane... yes
- checking for a thread-safe mkdir -p... /bin/mkdir -p
- checking for gawk... gawk
- checking whether make sets $(MAKE)... yes
- checking build system type... mipsel-unknown-linux-gnu
- checking host system type... mipsel-unknown-linux-gnu
- configure: autobuild project... GNU Libtool
- configure: autobuild revision... 2.4.2 ()
- configure: autobuild hostname... localhost.localdomain
- configure: autobuild mode... default
- configure: autobuild timestamp... 20121116T063533Z
- checking for mipsel-linux-gcc... mipsel-linux-gcc
- checking whether the C compiler works... yes
- checking for C compiler default output file name... a.out
- checking for suffix of executables...
- checking whether we are cross compiling... configure: error: in `/opt/jpeg/libtool-2.4.2':
- configure: error: cannot run C compiled programs.
- If you meant to cross compile, use `--host'.
- See `config.log' for more details
- 后来改为:
- [root@localhost libtool-2.4.2]# ./configure CC=mipsel-linux-gcc --host=mipsel-linux --prefix=/opt/jpeg/libtool-release
- 配置通过。
[root@localhost libtool-2.4.2]# ./configure CC=mipsel-linux-gcc --host=mipsel-linux --build=mipsel-linux --prefix=/opt/jpeg/libtool-release ## ------------------------- #### Configuring libtool 2.4.2 #### ------------------------- ##checking for a BSD-compatible install... /usr/bin/install -cchecking whether build environment is sane... yeschecking for a thread-safe mkdir -p... /bin/mkdir -pchecking for gawk... gawkchecking whether make sets $(MAKE)... yeschecking build system type... mipsel-unknown-linux-gnuchecking host system type... mipsel-unknown-linux-gnuconfigure: autobuild project... GNU Libtoolconfigure: autobuild revision... 2.4.2 ()configure: autobuild hostname... localhost.localdomainconfigure: autobuild mode... defaultconfigure: autobuild timestamp... 20121116T063533Zchecking for mipsel-linux-gcc... mipsel-linux-gccchecking whether the C compiler works... yeschecking for C compiler default output file name... a.outchecking for suffix of executables... checking whether we are cross compiling... configure: error: in `/opt/jpeg/libtool-2.4.2':configure: error: cannot run C compiled programs.If you meant to cross compile, use `--host'.See `config.log' for more details后来改为: [root@localhost libtool-2.4.2]# ./configure CC=mipsel-linux-gcc --host=mipsel-linux --prefix=/opt/jpeg/libtool-release 配置通过。
- $ make && make install
- [root@localhost libtool-2.4.2]# ls ../libtool-release/bin
- libtool libtoolize
- [root@localhost libtool-2.4.2]# cp ../libtool-release/bin/* ../jpeg-6b/
- [root@localhost libtool-2.4.2]# cd ../jpeg-6b
- ./configure CC=mipsel-linux-gcc --prefix=/opt/jpeg/jpeg-6b-release --enable-shared --enable-static --host=mipsel-linux
- make && mak install
$ make && make install [root@localhost libtool-2.4.2]# ls ../libtool-release/binlibtool libtoolize[root@localhost libtool-2.4.2]# cp ../libtool-release/bin/* ../jpeg-6b/[root@localhost libtool-2.4.2]# cd ../jpeg-6b./configure CC=mipsel-linux-gcc --prefix=/opt/jpeg/jpeg-6b-release --enable-shared --enable-static --host=mipsel-linuxmake && mak install
至此,得到我们的文件在 jpeg-6b-release 目录下面。
下面我们再延伸一下,将8d版本的库也编译了吧。
- [root@localhost jpeg]# cp /mnt/hgfs/jpeg_lib/jpegsrc.v8d.tar.gz ./
- [root@localhost jpeg]# tar zxvf jpegsrc.v8d.tar.gz
- [root@localhost jpeg-8d]# ./configure CC=mipsel-linux-gcc --prefix=/opt/jpeg/jpeg-8d-release --enable-shared --enable-static --host=mipsel-linux
- [root@localhost jpeg-8d]# make && make install
- [root@localhost jpeg-8d]# cd ../jpeg-8d-release/
- [root@localhost jpeg-8d-release]# tree
- .
- |-- bin
- | |-- cjpeg
- | |-- djpeg
- | |-- jpegtran
- | |-- rdjpgcom
- | `-- wrjpgcom
- |-- include
- | |-- jconfig.h
- | |-- jerror.h
- | |-- jmorecfg.h
- | `-- jpeglib.h
- |-- lib
- | |-- libjpeg.a
- | |-- libjpeg.la
- | |-- libjpeg.so -> libjpeg.so.8.4.0
- | |-- libjpeg.so.8 -> libjpeg.so.8.4.0
- | `-- libjpeg.so.8.4.0
- |-- man
- | `-- man1
- | |-- cjpeg.1
- | |-- djpeg.1
- | |-- jpegtran.1
- | |-- rdjpgcom.1
- | `-- wrjpgcom.1
- `-- share
- `-- man
- `-- man1
- |-- cjpeg.1
- |-- djpeg.1
- |-- jpegtran.1
- |-- rdjpgcom.1
- `-- wrjpgcom.1
- 8 directories, 24 files
[root@localhost jpeg]# cp /mnt/hgfs/jpeg_lib/jpegsrc.v8d.tar.gz ./[root@localhost jpeg]# tar zxvf jpegsrc.v8d.tar.gz [root@localhost jpeg-8d]# ./configure CC=mipsel-linux-gcc --prefix=/opt/jpeg/jpeg-8d-release --enable-shared --enable-static --host=mipsel-linux[root@localhost jpeg-8d]# make && make install[root@localhost jpeg-8d]# cd ../jpeg-8d-release/[root@localhost jpeg-8d-release]# tree.|-- bin| |-- cjpeg| |-- djpeg| |-- jpegtran| |-- rdjpgcom| `-- wrjpgcom|-- include| |-- jconfig.h| |-- jerror.h| |-- jmorecfg.h| `-- jpeglib.h|-- lib| |-- libjpeg.a| |-- libjpeg.la| |-- libjpeg.so -> libjpeg.so.8.4.0| |-- libjpeg.so.8 -> libjpeg.so.8.4.0| `-- libjpeg.so.8.4.0|-- man| `-- man1| |-- cjpeg.1| |-- djpeg.1| |-- jpegtran.1| |-- rdjpgcom.1| `-- wrjpgcom.1`-- share `-- man `-- man1 |-- cjpeg.1 |-- djpeg.1 |-- jpegtran.1 |-- rdjpgcom.1 `-- wrjpgcom.18 directories, 24 files
至此, 我们的8d版本的JPEG库也编译通过了,哈哈。。
现在我们回过头来看看xz文件的压缩作用如何:
-rwxr-xr-x 1 root root 11929600 2012-11-16 01:11 libtool-2.4.2.tar
-rwxrwxrwx 1 root root 868760 2012-11-16 01:09 libtool-2.4.2.tar.xz
事实证明,xz在压缩文件方面还是相当优秀的的。。
经网上查阅资料,xz文件的压缩和解压步骤如下:
创建tar.xz文件:只要先 tar cvf xxx.tar xxx/ 这样创建xxx.tar文件先,然后使用 xz -z xxx.tar 来将 xxx.tar压缩成为 xxx.tar.xz
解压tar.xz文件:先 xz -d xxx.tar.xz 将 xxx.tar.xz解压成 xxx.tar 然后,再用 tar xvf xxx.tar来解包。
- libjpeg的交叉编译
- libjpeg的交叉编译
- libjpeg的交叉编译
- libjpeg的交叉编译
- 常用库之一:libjpeg的交叉编译
- 交叉编译libjpeg
- libjpeg交叉编译
- 交叉编译使用libjpeg
- libjpeg交叉编译libjpeg.so.62
- 交叉编译 libjpeg.so.62
- 6、交叉编译libjpeg-7
- libjpeg库的安装、移植、交叉编译环境、编解码。
- libjpeg的交叉编译(移植Mjpg-streamer之前必须移植好libjpeg)
- 为DM6446交叉编译libjpeg v8b
- 交叉编译libpng和libjpeg库
- libjpeg的编译
- 编译64位的libjpeg
- linux下交叉编译libjpeg与opencv1.0
- struts总是出错,代码没有报错
- ise工程产生的文件
- MySpace,YouTube,Flickr等各大网站架构总结
- mp4文件格式解析(一)
- wince6.0驱动开发
- libjpeg的交叉编译
- mp4文件格式解析(二)
- 嵌套模版类
- 声音设备返回的input buffer总是320个字节
- 九度OJ 题目1041:Simple Sorting
- mp4文件格式解析(三)
- iText生成PDF入门
- mp4文件格式解析(四)
- Dos文件到Unix文件转换