pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/math/liblinear Add support for CFLAGS and LDFLAGS



details:   https://anonhg.NetBSD.org/pkgsrc/rev/8e26f07d6410
branches:  trunk
changeset: 371405:8e26f07d6410
user:      khorben <khorben%pkgsrc.org@localhost>
date:      Fri Nov 10 16:18:47 2017 +0000

description:
Add support for CFLAGS and LDFLAGS

This notably fixes building with RELRO enabled.

Bump PKGREVISION, since this generates a different binary now that SSP and
FORTIFY are enabled.

diffstat:

 math/liblinear/Makefile                    |   6 +++++-
 math/liblinear/distinfo                    |   6 +++---
 math/liblinear/patches/patch-Makefile      |  18 ++++++++++++------
 math/liblinear/patches/patch-blas_Makefile |   5 +++--
 4 files changed, 23 insertions(+), 12 deletions(-)

diffs (106 lines):

diff -r b0a0ed27747f -r 8e26f07d6410 math/liblinear/Makefile
--- a/math/liblinear/Makefile   Fri Nov 10 15:08:08 2017 +0000
+++ b/math/liblinear/Makefile   Fri Nov 10 16:18:47 2017 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.4 2017/05/21 10:40:28 adam Exp $
+# $NetBSD: Makefile,v 1.5 2017/11/10 16:18:47 khorben Exp $
 
 DISTNAME=      liblinear-2.11
+PKGREVISION=   1
 CATEGORIES=    math
 MASTER_SITES=  http://www.csie.ntu.edu.tw/~cjlin/liblinear/
 
@@ -15,6 +16,9 @@
 BUILD_TARGET=  all lib
 AUTO_MKDIRS=   yes
 
+MAKE_FLAGS+=   CFLAGS=${CFLAGS:Q}
+MAKE_FLAGS+=   LDFLAGS=${LDFLAGS:Q}
+
 do-install:
        ${INSTALL_PROGRAM} ${WRKSRC}/predict ${DESTDIR}${PREFIX}/bin/liblinear-predict
        ${INSTALL_PROGRAM} ${WRKSRC}/train ${DESTDIR}${PREFIX}/bin/liblinear-train
diff -r b0a0ed27747f -r 8e26f07d6410 math/liblinear/distinfo
--- a/math/liblinear/distinfo   Fri Nov 10 15:08:08 2017 +0000
+++ b/math/liblinear/distinfo   Fri Nov 10 16:18:47 2017 +0000
@@ -1,8 +1,8 @@
-$NetBSD: distinfo,v 1.5 2017/05/21 10:40:28 adam Exp $
+$NetBSD: distinfo,v 1.6 2017/11/10 16:18:47 khorben Exp $
 
 SHA1 (liblinear-2.11.tar.gz) = 6c306d0d0b7ea5281ee2b587adc89745ee0d74fa
 RMD160 (liblinear-2.11.tar.gz) = c80d051e8b354de03da3e41bd1bea096ef4076f3
 SHA512 (liblinear-2.11.tar.gz) = c5a33e98ae3c792173d38060b6002cf63af4571b42cdf313f6e5fd8ee5ac7b86caa99d123a028a6ecb3843aac0f839c9ff655f5fb28cfdf26ca7a6cb5f3f359d
 Size (liblinear-2.11.tar.gz) = 506509 bytes
-SHA1 (patch-Makefile) = 88e7188f9e5a8bb5da90a1cac23a5de98dbe5817
-SHA1 (patch-blas_Makefile) = b52b5e18a47c075241adbfcdcf8f70e6fe849711
+SHA1 (patch-Makefile) = 1f10259764b0ca07874da35d35b76d4054e92117
+SHA1 (patch-blas_Makefile) = d829bdf80671d1eb95e78e4a7592f6fd3ffb7c46
diff -r b0a0ed27747f -r 8e26f07d6410 math/liblinear/patches/patch-Makefile
--- a/math/liblinear/patches/patch-Makefile     Fri Nov 10 15:08:08 2017 +0000
+++ b/math/liblinear/patches/patch-Makefile     Fri Nov 10 16:18:47 2017 +0000
@@ -1,10 +1,11 @@
-$NetBSD: patch-Makefile,v 1.2 2016/01/28 11:34:48 jperkin Exp $
+$NetBSD: patch-Makefile,v 1.3 2017/11/10 16:18:47 khorben Exp $
 
 Use LIBTOOL.
