update Tue Jun 15 18:37:00 PDT 2010
[pkgsrc.git] / devel / nspr / Makefile
1 # $NetBSD: Makefile,v 1.33 2010/01/16 14:22:30 tnn Exp $
2 #
3
4 .include "../../devel/xulrunner/dist.mk"
5 PKGNAME=        ${DISTNAME:S/firefox-3.5/nspr-${NSPR_RELEASE}/:S/.source//}
6 NSPR_RELEASE=   4.8.2
7 CATEGORIES=     devel
8
9 MAINTAINER=     tnn@NetBSD.org
10 HOMEPAGE=       http://www.mozilla.org/projects/nspr/index.html
11 COMMENT=        Platform-neutral API for system level and libc like functions
12
13 PKG_DESTDIR_SUPPORT=    user-destdir
14 CHECK_PORTABILITY_SKIP+=${MOZILLA_DIR}security/nss/tests/libpkix/libpkix.sh
15
16 GNU_CONFIGURE=          yes
17 CONFIGURE_DIRS=         nsprpub
18
19 USE_TOOLS+=             autoconf213 gmake perl
20 REPLACE_PERL+=          nsprpub/pr/src/misc/compile-et.pl
21
22 CONFIGURE_ARGS+=        --disable-debug
23 CONFIGURE_ARGS+=        --with-pthreads
24 CONFIGURE_ARGS+=        --libdir=${PREFIX}/lib/nspr
25 CONFIGURE_ENV+=         LIBRUNPATH=${PREFIX:Q}/lib/nspr
26
27 .include "../../mk/bsd.prefs.mk"
28
29 SUBST_CLASSES+=                 nspr-config
30 SUBST_STAGE.nspr-config=        pre-configure
31 SUBST_MESSAGE.nspr-config=      Fixing nspr-config run path
32 SUBST_FILES.nspr-config=        nsprpub/config/nspr-config.in
33 SUBST_SED.nspr-config=          -e 's|-L$$libdir|"${COMPILER_RPATH_FLAG}$$libdir -L$$libdir"|g'
34
35 .if ${OBJECT_FMT} == "ELF"
36 SO_SUFFIX=              so
37 .elif ${OBJECT_FMT} == "Mach-O"
38 SO_SUFFIX=              dylib
39 .else
40 SO_SUFFIX=              so.1.0
41 .endif
42 PLIST_SUBST+=           SO_SUFFIX=${SO_SUFFIX:Q}
43
44 PLIST_VARS+=            sun4u_32
45 # see nsprpub/pr/src/md/unix/Makefile.in
46 # for the bit about 32-bit sun4u machines installing an extra file.
47 # That is why we have this specific test and modify the PLIST
48 .if ${OPSYS} == "SunOS"
49 .  if defined(ABI) && ${ABI} == "64"
50 CONFIGURE_ARGS+=        --enable-64bit
51 .  else
52 HW_CLASS!=      ${UNAME} -m
53 .    if ${HW_CLASS} == "sun4u"
54 PLIST.sun4u_32=                yes
55 .    endif
56 .  endif
57 .endif
58
59 .if ${OPSYS} == "Linux"
60 .  if defined(ABI) && ${ABI} == "64"
61 CONFIGURE_ARGS+=        --enable-64bit
62 .  endif
63 .endif
64
65 .if ${OPSYS} == "Darwin" && exists(/Developer/Headers/FlatCarbon)
66 BUILDLINK_PASSTHRU_DIRS+=       Developer/Headers/FlatCarbon
67 .endif
68
69 pre-configure:
70 # sanity check: make sure the nspr release is what we think it is.
71         @set -e; if [ '"${NSPR_RELEASE}"' !=                    \
72           "`${AWK} '/PR_VERSION/ {print $$3}' <                 \
73             ${WRKSRC}/nsprpub/pr/include/prinit.h`" ]; then     \
74           ${ECHO} "package is out of date";                     \
75           exit 1;                                               \
76         fi
77         cd ${WRKSRC}/nsprpub && autoconf
78
79 post-build:
80         set -e; ( \
81           ${ECHO} "Name: NSPR"; \
82           ${ECHO} "Description: The Netscape Portable Runtime"; \
83           ${ECHO} "Version: ${NSPR_RELEASE}";                   \
84           ${ECHO} "Cflags: -I${PREFIX}/include/nspr";           \
85           ${ECHO} "Libs: -L${PREFIX}/lib/nspr"                  \
86             "${COMPILER_RPATH_FLAG}${PREFIX}/lib/nspr"          \
87             "-lplds4 -lplc4 -lnspr4 -pthread"                   \
88         ) > ${WRKDIR}/nspr.pc
89
90 INSTALLATION_DIRS+=     lib/pkgconfig
91
92 post-install:
93         ${INSTALL_DATA} ${WRKDIR}/nspr.pc ${DESTDIR}${PREFIX}/lib/pkgconfig
94
95 .include "../../mk/pthread.buildlink3.mk"
96 .include "../../mk/bsd.pkg.mk"