svn commit: r309324 - in head/math: . libmissing
Brendan Fabeny
bf at FreeBSD.org
Thu Dec 20 19:38:13 UTC 2012
Author: bf
Date: Thu Dec 20 19:38:12 2012
New Revision: 309324
URL: http://svnweb.freebsd.org/changeset/ports/309324
Log:
Add libmissing , standard math functions missing from the FreeBSD libm.
Added:
head/math/libmissing/
head/math/libmissing/Makefile (contents, props changed)
head/math/libmissing/distinfo (contents, props changed)
head/math/libmissing/pkg-descr (contents, props changed)
Modified:
head/math/Makefile
Modified: head/math/Makefile
==============================================================================
--- head/math/Makefile Thu Dec 20 19:31:18 2012 (r309323)
+++ head/math/Makefile Thu Dec 20 19:38:12 2012 (r309324)
@@ -215,6 +215,7 @@
SUBDIR += libjbigi
SUBDIR += liblbfgs
SUBDIR += libmath++
+ SUBDIR += libmissing
SUBDIR += libneural
SUBDIR += libocas
SUBDIR += liborigin
Added: head/math/libmissing/Makefile
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/math/libmissing/Makefile Thu Dec 20 19:38:12 2012 (r309324)
@@ -0,0 +1,85 @@
+# $FreeBSD$
+
+PORTNAME= libmissing
+DISTVERSION= 20121220
+CATEGORIES= math
+MASTER_SITES= LOCAL/bf
+
+MAINTAINER= bf at FreeBSD.org
+COMMENT= Standard math functions missing from the FreeBSD libm
+
+LICENSE= BSD
+
+LIB_DEPENDS= mpc:${PORTSDIR}/math/mpc
+
+USE_LDCONFIG= yes
+USE_XZ= yes
+
+MAKE_ENV= LDADD="-lmpc" LIB=missing SHLIB_MAJOR="${SHLIB_MAJOR}" \
+ SRCCONF="${NONEXISTENT}" SRCS="${SRCS}"
+
+OPTIONS_DEFINE= PROFILE
+
+PLIST_FILES= include/missing_complex.h \
+ include/missing_math.h \
+ lib/libmissing.a lib/libmissing.so \
+ lib/libmissing.so.${SHLIB_MAJOR}
+
+SHLIB_MAJOR= 1
+SRCS= libmissing.c
+
+CFLAGS+= -fno-builtin -fno-math-errno -I. -I${LOCALBASE}/include
+LDFLAGS+= -L${LOCALBASE}/lib
+
+.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>
Added: head/math/libmissing/distinfo
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/math/libmissing/distinfo Thu Dec 20 19:38:12 2012 (r309324)
@@ -0,0 +1,2 @@
+SHA256 (libmissing-20121220.tar.xz) = 226325e8cb7f28873c06da081978762079c07a90d53524aabb574d8731a6fb47
+SIZE (libmissing-20121220.tar.xz) = 129684
Added: head/math/libmissing/pkg-descr
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/math/libmissing/pkg-descr Thu Dec 20 19:38:12 2012 (r309324)
@@ -0,0 +1,7 @@
+This is a collection of stopgap replacements for standard math
+functions missing from libm in various supported versions of
+FreeBSD. The functions are slower than the existing libm
+functions, but are more accurate than many naive replacements.
+Exceptions are largely ignored. N. Beebe's extended C version
+of the ELEFUNT package is used to provide regression tests for
+some of the real-valued functions.
More information about the svn-ports-head
mailing list