使用自带的configure,发现不支持交叉编译
zhangbin@bogon:~/bcm/unimedia/depvlc/libz/code_zlib-1.2.5$ ./configure --help
usage:默认会用gcc
zhangbin@bogon:~/bcm/unimedia/depvlc/libz/code_zlib-1.2.5$ source config_libz_skmedia.sh======================================
#!/bin/bash
DST=/home/zhangbin/bcm/libz/home
A52_HOME=$DST
echo "####################"
echo "A52_HOME IS $A52_HOME"
echo "####################"
export AS=${CROSS_COMPILE}as
export LD=${CROSS_COMPILE}ld
export CC=${CROSS_COMPILE}gcc
# NOTE: We must use c++ and not g++. g++ uses libraries with GPL code which we don't want to link with.
export CXX=${CROSS_COMPILE}c++
export AR=${CROSS_COMPILE}ar
export NM=${CROSS_COMPILE}nm
export STRIP=${CROSS_COMPILE}strip
export OBJCOPY=${CROSS_COMPILE}objcopy
export OBJDUMP=${CROSS_COMPILE}objdump
export RANLIB=${CROSS_COMPILE}ranlib
echo "================"
echo "AS IS $AS"
echo "LD IS $LD"
echo "CC IS $CC"
echo "CXX IS $CXX"
echo "================"
#HOST=mipsel-linux-uclibc
./configure --prefix=${A52_HOME}
#--host=$HOST
echo "configure done ..."
=========================================
重新设定了环境变量,其实人家只用CC就好了:
其他都是多余的。
zhangbin@bogon:~/bcm/unimedia/depvlc/libz/code_zlib-1.2.5$
==================还是保留了所有的变量,并且安装到dest下==============
zhangbin@bogon:~/bcm/unimedia/depvlc/libz/code_zlib-1.2.5$ source config_libz_skmedia.sh
####################
A52_HOME IS /home/lbteam/zhangbin/bcm/unimedia/dest
####################
================
AS IS mipsel-linux-uclibc-as
LD IS mipsel-linux-uclibc-ld
CC IS mipsel-linux-uclibc-gcc
CXX IS mipsel-linux-uclibc-c++
================
Checking for shared library support...
Building shared library libz.so.1.2.5 with mipsel-linux-uclibc-gcc.
Checking for off64_t... Yes.
Checking for fseeko... Yes.
Checking for unistd.h... Yes.
Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf().
Checking for vsnprintf() in stdio.h... Yes.
Checking for return value of vsnprintf()... Yes.
Checking for attribute(visibility) support... Yes.
configure done ...
zhangbin@bogon:~/bcm/unimedia/depvlc/libz/code_zlib-1.2.5$ make
mipsel-linux-uclibc-gcc -fPIC -D_LARGEFILE64_SOURCE=1 -c -o example.o example.c
mipsel-linux-uclibc-gcc -fPIC -D_LARGEFILE64_SOURCE=1 -c -o adler32.o adler32.c
mipsel-linux-uclibc-gcc -fPIC -D_LARGEFILE64_SOURCE=1 -c -o compress.o compress.c
mipsel-linux-uclibc-gcc -fPIC -D_LARGEFILE64_SOURCE=1 -c -o crc32.o crc32.c
mipsel-linux-uclibc-gcc -fPIC -D_LARGEFILE64_SOURCE=1 -c -o deflate.o deflate.c
mipsel-linux-uclibc-gcc -fPIC -D_LARGEFILE64_SOURCE=1 -c -o gzclose.o gzclose.c
mipsel-linux-uclibc-gcc -fPIC -D_LARGEFILE64_SOURCE=1 -c -o gzlib.o gzlib.c
mipsel-linux-uclibc-gcc -fPIC -D_LARGEFILE64_SOURCE=1 -c -o gzread.o gzread.c
mipsel-linux-uclibc-gcc -fPIC -D_LARGEFILE64_SOURCE=1 -c -o gzwrite.o gzwrite.c
mipsel-linux-uclibc-gcc -fPIC -D_LARGEFILE64_SOURCE=1 -c -o infback.o infback.c
mipsel-linux-uclibc-gcc -fPIC -D_LARGEFILE64_SOURCE=1 -c -o inffast.o inffast.c
mipsel-linux-uclibc-gcc -fPIC -D_LARGEFILE64_SOURCE=1 -c -o inflate.o inflate.c
mipsel-linux-uclibc-gcc -fPIC -D_LARGEFILE64_SOURCE=1 -c -o inftrees.o inftrees.c
mipsel-linux-uclibc-gcc -fPIC -D_LARGEFILE64_SOURCE=1 -c -o trees.o trees.c
mipsel-linux-uclibc-gcc -fPIC -D_LARGEFILE64_SOURCE=1 -c -o uncompr.o uncompr.c
mipsel-linux-uclibc-gcc -fPIC -D_LARGEFILE64_SOURCE=1 -c -o zutil.o zutil.c
mipsel-linux-uclibc-ar rc libz.a adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
mipsel-linux-uclibc-gcc -fPIC -D_LARGEFILE64_SOURCE=1 -o example example.o -L. libz.a
mipsel-linux-uclibc-gcc -fPIC -D_LARGEFILE64_SOURCE=1 -c -o minigzip.o minigzip.c
mipsel-linux-uclibc-gcc -fPIC -D_LARGEFILE64_SOURCE=1 -o minigzip minigzip.o -L. libz.a
mipsel-linux-uclibc-gcc -fPIC -fPIC -D_LARGEFILE64_SOURCE=1 -DPIC -c -o objs/adler32.o adler32.c
mipsel-linux-uclibc-gcc -fPIC -fPIC -D_LARGEFILE64_SOURCE=1 -DPIC -c -o objs/compress.o compress.c
mipsel-linux-uclibc-gcc -fPIC -fPIC -D_LARGEFILE64_SOURCE=1 -DPIC -c -o objs/crc32.o crc32.c
mipsel-linux-uclibc-gcc -fPIC -fPIC -D_LARGEFILE64_SOURCE=1 -DPIC -c -o objs/deflate.o deflate.c
mipsel-linux-uclibc-gcc -fPIC -fPIC -D_LARGEFILE64_SOURCE=1 -DPIC -c -o objs/gzclose.o gzclose.c
mipsel-linux-uclibc-gcc -fPIC -fPIC -D_LARGEFILE64_SOURCE=1 -DPIC -c -o objs/gzlib.o gzlib.c
mipsel-linux-uclibc-gcc -fPIC -fPIC -D_LARGEFILE64_SOURCE=1 -DPIC -c -o objs/gzread.o gzread.c
mipsel-linux-uclibc-gcc -fPIC -fPIC -D_LARGEFILE64_SOURCE=1 -DPIC -c -o objs/gzwrite.o gzwrite.c
mipsel-linux-uclibc-gcc -fPIC -fPIC -D_LARGEFILE64_SOURCE=1 -DPIC -c -o objs/infback.o infback.c
mipsel-linux-uclibc-gcc -fPIC -fPIC -D_LARGEFILE64_SOURCE=1 -DPIC -c -o objs/inffast.o inffast.c
mipsel-linux-uclibc-gcc -fPIC -fPIC -D_LARGEFILE64_SOURCE=1 -DPIC -c -o objs/inflate.o inflate.c
mipsel-linux-uclibc-gcc -fPIC -fPIC -D_LARGEFILE64_SOURCE=1 -DPIC -c -o objs/inftrees.o inftrees.c
mipsel-linux-uclibc-gcc -fPIC -fPIC -D_LARGEFILE64_SOURCE=1 -DPIC -c -o objs/trees.o trees.c
mipsel-linux-uclibc-gcc -fPIC -fPIC -D_LARGEFILE64_SOURCE=1 -DPIC -c -o objs/uncompr.o uncompr.c
mipsel-linux-uclibc-gcc -fPIC -fPIC -D_LARGEFILE64_SOURCE=1 -DPIC -c -o objs/zutil.o zutil.c
mipsel-linux-uclibc-gcc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map -fPIC -fPIC -D_LARGEFILE64_SOURCE=1 -o libz.so.1.2.5 adler32.lo compress.lo crc32.lo deflate.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo uncompr.lo zutil.lo -lc -L. libz.a
rm -f libz.so libz.so.1
ln -s libz.so.1.2.5 libz.so
ln -s libz.so.1.2.5 libz.so.1
mipsel-linux-uclibc-gcc -fPIC -D_LARGEFILE64_SOURCE=1 -o examplesh example.o -L. libz.so.1.2.5
mipsel-linux-uclibc-gcc -fPIC -D_LARGEFILE64_SOURCE=1 -o minigzipsh minigzip.o -L. libz.so.1.2.5
mipsel-linux-uclibc-gcc -fPIC -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -c -o example64.o example.c
mipsel-linux-uclibc-gcc -fPIC -D_LARGEFILE64_SOURCE=1 -o example64 example64.o -L. libz.a
mipsel-linux-uclibc-gcc -fPIC -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -c -o minigzip64.o minigzip.c
mipsel-linux-uclibc-gcc -fPIC -D_LARGEFILE64_SOURCE=1 -o minigzip64 minigzip64.o -L. libz.a
zhangbin@bogon:~/bcm/unimedia/depvlc/libz/code_zlib-1.2.5$ make install
cp libz.a /home/lbteam/zhangbin/bcm/unimedia/dest/lib
cp libz.so.1.2.5 /home/lbteam/zhangbin/bcm/unimedia/dest/lib
cd /home/lbteam/zhangbin/bcm/unimedia/dest/lib; chmod u=rw,go=r libz.a
cp zlib.3 /home/lbteam/zhangbin/bcm/unimedia/dest/share/man/man3
chmod 644 /home/lbteam/zhangbin/bcm/unimedia/dest/share/man/man3/zlib.3
cp zlib.pc /home/lbteam/zhangbin/bcm/unimedia/dest/lib/pkgconfig
chmod 644 /home/lbteam/zhangbin/bcm/unimedia/dest/lib/pkgconfig/zlib.pc
cp zlib.h zconf.h /home/lbteam/zhangbin/bcm/unimedia/dest/include
chmod 644 /home/lbteam/zhangbin/bcm/unimedia/dest/include/zlib.h /home/lbteam/zhangbin/bcm/unimedia/dest/include/zconf.h
zhangbin@bogon:~/bcm/unimedia/depvlc/libz/code_zlib-1.2.5$