lua51 0.1.6

Lua 5.1.5 bindings for Rust.
use std::env;
use std::process::Command;
use std::path::Path;

fn build_lua() {
	let platform = match env::var("TARGET").unwrap().split('-').nth(2).unwrap() {
		"windows" => "mingw",
		_ => "generic",
	};

	Command::new("make")
		.current_dir("lua")
		.arg(platform)
		.status().expect("Failed to build Lua.");
}

fn main() {
	build_lua();

	println!("cargo:rustc-link-search={}", Path::new(env::var("CARGO_MANIFEST_DIR").unwrap().as_str()).join("lua/src").to_str().unwrap());
	println!("cargo:rustc-link-lib=static=lua");
}