abieber c4a283c051 From tedu@:
On i386, it's better for a jit to ask for exec memory upfront, so uvm
knows to place it in the exec segment. Otherwise, if you mmap non-exec
and mprotect it, you wind up with a high mapping and the segment must
be enlarged to cover the whole process.

I sent Mike a slightly different diff; this is what he ended up
committing to git. I think we should add it to the port.

OK dcoppa@
2015-01-20 15:26:26 +00:00

64 lines
1.3 KiB
Makefile

# $OpenBSD: Makefile,v 1.15 2015/01/20 15:26:26 abieber Exp $
ONLY_FOR_ARCHS = powerpc i386 amd64
# arm needs EABI/aapcs
# for mips64* gcc 4.6 is needed, but that doesn't build on this arch (yet)
SHARED_ONLY = Yes
SHARED_LIBS += luajit-${MODLUA_VERSION} 0.0 # 2.0.0
COMMENT = just-in-time compiler for Lua
V = 2.0.3
DISTNAME = LuaJIT-${V}
PKGNAME = ${DISTNAME:L}
REVISION = 2
CATEGORIES = lang
HOMEPAGE = http://luajit.org/
MAINTAINER = Aaron Bieber <abieber@openbsd.org>
# MIT
PERMIT_PACKAGE_CDROM = Yes
WANTLIB = c m
MASTER_SITES = ${HOMEPAGE}download/
MODULES = lang/lua
MODLUA_SA= Yes
MODULES += gcc4
MODGCC4_ARCHS = powerpc
MODGCC4_LANGS = c
MAKE_FLAGS += \
CC="${CC}" \
CCOPT="${CFLAGS}" \
CCOPT_x86="" \
INSTALL_LJLIBD="${DESTDIR}${MODLUA_DATADIR}" \
INSTALL_MAN="${DESTDIR}${PREFIX}/man/man1" \
INSTALL_SONAME=libluajit-${MODLUA_VERSION}.so.${LIBluajit-${MODLUA_VERSION}_VERSION} \
PREFIX="${PREFIX}"
USE_GMAKE = Yes
SUBST_VARS+= MODLUA_VERSION
# http://luajit.org/extensions.html
.if defined(FLAVOR) && ${FLAVOR:Mlua52}
MAKE_FLAGS += XCFLAGS="-DLUAJIT_ENABLE_LUA52COMPAT"
.endif
pre-configure:
${SUBST_CMD} ${WRKDIST}/Makefile
post-install:
mv ${PREFIX}/bin/luajit-$V ${PREFIX}/bin/luajit${MODLUA_DEP_VERSION}
do-test:
${WRKSRC}/src/luajit -e "print('hello world')" | grep "^hello world$$"
.include <bsd.port.mk>