aboutsummaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
authorMaho Nakata <maho@FreeBSD.org>2006-11-29 01:52:30 +0000
committerMaho Nakata <maho@FreeBSD.org>2006-11-29 01:52:30 +0000
commitea2c0c37c2c3de4f1a9bb90071d74b1ba3e0b520 (patch)
treeaeb7e68fb93b665330bb0381d3423833ffb706ab /math
parent631071eaacf8324b1eea76368e9d840d7470f69e (diff)
downloadports-ea2c0c37c2c3de4f1a9bb90071d74b1ba3e0b520.tar.gz
ports-ea2c0c37c2c3de4f1a9bb90071d74b1ba3e0b520.zip
Build shared libs as well.
Bump port revision. Suggested by: kris
Notes
Notes: svn path=/head/; revision=178222
Diffstat (limited to 'math')
-rw-r--r--math/suitesparse/Makefile80
-rw-r--r--math/suitesparse/pkg-plist21
2 files changed, 71 insertions, 30 deletions
diff --git a/math/suitesparse/Makefile b/math/suitesparse/Makefile
index 726143a87c9c..170e8bc3f3f7 100644
--- a/math/suitesparse/Makefile
+++ b/math/suitesparse/Makefile
@@ -7,7 +7,7 @@
PORTNAME= suitesparse
PORTVERSION= 2.1.1
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= math
MASTER_SITES= http://www.cise.ufl.edu/research/sparse/SuiteSparse/current/
DISTNAME= SuiteSparse
@@ -16,21 +16,8 @@ DIST_SUBDIR= ${PORTNAME}/${PORTVERSION}
MAINTAINER= maho@FreeBSD.org
COMMENT= SuiteSparse is a set of packages for sparse matrices calculation
-CONFLICTS= elmer-umfpack-4*
-
BUILD_DEPENDS= ${LOCALBASE}/lib/libmetis.a:${PORTSDIR}/math/metis
-.include <bsd.port.pre.mk>
-
-.if ${ARCH} == "sparc64" || ${ARCH} == "amd64"
-FPIC= -fPIC
-.else
-FPIC= -fpic
-.endif
-
-CFLAGS+= ${FPIC}
-FFLAGS+= ${FPIC}
-
.if defined(WITH_BLAS)
LIB_DEPENDS+= blas.1:${PORTSDIR}/math/blas
BLAS= -L${LOCALBASE}/lib -lblas
@@ -41,12 +28,28 @@ BLAS= -L${LOCALBASE}/lib -lf77blas -latlas -lg2c
LAPACK= -L${LOCALBASE}/lib -lalapack -lcblas
.endif
+CONFLICTS= elmer-umfpack-4*
+
+.include <bsd.port.pre.mk>
+
+.if ${ARCH} == "sparc64" || ${ARCH} == "amd64"
+FPIC= -fPIC
+.else
+FPIC= -fpic
+.endif
+
CONFLICTS= umfpack-*
-ALL_TARGET= default
+USE_LDCONFIG= yes
USE_GMAKE= yes
+WRKSRC_SHARED=${WRKSRC}_shared
+CFLAGS_SHARED=${CFLAGS} ${FPIC}
+FFLAGS_SHARED=${CFLAGS} ${FPIC}
+SVERSION=1
+
post-patch:
+ ${CP} -r ${WRKSRC} ${WRKSRC_SHARED}
@${REINPLACE_CMD} -e 's,%%CC%%,${CC},g' \
-e 's,%%CFLAGS%%,${CFLAGS},g' \
-e 's,%%F77%%,${FC},g' \
@@ -59,27 +62,48 @@ post-patch:
-e 's,%%CFLAGS%%,${CFLAGS},g' \
${WRKSRC}/CSparse/Source/Makefile \
${WRKSRC}/CXSparse/Source/Makefile
-do-install:
+
+ @${REINPLACE_CMD} -e 's,%%CC%%,${CC},g' \
+ -e 's,%%CFLAGS%%,${CFLAGS_SHARED},g' \
+ -e 's,%%F77%%,${FC},g' \
+ -e 's,%%FFLAGS%%,${FFLAGS_SHARED},g' \
+ -e 's,%%BLAS%%,${BLAS},g' \
+ -e 's,%%LAPACK%%,${LAPACK},g' \
+ -e 's,%%LOCALBASE%%,${LOCALBASE},g' \
+ ${WRKSRC_SHARED}/UFconfig/UFconfig.mk
+ @${REINPLACE_CMD} -e 's,%%CC%%,${CC},g' \
+ -e 's,%%CFLAGS%%,${CFLAGS_SHARED},g' \
+ ${WRKSRC_SHARED}/CSparse/Source/Makefile \
+ ${WRKSRC_SHARED}/CXSparse/Source/Makefile
+
+do-build:
+ cd ${WRKSRC} ; ${GMAKE}
+ cd ${WRKSRC_SHARED} ; ${GMAKE}
+ ${RM} -rf ${WRKDIR}/tmp_static
+ ${MKDIR} ${WRKDIR}/tmp_static
+ cd ${WRKDIR}/tmp_static
+ ${FIND} ${WRKSRC} -name "*\.a" -exec ${MV} {} ${WRKDIR}/tmp_static \;
+ ${RM} -rf ${WRKDIR}/tmp_shared
+ ${MKDIR} ${WRKDIR}/tmp_shared
+ ${FIND} ${WRKSRC_SHARED} -name "*\.a" -exec ${MV} {} ${WRKDIR}/tmp_shared \;
+ cd ${WRKDIR}/tmp_shared ; for i in `ls *.a | ${SED} 's/\.a//' `; do \
+ ld -Bshareable -o $${i}.so.${SVERSION} -x -soname $${i}.so.${SVERSION} --whole-archive $${i}.a ;\
+ done
+
+do-install:
${MKDIR} ${PREFIX}/include/suitesparse
${LN} -sf ${PREFIX}/include/suitesparse ${PREFIX}/include/ufsparse
- ${INSTALL_DATA} ${WRKSRC}/UFconfig/UFconfig.h ${PREFIX}/include/suitesparse
- ${INSTALL_DATA} ${WRKSRC}/UMFPACK/Include/*.h ${PREFIX}/include/suitesparse
+ ${INSTALL_DATA} ${WRKSRC}/UFconfig/UFconfig.h ${PREFIX}/include/suitesparse
+ ${INSTALL_DATA} ${WRKSRC}/UMFPACK/Include/*.h ${PREFIX}/include/suitesparse
${INSTALL_DATA} ${WRKSRC}/AMD/Include/*.h ${PREFIX}/include/suitesparse
${INSTALL_DATA} ${WRKSRC}/BTF/Include/*.h ${PREFIX}/include/suitesparse
${INSTALL_DATA} ${WRKSRC}/CCOLAMD/*.h ${PREFIX}/include/suitesparse
${INSTALL_DATA} ${WRKSRC}/CHOLMOD/Include/*.h ${PREFIX}/include/suitesparse
${INSTALL_DATA} ${WRKSRC}/COLAMD/*.h ${PREFIX}/include/suitesparse
${INSTALL_DATA} ${WRKSRC}/CXSparse/Source/*.h ${PREFIX}/include/suitesparse
- ${INSTALL_DATA} ${WRKSRC}/KLU/Include/*.h ${PREFIX}/include/suitesparse
+ ${INSTALL_DATA} ${WRKSRC}/KLU/Include/*.h ${PREFIX}/include/suitesparse
${INSTALL_DATA} ${WRKSRC}/CAMD/Include/*.h ${PREFIX}/include/suitesparse
- ${INSTALL_DATA} ${WRKSRC}/UMFPACK/Lib/libumfpack.a ${PREFIX}/lib
- ${INSTALL_DATA} ${WRKSRC}/AMD/Lib/libamd.a ${PREFIX}/lib
- ${INSTALL_DATA} ${WRKSRC}/CCOLAMD/libccolamd.a ${PREFIX}/lib
- ${INSTALL_DATA} ${WRKSRC}/CHOLMOD/Lib/libcholmod.a ${PREFIX}/lib
- ${INSTALL_DATA} ${WRKSRC}/COLAMD/libcolamd.a ${PREFIX}/lib
- ${INSTALL_DATA} ${WRKSRC}/KLU/Lib/libklu.a ${PREFIX}/lib
- ${INSTALL_DATA} ${WRKSRC}/BTF/Lib/libbtf.a ${PREFIX}/lib
- ${INSTALL_DATA} ${WRKSRC}/CAMD/Lib/libcamd.a ${PREFIX}/lib
- ${INSTALL_DATA} ${WRKSRC}/CXSparse/Source/libcxsparse.a ${PREFIX}/lib
+ ${INSTALL_DATA} ${WRKDIR}/tmp_static/*.a ${PREFIX}/lib
+ ${INSTALL_DATA} ${WRKDIR}/tmp_shared/*.so.${SVERSION} ${PREFIX}/lib
.include <bsd.port.post.mk>
diff --git a/math/suitesparse/pkg-plist b/math/suitesparse/pkg-plist
index e60229a78d19..4f8daf95cc4f 100644
--- a/math/suitesparse/pkg-plist
+++ b/math/suitesparse/pkg-plist
@@ -60,11 +60,28 @@ include/suitesparse/umfpack_wsolve.h
include/ufsparse
@dirrm include/suitesparse
lib/libamd.a
+lib/libamd.so.1
lib/libbtf.a
+lib/libbtf.so.1
lib/libcamd.a
+lib/libcamd.so.1
lib/libccolamd.a
-lib/libcolamd.a
+lib/libccolamd.so.1
+lib/libcerbla.a
+lib/libcerbla.so.1
lib/libcholmod.a
+lib/libcholmod.so.1
+lib/libcolamd.a
+lib/libcolamd.so.1
+lib/libcsparse.a
+lib/libcsparse.so.1
+lib/libcxsparse.a
+lib/libcxsparse.so.1
lib/libklu.a
+lib/libklu.so.1
+lib/libklu_cholmod.a
+lib/libklu_cholmod.so.1
+lib/libldl.a
+lib/libldl.so.1
lib/libumfpack.a
-lib/libcxsparse.a
+lib/libumfpack.so.1