编译成功。
3. 构建处方
jpeg.mk
JPEG_DIR="jpeg-6b"
all: clean config build
config:
@cd $(JPEG_DIR) && \
export CC=arm-linux-gcc && \
./configure --prefix=$$ROOTFS_DIR/usr && \
echo "config done"
build:
@cd $(JPEG_DIR) && \
make && make install && \
echo "build done"
clean:
@cd $(JPEG_DIR) && \
if [ -e Makefile ]; then make distclean; fi && \
echo "clean done"
1. 基本信息:
软件名称
libpng
功能简述
libpng一个png图形编码解码程序库
下载地址
http://www.libpng.org/pub/png/libpng.html
软件版本
libpng-1.2.8-config.tar.gz
依赖关系
默认zlib
前置条件
源文件位置:$(WORK_DIR)/ libpng-1.2.8-config
2. 过程分析
下载的稳定版本,configure已经存在,直接进行配置:
[root@linux libpng-1.2.8-config]# ./configure --host=$ARCH-linux --prefix=$ROOTFS_DIR/usr
出现了如下错误:
configure: error: ZLib not installed
奇怪,zlib已经编译过了啊。为什么configure找不到zlib呢?设置一下环境变量CFLAGS和LDFLAGS试试,Makefile一般都通过CFLAGS来设置额外的编译选项,通过LDFLAGS来设置额外的连接选项,configure大概也遵循这个规则吧。
[root@linux libpng-1.2.8-config]# export LDFLAGS=-L$ROOTFS_DIR/usr/local/lib
[root@linux libpng-1.2.8-config]# export CFLAGS=-I$ROOTFS_DIR/usr/local/include
[root@linux libpng-1.2.8-config]# ./configure --host=$ARCH-linux --prefix=$ROOTFS_DIR/usr
OK,配置成功,编译:
[root@linux libpng-1.2.8-config]# make && make install
OK,编译成功。
3. 构建处方
png.mk
PNG_DIR="libpng-1.2.8-config"
all: clean config build
config:
@cd $(PNG_DIR) && \
export LDFLAGS=-L$$ROOTFS_DIR/usr/local/lib && \
export CFLAGS=-I$$ROOTFS_DIR/usr/local/include && \
./configure --host=$$ARCH-linux --prefix=$$ROOTFS_DIR/usr && \
echo "config done"
build:
@cd $(PNG_DIR) && \
make && make install && \
echo "build done"
clean:
@cd $(PNG_DIR) && \
if [ -e Makefile ]; then make distclean; fi && \
echo "clean done"
[编译TinyX]
软件名称
TinyX
功能简述
TinyX是一个针对嵌入式系统设计的X Window,相对PC版的X Window而言,它占用的资源要少很多,服务器程序仅700多K,客户端的动态库约2M(看你需要而定)多。
下载地址
http://www.xfree86.org
软件版本
XFree86-4.5.0-src-1.tgz
XFree86-4.5.0-src-2.tgz
XFree86-4.5.0-src-3.tgz
XFree86-4.5.0-src-4.tgz
XFree86-4.5.0-src-5.tgz
XFree86-4.5.0-src-6.tgz
XFree86-4.5.0-src-7.tgz
依赖关系
默认
readline
zlib
ncurses
前置条件
源文件位置:$(WORK_DIR)/xc
2. 过程分析
TinyX并不是一个独立的软件包,而是X Window的一种编译配置。X Window采用的imake配置方式,与autoconf不一样,你先要手工编译配置文件。在xc/config/cf/README文件里,有对各种选项详细的介绍。
修改这些配置文件是一种比较繁琐的事情,特别对于新手来说,往往要经历修改配置文件-编译-失败-再修改配置文件这个循环好几次。即使是对于有经验的人来说,一次搞定也并非那么容易。这个过程讲起来比较冗长,这里就不再多说,具体的配置文件可以参考构建处方。
按照BUILD.txt里的建议,我们决定建立一个临时目录,在这个临时目录里编译,避免破坏原始文件。实践证明这个建议很有用,因为很少第一次编译成功,重新编译时不用再去解压软件包,可以节省不少时间。
[root@linux cross]# cd xc/config/util/
[root@linux util]# make lndir
[root@linux util]# cp lndir /usr/local/bin/
[root@linux util]# cd -
[root@linux cross]# mkdir armtinyx
[root@linux cross]# cd armtinyx
[root@linux armtinyx]# lndir ../xc/
现在我们把配置文件和patch文件拷贝进来:
[root@linux armtinyx]# cp ../armtinyx.patch/* . -rf
编译:
[root@linux armtinyx] make World DESTDIR=$ROOTFS_DIR
出现下列错误:
/usr/local/arm-linux/lib/gcc/arm-linux/3.4.2/../../../../arm-linux/sys-include/sys/io.h:38: error: conflicting types for 'inb'
../../../../../programs/Xserver/hw/xfree86/common/compiler.h:1452: error: previous definition of 'inb' was here
/usr/local/arm-linux/lib/gcc/arm-linux/3.4.2/../../../../arm-linux/sys-include/sys/io.h:39: error: conflicting types for 'inw'
编辑armtinyx/programs/Xserver/hw/xfree86/common/compiler.h,删除outb之类的空函数。
重新编译:
[root@linux