[liblinear] 03/123: Add patch for upstream's Makefile

Christian Kastner chrisk-guest at moszumanska.debian.org
Tue Aug 26 03:42:03 UTC 2014


This is an automated email from the git hooks/post-receive script.

chrisk-guest pushed a commit to branch master
in repository liblinear.

commit 0a92874f069a19c51a8d0d7f09ddf7077fbd57b2
Author: Christian Kastner <debian at kvr.at>
Date:   Thu Jun 17 15:58:31 2010 +0200

    Add patch for upstream's Makefile
    
    Properly build shared and static libraries, programs
---
 debian/changelog                                   |  2 +
 ...uild-shared-and-static-libraries-programs.patch | 71 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 74 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 9adbc51..9120285 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,7 @@
 liblinear (1.51~dfsg-1) unstable; urgency=low
 
   * Initial release (Closes: #585788)
+  * debian/patches:
+    - 0001-Properly-build-shared-and-static-libraries-programs
 
  -- Christian Kastner <debian at kvr.at>  Sat, 12 Jun 2010 21:21:11 +0200
diff --git a/debian/patches/0001-Properly-build-shared-and-static-libraries-programs.patch b/debian/patches/0001-Properly-build-shared-and-static-libraries-programs.patch
new file mode 100644
index 0000000..f5e4c69
--- /dev/null
+++ b/debian/patches/0001-Properly-build-shared-and-static-libraries-programs.patch
@@ -0,0 +1,71 @@
+From: Christian Kastner <debian at kvr.at>
+Date: Thu, 17 Jun 2010 15:57:19 +0200
+Subject: [PATCH] Properly build shared and static libraries, programs
+
+Modify upstream's Makefile to properly build shared and static libraries,
+link upstream's programs to the shared libraries.
+---
+ Makefile |   46 ++++++++++++++++++++++++++++++++--------------
+ 1 files changed, 32 insertions(+), 14 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 8e4cb10..c6df256 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,23 +1,41 @@
+ CXX ?= g++
+ CC ?= gcc
+-CFLAGS = -Wall -Wconversion -O3 -fPIC
+-LIBS =
+-#LIBS = -lblas
++CFLAGS +=
++LDFLAGS +=
++LIBS +=
+ 
+-all: train predict
++LIB_CFLAGS += $(CFLAGS) -fPIC
++LIB_LDFLAGS += $(LDFLAGS) -L.
++LIB_LIBS += $(LIBS) -llinear
+ 
+-train: tron.o linear.o train.c
+-	$(CXX) $(CFLAGS) -o train train.c tron.o linear.o $(LIBS)
++PROG_CFLAGS += $(CFLAGS)
++PROG_LDFLAGS += $(LDFLAGS) -L.
++PROG_LIBS += $(LIBS) -lblas -llinear
+ 
+-predict: tron.o linear.o predict.c
+-	$(CXX) $(CFLAGS) -o predict predict.c tron.o linear.o $(LIBS)
++LVER ?= 0
++LSUBVER ?= 0
++LIBFILE = liblinear.so.$(LVER).$(LSUBVER)
+ 
+-tron.o: tron.cpp tron.h
+-	$(CXX) $(CFLAGS) -c -o tron.o tron.cpp
+ 
+-linear.o: linear.cpp linear.h
+-	$(CXX) $(CFLAGS) -c -o linear.o linear.cpp
++all: linear-train linear-predict liblinear.a
++
++linear-train: train.c $(LIBFILE)
++	$(CXX) $(PROG_CFLAGS) $(PROG_LDFLAGS) -o $@ train.c $(PROG_LIBS)
++
++linear-predict: predict.c $(LIBFILE)
++	$(CXX) $(PROG_CFLAGS) $(PROG_LDFLAGS) -o $@ predict.c $(PROG_LIBS)
++
++$(LIBFILE): linear.cpp linear.h tron.cpp tron.h
++	$(CXX) $(LIB_CFLAGS) $(LIB_LDFLAGS) -shared \
++		-Wl,-soname,liblinear.so.$(LVER) \
++		-o $@ linear.cpp tron.cpp $(LIBS)
++	ln -s $@ liblinear.so.$(LVER)
++	ln -s liblinear.so.$(LVER) liblinear.so
++
++liblinear.a:
++	$(CXX) $(CFLAGS) $(LDFLAGS) -c -o linear-static.o linear.cpp
++	$(CXX) $(CFLAGS) $(LDFLAGS) -c -o tron-static.o tron.cpp
++	ar cru liblinear.a linear-static.o tron-static.o
+ 
+ clean:
+-	cd matlab;	make clean
+-	rm -f *~ tron.o linear.o train predict
++	rm -f *~ *.o *.so* linear-train linear-predict
+-- 
diff --git a/debian/patches/series b/debian/patches/series
index e69de29..72e9037 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-Properly-build-shared-and-static-libraries-programs.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/liblinear.git



More information about the debian-science-commits mailing list