# $Id$
# $OpenBSD: Makefile,v 1.20 2005/05/19 09:50:51 espie Exp $
# $FreeBSD: Makefile,v 1.7 1997/06/16 08:22:35 max Exp $

COMMENT=	"a free, standards-compilant jvm with a small footprint"

ONLY_FOR_ARCHS= i386 powerpc arm amd64

DISTNAME=	jamvm-1.3.3
PKGNAME= $(DISTNAME)p0

CATEGORIES=	lang

MASTER_SITES=	${MASTER_SITE_SOURCEFORGE:=jamvm/}

HOMEPAGE=	http://jamvm.sourceforge.net/

MAINTAINER= Frederick C. Druseikis <fredd@cse.sc.edu>

# this package is GPL 2
PERMIT_PACKAGE_CDROM=	Yes
PERMIT_PACKAGE_FTP=	Yes
PERMIT_DISTFILES_CDROM=	Yes
PERMIT_DISTFILES_FTP=	Yes

WANTLIB=		c m

AUTOMAKE_VERSION=    1.9
AUTOCONF_VERSION=    2.59
USE_GMAKE= Yes

CONFIGURE_STYLE= gnu 

# the i486-unknown-openbsd works around zealous checking:
# technically JamVM will not run in i386 because it uses some 
# 486-specific machine instructions; hence the i486-unknown-openbsd

CONFIGURE_ARGS+= --host=i486-unknown-openbsd --build=i486-unknown-openbsd

LDFLAGS+= -lpthread

# this is the default location for Classpath

CONFIGURE_ARGS+= --with-classpath-install-dir=/usr/local

where-am-i:
	@echo pwd=`pwd`
	@echo CFLAGS=$(CFLAGS)
	@echo LDFLAGS=$(LDFLAGS)
	@echo CONFIGURE_ARGS=$(CONFIGURE_ARGS)
	@echo CONFIGURE_ENV=$(CONFIGURE_ENV)
	@echo WRKBUILD=${WRKBUILD}
	@echo WRKSRC=$(WRKSRC)

# starting with JamVM 1.3.3 the ever popular stdint.h is referenced
# but appearantly only for correct 64-bit int pointers.
# the OpenBSD /usr/include/inttypes.h meets the requirements.

pre-configure:
	ln -s /usr/include/inttypes.h $(WRKSRC)/src/stdint.h

.include <bsd.port.mk>