+Add support for LDFLAGS.
 
---- Makefile.orig      2015-09-26 22:03:26.000000000 +0000
+--- Makefile.orig      2017-03-28 22:22:33.000000000 +0000
 +++ Makefile
-@@ -1,34 +1,27 @@
+@@ -1,37 +1,30 @@
  CXX ?= g++
  CC ?= gcc
 -CFLAGS = -Wall -Wconversion -O3 -fPIC
@@ -30,17 +31,17 @@
 -predict: tron.o linear.o predict.c blas/blas.a
 -      $(CXX) $(CFLAGS) -o predict predict.c tron.o linear.o $(LIBS)
 +lib: linear.lo tron.lo $(LIBS)
-+      ${LIBTOOL} --mode=link $(CXX) -o liblinear.la $> -rpath ${PREFIX}/lib -version-info ${SHVER}:0
++      ${LIBTOOL} --mode=link $(CXX) -o liblinear.la $(LDFLAGS) $> -rpath ${PREFIX}/lib -version-info ${SHVER}:0
  
 -tron.o: tron.cpp tron.h
 -      $(CXX) $(CFLAGS) -c -o tron.o tron.cpp
 +train: tron.lo linear.lo train.c $(LIBS)
-+      ${LIBTOOL} --mode=link $(CXX) $(CFLAGS) -o train $>
++      ${LIBTOOL} --mode=link $(CXX) $(CFLAGS) -o train $(LDFLAGS) $>
  
 -linear.o: linear.cpp linear.h
 -      $(CXX) $(CFLAGS) -c -o linear.o linear.cpp
 +predict: tron.lo linear.lo predict.c $(LIBS)
-+      ${LIBTOOL} --mode=link $(CXX) $(CFLAGS) -o predict $>
++      ${LIBTOOL} --mode=link $(CXX) $(CFLAGS) -o predict $(LDFLAGS) $>
  
 -blas/blas.a: blas/*.c blas/*.h
 +tron.lo: tron.cpp tron.h
@@ -53,3 +54,8 @@
        make -C blas OPTFLAGS='$(CFLAGS)' CC='$(CC)';
  
  clean:
+-      make -C blas clean
+-      make -C matlab clean
++      $(MAKE) -C blas clean
++      $(MAKE) -C matlab clean
+       rm -f *~ tron.o linear.o train predict liblinear.so.$(SHVER)
diff -r b0a0ed27747f -r 8e26f07d6410 math/liblinear/patches/patch-blas_Makefile
--- a/math/liblinear/patches/patch-blas_Makefile        Fri Nov 10 15:08:08 2017 +0000
+++ b/math/liblinear/patches/patch-blas_Makefile        Fri Nov 10 16:18:47 2017 +0000
@@ -1,6 +1,7 @@
-$NetBSD: patch-blas_Makefile,v 1.2 2017/05/21 10:40:28 adam Exp $
+$NetBSD: patch-blas_Makefile,v 1.3 2017/11/10 16:18:47 khorben Exp $
 
 Use LIBTOOL.
+Add support for LDFLAGS.
 
 --- blas/Makefile.orig 2017-03-28 22:22:33.000000000 +0000
 +++ blas/Makefile
@@ -12,7 +13,7 @@
 -      $(AR) blas.a $(FILES)
 -      $(RANLIB) blas.a
 +blas: $(FILES:.o=.lo) $(HEADERS)
-+      $(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o libblas.la $(FILES:.o=.lo)
++      $(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o libblas.la $(LDFLAGS) $(FILES:.o=.lo)
  
  clean:
        - rm -f *.o



Home | Main Index | Thread Index | Old Index