xref: /OK3568_Linux_fs/buildroot/package/bzip2/0002-improve-build-system.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunImprove bzip2 build system
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunThis patch makes a number of improvements to the bzip2 build system:
4*4882a593Smuzhiyun
5*4882a593Smuzhiyun * Remove the BIGFILE variable that was used to force largefile
6*4882a593Smuzhiyun   support. Now, the user of the Makefile is supposed to pass
7*4882a593Smuzhiyun   -D_FILE_OFFSET_BITS=64 when largefile support is desired.
8*4882a593Smuzhiyun
9*4882a593Smuzhiyun * Use override CFLAGS += so that additional CFLAGS can be passed on
10*4882a593Smuzhiyun   the command line.
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun * Removed "forced" CFLAGS -O2, -g and -Winline. We don't want them by
13*4882a593Smuzhiyun   default, and want the build system to use its own ones.
14*4882a593Smuzhiyun
15*4882a593Smuzhiyun * When creating the symbolic links bzegrep, bzfgrep, bzless and
16*4882a593Smuzhiyun   bzcmp, don't link them to an absolute path, or they'll point to
17*4882a593Smuzhiyun   some path on the build machine.
18*4882a593Smuzhiyun
19*4882a593Smuzhiyun * Provide an install target for the shared library, which creates the
20*4882a593Smuzhiyun   appropriate symbolic links.
21*4882a593Smuzhiyun
22*4882a593SmuzhiyunSigned-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
23*4882a593Smuzhiyun
24*4882a593SmuzhiyunIndex: b/Makefile
25*4882a593Smuzhiyun===================================================================
26*4882a593Smuzhiyun--- a/Makefile
27*4882a593Smuzhiyun+++ b/Makefile
28*4882a593Smuzhiyun@@ -20,8 +20,7 @@
29*4882a593Smuzhiyun RANLIB=ranlib
30*4882a593Smuzhiyun LDFLAGS=
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun-BIGFILES=-D_FILE_OFFSET_BITS=64
33*4882a593Smuzhiyun-CFLAGS=-Wall -Winline -O2 -g $(BIGFILES)
34*4882a593Smuzhiyun+override CFLAGS += -Wall
35*4882a593Smuzhiyun
36*4882a593Smuzhiyun # Where you want it installed when you do 'make install'
37*4882a593Smuzhiyun PREFIX=/usr/local
38*4882a593Smuzhiyun@@ -90,14 +89,14 @@
39*4882a593Smuzhiyun 	cp -f libbz2.a $(PREFIX)/lib
40*4882a593Smuzhiyun 	chmod a+r $(PREFIX)/lib/libbz2.a
41*4882a593Smuzhiyun 	cp -f bzgrep $(PREFIX)/bin/bzgrep
42*4882a593Smuzhiyun-	ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep
43*4882a593Smuzhiyun-	ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep
44*4882a593Smuzhiyun+	ln -s -f bzgrep $(PREFIX)/bin/bzegrep
45*4882a593Smuzhiyun+	ln -s -f bzgrep $(PREFIX)/bin/bzfgrep
46*4882a593Smuzhiyun 	chmod a+x $(PREFIX)/bin/bzgrep
47*4882a593Smuzhiyun 	cp -f bzmore $(PREFIX)/bin/bzmore
48*4882a593Smuzhiyun-	ln -s -f $(PREFIX)/bin/bzmore $(PREFIX)/bin/bzless
49*4882a593Smuzhiyun+	ln -s -f bzmore $(PREFIX)/bin/bzless
50*4882a593Smuzhiyun 	chmod a+x $(PREFIX)/bin/bzmore
51*4882a593Smuzhiyun 	cp -f bzdiff $(PREFIX)/bin/bzdiff
52*4882a593Smuzhiyun-	ln -s -f $(PREFIX)/bin/bzdiff $(PREFIX)/bin/bzcmp
53*4882a593Smuzhiyun+	ln -s -f bzdiff $(PREFIX)/bin/bzcmp
54*4882a593Smuzhiyun 	chmod a+x $(PREFIX)/bin/bzdiff
55*4882a593Smuzhiyun 	cp -f bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1
56*4882a593Smuzhiyun 	chmod a+r $(PREFIX)/man/man1/bzgrep.1
57*4882a593SmuzhiyunIndex: b/Makefile-libbz2_so
58*4882a593Smuzhiyun===================================================================
59*4882a593Smuzhiyun--- a/Makefile-libbz2_so
60*4882a593Smuzhiyun+++ b/Makefile-libbz2_so
61*4882a593Smuzhiyun@@ -23,8 +23,7 @@
62*4882a593Smuzhiyun
63*4882a593Smuzhiyun SHELL=/bin/sh
64*4882a593Smuzhiyun CC=gcc
65*4882a593Smuzhiyun-BIGFILES=-D_FILE_OFFSET_BITS=64
66*4882a593Smuzhiyun-CFLAGS=-fpic -fPIC -Wall -Winline -O2 -g $(BIGFILES)
67*4882a593Smuzhiyun+override CFLAGS += -fpic -fPIC -Wall
68*4882a593Smuzhiyun
69*4882a593Smuzhiyun OBJS= blocksort.o  \
70*4882a593Smuzhiyun       huffman.o    \
71*4882a593Smuzhiyun@@ -37,8 +36,11 @@
72*4882a593Smuzhiyun all: $(OBJS)
73*4882a593Smuzhiyun 	$(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.8 $(OBJS)
74*4882a593Smuzhiyun 	$(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.8
75*4882a593Smuzhiyun-	rm -f libbz2.so.1.0
76*4882a593Smuzhiyun-	ln -s libbz2.so.1.0.8 libbz2.so.1.0
77*4882a593Smuzhiyun+
78*4882a593Smuzhiyun+install:
79*4882a593Smuzhiyun+	install -m 0755 -D libbz2.so.1.0.8 $(PREFIX)/lib/libbz2.so.1.0.8
80*4882a593Smuzhiyun+	ln -sf libbz2.so.1.0.8 $(PREFIX)/lib/libbz2.so
81*4882a593Smuzhiyun+	ln -sf libbz2.so.1.0.8 $(PREFIX)/lib/libbz2.so.1.0
82*4882a593Smuzhiyun
83*4882a593Smuzhiyun clean:
84*4882a593Smuzhiyun 	rm -f $(OBJS) bzip2.o libbz2.so.1.0.8 libbz2.so.1.0 bzip2-shared
85