Ubuntu18.04 交叉编译 jpegsrc.v6b (arm-linux)

 

1、下载 jpegsrc.v6b 的源码:jpegsrc.v6b.tar.gz,然后解压到/home/work 目录下

2、进入  /home/workjpeg-6b 目录并建立如下编译脚本 build.sh:

export PATH=/opt/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin:$PATH

./configure \
	CC=arm-linux-gnueabihf-gcc \
	--prefix=/opt/libjpeg-arm \
	--exec-prefix=/opt/libjpeg-arm \
	--enable-shared \
	--enable-static

make 

sudo make install

我的安装目录是:/opt/libjpeg-arm , 所以在编译之前先建立如下目录:

        /opt

              /libjpeg-arm

                                /bin

                                /include

                                /lib

                                /man

                                         /man1

3、添加可执行权限,并执:

              chmod +x build.sh

              ./build.sh

4、我的编译过程中产生了如下错误:

work@work:~/jpeg-6b$ ./build.sh 
checking for gcc... arm-linux-gnueabihf-gcc
checking whether the C compiler (arm-linux-gnueabihf-gcc  ) works... yes
checking whether the C compiler (arm-linux-gnueabihf-gcc  ) is a cross-compiler... yes
checking whether we are using GNU C... yes
checking how to run the C preprocessor... arm-linux-gnueabihf-gcc -E
checking for function prototypes... yes
checking for stddef.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for size_t... yes
checking for type unsigned char... yes
checking for type unsigned short... yes
checking for type void... yes
checking for working const... yes
checking for inline... __inline__
checking for broken incomplete types... ok
checking for short external names... ok
checking to see if char is signed... Assuming that char is signed on target machine.
If it is unsigned, this will be a little bit inefficient.
checking to see if right shift is signed... Assuming that right shift is signed on target machine.
checking to see if fopen accepts b spec... Assuming that it does.
checking for a BSD compatible install... /usr/bin/install -c
checking for ranlib... ranlib
checking host system type... ./config.guess: 618: ./config.guess: ./dummy: Exec format error
./config.guess: 848: ./config.guess: ./dummy: Exec format error
ltconfig: cannot guess host type; you must specify one
Try `ltconfig --help' for more information.
checking libjpeg version number... 62
creating ./config.status
creating Makefile
creating jconfig.h
jconfig.h is unchanged
./libtool --mode=compile arm-linux-gnueabihf-gcc -O2  -I. -c ./jcapimin.c
make: ./libtool: Command not found
Makefile:143: recipe for target 'jcapimin.lo' failed
make: *** [jcapimin.lo] Error 127

 

解决方法如下:

参考:  解决linux64位安装jpeg 出错make: ./libtool: Command not found  

1)编译安装libtool-2.2.6:

     下载  libtool-2.2.6 源码并解压,然后执行如下命令,编译安装:

      ./configure

       make 

       sudo make install

2)拷贝如下文件到  jpegsrc.v6b 目录,然后重新执行 build.sh 脚本:

    我是在  /home/work//jpeg-6b 目录下执行的如下命令:

      cp /usr/share/libtool/build-aux/config.sub ./

      cp /usr/share/libtool/build-aux/config.guess ./

你可能感兴趣的:(开发环境搭建)