Luaに興味が出てきたのでコンパイルしてみる

環境はWindows XP SP3、Visual C++ 2008 Express。

* Building Lua on Windows and other systems
  -----------------------------------------
  If you're not using the usual Unix tools, then the instructions for
  building Lua depend on the compiler you use. You'll need to create
  projects (or whatever your compiler uses) for building the library,
  the interpreter, and the compiler, as follows:

  library:	lapi.c lcode.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c
		lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c
		ltable.c ltm.c lundump.c lvm.c lzio.c
		lauxlib.c lbaselib.c ldblib.c liolib.c lmathlib.c loslib.c
		ltablib.c lstrlib.c loadlib.c linit.c

  interpreter:	library, lua.c

  compiler:	library, luac.c print.c

  If you use Visual Studio .NET, you can use etc/luavs.bat in its
  "Command Prompt".
    • こりゃまたご丁寧に、etc/luavs.batが用意されているではないか。
    • というわけで、etc/luavs.batの中身をのぞく
@rem Script to build Lua under "Visual Studio .NET Command Prompt".
@rem Do not run from this directory; run it from the toplevel: etc\luavs.bat .
@rem It creates lua51.dll, lua51.lib, lua.exe, and luac.exe in src.
@rem (contributed by David Manura and Mike Pall)
    • はぁ、なるほど、Visual Studio .NET Command Promptの下でビルドしろとのことなのでそのようにする。この程度の英語だったら理解可能だ :-)
  • すべてプログラム > Microsoft Visual C++ 2008 Express Edition > Visual Studio Tools > Visual Studio 2008 コマンド プロンプトを実行する
  • トップレベルのディレクトリから、luavs.batを実行せよとのことなので、実行する
    • ビルドが始まる…しばらく経って終了。コンパクトな言語なだけに待たされる時間も短い。
  • dllがsrcディレクトリにできました。
    • どっちかというと、この記事にまとめるほうが時間かかった。

なんとなく、dllをビルドしてみたけど、肝心なのはc++とのバインディングなので、それはまた後日。