2012-12-20 20:38:12 +01:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
PORTNAME= libmissing
|
2013-08-16 00:13:42 +02:00
|
|
|
DISTVERSION= 20130815
|
Update to libmpc version 1.0.1 which brings the following fixes:
- Switched to automake 1.11.6, see CVE-2012-3386.
- #14669: Fixed extraction of CC from gmp.h.
- Fixed case of intermediate zero real or imaginary part in mpc_fma,
found by hydra with GMP_CHECK_RANDOMIZE=1346362345.
This is on top of the following changes from version 1.0
- Licence change towards LGPLv3+ for the code and GFDLv1.3+ (with no
invariant sections) for the documentation.
- 100% of all lines are covered by tests
- Renamed functions
. mpc_mul_2exp to mpc_mul_2ui
. mpc_div_2exp to mpc_div_2ui
- 0^0, which returned (NaN,NaN) previously, now returns (1,+0).
- Removed compatibility with K&R compilers, which was untestable due
to lack of such compilers.
- New functions
. mpc_log10
. mpc_mul_2si, mpc_div_2si
- Speed-ups
. mpc_fma
- Bug fixes
. mpc_div and mpc_norm now return a value indicating the effective
rounding direction, as the other functions.
. mpc_mul, mpc_sqr and mpc_norm now return correct results even if
there are over- or underflows during the computation.
. mpc_asin, mpc_proj, mpc_sqr: Wrong result when input variable has
infinite part and equals output variable is corrected.
. mpc_fr_sub: Wrong return value for imaginary part is corrected.
Convert to the new LIB_DEPENDS standard and remove hard-coded
.so versions from a couple of dependent ports.
Bump PORTREVISIONS of all dependent ports.
PR: 183141
Approved by: portmgr (bdrewery)
2013-10-26 02:52:33 +02:00
|
|
|
PORTREVISION= 1
|
2012-12-20 20:38:12 +01:00
|
|
|
CATEGORIES= math
|
|
|
|
MASTER_SITES= LOCAL/bf
|
|
|
|
|
|
|
|
MAINTAINER= bf@FreeBSD.org
|
|
|
|
COMMENT= Standard math functions missing from the FreeBSD libm
|
|
|
|
|
|
|
|
LICENSE= BSD
|
|
|
|
|
2013-08-16 00:13:42 +02:00
|
|
|
LIB_DEPENDS= libmpc.so:${PORTSDIR}/math/mpc
|
2012-12-20 20:38:12 +01:00
|
|
|
|
|
|
|
USE_LDCONFIG= yes
|
|
|
|
USE_XZ= yes
|
|
|
|
|
2013-03-28 20:25:12 +01:00
|
|
|
MAKE_ENV= LDADD=-lmpc LIB=missing SHLIB_MAJOR="${SHLIB_MAJOR}" \
|
|
|
|
SRCCONF=/dev/null SRCS="${SRCS}"
|
2012-12-20 20:38:12 +01:00
|
|
|
|
|
|
|
OPTIONS_DEFINE= PROFILE
|
|
|
|
|
|
|
|
PLIST_FILES= include/missing_complex.h \
|
|
|
|
include/missing_math.h \
|
|
|
|
lib/libmissing.a lib/libmissing.so \
|
|
|
|
lib/libmissing.so.${SHLIB_MAJOR}
|
|
|
|
|
2013-08-16 00:13:42 +02:00
|
|
|
SHLIB_MAJOR= 2
|
2012-12-20 20:38:12 +01:00
|
|
|
SRCS= libmissing.c
|
|
|
|
|
|
|
|
CFLAGS+= -fno-builtin -fno-math-errno -I. -I${LOCALBASE}/include
|
|
|
|
LDFLAGS+= -L${LOCALBASE}/lib
|
|
|
|
|
2013-09-20 22:55:04 +02:00
|
|
|
NO_STAGE= yes
|
2012-12-20 20:38:12 +01:00
|
|
|
.include <bsd.port.options.mk>
|
|
|
|
|
|
|
|
.if ${PORT_OPTIONS:MPROFILE} || defined(WITH_PROFILE)
|
|
|
|
.if defined(NOPROFILE) || defined(NO_PROFILE) || defined(WITHOUT_PROFILE)
|
|
|
|
IGNORE = you have defined WITH_PROFILE, but have also defined\
|
|
|
|
WITHOUT_PROFILE, NOPROFILE, or NO_PROFILE
|
|
|
|
.elif !exists(/usr/lib/libc_p.a)
|
|
|
|
IGNORE = you have chosen WITH_PROFILE, but have not installed the\
|
|
|
|
base system profiling libraries
|
|
|
|
.endif
|
|
|
|
PLIST_FILES+= lib/libmissing_p.a
|
|
|
|
.else
|
|
|
|
MAKE_ENV+= NO_PROFILE=yes
|
|
|
|
.endif
|
|
|
|
|
|
|
|
post-patch:
|
|
|
|
@${PRINTF} "LIBDIR=\t${PREFIX}/lib\n.include <bsd.lib.mk>\n" > \
|
|
|
|
${WRKSRC}/Makefile
|
|
|
|
.for t in d q s
|
|
|
|
@cd ${WRKSRC}/c/common; ${CP} initseed.c maxtest.c ${WRKSRC}/c/${t}p/
|
|
|
|
.endfor
|
|
|
|
@${REINPLACE_CMD} -E \
|
|
|
|
'/(XCFLAGS|XDEFINES|XINCLUDES|XLDFLAGS|XLIBS|XMFLAGS|XOPT)[[:blank:]]+=/d' \
|
|
|
|
${WRKSRC}/c/Makefile
|
|
|
|
@${REINPLACE_CMD} -e \
|
|
|
|
'/#include <math.h>/{x;s|^.*$$|#include "missing_math.h"|;H;x;}' \
|
|
|
|
${WRKSRC}/c/common/elefunt.h
|
|
|
|
@${REINPLACE_CMD} -e '\|COMMONOBJS[[:blank:]]*=|s|../common/||g' \
|
|
|
|
${WRKSRC}/c/dp/Makefile \
|
|
|
|
${WRKSRC}/c/qp/Makefile \
|
|
|
|
${WRKSRC}/c/sp/Makefile
|
|
|
|
|
|
|
|
check regression-test test: build
|
|
|
|
@cd ${WRKSRC}/c; ${SETENV} ${MAKE_ENV} XCFLAGS="${CFLAGS} -frounding-math" \
|
|
|
|
XINCLUDES="-I${WRKSRC}" XLDFLAGS="${LDFLAGS}" XLIBS="-L${WRKSRC} -lmissing" \
|
|
|
|
LD_LIBRARY_PATH="/lib:/usr/lib:${LOCALBASE}/lib:${WRKSRC}" \
|
|
|
|
${MAKE} ${_MAKE_JOBS} ${MAKE_ARGS} all3
|
|
|
|
.for t in d q s
|
|
|
|
@${PRINTF} "\n\n\n\t\t%s\n\n\n" "REPORT OF ${t:U}. PRECISION TEST RESULTS:"
|
|
|
|
@${CAT} ${WRKSRC}/c/${t}p/tall${t}p.lst-xxx
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
post-install:
|
|
|
|
@cd ${WRKSRC}; ${INSTALL_DATA} missing_complex.h missing_math.h \
|
|
|
|
${PREFIX}/include
|
|
|
|
.if !${PORT_OPTIONS:MEXAMPLES}
|
|
|
|
@${MKDIR} ${EXAMPLESDIR}
|
|
|
|
@cd ${WRKSRC}; ${INSTALL_DATA} ${PORTEXAMPLES} ${EXAMPLESDIR}
|
|
|
|
|
|
|
|
PORTEXAMPLES= ${SRCS}
|
|
|
|
.endif
|
|
|
|
.include <bsd.port.mk>
|