交叉编译-bzip2

版本:
bzip2-1.0.6 下载

bzip2-1.0.6

一、修改Makefile

vim Makefile

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# To assist in cross-compiling
CC=arm-linux-gnueabihf-gcc -fPIC
AR=arm-linux-gnueabihf-ar
RANLIB=arm-linux-gnueabihf-ranlib
LDFLAGS=

BIGFILES=-D_FILE_OFFSET_BITS=32
CFLAGS=-Wall -Winline -O2 -g $(BIGFILES)

# Where you want it installed when you do 'make install'
PREFIX=/opt/Crosscompile/buildComplete/bzip2-1.0.6


...


check: test
test: bzip2
# @cat words1
# ./bzip2 -1 < sample1.ref > sample1.rb2
# ./bzip2 -2 < sample2.ref > sample2.rb2
# ./bzip2 -3 < sample3.ref > sample3.rb2
# ./bzip2 -d < sample1.bz2 > sample1.tst
# ./bzip2 -d < sample2.bz2 > sample2.tst
# ./bzip2 -ds < sample3.bz2 > sample3.tst
# cmp sample1.bz2 sample1.rb2
# cmp sample2.bz2 sample2.rb2
# cmp sample3.bz2 sample3.rb2
# cmp sample1.tst sample1.ref
# cmp sample2.tst sample2.ref
# cmp sample3.tst sample3.ref
# @cat words3

二、执行make和make install

1
2
make
make install