Import devel/nspr version 4.9.4
[dports.git] / devel / nspr / Makefile
1 # Ports collection Makefile for:        nspr
2 # Date created:                         18 December 2001
3 # Whom:                                 Maxim Sobolev <sobomax@FreeBSD.org>
4 #
5 # $FreeBSD: ports/devel/nspr/Makefile,v 1.57 2012/11/27 00:21:27 svnexp Exp $
6 #    $MCom: ports-experimental/devel/nspr/Makefile,v 1.6 2008/03/12 13:06:56 ahze Exp $
7
8 PORTNAME=       nspr
9 DISTVERSION=    4.9.4
10 CATEGORIES=     devel
11 MASTER_SITES=   MOZILLA
12 MASTER_SITE_SUBDIR=     nspr/releases/v${PORTVERSION}/src
13
14 MAINTAINER=     gecko@FreeBSD.org
15 COMMENT=        A platform-neutral API for system level and libc like functions
16
17 WRKSRC=         ${WRKDIR}/${DISTNAME}/mozilla/nsprpub/build
18
19 USE_LDCONFIG=   yes
20 USE_GMAKE=      yes
21 MAKE_JOBS_SAFE= yes
22 GNU_CONFIGURE=  yes
23 CONFIGURE_SCRIPT=../configure
24 CONFIGURE_ARGS= --srcdir=${WRKSRC:H} \
25                 --with-pthreads
26 CONFIGURE_ENV=  BSD_PTHREAD_LIBS=${PTHREAD_LIBS}
27
28 MAKE_ENV=       DIST=${WRKSRC}/dist
29
30 LIBS=           libnspr4.so.1 libplc4.so.1 libplds4.so.1
31
32 .include <bsd.port.pre.mk>
33
34 .if ${ARCH} == "arm"
35 BROKEN=         Does not compile on arm
36 .endif
37
38 .if !defined(WITH_DEBUG)
39 CONFIGURE_ARGS+=--disable-debug
40 .endif
41
42 post-patch:
43         @${REINPLACE_CMD} -e 's,-lpthread,${PTHREAD_LIBS},g ; s,echo aout,echo elf,g' ${WRKSRC}/${CONFIGURE_SCRIPT}
44
45 do-install:
46         ${MKDIR} ${PREFIX}/include/nspr
47         ${TAR} -C ${WRKSRC}/dist/include --dereference -cf - . | \
48                 ${TAR} -C ${PREFIX}/include -xof -
49         ${FIND} ${PREFIX}/include/nspr -type d | \
50                 ${XARGS} ${CHMOD} 0755
51         ${FIND} ${PREFIX}/include/nspr -type f | \
52                 ${XARGS} ${CHMOD} ${SHAREMODE}
53         ${TAR} -C ${WRKSRC}/dist/lib --dereference -cf - . | \
54                 ${TAR} -C ${PREFIX}/lib -xof -
55         ${INSTALL_SCRIPT} ${WRKSRC}/config/nspr-config ${PREFIX}/bin
56         ${MKDIR} ${PREFIX}/libdata/pkgconfig
57         ${INSTALL_DATA} ${WRKSRC}/config/nspr.pc ${PREFIX}/libdata/pkgconfig
58 .for lib in ${LIBS}
59 .if defined(STRIP) && ${STRIP} != ""
60         ${STRIP_CMD} ${PREFIX}/lib/${lib}
61 .endif
62         ${CHMOD} ${BINMODE} ${PREFIX}/lib/${lib}
63         ${LN} -sf ${lib} ${PREFIX}/lib/${lib:R}
64 .endfor
65
66 prtests:
67         ${SETENV} PTHREAD_LIBS="${PTHREAD_LIBS}" ${GMAKE} -C ${WRKSRC}/pr/tests
68         ${LN} -sf libmy.so.1 ${WRKSRC}/pr/tests/dll/libmy.so
69         cd ${WRKSRC}/pr/tests && ../../../pr/tests/runtests.sh
70
71 libtests:
72         ${GMAKE} -C ${WRKSRC}/lib/tests
73         ${WRKSRC}/lib/tests/string
74         ${WRKSRC}/lib/tests/base64t
75         # The test below is commented out, because arena requires
76         # command-line arguments. If you can provide reasonable values
77         # for it, please contact ${MAINTAINER}. Thank you.
78         #       ${WRKSRC}/lib/tests/arena
79         #
80
81 test: libtests prtests
82
83 #regression-test: test
84
85 #.if defined(PACKAGE_BUILDING)
86 #post-build: test
87 #.else
88 post-build:
89         #
90         # Please, consider running ``make test'' to find any
91         # possible build problems.
92         #
93 #.endif
94
95 .include <bsd.port.post.mk>