building.rst 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. Building luabind
  2. ================
  3. Prerequisites
  4. -------------
  5. Luabind depends on a number of Boost 1.34 libraries. It also depends on
  6. Boost Jam and Boost Build V2 to build the library and run the tests.
  7. Boost provides `precompiled bjam binaries`__ for a number of platforms.
  8. If there isn't a precompiled binary available for your platform, you may
  9. need to `build it yourself`__.
  10. __ http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=72941
  11. __ http://www.boost.org/doc/libs/1_36_0/doc/html/jam/building.html
  12. Windows
  13. -------
  14. The environment varaible ``LUA_PATH`` needs to be set to point to a
  15. directory containing the Lua include directory and built libraries. At
  16. least for the purpose of running the test suite, the recommended way to
  17. get these is the `Lua Binaries`_ *Windows x86 DLL and Includes* package.
  18. Furthermore, the environment variable ``BOOST_ROOT`` must point to
  19. a Boost installation directory.
  20. .. _`Lua Binaries`: http://luabinaries.luaforge.net
  21. Linux and other \*nix flavors
  22. -----------------------------
  23. If your system already has Lua installed, it is very likely that the
  24. build system will automatically find it and just work. If you have
  25. Lua installed in a non-standard location, you may need to set
  26. ``LUA_PATH`` to point to the installation prefix.
  27. ``BOOST_ROOT`` can be set to a Boost installation directory. If left
  28. unset, the build system will try to use boost headers from the standard
  29. include path.
  30. MacOSX
  31. ~~~~~~
  32. If you have both the 10.4 and 10.5 SDK installed, Boost Build seems to
  33. default to 10.4. Lua, at least when installed from MacPorts, will be
  34. linked with the 10.5 SDK. If the luabind build fails with link errors,
  35. you may need to explicitly build with the 10.5 SDK::
  36. $ bjam macosx-version=10.5
  37. Building and testing
  38. --------------------
  39. Building the default variant of the library, which is a shared debug
  40. library, is simply done by invoking ``bjam`` in the luabind root
  41. directory::
  42. $ bjam
  43. ...patience...
  44. ...found 714 targets...
  45. ...updating 23 targets...
  46. When building with GCC on Linux, this results in::
  47. bin/gcc-4.2.3/debug/libluabind.so
  48. On Windows a dll and matching import library would be produced.
  49. To run the unit tests, invoke ``bjam`` with the ``test`` target::
  50. $ bjam test
  51. This will build and run the unit tests in four different variants:
  52. debug, release, debug-static-lib, release-static-lib. A clean test run
  53. output should end with something like:
  54. .. parsed-literal::
  55. ... updated *xxx* targets...
  56. A failed run would end with something like:
  57. .. parsed-literal::
  58. ...failed updating *xxx* target...
  59. ...skipped *xxx* targets...
  60. If you are not using Boost Build to build your application, and want to
  61. use the shared library variant, ``LUABIND_DYNAMIC_LINK`` needs to be
  62. defined to properly import symbols.