diff options
Diffstat (limited to 'sci-libs/libsvm/files/libsvm-3.25-makefile.patch')
-rw-r--r-- | sci-libs/libsvm/files/libsvm-3.25-makefile.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/sci-libs/libsvm/files/libsvm-3.25-makefile.patch b/sci-libs/libsvm/files/libsvm-3.25-makefile.patch new file mode 100644 index 000000000000..ea48368b27a5 --- /dev/null +++ b/sci-libs/libsvm/files/libsvm-3.25-makefile.patch @@ -0,0 +1,49 @@ +* respect CFLAGS and CXXFLAGS from user +* compile with CC for C and CXX for C++ files +* propagate and respect user's LDFLAGS +* PIC only used for the library +* link the shared version library + +--- a/Makefile ++++ b/Makefile +@@ -1,9 +1,10 @@ +-CXX ?= g++ +-CFLAGS = -Wall -Wconversion -O3 -fPIC ++CFLAGS ?= -Wall -Wconversion ++CXXFLAGS ?= $(CFLAGS) + SHVER = 2 + OS = $(shell uname) ++PICFLAGS ?= -fPIC + +-all: svm-train svm-predict svm-scale ++all: svm-train svm-predict svm-scale lib + + lib: svm.o + if [ "$(OS)" = "Darwin" ]; then \ +@@ -11,15 +12,17 @@ + else \ + SHARED_LIB_FLAG="-shared -Wl,-soname,libsvm.so.$(SHVER)"; \ + fi; \ +- $(CXX) $${SHARED_LIB_FLAG} svm.o -o libsvm.so.$(SHVER) ++ $(CXX) $(LDFLAGS) $${SHARED_LIB_FLAG} svm.o -o libsvm.so.$(SHVER) $(OPENMP_LIBS) ; \ ++ ln -s libsvm.so.$(SHVER) libsvm.so ++ ++svm-predict: svm-predict.o lib ++ $(CXX) $(LDFLAGS) $< -o $@ $(LIBS) -L. -lsvm -lm ++svm-train: svm-train.o lib ++ $(CXX) $(LDFLAGS) $< -o $@ $(LIBS) -L. -lsvm -lm ++svm-scale: svm-scale.o ++ $(CXX) $(LDFLAGS) $< -o $@ $(LIBS) + +-svm-predict: svm-predict.c svm.o +- $(CXX) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm +-svm-train: svm-train.c svm.o +- $(CXX) $(CFLAGS) svm-train.c svm.o -o svm-train -lm +-svm-scale: svm-scale.c +- $(CXX) $(CFLAGS) svm-scale.c -o svm-scale + svm.o: svm.cpp svm.h +- $(CXX) $(CFLAGS) -c svm.cpp ++ $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(PICFLAGS) $(OPENMP_CFLAGS) -c svm.cpp -o $@ + clean: +- rm -f *~ svm.o svm-train svm-predict svm-scale libsvm.so.$(SHVER) ++ rm -f *~ svm.o svm-train svm-predict svm-scale libsvm.so.$(SHVER) libsvm.so |