4 from __future__
import with_statement
11 DBUS_NAME_BASE
= 'org.ladish'
14 # these variables are mandatory ('/' are converted automatically)
18 import os
, sys
, re
, io
, optparse
, shutil
, tokenize
19 from hashlib
import md5
21 from waflib
import Errors
, Utils
, Options
, Logs
, Scripting
22 from waflib
import Configure
23 from waflib
import Context
25 def display_msg(conf
, msg
="", status
= None, color
= None):
27 conf
.msg(msg
, status
, color
)
29 Logs
.pprint('NORMAL', msg
)
31 def display_raw_text(conf
, text
, color
= 'NORMAL'):
32 Logs
.pprint(color
, text
, sep
= '')
34 def display_line(conf
, text
, color
= 'NORMAL'):
35 Logs
.pprint(color
, text
, sep
= os
.linesep
)
44 opt
.load('compiler_c')
45 opt
.load('compiler_cxx')
47 opt
.add_option('--enable-pkg-config-dbus-service-dir', action
='store_true', default
=False, help='force D-Bus service install dir to be one returned by pkg-config')
48 opt
.add_option('--enable-gladish', action
='store_true', default
=False, help='Build gladish')
49 opt
.add_option('--enable-liblash', action
='store_true', default
=False, help='Build LASH compatibility library')
50 opt
.add_option('--enable-pylash', action
='store_true', default
=False, help='Build python bindings for LASH compatibility library')
51 opt
.add_option('--debug', action
='store_true', default
=False, dest
='debug', help="Build debuggable binaries")
52 opt
.add_option('--siginfo', action
='store_true', default
=False, dest
='siginfo', help="Log backtrace on fatal signal")
53 opt
.add_option('--doxygen', action
='store_true', default
=False, help='Enable build of doxygen documentation')
54 opt
.add_option('--distnodeps', action
='store_true', default
=False, help="When creating distribution tarball, don't package git submodules")
55 opt
.add_option('--distname', type='string', default
=None, help="Name for the distribution tarball")
56 opt
.add_option('--distsuffix', type='string', default
="", help="String to append to the distribution tarball name")
57 opt
.add_option('--tagdist', action
='store_true', default
=False, help='Create of git tag for distname')
58 opt
.add_option('--libdir', type='string', default
=None, help='Define lib dir')
59 opt
.add_option('--docdir', type='string', default
=None, help="Define doc dir [default: PREFIX'/share/doc/" + APPNAME
+ ']')
63 opt
.load('parallel_debug')
65 def add_cflag(conf
, flag
):
66 conf
.env
.prepend_value('CXXFLAGS', flag
)
67 conf
.env
.prepend_value('CFLAGS', flag
)
69 def add_linkflag(conf
, flag
):
70 conf
.env
.prepend_value('LINKFLAGS', flag
)
72 def check_gcc_optimizations_enabled(flags
):
73 gcc_optimizations_enabled
= False
75 if len(flag
) < 2 or flag
[0] != '-' or flag
[1] != 'O':
78 gcc_optimizations_enabled
= True;
80 gcc_optimizations_enabled
= flag
[2] != '0';
81 return gcc_optimizations_enabled
83 def create_service_taskgen(bld
, target
, opath
, binary
):
85 features
= 'subst', # the feature 'subst' overrides the source/target processing
86 source
= os
.path
.join('daemon', 'dbus.service.in'), # list of string or nodes
87 target
= target
, # list of strings or nodes
88 install_path
= bld
.env
['DBUS_SERVICES_DIR'] + os
.path
.sep
,
89 # variables to use in the substitution
90 dbus_object_path
= opath
,
91 daemon_bin_path
= os
.path
.join(bld
.env
['PREFIX'], 'bin', binary
))
94 conf
.load('compiler_c')
95 conf
.load('compiler_cxx')
99 conf
.load('parallel_debug')
101 # dladdr() is used by daemon/siginfo.c
102 # dlvsym() is used by the alsapid library
103 conf
.check_cc(msg
="Checking for libdl", lib
=['dl'], uselib_store
='DL')
105 # forkpty() is used by ladishd
106 conf
.check_cc(msg
="Checking for libutil", lib
=['util'], uselib_store
='UTIL')
111 errmsg
= "not installed, see http://jackaudio.org/",
112 args
= '--cflags --libs')
117 errmsg
= "not installed, see http://www.alsa-project.org/",
122 atleast_version
= '1.0.0',
124 errmsg
= "not installed, see http://dbus.freedesktop.org/",
125 args
= '--cflags --libs')
127 dbus_dir
= conf
.check_cfg(package
='dbus-1', args
='--variable=session_bus_services_dir', msg
="Retrieving D-Bus services dir")
131 dbus_dir
= dbus_dir
.strip()
132 conf
.env
['DBUS_SERVICES_DIR_REAL'] = dbus_dir
134 if Options
.options
.enable_pkg_config_dbus_service_dir
:
135 conf
.env
['DBUS_SERVICES_DIR'] = dbus_dir
137 conf
.env
['DBUS_SERVICES_DIR'] = os
.path
.join(os
.path
.normpath(conf
.env
['PREFIX']), 'share', 'dbus-1', 'services')
139 if Options
.options
.libdir
:
140 conf
.env
['LIBDIR'] = Options
.options
.libdir
142 conf
.env
['LIBDIR'] = os
.path
.join(os
.path
.normpath(conf
.env
['PREFIX']), 'lib')
144 if Options
.options
.docdir
:
145 conf
.env
['DOCDIR'] = Options
.options
.docdir
147 conf
.env
['DOCDIR'] = os
.path
.join(os
.path
.normpath(conf
.env
['PREFIX']), 'share', 'doc', APPNAME
)
149 conf
.env
['BUILD_DOXYGEN_DOCS'] = Options
.options
.doxygen
154 errmsg
= "not installed, see http://e2fsprogs.sourceforge.net/",
155 args
= '--cflags --libs')
158 header_name
='expat.h',
160 errmsg
= "not installed, see http://expat.sourceforge.net/")
162 conf
.env
['LIB_EXPAT'] = ['expat']
164 if Options
.options
.enable_gladish
:
166 package
= 'glib-2.0',
167 errmsg
= "not installed, see http://www.gtk.org/",
168 args
= '--cflags --libs')
170 package
= 'dbus-glib-1',
171 errmsg
= "not installed, see http://dbus.freedesktop.org/",
172 args
= '--cflags --libs')
174 package
= 'gtk+-2.0',
175 atleast_version
= '2.20.0',
176 errmsg
= "not installed, see http://www.gtk.org/",
177 args
= '--cflags --libs')
179 package
= 'gtkmm-2.4',
180 atleast_version
= '2.10.0',
181 errmsg
= "not installed, see http://www.gtkmm.org",
182 args
= '--cflags --libs')
185 package
= 'libgnomecanvasmm-2.6',
186 atleast_version
= '2.6.0',
187 errmsg
= "not installed, see http://www.gtkmm.org",
188 args
= '--cflags --libs')
190 #autowaf.check_pkg(conf, 'libgvc', uselib_store='AGRAPH', atleast_version='2.8', mandatory=False)
192 # The boost headers package (e.g. libboost-dev) is needed
194 {'header_name': "boost/shared_ptr.hpp"},
195 {'header_name': "boost/weak_ptr.hpp"},
196 {'header_name': "boost/enable_shared_from_this.hpp"},
197 {'header_name': "boost/utility.hpp"},
198 msg
= "Checking for boost headers",
200 display_msg(conf
, 'Found boost/shared_ptr.hpp',
201 yesno(conf
.env
['HAVE_BOOST_SHARED_PTR_HPP']))
202 display_msg(conf
, 'Found boost/weak_ptr.hpp',
203 yesno(conf
.env
['HAVE_BOOST_WEAK_PTR_HPP']))
204 display_msg(conf
, 'Found boost/enable_shared_from_this.hpp',
205 yesno(conf
.env
['HAVE_BOOST_ENABLE_SHARED_FROM_THIS_HPP']))
206 display_msg(conf
, 'Found boost/utility.hpp',
207 yesno(conf
.env
['HAVE_BOOST_UTILITY_HPP']))
208 if not (conf
.env
['HAVE_BOOST_SHARED_PTR_HPP'] and \
209 conf
.env
['HAVE_BOOST_WEAK_PTR_HPP'] and \
210 conf
.env
['HAVE_BOOST_ENABLE_SHARED_FROM_THIS_HPP'] and \
211 conf
.env
['HAVE_BOOST_UTILITY_HPP']):
212 display_line(conf
, "One or more boost headers not found, see http://boost.org/")
215 conf
.env
['BUILD_GLADISH'] = Options
.options
.enable_gladish
216 conf
.env
['BUILD_LIBLASH'] = Options
.options
.enable_liblash
217 conf
.env
['BUILD_PYLASH'] = Options
.options
.enable_pylash
218 conf
.env
['BUILD_SIGINFO'] = Options
.options
.siginfo
219 if conf
.env
['BUILD_PYLASH'] and not conf
.env
['BUILD_LIBLASH']:
220 conf
.fatal("pylash build was requested but liblash was not")
221 conf
.env
['BUILD_PYLASH'] = False
222 if conf
.env
['BUILD_PYLASH']:
223 conf
.check_python_version()
224 conf
.check_python_headers()
226 add_cflag(conf
, '-fvisibility=hidden')
228 conf
.env
['BUILD_WERROR'] = False #not RELEASE
229 add_cflag(conf
, '-Wall')
230 # lash_wrap code is generated by swig and causes warnings
231 if not conf
.env
['BUILD_PYLASH']:
232 add_cflag(conf
, '-Wextra')
233 conf
.env
.append_unique('CXXFLAGS', '-Wno-unused-parameter') # the UNUSED() macro doesnt work for C++
235 add_cflag(conf
, '-Wimplicit-fallthrough=2')
237 if conf
.env
['BUILD_WERROR']:
238 add_cflag(conf
, '-Werror')
239 # for pre gcc-4.4, enable optimizations so use of uninitialized variables gets detected
241 is_gcc
= conf
.env
['CC_NAME'] == 'gcc'
244 for n
in conf
.env
['CC_VERSION']:
245 gcc_ver
.append(int(n
))
246 if gcc_ver
[0] < 4 or gcc_ver
[1] < 4:
247 #print "optimize force enable is required"
248 if not check_gcc_optimizations_enabled(conf
.env
['CFLAGS']):
249 if Options
.options
.debug
:
250 print ("C optimization must be forced in order to enable -Wuninitialized")
251 print ("However this will not be made because debug compilation is enabled")
253 print ("C optimization forced in order to enable -Wuninitialized")
254 conf
.env
.append_unique('CFLAGS', "-O")
258 conf
.env
['BUILD_DEBUG'] = Options
.options
.debug
259 if conf
.env
['BUILD_DEBUG']:
260 add_cflag(conf
, '-g')
261 add_cflag(conf
, '-O0')
262 add_linkflag(conf
, '-g')
264 conf
.env
['DATA_DIR'] = os
.path
.normpath(os
.path
.join(conf
.env
['PREFIX'], 'share', APPNAME
))
265 conf
.env
['LOCALE_DIR'] = os
.path
.normpath(os
.path
.join(conf
.env
['PREFIX'], 'share', 'locale'))
267 # write some parts of the configure environment to the config.h file
268 conf
.define('DATA_DIR', conf
.env
['DATA_DIR'])
269 conf
.define('LOCALE_DIR', conf
.env
['LOCALE_DIR'])
270 conf
.define('PACKAGE_VERSION', VERSION
)
271 conf
.define('DBUS_NAME_BASE', DBUS_NAME_BASE
)
272 conf
.define('DBUS_BASE_PATH', '/' + DBUS_NAME_BASE
.replace('.', '/'))
273 conf
.define('BASE_NAME', APPNAME
)
274 conf
.define('SIGINFO_ENABLED', conf
.env
['BUILD_SIGINFO'])
275 conf
.define('_GNU_SOURCE', 1)
276 conf
.write_config_header('config.h')
280 display_msg(conf
, "==================")
281 version_msg
= APPNAME
+ "-" + VERSION
283 if os
.access('version.h', os
.R_OK
):
284 data
= open('version.h').read()
285 m
= re
.match(r
'^#define GIT_VERSION "([^"]*)"$', data
)
287 version_msg
+= " exported from " + m
.group(1)
288 elif os
.access('.git', os
.R_OK
):
289 version_msg
+= " git revision will checked and eventually updated during build"
291 display_msg(conf
, version_msg
)
294 display_msg(conf
, "Install prefix", conf
.env
['PREFIX'], 'CYAN')
296 display_msg(conf
, 'Build gladish', yesno(conf
.env
['BUILD_GLADISH']))
297 display_msg(conf
, 'Build liblash', yesno(Options
.options
.enable_liblash
))
298 display_msg(conf
, 'Build pylash', yesno(conf
.env
['BUILD_PYLASH']))
299 display_msg(conf
, 'Build with siginfo', yesno(conf
.env
['BUILD_SIGINFO']))
300 display_msg(conf
, 'Treat warnings as errors', yesno(conf
.env
['BUILD_WERROR']))
301 display_msg(conf
, 'Debuggable binaries', yesno(conf
.env
['BUILD_DEBUG']))
302 display_msg(conf
, 'Build doxygen documentation', yesno(conf
.env
['BUILD_DOXYGEN_DOCS']))
304 if conf
.env
['DBUS_SERVICES_DIR'] != conf
.env
['DBUS_SERVICES_DIR_REAL']:
306 display_line(conf
, "WARNING: D-Bus session services directory as reported by pkg-config is", 'RED')
307 display_raw_text(conf
, "WARNING:", 'RED')
308 display_line(conf
, conf
.env
['DBUS_SERVICES_DIR_REAL'], 'CYAN')
309 display_line(conf
, 'WARNING: but service file will be installed in', 'RED')
310 display_raw_text(conf
, "WARNING:", 'RED')
311 display_line(conf
, conf
.env
['DBUS_SERVICES_DIR'], 'CYAN')
312 display_line(conf
, 'WARNING: You may need to adjust your D-Bus configuration after installing ladish', 'RED')
313 display_line(conf
, 'WARNING: You can override dbus service install directory', 'RED')
314 display_line(conf
, 'WARNING: with --enable-pkg-config-dbus-service-dir option to this script', 'RED')
316 display_msg(conf
, 'C compiler flags', repr(conf
.env
['CFLAGS']))
317 display_msg(conf
, 'C++ compiler flags', repr(conf
.env
['CXXFLAGS']))
318 display_msg(conf
, 'Linker flags', repr(conf
.env
['LINKFLAGS']))
320 if not conf
.env
['BUILD_GLADISH']:
322 display_line(conf
, "WARNING: The GUI frontend will not built", 'RED')
327 bld
= self
.generator
.bld
328 header
= self
.outputs
[0].abspath()
329 if os
.access('./version.h', os
.R_OK
):
330 header
= os
.path
.join(os
.getcwd(), out
, "version.h")
331 shutil
.copy('./version.h', header
)
332 data
= open(header
).read()
333 m
= re
.match(r
'^#define GIT_VERSION "([^"]*)"$', data
)
335 self
.ver
= m
.group(1)
336 Logs
.pprint('BLUE', "tarball from git revision " + self
.ver
)
341 if bld
.srcnode
.find_node('.git'):
342 self
.ver
= bld
.cmd_and_log("LANG= git rev-parse HEAD", quiet
=Context
.BOTH
).splitlines()[0]
343 if bld
.cmd_and_log("LANG= git diff-index --name-only HEAD", quiet
=Context
.BOTH
).splitlines():
346 Logs
.pprint('BLUE', "git revision " + self
.ver
)
350 fi
= open(header
, 'w')
351 fi
.write('#define GIT_VERSION "%s"\n' % self
.ver
)
355 if not bld
.env
['DATA_DIR']:
356 raise "DATA_DIR is emtpy"
358 bld(rule
=git_ver
, target
='version.h', update_outputs
=True, always
=True, ext_out
=['.h'])
360 daemon
= bld
.program(source
= [], features
= 'c cprogram', includes
= [bld
.path
.get_bld()])
361 daemon
.target
= 'ladishd'
362 daemon
.uselib
= 'DBUS-1 UUID EXPAT DL UTIL'
363 daemon
.ver_header
= 'version.h'
364 # Make backtrace function lookup to work for functions in the executable itself
365 daemon
.env
.append_value("LINKFLAGS", ["-Wl,-E"])
366 daemon
.defines
= ["HAVE_CONFIG_H"]
368 daemon
.source
= ["string_constants.c"]
386 'studio_jack_conf.c',
392 'cmd_rename_studio.c',
394 'cmd_start_studio.c',
396 'cmd_unload_studio.c',
398 'cmd_change_app_state.c',
402 'cmd_save_project.c',
403 'cmd_unload_project.c',
404 'cmd_load_project.c',
417 daemon
.source
.append(os
.path
.join("daemon", source
))
419 if Options
.options
.siginfo
:
420 daemon
.source
.append(os
.path
.join("daemon", 'siginfo.c'))
429 "lash_client_proxy.c",
431 daemon
.source
.append(os
.path
.join("proxies", source
))
440 daemon
.source
.append(os
.path
.join("cdbus", source
))
448 daemon
.source
.append(os
.path
.join("common", source
))
450 daemon
.source
.append(os
.path
.join("alsapid", "helper.c"))
452 # process dbus.service.in -> ladish.service
453 create_service_taskgen(bld
, DBUS_NAME_BASE
+ '.service', DBUS_NAME_BASE
, daemon
.target
)
455 #####################################################
457 jmcore
= bld
.program(source
= [], features
= 'c cprogram', includes
= [bld
.path
.get_bld()])
458 jmcore
.target
= 'jmcore'
459 jmcore
.uselib
= 'DBUS-1 JACK'
460 jmcore
.defines
= ['LOG_OUTPUT_STDOUT']
461 jmcore
.source
= ['jmcore.c']
466 jmcore
.source
.append(os
.path
.join("common", source
))
475 jmcore
.source
.append(os
.path
.join("cdbus", source
))
477 create_service_taskgen(bld
, DBUS_NAME_BASE
+ '.jmcore.service', DBUS_NAME_BASE
+ ".jmcore", jmcore
.target
)
479 #####################################################
481 ladiconfd
= bld
.program(source
= [], features
= 'c cprogram', includes
= [bld
.path
.get_bld()])
482 ladiconfd
.target
= 'ladiconfd'
483 ladiconfd
.uselib
= 'DBUS-1'
484 ladiconfd
.defines
= ['LOG_OUTPUT_STDOUT']
485 ladiconfd
.source
= ['conf.c']
492 ladiconfd
.source
.append(os
.path
.join("common", source
))
501 ladiconfd
.source
.append(os
.path
.join("cdbus", source
))
503 create_service_taskgen(bld
, DBUS_NAME_BASE
+ '.conf.service', DBUS_NAME_BASE
+ ".conf", ladiconfd
.target
)
505 #####################################################
507 alsapid
= bld
.shlib(source
= [], features
= 'c cshlib', includes
= [bld
.path
.get_bld()])
508 alsapid
.uselib
= 'DL'
509 alsapid
.target
= 'alsapid'
514 alsapid
.source
.append(os
.path
.join("alsapid", source
))
516 #####################################################
518 if bld
.env
['BUILD_LIBLASH']:
519 liblash
= bld
.shlib(source
= [], features
= 'c cshlib', includes
= [bld
.path
.get_bld()])
520 liblash
.uselib
= 'DBUS-1'
521 liblash
.target
= 'lash'
522 liblash
.vnum
= "1.1.1"
523 liblash
.defines
= ['LOG_OUTPUT_STDOUT']
524 liblash
.source
= [os
.path
.join("lash_compat", "liblash", 'lash.c')]
532 liblash
.source
.append(os
.path
.join("common", source
))
540 liblash
.source
.append(os
.path
.join("cdbus", source
))
542 bld
.install_files('${PREFIX}/include/lash-1.0/lash', bld
.path
.ant_glob('lash_compat/liblash/lash/*.h'))
544 # process lash-1.0.pc.in -> lash-1.0.pc
546 features
= 'subst', # the feature 'subst' overrides the source/target processing
547 source
= os
.path
.join("lash_compat", 'lash-1.0.pc.in'), # list of string or nodes
548 target
= 'lash-1.0.pc', # list of strings or nodes
549 install_path
= '${LIBDIR}/pkgconfig/',
550 # variables to use in the substitution
551 prefix
= bld
.env
['PREFIX'],
552 exec_prefix
= bld
.env
['PREFIX'],
553 libdir
= bld
.env
['LIBDIR'],
554 includedir
= os
.path
.normpath(bld
.env
['PREFIX'] + '/include'))
556 #####################################################
558 if bld
.env
['BUILD_PYLASH']:
559 pylash
= bld
.shlib(source
= [], features
= 'c cshlib pyext', includes
= ["lash_compat/liblash"])
560 pylash
.target
= '_lash'
562 pylash
.install_path
= '${PYTHONDIR}'
568 pylash
.source
.append(os
.path
.join("lash_compat", "pylash", source
))
570 bld
.install_files('${PYTHONDIR}', os
.path
.join("lash_compat", "pylash", "lash.py"))
572 #####################################################
574 if bld
.env
['BUILD_GLADISH']:
575 gladish
= bld
.program(source
= [], features
= 'c cxx cxxprogram', includes
= [bld
.path
.get_bld()])
576 gladish
.target
= 'gladish'
577 gladish
.defines
= ['LOG_OUTPUT_STDOUT']
578 gladish
.uselib
= 'DBUS-1 DBUS-GLIB-1 GTKMM-2.4 LIBGNOMECANVASMM-2.6 GTK+-2.0'
580 gladish
.source
= ["string_constants.c"]
584 'load_project_dialog.c',
585 'save_project_dialog.c',
586 'project_properties.c',
593 'create_room_dialog.c',
611 gladish
.source
.append(os
.path
.join("gui", source
))
622 gladish
.source
.append(os
.path
.join("gui", "flowcanvas", source
))
630 'app_supervisor_proxy.c',
634 gladish
.source
.append(os
.path
.join("proxies", source
))
640 gladish
.source
.append(os
.path
.join("cdbus", source
))
647 gladish
.source
.append(os
.path
.join("common", source
))
649 # GtkBuilder UI definitions (XML)
650 bld
.install_files('${DATA_DIR}', 'gui/gladish.ui')
652 # 'Desktop' file (menu entry, icon, etc)
653 bld
.install_files('${PREFIX}/share/applications/', 'gui/gladish.desktop', chmod
=0o0644)
656 icon_sizes
= ['16x16', '22x22', '24x24', '32x32', '48x48', '256x256']
657 for icon_size
in icon_sizes
:
658 bld
.path
.ant_glob('art/' + icon_size
+ '/apps/*.png')
659 bld
.install_files('${PREFIX}/share/icons/hicolor/' + icon_size
+ '/apps/', 'art/' + icon_size
+ '/apps/gladish.png')
662 for status
in ["down", "unloaded", "started", "stopped", "warning", "error"]:
663 status_images
.append("art/status_" + status
+ ".png")
665 bld
.install_files('${DATA_DIR}', status_images
)
666 bld
.install_files('${DATA_DIR}', "art/ladish-logo-128x128.png")
668 bld(features
='intltool_po', appname
=APPNAME
, podir
='po', install_path
="${LOCALE_DIR}")
670 bld
.install_files('${PREFIX}/bin', 'ladish_control', chmod
=0o0755)
672 bld
.install_files('${DOCDIR}', ["AUTHORS", "README.adoc", "NEWS"])
673 bld
.install_as('${DATA_DIR}/COPYING', "gpl2.txt")
675 if bld
.env
['BUILD_DOXYGEN_DOCS'] == True:
676 html_docs_source_dir
= "build/default/html"
677 if bld
.cmd
== 'clean':
678 if os
.access(html_docs_source_dir
, os
.R_OK
):
679 Logs
.pprint('CYAN', "Removing doxygen generated documentation...")
680 shutil
.rmtree(html_docs_source_dir
)
681 Logs
.pprint('CYAN', "Removing doxygen generated documentation done.")
682 elif bld
.cmd
== 'build':
683 if not os
.access(html_docs_source_dir
, os
.R_OK
):
684 os
.popen("doxygen").read()
686 Logs
.pprint('CYAN', "doxygen documentation already built.")
689 source_root
= os
.path
.dirname(Utils
.g_module
.root_path
)
690 if 'relpath' in os
.path
.__all
__:
691 source_root
= os
.path
.relpath(source_root
)
693 paths
+= " " + os
.path
.join(source_root
, "common")
694 paths
+= " " + os
.path
.join(source_root
, "cdbus")
695 paths
+= " " + os
.path
.join(source_root
, "proxies")
696 paths
+= " " + os
.path
.join(source_root
, "daemon")
697 paths
+= " " + os
.path
.join(source_root
, "gui")
698 paths
+= " " + os
.path
.join(source_root
, "example-apps")
699 paths
+= " " + os
.path
.join(source_root
, "lib")
700 paths
+= " " + os
.path
.join(source_root
, "lash_compat", "liblash")
701 paths
+= " " + os
.path
.join(source_root
, "lash_compat", "liblash", "lash")
705 '''build tag files for GNU global'''
706 cmd
= "find %s -mindepth 1 -maxdepth 1 -name '*.[ch]' -print | gtags --statistics -f -" % get_tags_dirs()
707 #print("Running: %s" % cmd)
711 '''build TAGS file using etags'''
712 cmd
= "find %s -mindepth 1 -maxdepth 1 -name '*.[ch]' -print | etags -" % get_tags_dirs()
713 #print("Running: %s" % cmd)
715 os
.system("stat -c '%y' TAGS")
717 class ladish_dist(Scripting
.Dist
):
722 Scripting
.Dist
.__init
__(self
)
723 if Options
.options
.distname
:
724 self
.base_name
= Options
.options
.distname
727 sha
= self
.cmd_and_log("LANG= git rev-parse --short HEAD", quiet
=Context
.BOTH
).splitlines()[0]
728 self
.base_name
= APPNAME
+ '-' + VERSION
+ "-g" + sha
730 self
.base_name
= APPNAME
+ '-' + VERSION
731 self
.base_name
+= Options
.options
.distsuffix
733 #print self.base_name
735 if Options
.options
.distname
and Options
.options
.tagdist
:
736 ret
= self
.exec_command("LANG= git tag " + self
.base_name
)
738 raise waflib
.Errors
.WafError('git tag creation failed')
740 def get_base_name(self
):
741 return self
.base_name
744 excl
= Scripting
.Dist
.get_excl(self
)
746 excl
+= ' .gitmodules'
752 if Options
.options
.distnodeps
:
761 shutil
.copy('./build/version.h', "./")
763 super(ladish_dist
, self
).execute()
765 os
.remove("version.h")