7 import virtual-target ;
10 BOOST_ROOT = [ os.environ BOOST_ROOT ] ;
12 rule debug-message ( txt * )
14 if --debug-build in [ modules.peek : ARGV ]
16 echo [luabind DEBUG] $(txt) ;
20 debug-message figuring out which libraries to link to... ;
21 debug-message os.name is [ os.name ] ;
27 errors.user-error "*** BOOST_ROOT must be set to a Boost installation." ;
30 LUA_PATH = [ os.environ LUA_PATH ] ;
34 errors.user-error "*** LUA_PATH must be set." ;
37 local includes = [ GLOB $(LUA_PATH)/include $(LUA_PATH)/src : lua.h ] ;
41 errors.user-error "*** Unable to determine Lua include directory." ;
44 includes = $(includes:D) ;
46 debug-message found include directory in $(includes) ;
48 if [ GLOB $(LUA_PATH) : lib ]
50 lib lua : : <link>static <name>lua5.1 <search>$(LUA_PATH)/lib/static : : <include>$(includes) ;
51 lib lua : : <link>shared <name>lua5.1 <search>$(LUA_PATH)/lib : : <include>$(includes) ;
53 else if [ GLOB $(LUA_PATH) : lua5.1.dll ]
55 lib lua : : <name>lua5.1 <search>$(LUA_PATH) : : <include>$(includes) ;
58 else if [ os.name ] in LINUX MACOSX FREEBSD
60 LUA_PATH = [ os.environ LUA_PATH ] ;
61 HOME = [ os.environ HOME ] ;
63 local possible-prefixes =
64 $(LUA_PATH) $(HOME)/Library/Frameworks /Library/Frameworks /usr /usr/local /opt/local /opt ;
66 local possible-suffixes =
67 include/lua5.1 include/lua51 include/lua include ;
69 local includes = [ GLOB $(possible-prefixes)/$(possible-suffixes) : lua.h ] ;
73 errors.user-error "*** Unable to determine Lua include directory." ;
76 local includes = $(includes[1]:D) ;
77 local prefix = $(includes:D) ;
79 if $(prefix:B) = "include"
81 prefix = $(prefix:D) ;
84 local lib = $(prefix)/lib ;
86 local names = liblua5.1 liblua51 liblua ;
87 local extensions = .a .so ;
89 library = [ GLOB $(lib)/lua51 $(lib)/lua5.1 $(lib)/lua $(lib) :
90 $(names)$(extensions) ] ;
91 lib-name = [ MATCH "lib(.*)" : $(library[1]:B) ] ;
93 debug-message prefix: $(prefix) ;
94 debug-message includes: $(includes) ;
95 debug-message lib: $(library:D) ;
96 debug-message candidates: $(library) ;
97 debug-message linking to: $(lib-name) ;
101 errors.user-error "*** Unable to find Lua library." ;
104 lib m : : <link>shared ;
105 if [ os.name ] = LINUX
107 lib dl : : <link>shared ;
113 lib lua : m dl : <name>$(lib-name) <search>$(library:D) : : <include>$(includes) ;
116 rule tag-names ( name : type ? : property-set )
118 if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB &&
119 [ $(property-set).get <variant> ] = debug
124 local result = [ virtual-target.add-prefix-and-suffix $(name) : $(type) : $(property-set) ] ;
126 if $(type) = SHARED_LIB &&
127 ( ! ( [ $(property-set).get <target-os> ] in windows cygwin darwin aix ) &&
128 ! ( [ $(property-set).get <toolset> ] in pgi ) )
130 result = $(result).$(VERSION) ;
143 exception_handler.cpp
147 link_compatibility.cpp
152 stack_content_by_name.cpp
158 <toolset>msvc,<link>shared:<cxxflags>/wd4251
159 <link>shared:<define>LUABIND_DYNAMIC_LINK
165 : <include>. <include>$(BOOST_ROOT)
166 $(usage-requirements)
170 : <include>. <include>$(BOOST_ROOT)
171 $(usage-requirements)
179 : <link>static <link>shared release debug ;
183 rule git-describe ( )
185 local result = [ SHELL "git describe HEAD 2>&1" : exit-status ] ;
189 return [ MATCH "^v([a-zA-Z.0-9\\-]+)" : $(result[1]) ] ;
193 version-tag = [ git-describe ] ;
197 actions make-version-file
199 echo ".. |version| replace:: $(version-tag)" > doc/version.rst
202 notfile make-version-file : @make-version-file ;
206 alias make-version-file ;
209 if docs in [ modules.peek : ARGV ]
211 local result = [ SHELL "rst2html.py --version 2>&1" : exit-status ] ;
214 found-rst2html = rst2html.py ;
220 : <dependency>make-version-file
221 <docutils-cmd>$(found-rst2html)
222 <docutils-html>"--traceback -gdt --stylesheet=style.css --link-stylesheet" ;
224 stage docs : docs.html : <location>doc ;
225 explicit docs docs.html make-version-file ;
227 headers = [ path.glob-tree luabind : *.hpp ] ;
229 package.install install
230 : <install-header-subdir>luabind
231 <install-source-root>luabind
232 <install-no-version-symlinks>on
238 local stage-locate = [ MATCH "^--stagedir=(.*)" : [ modules.peek : ARGV ] ] ;
239 stage-locate ?= stage ;
243 : <location>$(stage-locate)
244 <install-no-version-symlinks>on
245 <install-dependencies>on