ncftp: bump version to 3.2.6
[buildroot-gz.git] / package / bzip2 / 0001-build-objects-twice.patch
blob9bde0f6488c08788a3d1ecf362129afbc466e2fe
1 Build objects twice for shared and static libraries
3 The existing Makefile causes problems on MIPS because the same object
4 files (not compiled with -fPIC) are used in static and shared libraries.
5 MIPS will refuce to link non-pic objects in shared libraries.
6 We fix this problems by creating a new rule for the shared library
7 and build the shared objects as *.sho instead of *.o.
8 Then, we use these objects to create the shared library.
10 Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
12 Index: bzip2-1.0.6/Makefile-libbz2_so
13 ===================================================================
14 --- bzip2-1.0.6.orig/Makefile-libbz2_so
15 +++ bzip2-1.0.6/Makefile-libbz2_so
16 @@ -25,13 +25,13 @@ SHELL=/bin/sh
17 CC=gcc
18 override CFLAGS += -fpic -fPIC -Wall
20 -OBJS= blocksort.o \
21 - huffman.o \
22 - crctable.o \
23 - randtable.o \
24 - compress.o \
25 - decompress.o \
26 - bzlib.o
27 +OBJS= blocksort.sho \
28 + huffman.sho \
29 + crctable.sho \
30 + randtable.sho \
31 + compress.sho \
32 + decompress.sho \
33 + bzlib.sho
35 all: $(OBJS)
36 $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.6 $(OBJS)
37 @@ -45,17 +45,5 @@ install:
38 clean:
39 rm -f $(OBJS) bzip2.o libbz2.so.1.0.6 libbz2.so.1.0 bzip2-shared
41 -blocksort.o: blocksort.c
42 - $(CC) $(CFLAGS) -c blocksort.c
43 -huffman.o: huffman.c
44 - $(CC) $(CFLAGS) -c huffman.c
45 -crctable.o: crctable.c
46 - $(CC) $(CFLAGS) -c crctable.c
47 -randtable.o: randtable.c
48 - $(CC) $(CFLAGS) -c randtable.c
49 -compress.o: compress.c
50 - $(CC) $(CFLAGS) -c compress.c
51 -decompress.o: decompress.c
52 - $(CC) $(CFLAGS) -c decompress.c
53 -bzlib.o: bzlib.c
54 - $(CC) $(CFLAGS) -c bzlib.c
55 +%.sho: %.c
56 + $(CC) $(CFLAGS) -o $@ -c $<