From c17cbbe3cdd5088ecae392d1c662096328067fb4 Mon Sep 17 00:00:00 2001 From: Brendan Fabeny Date: Thu, 12 Jan 2012 23:13:33 +0000 Subject: use archive in unmodified form; make the MPFR dependency optional; compile test executables with appropriate flags; enable SSE2 math by default when possible --- math/crlibm/Makefile | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/math/crlibm/Makefile b/math/crlibm/Makefile index 34d7428fb4a7..6f3534e532d7 100644 --- a/math/crlibm/Makefile +++ b/math/crlibm/Makefile @@ -7,6 +7,7 @@ PORTNAME= crlibm DISTVERSION= 1.0beta4 +PORTREVISION= 1 CATEGORIES= math MASTER_SITES= http://lipforge.ens-lyon.fr/frs/download.php/%SUBDIR%/:1,2,3 \ LOCAL/bf:4 @@ -23,27 +24,36 @@ COMMENT= Correctly-rounded mathematics library LICENSE= LGPL21 -LIB_DEPENDS= mpfr.4:${PORTSDIR}/math/mpfr - GNU_CONFIGURE= yes -CONFIGURE_ARGS = --enable-mpfr + CPPFLAGS+= -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib +OPTIONS= "TEST" "Include all test capabilities (requires MPFR)" "on" -.include +.include +post-patch: #7-STABLE has log2() in libm after r226457 on 17 Oct 2011, but -#there was no accompanying OSVERSION bump +#there was no accompanying __FreeBSD_version bump .if ${OSVERSION} < 802502 || (${OSVERSION} >= 900000 && ${OSVERSION} < 900027) -post-patch: @${REINPLACE_CMD} \ -e '/testfun_libm[[:blank:]]*=[[:blank:]]*log2;/s/log2/NULL/' \ ${WRKSRC}/tests/test_common.c +.endif + @${REINPLACE_CMD} -e 's/\($$(AM_CFLAGS)\) \($$(CFLAGS)\)/\2 \1/' \ + ${WRKSRC}/tests/Makefile.in +.if !empty(MACHINE_CPU:Msse2) +CFLAGS+= -msse2 -mfpmath=sse +CONFIGURE_ARGS+= --enable-sse2 .endif -post-build: - @cd ${WRKSRC}; ${STRIP_CMD} -x libcrlibm.a scs_lib/libscs.a +.if defined(WITH_TEST) +CONFIGURE_ARGS+= --enable-mpfr +LIB_DEPENDS+= mpfr.4:${PORTSDIR}/math/mpfr +.else +CONFIGURE_ARGS+= --disable-mpfr +.endif check regression-test test: build @cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${_MAKE_JOBS} \ @@ -58,4 +68,4 @@ post-install: .endif -.include +.include -- cgit v1.2.3