---
project: luajit
tagline: LuaJIT binary
---

## Overview

LuaJIT binaries (frontend, static library, dynamic library).

## Build Flags

GCC flags `-msse -msse2` were added for 32bit platforms.

## Module Paths

### Windows

`!\..\..\?.lua;!\..\..\?\init.lua` was added to the default package.path
in luaconf.h. This allows luapower modules to be found regardless of what
the current directory is, making the distribution portable.

The default `package.cpath` was also modified from `!\?.dll` to `!\clib\?.dll`.
This is to distinguish between Lua/C modules and other binary dependencies.

> Windows looks for dependent dlls in the directory of the executable first,
and that's where the luapower dlls are, so isolation from system libraries
is acheived automatically in this case.

### Linux and OSX

For Linux and OSX, luajit is a shell wrapper script that sets LD_LIBRARY_PATH,
LUA_PATH and LUA_CPATH to acheive the same effect and assure isolation from
system libraries.

### Going further

The above solves the problem of finding Lua modules and binary dependencies
relative to the directory of the executable, and independent of the directory
the script was started in.

To get the location of the running script, as opposed to that of the luajit
executable, use [glue.bin].

To add more paths to package.path and package.cpath at runtime,
use [glue.luapath] and [glue.cpath].


[glue.bin]:     glue.html#bin
[glue.luapath]: glue.html#luapath
[glue.cpath]:   glue.html#cpath

