summarylogtreecommitdiffstats
path: root/002-libsvm-use-archlinux-flags.patch
blob: 67e4350530b028c369f73a10b4d4506ab30cdecc (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
diff -Naurp a/Makefile b/Makefile
--- a/Makefile	2018-07-15 14:15:32.000000000 +0000
+++ b/Makefile	2018-12-04 18:32:24.627133671 +0000
@@ -1,5 +1,5 @@
 CXX ?= g++
-CFLAGS = -Wall -Wconversion -O3 -fPIC
+CFLAGS += -Wall -Wconversion -fPIC
 SHVER = 2
 OS = $(shell uname)
 
@@ -11,14 +11,14 @@ lib: svm.o
 	else \
 		SHARED_LIB_FLAG="-shared -Wl,-soname,libsvm.so.$(SHVER)"; \
 	fi; \
-	$(CXX) $${SHARED_LIB_FLAG} svm.o -o libsvm.so.$(SHVER)
+	$(CXX) $${SHARED_LIB_FLAG} svm.o -o libsvm.so.$(SHVER) $(LDFLAGS)
 
 svm-predict: svm-predict.c svm.o
-	$(CXX) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm
+	$(CXX) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm $(LDFLAGS)
 svm-train: svm-train.c svm.o
-	$(CXX) $(CFLAGS) svm-train.c svm.o -o svm-train -lm
+	$(CXX) $(CFLAGS) svm-train.c svm.o -o svm-train -lm $(LDFLAGS)
 svm-scale: svm-scale.c
-	$(CXX) $(CFLAGS) svm-scale.c -o svm-scale
+	$(CXX) $(CFLAGS) svm-scale.c -o svm-scale $(LDFLAGS)
 svm.o: svm.cpp svm.h
 	$(CXX) $(CFLAGS) -c svm.cpp
 clean:
diff -Naurp a/svm-toy/qt/Makefile b/svm-toy/qt/Makefile
--- a/svm-toy/qt/Makefile	2018-12-04 18:34:40.715220500 +0000
+++ b/svm-toy/qt/Makefile	2018-12-04 18:40:33.446873531 +0000
@@ -2,12 +2,12 @@
 # may need to adjust the path of header files
 CXX? = g++
 INCLUDE = /usr/include/qt
-CFLAGS = -Wall -O3 -I$(INCLUDE) -I$(INCLUDE)/QtWidgets -I$(INCLUDE)/QtGui -I$(INCLUDE)/QtCore -fPIC -std=c++11
+CFLAGS += -Wall -I$(INCLUDE) -I$(INCLUDE)/QtWidgets -I$(INCLUDE)/QtGui -I$(INCLUDE)/QtCore -fPIC -std=c++11
 LIB = -lQt5Widgets -lQt5Gui -lQt5Core
 MOC = /usr/bin/moc
 
 svm-toy: svm-toy.cpp svm-toy.moc ../../svm.o
-	$(CXX) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy $(LIB)
+	$(CXX) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy $(LIB) $(LDFLAGS)
 
 svm-toy.moc: svm-toy.cpp
 	$(MOC) svm-toy.cpp -o svm-toy.moc