summaryrefslogtreecommitdiff
path: root/extra/xdelta3/xdelta3-makefile.patch
blob: d5fa12e7068510910bfc767a4c3f900bcaaf269c (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
diff -Naur xdelta3.0.0-orig/Makefile xdelta3.0.0/Makefile
--- xdelta3.0.0-orig/Makefile	2011-01-09 18:29:06.000000000 +1000
+++ xdelta3.0.0/Makefile	2011-12-21 11:53:13.530028738 +1000
@@ -54,7 +54,7 @@
 WIXDIR = "/cygdrive/c/Program Files/wix2.0.4820"
 
 # -arch x86_64
-CFLAGS= -Wall -Wshadow -fno-builtin
+CFLAGS+= -Wall -Wshadow -fno-builtin
 WFLAGS= -Wextra -Wsign-compare -Wconversion -Wextra -Wno-unused-parameter
 
 # $Format: "REL=$Xdelta3Version$" $
@@ -126,7 +126,7 @@
 	$(WIXDIR)/light.exe xdelta3.wixobj -out xdelta3.msi
 
 xdelta3: $(SOURCES)
-	$(CC) $(CFLAGS) -O3 xdelta3.c -lm -o xdelta3 \
+	$(CC) $(CFLAGS) -O3 xdelta3.c -lm $(LDFLAGS) -o xdelta3 \
 	      -DGENERIC_ENCODE_TABLES=0 \
 	      -DREGRESSION_TEST=1 \
 	      -DSECONDARY_DJW=1 \
@@ -137,7 +137,7 @@
 	      -DXD3_USE_LARGEFILE64=1
 
 xdelta3-debug: $(SOURCES)
-	$(CC) -g $(CFLAGS) xdelta3.c -lm -o xdelta3-debug \
+	$(CC) -g $(CFLAGS) xdelta3.c -lm $(LDFLAGS) -o xdelta3-debug \
 		-DGENERIC_ENCODE_TABLES=1 \
 		-DREGRESSION_TEST=1 \
 		-DSECONDARY_DJW=1 \
@@ -202,6 +202,9 @@
 xdelta3.o: $(SOURCES)
 	$(CC) -O3 $(CFLAGS) -c xdelta3.c $(SWIG_FLAGS) -o xdelta3.o
 
+xdelta3_PIC.o: $(SOURCES)
+	$(CC) -O3 $(CFLAGS) -fPIC -c xdelta3.c $(SWIG_FLAGS) -o xdelta3_PIC.o
+
 xdelta3_wrap.o: xdelta3_wrap.c
 	$(CC) -O3 $(CFLAGS) $(SWIG_FLAGS) \
 	      -DHAVE_CONFIG_H \
@@ -221,8 +224,8 @@
 	cp $(SWIGTGT) /usr/lib/python$(PYVER)/site-packages
 
 ifeq ("$(DARWIN)", "")
-xdelta3module.so: xdelta3_wrap.o xdelta3.o
-	ld -shared xdelta3.o xdelta3_wrap.o \
+xdelta3module.so: xdelta3_wrap.o xdelta3_PIC.o
+	cc $(CFLAGS) $(LDFLAGS) -shared xdelta3_PIC.o xdelta3_wrap.o \
 		-o xdelta3module.so \
 		/usr/lib/libpython$(PYVER).so \
 		-lc