freebsd-ports/science/netcdf/Makefile
Tijl Coosemans aad09bc5e2 When linking a library libA with a library libB using libtool, if libB.la
exists, libtool will add all libraries libB.la refers to (dependency_libs
field) to the linker command line and store them in the dependency_libs
field of libA.la.  So everything that subsequently links with libA will also
link to these extra libraries.  This causes too much overlinking.

This commit modifies Mk/Uses/libtool.mk so it empties the dependency_libs
field in .la libraries during staging.  However, because .la libraries have
very limited use when dependency_libs is empty it makes sense to completely
remove them during staging.

So with this commit USES=libtool is modified to remove .la libraries and a
new form (USES=libtool:keepla) is introduced in case they need to be kept
(dependency_libs is still emptied).

PORTREVISION is bumped on all ports with USES=libtool that install .la
libraries.  Most ports are also changed to add :keepla because .la
libraries have to be kept around as long as there are dependent ports with
.la libraries that refer to them in their dependency_libs field.  In most
cases :keepla can be removed again as soon as all dependent ports that
install .la libraries have some form of USES=libtool added to their
Makefile.

PR:		ports/188759
Exp-run:	bdrewery
Approved by:	portmgr (bdrewery)
2014-04-23 13:25:16 +00:00

65 lines
1.5 KiB
Makefile

# Created by: Thomas Gellekum <tg@FreeBSD.org>
# $FreeBSD$
PORTNAME= netcdf
PORTVERSION= 3.6.3
PORTREVISION?= 7
CATEGORIES= science
MASTER_SITES= http://www.unidata.ucar.edu/downloads/netcdf/ftp/ \
ftp://ftp.unidata.ucar.edu/pub/netcdf/ \
LOCAL/sunpoet
PKGNAMESUFFIX?= 3
MAINTAINER= sunpoet@FreeBSD.org
COMMENT?= Library for machine-independent, array-oriented data access
CONFLICTS= hdf-4.* netcdf-4.*
PORTSCOUT= limit:^3\.
CONFIGURE_ARGS= --enable-shared
CPPFLAGS+= -I${LOCALBASE}/include -fPIC -DPIC
GNU_CONFIGURE= yes
USES= gmake libtool:keepla
USE_LDCONFIG= yes
INFO= netcdf netcdf-c netcdf-cxx netcdf-f77 netcdf-f90 \
netcdf-install netcdf-tutorial
OPTIONS_DEFINE= FORTRAN DOCS
FORTRAN_DESC= Build library for Fortran
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MDOCS}
CONFIGURE_ARGS+=--enable-docs-install
.else
CONFIGURE_ARGS+=--disable-docs-install
.endif
.if ${PORT_OPTIONS:MFORTRAN}
CPPFLAGS+= -DpgiFortran
CONFLICTS+= netcdf-3.*
PLIST_SUB+= FORTRAN=""
USES+= fortran
.else
CONFIGURE_ARGS+=--disable-f77 --disable-f90
CONFLICTS+= netcdf-ftn-3.*
PLIST_SUB+= FORTRAN="@comment "
.endif
post-patch:
@${REINPLACE_CMD} -e \
'291 s/\(html_docs)\).*/\1/' \
${WRKSRC}/man/Makefile.in
@${REINPLACE_CMD} -e \
'271 s/\(info_docs\).*/html_docs\)/' \
${WRKSRC}/man4/Makefile.in
.if ! ${PORT_OPTIONS:MDOCS}
@${REINPLACE_CMD} -e '790 s/install-docDATA //' \
${WRKSRC}/man/Makefile.in
.endif
regression-test: build
@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} check
.include <bsd.port.mk>