aboutsummaryrefslogtreecommitdiffstats
path: root/java/cacao/Makefile
blob: c31e12de66c7f54a3636db0deb1e6e5730c8e8da (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
# Created by:   Tilman Keskinoz <arved@FreeBSD.org>
# $FreeBSD$

PORTNAME=   cacao
PORTVERSION=    1.6.0
CATEGORIES= java devel
MASTER_SITES=   http://www.complang.tuwien.ac.at/cacaojvm/download/cacao-${PORTVERSION}/

MAINTAINER= java@FreeBSD.org
COMMENT=    JIT compiler for JAVA

LICENSE=    GPLv2

BUILD_DEPENDS=  ${LOCALBASE}/share/classpath/glibj.zip:${PORTSDIR}/java/classpath
RUN_DEPENDS=    ${LOCALBASE}/share/classpath/glibj.zip:${PORTSDIR}/java/classpath

GNU_CONFIGURE=  yes
USE_GMAKE=  yes
USE_XZ=     yes

MAN1=       cacao.1

CONFIGURE_ARGS= --with-java-runtime-library=gnuclasspath \
        --with-java-runtime-library-prefix=${PREFIX} \
        --with-build-java-runtime-library-classes=${LOCALBASE}/share/classpath/glibj.zip
CONFIGURE_ENV=  JAVAC="${JAVAC}" JAR="${JAR}"

ONLY_FOR_ARCHS= amd64 i386

OPTIONS_DEFINE= JDK
OPTIONS_DEFAULT=JDK
JDK_DESC=   Build with native JDK

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MJDK}
USE_JAVA=   yes
JAVA_BUILD= jdk
JAVA_VERSION=   1.5+
.else
.if defined(WITH_GCC)
GCC_SUFX=   ${WITH_GCC:S/.//}
.endif
GCC_SUFX?=  46
BUILD_DEPENDS+= gcj${GCC_SUFX}:${PORTSDIR}/lang/gcc${GCC_SUFX}
EXTRA_PATCHES=  ${FILESDIR}/gcj.patch
JAR=        ${LOCALBASE}/bin/gjar${GCC_SUFX}
JAVAC=      ${LOCALBASE}/bin/gcj${GCC_SUFX}
JAVACFLAGS= -C
CONFIGURE_ENV+= JAVACFLAGS="${JAVACFLAGS}"
MAKE_ENV+=  JAVACFLAGS="${JAVACFLAGS}"
.endif

post-patch:
    ${REINPLACE_CMD} -e 's|%%PTHREAD_LIBS%%|${PTHREAD_LIBS}|g' \
        ${WRKSRC}/configure ${WRKSRC}/src/mm/boehm-gc/configure

do-install:
    ${MKDIR} ${DATADIR}
    ${INSTALL_PROGRAM} ${WRKSRC}/src/cacao/cacao ${PREFIX}/bin
    ${INSTALL_LIB} ${WRKSRC}/src/cacao/.libs/libjvm.so ${PREFIX}/lib
    ${INSTALL_DATA} ${WRKSRC}/src/classes/vm.zip ${DATADIR}
    ${INSTALL_MAN} ${WRKSRC}/man/cacao.1 ${MANPREFIX}/man/man1

.include <bsd.port.mk>