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
146 link_compatibility.cpp
151 stack_content_by_name.cpp
157 <toolset>msvc,<link>shared:<cxxflags>/wd4251
158 <link>shared:<define>LUABIND_DYNAMIC_LINK
164 : <include>. <include>$(BOOST_ROOT)
165 $(usage-requirements)
169 : <include>. <include>$(BOOST_ROOT)
170 $(usage-requirements)
178 : <link>static <link>shared release debug ;
182 rule git-describe ( )
184 local result = [ SHELL "git describe HEAD 2>&1" : exit-status ] ;
188 return [ MATCH "^v([a-zA-Z.0-9\\-]+)" : $(result[1]) ] ;
192 version-tag = [ git-describe ] ;
196 actions make-version-file
198 echo ".. |version| replace:: $(version-tag)" > doc/version.rst
201 notfile make-version-file : @make-version-file ;
205 alias make-version-file ;
208 if docs in [ modules.peek : ARGV ]
210 local result = [ SHELL "rst2html.py --version 2>&1" : exit-status ] ;
213 found-rst2html = rst2html.py ;
219 : <dependency>make-version-file
220 <docutils-cmd>$(found-rst2html)
221 <docutils-html>"--traceback -gdt --stylesheet=style.css --link-stylesheet" ;
223 stage docs : docs.html : <location>doc ;
224 explicit docs docs.html make-version-file ;
226 headers = [ path.glob-tree luabind : *.hpp ] ;
228 package.install install
229 : <install-header-subdir>luabind
230 <install-source-root>luabind
231 <install-no-version-symlinks>on
237 local stage-locate = [ MATCH "^--stagedir=(.*)" : [ modules.peek : ARGV ] ] ;
238 stage-locate ?= stage ;
242 : <location>$(stage-locate)
243 <install-no-version-symlinks>on
244 <install-dependencies>on