1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit toolchain-funcs
8 DESCRIPTION="MINPACK-1 Least Squares Fitting Library in C"
9 HOMEPAGE="http://www.physics.wisc.edu/~craigm/idl/cmpfit.html"
10 SRC_URI="http://www.physics.wisc.edu/~craigm/idl/down/${P}.tar.gz"
12 LICENSE="public-domain minpack"
14 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
17 DOCS=( README DISCLAIMER )
20 if use static-libs; then
21 $(tc-getCC) ${CFLAGS} -c mpfit.c || die "non-PIC compilation failed"
22 $(tc-getAR) cr libmpfit.a mpfit.o || die "creation of static archive failed"
24 $(tc-getCC) ${CFLAGS} -fPIC -c mpfit.c -o mpfit.so || die "PIC compilation failed"
25 $(tc-getCC) ${LDFLAGS} -shared -Wl,-soname=libmpfit.so mpfit.so -lm -o libmpfit.so || die "linking failed"
29 $(tc-getCC) ${CFLAGS} testmpfit.c -L. -lmpfit -lm -o testmpfit || die
30 LD_LIBRARY_PATH=.:${LD_LIBRARY_PATH} ./testmpfit || die
35 use static-libs && dolib.a libmpfit.a