1. 新建jpeg和jpegku目录:mkdir jpeg jpegku
2. 拷贝jpeg-6b-idctmxu-jz4740-080422.tgz在jpeg目录下,然后解压:
tar xzvf jpeg-6b-idctmxu-jz4740-080422.tgz
3. 到解压后的jpeg-6b目录下,执行:
./configure \
--build=i386-linux \
--host=mipsel-linux \
--target=mipsel-linux \
--prefix=/opt/.../minigui/jpeg/jpegku \
--enable-shared
显示如下:
~ ./configure \
> --build=i386-linux \
> --host=mipsel-linux \
> --target=mipsel-linux \
> --prefix=/opt/project/uto/minigui/jpeg/jpegku \
> --enable-share
checking for gcc... gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking how to run the C preprocessor... 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... yes
checking to see if right shift is signed... yes
checking to see if fopen accepts b spec... yes
checking for a BSD compatible install... /usr/bin/install -c
checking for ranlib... ranlib
checking libjpeg version number... 62
creating ./config.status
creating Makefile
creating jconfig.h
jconfig.h is unchanged
4. make && make install
make显示如下:
mipsel-linux-gcc -mips32 -O2 -I. -c -o jcapimin.o jcapimin.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jcapistd.o jcapistd.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jctrans.o jctrans.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jcparam.o jcparam.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jdatadst.o jdatadst.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jcinit.o jcinit.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jcmaster.o jcmaster.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jcmarker.o jcmarker.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jcmainct.o jcmainct.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jcprepct.o jcprepct.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jccoefct.o jccoefct.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jccolor.o jccolor.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jcsample.o jcsample.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jchuff.o jchuff.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jcphuff.o jcphuff.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jcdctmgr.o jcdctmgr.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jfdctfst.o jfdctfst.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jfdctflt.o jfdctflt.c
mipsel-linux-gcc -mips32 -O2 -I. -S jfdctint.c
mxu_as jfdctint.s > jfdctint_mxu.s
mipsel-linux-gcc -mips32 -O2 -I. -c -o jfdctint.o jfdctint_mxu.s
mipsel-linux-gcc -mips32 -O2 -I. -c -o jdapimin.o jdapimin.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jdapistd.o jdapistd.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jdtrans.o jdtrans.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jdatasrc.o jdatasrc.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jdmaster.o jdmaster.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jdinput.o jdinput.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jdmarker.o jdmarker.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jdhuff.o jdhuff.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jdphuff.o jdphuff.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jdmainct.o jdmainct.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jdcoefct.o jdcoefct.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jdpostct.o jdpostct.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jddctmgr.o jddctmgr.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jidctfst.o jidctfst.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jidctflt.o jidctflt.c
mipsel-linux-gcc -mips32 -O2 -I. -S jidctint.c
mxu_as jidctint.s > jidctint_mxu.s
mipsel-linux-gcc -mips32 -O2 -I. -c -o jidctint.o jidctint_mxu.s
mipsel-linux-gcc -mips32 -O2 -I. -c -o jidctred.o jidctred.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jdsample.o jdsample.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jdcolor.o jdcolor.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jquant1.o jquant1.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jquant2.o jquant2.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jdmerge.o jdmerge.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jcomapi.o jcomapi.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jutils.o jutils.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jerror.o jerror.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jmemmgr.o jmemmgr.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o jmemnobs.o jmemnobs.c
rm -f libjpeg.a
mipsel-linux-ar rc libjpeg.a jcapimin.o jcapistd.o jctrans.o jcparam.o jdatadst.o jcinit.o jcmaster.o jcmarker.o jcmainct.o jcprepct.o jccoefct.o jccolor.o jcsample.o jchuff.o jcphuff.o jcdctmgr.o jfdctfst.o jfdctflt.o jfdctint.o jdapimin.o jdapistd.o jdtrans.o jdatasrc.o jdmaster.o jdinput.o jdmarker.o jdhuff.o jdphuff.o jdmainct.o jdcoefct.o jdpostct.o jddctmgr.o jidctfst.o jidctflt.o jidctint.o jidctred.o jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o jcomapi.o jutils.o jerror.o jmemmgr.o jmemnobs.o
mipsel-linux-ranlib libjpeg.a
mipsel-linux-gcc -mips32 -O2 -I. -c -o cjpeg.o cjpeg.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o rdppm.o rdppm.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o rdgif.o rdgif.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o rdtarga.o rdtarga.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o rdrle.o rdrle.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o rdbmp.o rdbmp.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o rdswitch.o rdswitch.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o cdjpeg.o cdjpeg.c
mipsel-linux-gcc -mips32 -o cjpeg cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswitch.o cdjpeg.o libjpeg.a
mipsel-linux-gcc -mips32 -O2 -I. -c -o djpeg.o djpeg.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o wrppm.o wrppm.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o wrgif.o wrgif.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o wrtarga.o wrtarga.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o wrrle.o wrrle.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o wrbmp.o wrbmp.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o rdcolmap.o rdcolmap.c
mipsel-linux-gcc -mips32 -o djpeg djpeg.o wrppm.o wrgif.o wrtarga.o wrrle.o wrbmp.o rdcolmap.o cdjpeg.o libjpeg.a
mipsel-linux-gcc -mips32 -O2 -I. -c -o jpegtran.o jpegtran.c
mipsel-linux-gcc -mips32 -O2 -I. -c -o transupp.o transupp.c
mipsel-linux-gcc -mips32 -o jpegtran jpegtran.o rdswitch.o cdjpeg.o transupp.o libjpeg.a
mipsel-linux-gcc -mips32 -O2 -I. -c -o rdjpgcom.o rdjpgcom.c
mipsel-linux-gcc -mips32 -o rdjpgcom rdjpgcom.o
mipsel-linux-gcc -mips32 -O2 -I. -c -o wrjpgcom.o wrjpgcom.c
mipsel-linux-gcc -mips32 -o wrjpgcom wrjpgcom.o
make install显示如下:
mkdir -p /opt/project/uto/minigui/jpeg/jpegku/include
/usr/bin/install -c -m 644 jconfig.h /opt/project/uto/minigui/jpeg/jpegku/include/jconfig.h
/usr/bin/install -c -m 644 ./jpeglib.h /opt/project/uto/minigui/jpeg/jpegku/include/jpeglib.h
/usr/bin/install -c -m 644 ./jmorecfg.h /opt/project/uto/minigui/jpeg/jpegku/include/jmorecfg.h
/usr/bin/install -c -m 644 ./jerror.h /opt/project/uto/minigui/jpeg/jpegku/include/jerror.h
mkdir -p /opt/project/uto/minigui/jpeg/jpegku/lib
./libtool --mode=install /usr/bin/install -c libjpeg.la /opt/project/uto/minigui/jpeg/jpegku/lib/libjpeg.la
/usr/bin/install -c .libs/libjpeg.so.62.0.0 /opt/project/uto/minigui/jpeg/jpegku/lib/libjpeg.so.62.0.0
rm -f /opt/project/uto/minigui/jpeg/jpegku/lib/libjpeg.so.62 /opt/project/uto/minigui/jpeg/jpegku/lib/libjpeg.so
(cd /opt/project/uto/minigui/jpeg/jpegku/lib && ln -s libjpeg.so.62.0.0 libjpeg.so.62)
(cd /opt/project/uto/minigui/jpeg/jpegku/lib && ln -s libjpeg.so.62.0.0 libjpeg.so)
/usr/bin/install -c libjpeg.la /opt/project/uto/minigui/jpeg/jpegku/lib/libjpeg.la
PATH="/opt/project/ToolChain/mipseltools-gcc-4.1.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin :/usr/games:/sbin" ldconfig -n /opt/project/uto/minigui/jpeg/jpegku/lib
------------------------------------------------------------------------------
Libraries have been installed in:
/opt/project/uto/minigui/jpeg/jpegku/lib
To link against installed libraries in a given directory, LIBDIR,
you must use the `-LLIBDIR' flag during linking.
You will also need to do one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
------------------------------------------------------------------------------
mkdir -p /opt/project/uto/minigui/jpeg/jpegku/bin /opt/project/uto/minigui/jpeg/jpegku/man/man1
./libtool --mode=install /usr/bin/install -c cjpeg /opt/project/uto/minigui/jpeg/jpegku/bin/cjpeg
/usr/bin/install -c .libs/cjpeg /opt/project/uto/minigui/jpeg/jpegku/bin/cjpeg
./libtool --mode=install /usr/bin/install -c djpeg /opt/project/uto/minigui/jpeg/jpegku/bin/djpeg
/usr/bin/install -c .libs/djpeg /opt/project/uto/minigui/jpeg/jpegku/bin/djpeg
./libtool --mode=install /usr/bin/install -c jpegtran /opt/project/uto/minigui/jpeg/jpegku/bin/jpegtran
/usr/bin/install -c .libs/jpegtran /opt/project/uto/minigui/jpeg/jpegku/bin/jpegtran
./libtool --mode=install /usr/bin/install -c rdjpgcom /opt/project/uto/minigui/jpeg/jpegku/bin/rdjpgcom
/usr/bin/install -c rdjpgcom /opt/project/uto/minigui/jpeg/jpegku/bin/rdjpgcom
./libtool --mode=install /usr/bin/install -c wrjpgcom /opt/project/uto/minigui/jpeg/jpegku/bin/wrjpgcom
/usr/bin/install -c wrjpgcom /opt/project/uto/minigui/jpeg/jpegku/bin/wrjpgcom
/usr/bin/install -c -m 644 ./cjpeg.1 /opt/project/uto/minigui/jpeg/jpegku/man/man1/cjpeg.1
/usr/bin/install -c -m 644 ./djpeg.1 /opt/project/uto/minigui/jpeg/jpegku/man/man1/djpeg.1
/usr/bin/install -c -m 644 ./jpegtran.1 /opt/project/uto/minigui/jpeg/jpegku/man/man1/jpegtran.1
/usr/bin/install -c -m 644 ./rdjpgcom.1 /opt/project/uto/minigui/jpeg/jpegku/man/man1/rdjpgcom.1
/usr/bin/install -c -m 644 ./wrjpgcom.1 /opt/project/uto/minigui/jpeg/jpegku/man/man1/wrjpgcom.1
完成后,将在jpegku目录下自动生成bin、include、lib、man目录及里面包含的相应文件
可以将相应的lib和bin拷贝到rootfs目录下的相应位置,这样真正的机器上便可以运行相关jpeg的动作了
ps:
1. 在配置时,如果将prefix指定为rootfs目录,这样就不需要手动拷贝lib和bin内相关文件了(--prefix=/opt/.../fs/rootfs\)
2. 最好的方法是prefix指定为交叉编译器的位置,这样在编程时会比较方便,一般在机器运行编程的程序需要的只是lib库就可以了,在制作rootfs时,一般都会将交叉编译器下的lib拷贝到rootfs的lib下(--prefix=/opt/.../ToolChain/mipsel-linux-gcc-4.1.2/(mipsel-linux) \)