- USES=fortran pathfix.

- Pass --enable-shared to configure instead of building a shared library
  in post-build.  This decreases the library version to zero so patch the
  Makefile to force it back to one.  The shared library also links with
  Fortran runtime libraries correctly now.
- Remove -fPIC from CFLAGS and FFLAGS now that the shared library is no
  longer created from the static library.
- Remove do-install.  Normal make install works just fine.
This commit is contained in:
Tijl Coosemans 2013-12-25 22:40:54 +00:00
parent 8431d3384f
commit aedb352a71
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=337461

View file

@ -3,6 +3,7 @@
PORTNAME= matio
PORTVERSION= 1.3.4
PORTREVISION= 1
CATEGORIES= math
MASTER_SITES= SF
@ -10,55 +11,37 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Library for reading/writing Matlab files
GNU_CONFIGURE= yes
USES= pathfix
USE_LDCONFIG= yes
CFLAGS+= -fPIC
OPTIONS_DEFINE= FORTRAN
FORTRAN_DESC= Build Fortran bindings
.include <bsd.port.options.mk>
CONFIGURE_ARGS= --enable-shared
PLIST_FILES= include/matio.h \
include/matioConfig.h \
lib/libmatio.a \
lib/libmatio.la \
lib/libmatio.so \
lib/libmatio.so.1 \
libdata/pkgconfig/matio.pc
.if ${PORT_OPTIONS:MFORTRAN}
USE_FORTRAN= yes
.include <bsd.port.options.mk>
FFLAGS+= -fPIC
.if ${PORT_OPTIONS:MFORTRAN}
USES+= fortran
CONFIGURE_ARGS+= --enable-fortran
CONFIGURE_ENV+= FCFLAGS="${FFLAGS}"
PLIST_FILES+= include/matio.mod
USES+= gmake
MAKE_JOBS_UNSAFE=yes
.endif
post-build:
.if !${PORT_OPTIONS:MFORTRAN}
(cd ${WRKSRC}/src && ${CC} ${CFLAGS} -shared -o libmatio.so.1 snprintf.o \
endian.o io.o inflate.o read_data.o mat5.o mat4.o mat.o)
.else
(cd ${WRKSRC}/src && ${CC} ${CFLAGS} -shared -o libmatio.so.1 snprintf.o \
endian.o io.o inflate.o read_data.o mat5.o mat4.o mat.o matio_internal.o \
matio.o)
.endif
do-install:
${INSTALL_DATA} ${WRKSRC}/src/.libs/libmatio.lai ${STAGEDIR}${PREFIX}/lib/libmatio.la
${INSTALL_DATA} ${WRKSRC}/src/.libs/libmatio.a ${STAGEDIR}${PREFIX}/lib
${INSTALL_DATA} ${WRKSRC}/src/matio.h ${STAGEDIR}${PREFIX}/include
${INSTALL_DATA} ${WRKSRC}/src/matioConfig.h ${STAGEDIR}${PREFIX}/include
${INSTALL_PROGRAM} ${WRKSRC}/src/libmatio.so.1 ${STAGEDIR}${PREFIX}/lib
${INSTALL_DATA} ${WRKSRC}/matio.pc ${STAGEDIR}${PREFIX}/libdata/pkgconfig
.if ${PORT_OPTIONS:MFORTRAN}
${INSTALL_DATA} ${WRKSRC}/src/matio.mod ${STAGEDIR}${PREFIX}/include
.endif
post-patch:
@${REINPLACE_CMD} -e '/AM_LDFLAGS = /s/$$/ -version-info 1/' \
${WRKSRC}/src/Makefile.in
.include <bsd.port.mk>