aboutsummaryrefslogtreecommitdiffstats
path: root/lang/v8/Makefile
blob: c44039edbba09d2d75fc6be1e7873843526bac9a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# New ports collection makefile for:   v8
# Date created:        12 November 2010
# Whom:                siasia
#
# $FreeBSD$
#

PORTNAME=   v8
PORTVERSION=    3.5.10
PORTREVISION=   0
CATEGORIES= lang
MASTER_SITES=   http://github.com/${PORTNAME}/${PORTNAME}/tarball/${PORTVERSION}/
DISTNAME=   ${PORTNAME}-${PORTNAME}-${PORTVERSION}-${GITVERSION}

MAINTAINER= vanilla@FreeBSD.org
COMMENT=    Google\'s open source JavaScript engine

LIB_DEPENDS=    execinfo.1:${PORTSDIR}/devel/libexecinfo

GITVERSION= 0-g4cf15c7
FETCH_ARGS= -pRr
WRKSRC=     ${WRKDIR}/${PORTNAME}-${PORTNAME}-${GITVERSION:S/^0-g//}
USE_SCONS=  yes
USE_LDCONFIG=   yes
OPTIONS=    DEBUG "Build in debug mode" Off \
        SNAPSHOT "Enable snapshots" Off

.include <bsd.port.options.mk>

SCONS_ARGS= visibility=default

.if defined(WITHOUT_DEBUG)
SCONS_ARGS+=    mode=release
.else
SCONS_ARGS+=    mode=debug
.endif

.if defined(WITHOUT_SNAPSHOT)
SCONS_ARGS+=    snapshot=off
.else
SCONS_ARGS+=    snapshot=on
.endif

ONLY_FOR_ARCHS= i386 amd64

.include <bsd.port.pre.mk>

.if ${ARCH} == i386
V8ARCH=ia32
.elif ${ARCH} == amd64
V8ARCH=x64
.endif
PLIST_SUB+= ARCH=${V8ARCH}
SCONS_ARGS+=    arch=${V8ARCH}
SCONS_BUILDENV+= CC="${CC} ${CFLAGS}" CXX="${CXX} ${CXXFLAGS}"

do-build:
    @cd ${BUILD_WRKSRC} && \
    ${SETENV} ${SCONS_BUILDENV} ${SCONS_BIN} ${SCONS_ENV} ${_MAKE_JOBS} \
    ${SCONS_ARGS} library=static ${SCONS_TARGET}
    @cd ${BUILD_WRKSRC} && \
    ${SETENV} ${SCONS_BUILDENV} ${SCONS_BIN} ${SCONS_ENV} ${_MAKE_JOBS} \
    ${SCONS_ARGS} library=shared ${SCONS_TARGET}

do-install:
    ${INSTALL_LIB} -m 755 ${WRKSRC}/libv8.a ${PREFIX}/lib/libv8.a
    ${INSTALL_LIB} -m 755 ${WRKSRC}/libv8.so ${PREFIX}/lib/libv8.so.1
    ${INSTALL_LIB} -m 755 ${WRKSRC}/libv8preparser.a ${PREFIX}/lib/libv8preparser.a
    ${INSTALL_LIB} -m 755 ${WRKSRC}/libv8preparser.so ${PREFIX}/lib/libv8preparser.so.1
    ${LN} -sf ${PREFIX}/lib/libv8.so.1 ${PREFIX}/lib/libv8.so
    ${LN} -sf ${PREFIX}/lib/libv8preparser.so.1 ${PREFIX}/lib/libv8preparser.so
    ${INSTALL_DATA} ${WRKSRC}/include/v8.h ${PREFIX}/include/
    ${INSTALL_DATA} ${WRKSRC}/include/v8-debug.h ${PREFIX}/include/
    ${INSTALL_DATA} ${WRKSRC}/include/v8-preparser.h ${PREFIX}/include/
    ${INSTALL_DATA} ${WRKSRC}/include/v8-profiler.h ${PREFIX}/include/
    ${INSTALL_DATA} ${WRKSRC}/include/v8-testing.h ${PREFIX}/include/
    ${INSTALL_DATA} ${WRKSRC}/include/v8stdint.h ${PREFIX}/include/

.include <bsd.port.post.mk>