6 BOOST_ROOT = [ os.environ BOOST_ROOT ] ;
8 rule debug-message ( txt * )
10 if --debug-build in [ modules.peek : ARGV ]
12 echo [luabind DEBUG] $(txt) ;
16 debug-message figuring out which libraries to link to... ;
17 debug-message os.name is [ os.name ] ;
23 errors.user-error "*** BOOST_ROOT must be set to a Boost installation." ;
26 LUA_PATH = [ os.environ LUA_PATH ] ;
30 errors.user-error "*** LUA_PATH must be set." ;
33 local includes = [ GLOB $(LUA_PATH)/include $(LUA_PATH)/src : lua.h ] ;
37 errors.user-error "*** Unable to determine Lua include directory." ;
40 includes = $(includes:D) ;
42 debug-message found include directory in $(includes) ;
44 if [ GLOB $(LUA_PATH) : lib ]
46 lib lua : : <link>static <name>lua5.1 <search>$(LUA_PATH)/lib/static : : <include>$(includes) ;
47 lib lua : : <link>shared <name>lua5.1 <search>$(LUA_PATH)/lib : : <include>$(includes) ;
49 else if [ GLOB $(LUA_PATH) : lua5.1.dll ]
51 lib lua : : <name>lua5.1 <search>$(LUA_PATH) : : <include>$(includes) ;
54 else if [ os.name ] in LINUX MACOSX FREEBSD
56 LUA_PATH = [ os.environ LUA_PATH ] ;
57 HOME = [ os.environ HOME ] ;
59 local possible-prefixes =
60 $(LUA_PATH) $(HOME)/Library/Frameworks /Library/Frameworks /usr /usr/local /opt/local /opt ;
62 local possible-suffixes =
63 include/lua5.1 include/lua51 include/lua include ;
65 local includes = [ GLOB $(possible-prefixes)/$(possible-suffixes) : lua.h ] ;
69 errors.user-error "*** Unable to determine Lua include directory." ;
72 local includes = $(includes[1]:D) ;
73 local prefix = $(includes:D) ;
75 if $(prefix:B) = "include"
77 prefix = $(prefix:D) ;
80 local lib = $(prefix)/lib ;
81 library = [ GLOB $(lib)/lua51 $(lib)/lua5.1 $(lib)/lua $(lib) :
82 liblua5.1.* liblua51.* liblua.* ] ;
83 lib-name = [ MATCH "lib(.*)" : $(library[1]:B) ] ;
85 debug-message prefix: $(prefix) ;
86 debug-message includes: $(includes) ;
87 debug-message lib: $(library:D) ;
91 errors.user-error "*** Unable to find Lua library." ;
94 lib m : : <link>shared ;
95 if [ os.name ] = LINUX
97 lib dl : : <link>shared ;
103 lib lua : m dl : <name>$(lib-name) <search>$(library:D) : : <include>$(includes) ;
113 exception_handler.cpp
117 link_compatibility.cpp
124 stack_content_by_name.cpp
130 <toolset>msvc,<link>shared:<define>LUABIND_IMPORT=__declspec(dllimport)
131 <toolset>msvc,<link>shared:<define>LUABIND_EXPORT=__declspec(dllexport)
132 <toolset>msvc,<link>shared:<cxxflags>/wd4251 ;
137 : <define>LUABIND_BUILDING
138 <include>. <include>$(BOOST_ROOT)
139 $(usage-requirements)
143 : <include>. <include>$(BOOST_ROOT)
144 $(usage-requirements)
152 : <link>static <link>shared release debug ;
156 rule git-describe ( )
158 local result = [ SHELL "git describe HEAD 2>&1" : exit-status ] ;
162 return [ MATCH "^v([a-zA-Z.0-9\\-]+)" : $(result[1]) ] ;
166 version-tag = [ git-describe ] ;
170 actions make-version-file
172 echo ".. |version| replace:: $(version-tag)" > doc/version.rst
175 notfile make-version-file : @make-version-file ;
179 alias make-version-file ;
182 if docs in [ modules.peek : ARGV ]
184 local result = [ SHELL "rst2html.py --version 2>&1" : exit-status ] ;
187 found-rst2html = rst2html.py ;
193 : <dependency>make-version-file
194 <docutils-cmd>$(found-rst2html)
195 <docutils-html>"--traceback -gdt --stylesheet=style.css --link-stylesheet" ;
197 stage docs : docs.html : <location>doc ;
198 explicit docs docs.html make-version-file ;