[libocas] 47/60: patches: Extend 0001-Properly-build-shared-and-static-libraries-programs

Christian Kastner chrisk-guest at moszumanska.debian.org
Mon Aug 25 03:34:45 UTC 2014


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

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

commit 738ff16a5be4ed2c7bca69f9b8b3986d0949a314
Author: Christian Kastner <debian at kvr.at>
Date:   Sun Jul 27 00:47:48 2014 +0200

    patches: Extend 0001-Properly-build-shared-and-static-libraries-programs
    
    Add an install target, honoring DESTDIR and allowing override of target
    directories for binaries and libraries.
---
 ...uild-shared-and-static-libraries-programs.patch | 38 +++++++++++++++-------
 1 file changed, 26 insertions(+), 12 deletions(-)

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
index 93e09cb..3bda3f6 100644
--- a/debian/patches/0001-Properly-build-shared-and-static-libraries-programs.patch
+++ b/debian/patches/0001-Properly-build-shared-and-static-libraries-programs.patch
@@ -3,19 +3,20 @@ Date: Thu, 17 Jun 2010 15:39:15 +0200
 Subject: Properly build shared and static libraries, programs
 
 Modify upstream's Makefile to properly build shared and static libraries, and
-link upstream's programs to the shared libraries.
+link upstream's programs to the shared libraries. Furthermore, provide an
+install target.
 
 Forwarded: no
-Last-Update: 2014-02-21
+Last-Update: 2014-07-26
 ---
- Makefile | 48 +++++++++++++++++++++++++++++++++++-------------
- 1 file changed, 35 insertions(+), 13 deletions(-)
+ Makefile | 60 +++++++++++++++++++++++++++++++++++++++++++++++-------------
+ 1 file changed, 47 insertions(+), 13 deletions(-)
 
 diff --git a/Makefile b/Makefile
-index 2ed4145..9bd3a9c 100644
+index 2ed4145..41924c1 100644
 --- a/Makefile
 +++ b/Makefile
-@@ -3,10 +3,23 @@ MEX := mex
+@@ -3,11 +3,28 @@ MEX := mex
  MEXFLAGS := $(shell if uname -m | grep -q x86_64 ; then echo -largeArrayDims ; fi)
  MEXSUFFIX := $(shell if uname -m | grep -q x86_64 ; then echo mexa64 ; else echo mexglx ; fi)
  CC := gcc
@@ -23,7 +24,7 @@ index 2ed4145..9bd3a9c 100644
 -CFLAGS := -lm -msse -O3 -fPIC -fstrict-aliasing -fomit-frame-pointer -Wall -pthread
 -#CFLAGS := -lm -msse -O3 -fPIC -fstrict-aliasing -fomit-frame-pointer -Wall
 -#CFLAGS := -lm -msse -O3 -fPIC -fopenmp -fstrict-aliasing -fomit-frame-pointer -Wall
-+
+ 
 +CFLAGS +=
 +LDFLAGS +=
 +LIBS += -lm
@@ -40,10 +41,15 @@ index 2ed4145..9bd3a9c 100644
 +LVER ?= 0
 +LSUBVER ?= 0
 +LIBFILE = libocas.so.$(LVER).$(LSUBVER)
- 
++
++bindir ?= /usr/bin/
++libdir ?= /usr/lib/
++bindest = $(DESTDIR)$(bindir)
++libdest = $(DESTDIR)$(libdir)
  
  ifeq (yes,$(MEXDETECTED))
-@@ -43,21 +56,30 @@ lbpfilter.$(MEXSUFFIX): lbpfilter_mex.c
+ all: svmocas.$(MEXSUFFIX) svmlight_linclass.$(MEXSUFFIX) libocas.so svmocas msvmocas linclass msvmocas.$(MEXSUFFIX) compute_errors.$(MEXSUFFIX) lbppyr.$(MEXSUFFIX) svmocas_lbp.$(MEXSUFFIX) lbppyr_features.$(MEXSUFFIX) lbpfilter.$(MEXSUFFIX)
+@@ -43,21 +60,38 @@ lbpfilter.$(MEXSUFFIX): lbpfilter_mex.c
  
  
  else 
@@ -65,7 +71,7 @@ index 2ed4145..9bd3a9c 100644
 -		$(CC) $(CFLAGS) -o $@ linclass.c lib_svmlight_format.c  
 +		$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ linclass.c lib_svmlight_format.c $(LIBS)
 +
- 
++
 +$(LIBFILE):	libocas.c libocas.h libqp_splx.c libqp.h
 +		$(CC) $(CPPFLAGS) $(LIB_CFLAGS) $(LIB_LDFLAGS) -shared \
 +			-Wl,-soname,libocas.so.$(LVER) \
@@ -73,13 +79,21 @@ index 2ed4145..9bd3a9c 100644
 +		ln -s $@ libocas.so.$(LVER)
 +		ln -s libocas.so.$(LVER) libocas.so
  
--libocas.so:	libocas.c libocas.h libqp_splx.c libqp.h 
--		$(CC) $(CFLAGS) -shared -o $@ libocas.c libqp_splx.c
 +libocas.a:
 +	$(CXX) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -c -o libocas-static.o libocas.c
 +	$(CXX) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -c -o libqp_splx-static.o libqp_splx.c
 +	ar cru libocas.a libocas-static.o libqp_splx-static.o
  
+-libocas.so:	libocas.c libocas.h libqp_splx.c libqp.h 
+-		$(CC) $(CFLAGS) -shared -o $@ libocas.c libqp_splx.c
++install: all
++	install -d $(bindest) $(libdest)
++	install svmocas msvmocas linclass -m 755 $(bindest)
++	install libocas.a -m 644 $(libdest)
++	install $(LIBFILE) -m 644 $(libdest)
++	cd $(libdest) && ln -s $(LIBFILE) libocas.so.$(LVER)
++	cd $(libdest) && ln -s libocas.so.$(LVER) libocas.so
+ 
  clean: 
 -		rm -f *~ svmocas.$(MEXSUFFIX) svmlight_linclass.$(MEXSUFFIX) svmocas msvmocas linclass libocas.so msvmocas.$(MEXSUFFIX) lbpfilter.$(MEXSUFFIX) lbppyr_features.$(MEXSUFFIX) svmocas_lbp.$(MEXSUFFIX) lbppyr.$(MEXSUFFIX) compute_errors.$(MEXSUFFIX)
 +		rm -f *~ *.o libocas.a svmocas.$(MEXSUFFIX) svmlight_linclass.$(MEXSUFFIX) svmocas msvmocas linclass libocas.so* msvmocas.$(MEXSUFFIX) lbpfilter.$(MEXSUFFIX) lbppyr_features.$(MEXSUFFIX) svmocas_lbp.$(MEXSUFFIX) lbppyr.$(MEXSUFFIX) compute_errors.$(MEXSUFFIX)

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



More information about the debian-science-commits mailing list