blob: 148c7562a822fef10f9ae5450cf46398f4359916 (
plain)
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
33
|
--- bzip2-1.0.6.orig/Makefile-libbz2_so 2010-09-11 01:07:52.000000000 +0200
+++ bzip2-1.0.6/Makefile-libbz2_so 2014-01-13 21:51:20.000000000 +0100
@@ -21,10 +21,18 @@
# ------------------------------------------------------------------
-SHELL=/bin/sh
-CC=gcc
+SHELL?=/bin/sh
+CC?=gcc
BIGFILES=-D_FILE_OFFSET_BITS=64
-CFLAGS=-fpic -fPIC -Wall -Winline -O2 -g $(BIGFILES)
+CFLAGS?=
+CFLAGS+=-fpic -fPIC -Wall -Winline $(BIGFILES)
+OS=$(shell uname)
+LDOPT=-soname
+ifneq ($(CROSS_COMPILE),1)
+ifeq ($(OS),Darwin)
+LDOPT=-install_name
+endif
+endif
OBJS= blocksort.o \
huffman.o \
@@ -35,7 +43,7 @@ OBJS= blocksort.o \
bzlib.o
all: $(OBJS)
- $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.6 $(OBJS)
+ $(CC) -shared -Wl,$(LDOPT) -Wl,libbz2.so.1.0 -o libbz2.so.1.0.6 $(OBJS)
$(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6
rm -f libbz2.so.1.0
ln -s libbz2.so.1.0.6 libbz2.so.1.0
|