git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2500 0c269be4-1314-0410-8aa9-9f06e86f4224tags/1.90
| @@ -1,287 +0,0 @@ | |||||
| # | |||||
| # Copyright (C) 2007 Arnold Krille | |||||
| # Copyright (C) 2007 Pieter Palmers | |||||
| # Copyright (C) 2008 Marc-Olivier Barre | |||||
| # | |||||
| # This file originates from FFADO (www.ffado.org) | |||||
| # | |||||
| # This program is free software: you can redistribute it and/or modify | |||||
| # it under the terms of the GNU General Public License as published by | |||||
| # the Free Software Foundation, either version 3 of the License, or | |||||
| # (at your option) any later version. | |||||
| # | |||||
| # This program is distributed in the hope that it will be useful, | |||||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| # GNU General Public License for more details. | |||||
| # | |||||
| # You should have received a copy of the GNU General Public License | |||||
| # along with this program. If not, see <http://www.gnu.org/licenses/>. | |||||
| # | |||||
| import os | |||||
| from string import Template | |||||
| import commands | |||||
| JACK_MAJOR_VERSION=1 | |||||
| JACK_MINOR_VERSION=9 | |||||
| JACK_MICRO_VERSION=0 | |||||
| JACKAPI_MAJOR_VERSION=0 | |||||
| JACKAPI_MINOR_VERSION=1 | |||||
| JACKAPI_MICRO_VERSION=0 | |||||
| def fetch_svn_revision(path): | |||||
| cmd = "LANG= " | |||||
| cmd += "svnversion " | |||||
| cmd += path | |||||
| return commands.getoutput(cmd) | |||||
| JACK_SVNREVISION=fetch_svn_revision('.') | |||||
| JACK_VERSION="%u.%u.%u" % (JACK_MAJOR_VERSION, JACK_MINOR_VERSION, JACK_MICRO_VERSION) | |||||
| JACKAPI_VERSION="%u.%u.%u" % (JACKAPI_MAJOR_VERSION, JACKAPI_MINOR_VERSION, JACKAPI_MICRO_VERSION) | |||||
| print "JACK %s (%s)" % (JACK_VERSION, JACK_SVNREVISION) | |||||
| platform = ARGUMENTS.get('OS', str(Platform())) | |||||
| build_dir = ARGUMENTS.get('BUILDDIR', '') | |||||
| if build_dir: | |||||
| build_base = build_dir + '/' | |||||
| if not os.path.isdir(build_base): | |||||
| os.makedirs(build_base) | |||||
| print 'Building into: ' + build_base | |||||
| else: | |||||
| build_base='' | |||||
| if not os.path.isdir('cache'): | |||||
| os.makedirs('cache') | |||||
| opts = Options('cache/'+build_base+'options.cache') | |||||
| # | |||||
| # Command-line options section | |||||
| # | |||||
| # If this is just to display a help-text for the variable used via ARGUMENTS, then its wrong... | |||||
| opts.Add( 'BUILDDIR', 'Path to place the built files in', '') | |||||
| opts.AddOptions( | |||||
| PathOption('DESTDIR', 'A prefix where the installed tree will be placed - for package maintainers', '', PathOption.PathAccept), | |||||
| PathOption('PREFIX', 'The prefix where jackdmp will be installed to', '/usr/local', PathOption.PathAccept), | |||||
| PathOption('BINDIR', 'Overwrite the directory where apps are installed to', '$PREFIX/bin', PathOption.PathAccept), | |||||
| PathOption('LIBDIR', 'Overwrite the directory where libs are installed to', '$PREFIX/lib', PathOption.PathAccept), | |||||
| PathOption('INCLUDEDIR', 'Overwrite the directory where headers are installed to', '$PREFIX/include', PathOption.PathAccept), | |||||
| # TODO: The next one is stupid, should be autodetected | |||||
| BoolOption('BUILD_FOR_LINUX', 'Enable/Disable depending on your system', True), | |||||
| BoolOption('ENABLE_ALSA', 'Enable/Disable the ALSA backend', True), | |||||
| BoolOption('ENABLE_FREEBOB', 'Enable/Disable the FreeBoB backend', True), | |||||
| BoolOption('ENABLE_FIREWIRE', 'Enable/Disable the FireWire backend', True), | |||||
| BoolOption('DEBUG', 'Do a debug build', False), | |||||
| BoolOption('BUILD_TESTS', 'Build tests where applicable', True), | |||||
| BoolOption('BUILD_EXAMPLES', 'Build the example clients in their directory', True), | |||||
| BoolOption('INSTALL_EXAMPLES', 'Install the example clients in the BINDIR directory', True), | |||||
| BoolOption('BUILD_DOXYGEN_DOCS', 'Build doxygen documentation', False), | |||||
| BoolOption('ENABLE_DBUS', 'Whether to use D-Bus API', False), | |||||
| ('cc', 'cc', False), | |||||
| ('cxx', 'cxx', False), | |||||
| ('ccflags', 'ccflags', False), | |||||
| ) | |||||
| # | |||||
| # Configuration section | |||||
| # | |||||
| # Load the builders in config | |||||
| buildenv = os.environ | |||||
| if os.environ.has_key('PATH'): | |||||
| buildenv['PATH'] = os.environ['PATH'] | |||||
| else: | |||||
| buildenv['PATH'] = '' | |||||
| if os.environ.has_key('PKG_CONFIG_PATH'): | |||||
| buildenv['PKG_CONFIG_PATH'] = os.environ['PKG_CONFIG_PATH'] | |||||
| else: | |||||
| buildenv['PKG_CONFIG_PATH'] = '' | |||||
| if os.environ.has_key('LD_LIBRARY_PATH'): | |||||
| buildenv['LD_LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH'] | |||||
| else: | |||||
| buildenv['LD_LIBRARY_PATH'] = '' | |||||
| env = Environment(tools=['default', 'scanreplace', 'pkgconfig', 'doxygen'], toolpath = ['admin'], ENV=buildenv, PLATFORM = platform, options = opts) | |||||
| Help('To build jackdmp you can set different options as listed below. You have to specify them only once, scons will save the latest values you set and re-use then. To really undo your settings and return to the factory defaults, remove the .sconsign.dblite and options.cache files from your BUILDDIR directory.') | |||||
| Help(opts.GenerateHelpText(env)) | |||||
| # update build settings | |||||
| if env['cc']: | |||||
| env['CC'] = env['cc'] | |||||
| if env['cxx']: | |||||
| env['CXX'] = env['cxx'] | |||||
| if env['ccflags']: | |||||
| env.Append(CCFLAGS=env['ccflags']) | |||||
| # Set version | |||||
| env['JACK_MAJOR_VERSION'] = JACK_MAJOR_VERSION | |||||
| env['JACK_MINOR_VERSION'] = JACK_MINOR_VERSION | |||||
| env['JACK_MICRO_VERSION'] = JACK_MICRO_VERSION | |||||
| env['JACK_SVNREVISION'] = JACK_SVNREVISION | |||||
| env['JACK_VERSION'] = JACK_VERSION | |||||
| env['JACKAPI_MAJOR_VERSION'] = JACKAPI_MAJOR_VERSION | |||||
| env['JACKAPI_MINOR_VERSION'] = JACKAPI_MINOR_VERSION | |||||
| env['JACKAPI_MICRO_VERSION'] = JACKAPI_MICRO_VERSION | |||||
| env['JACKAPI_VERSION'] = JACKAPI_VERSION | |||||
| # make sure the necessary dirs exist | |||||
| if not os.path.isdir('cache/' + build_base): | |||||
| os.makedirs('cache/' + build_base) | |||||
| if build_base: | |||||
| env['build_base']='#/'+build_base | |||||
| else: | |||||
| env['build_base']='#/' | |||||
| opts.Save('cache/' + build_base + 'options.cache', env) | |||||
| tests = {} | |||||
| tests.update(env['PKGCONFIG_TESTS']) | |||||
| if not env.GetOption('clean'): | |||||
| conf = Configure(env, | |||||
| custom_tests = tests, | |||||
| conf_dir = 'cache/' + build_base, | |||||
| log_file = 'cache/' + build_base + 'config.log') | |||||
| # Check if the environment can actually compile c-files by checking for a | |||||
| # header shipped with gcc | |||||
| if not conf.CheckHeader( 'stdio.h' ): | |||||
| print 'Error: It seems as if stdio.h is missing. This probably means that your build environment is broken, please make sure you have a working c-compiler and libstdc installed and usable.' | |||||
| Exit(1) | |||||
| # The following checks are for headers, libs and packages we depend on | |||||
| allpresent = 1; | |||||
| if env['BUILD_FOR_LINUX']: | |||||
| allpresent &= conf.CheckForPKGConfig('0.20'); | |||||
| if not allpresent: | |||||
| print "--> At least one of the dependencies is missing. I can't go on without it, please install the needed packages (remember to also install the *-devel packages)" | |||||
| Exit(1) | |||||
| # Optional checks follow: | |||||
| if env['BUILD_FOR_LINUX'] and env['ENABLE_ALSA']: | |||||
| env['ALSA_FLAGS'] = conf.GetPKGFlags('alsa', '1.0.0') | |||||
| if env['ALSA_FLAGS'] == 0: | |||||
| print "--> Disabling 'alsa' backend since no useful ALSA installation found" | |||||
| env['ENABLE_ALSA'] = False | |||||
| if env['BUILD_FOR_LINUX'] and env['ENABLE_FREEBOB']: | |||||
| env['FREEBOB_FLAGS'] = conf.GetPKGFlags('libfreebob', '1.0.0') | |||||
| if env['FREEBOB_FLAGS'] == 0: | |||||
| print "--> Disabling 'freebob' backend since no useful FreeBoB installation found" | |||||
| env['ENABLE_FREEBOB'] = False | |||||
| if env['BUILD_FOR_LINUX'] and env['ENABLE_FIREWIRE']: | |||||
| env['FFADO_FLAGS'] = conf.GetPKGFlags('libffado', '1.999.17') | |||||
| if env['FFADO_FLAGS'] == 0: | |||||
| print "--> Disabling 'firewire' backend since no useful FFADO installation found" | |||||
| env['ENABLE_FIREWIRE'] = False | |||||
| env = conf.Finish() | |||||
| if env['DEBUG']: | |||||
| print '--> Doing a DEBUG build' | |||||
| # TODO: -Werror could be added to, which would force the devs to really remove all the warnings :-) | |||||
| env.AppendUnique(CCFLAGS = ['-DDEBUG', '-Wall', '-g']) | |||||
| env.AppendUnique(LINKFLAGS = ['-g']) | |||||
| else: | |||||
| env.AppendUnique(CCFLAGS = ['-O3','-DNDEBUG']) | |||||
| env.AppendUnique(CCFLAGS = ['-fPIC', '-DSOCKET_RPC_FIFO_SEMA', '-D__SMP__']) | |||||
| env.AppendUnique(CFLAGS = ['-fPIC', '-DUSE_POSIX_SHM']) | |||||
| # used for alsa midi code, probably this define should be removed | |||||
| env.AppendUnique(CFLAGS = ['-DJACKMP']) | |||||
| env.AppendUnique(CPPFLAGS = ['-DJACKMP']) | |||||
| env['PREFIX'] = env.subst(env['PREFIX']) | |||||
| env['BINDIR'] = env.subst(env['BINDIR']) | |||||
| env['LIBDIR'] = env.subst(env['LIBDIR']) | |||||
| env['INCLUDEDIR'] = env.subst(env['INCLUDEDIR']) | |||||
| env['SERVER'] = 'jackd' | |||||
| env['CLIENTLIB'] = 'jack' | |||||
| env['SERVERLIB'] = 'jackserver' | |||||
| env['ADDON_DIR'] = env.subst(env['LIBDIR']) + "/jack" | |||||
| env['INSTALL_ADDON_DIR'] = env['DESTDIR'] + env.subst(env['LIBDIR']) + "/jack" | |||||
| env['INSTALL_PREFIX'] = env['DESTDIR'] + env['PREFIX'] | |||||
| env['INSTALL_BINDIR'] = env['DESTDIR'] + env['BINDIR'] | |||||
| env['INSTALL_LIBDIR'] = env['DESTDIR'] + env['LIBDIR'] | |||||
| env['INSTALL_INCLUDEDIR'] = env['DESTDIR'] + env['INCLUDEDIR'] + '/jack' | |||||
| env.Alias('install', env['INSTALL_LIBDIR']) | |||||
| env.Alias('install', env['INSTALL_INCLUDEDIR']) | |||||
| env.Alias('install', env['INSTALL_BINDIR']) | |||||
| env.Alias('install', env['INSTALL_ADDON_DIR']) | |||||
| env.ScanReplace('jack.pc.in') | |||||
| # jack.pc is always updated in case of config changes | |||||
| # (PREFIX or JACK_VERSION for instance) | |||||
| AlwaysBuild('jack.pc') | |||||
| pkg_config_dir = env['INSTALL_LIBDIR']+"/pkgconfig/" | |||||
| env.Install(pkg_config_dir, 'jack.pc') | |||||
| env.Alias('install', pkg_config_dir) | |||||
| env['BINDIR']=env.subst(env['BINDIR']) | |||||
| # To have the top_srcdir as the doxygen-script is used from auto* | |||||
| env['top_srcdir'] = env.Dir('.').abspath | |||||
| # for config.h.in | |||||
| env['JACK_LOCATION']=env.subst(env['BINDIR']) | |||||
| env.ScanReplace( 'config.h.in' ) | |||||
| # just like jack.pc, config.h is always updated in case of config changes | |||||
| # (PREFIX or JACK_VERSION for instance) | |||||
| AlwaysBuild('config.h') | |||||
| # Ensure we have a path to where the libraries are | |||||
| env.AppendUnique(LIBPATH=['#/common']) | |||||
| # | |||||
| # Build section | |||||
| # | |||||
| if env['BUILD_DOXYGEN_DOCS']: | |||||
| env.Doxygen('doxyfile') | |||||
| subdirs=['common'] | |||||
| if env['PLATFORM'] == 'posix': | |||||
| subdirs.append('linux') | |||||
| if env['ENABLE_DBUS']: | |||||
| subdirs.append('linux/dbus') | |||||
| env.AppendUnique(CCFLAGS = ['-DJACK_DBUS']) | |||||
| # TODO FOR Marc: make macosx/SConscript work right | |||||
| if env['PLATFORM'] == 'macosx': | |||||
| subdirs.append('macosx') | |||||
| # TODO FOR Marc: create/check windows/SConscript | |||||
| #if env['PLATFORM'] == 'windows': | |||||
| # subdirs.append('windows') | |||||
| if env['BUILD_EXAMPLES']: | |||||
| subdirs.append('example-clients') | |||||
| if env['BUILD_TESTS']: | |||||
| subdirs.append('tests') | |||||
| if build_base: | |||||
| env.SConscript(dirs=subdirs, exports='env', build_dir=build_base+subdir) | |||||
| else: | |||||
| env.SConscript(dirs=subdirs, exports='env') | |||||
| @@ -1,456 +0,0 @@ | |||||
| #!/usr/bin/python | |||||
| # | |||||
| # Copyright (C) 2007 Arnold Krille | |||||
| # | |||||
| # This file originates from FFADO (www.ffado.org) | |||||
| # | |||||
| # This program is free software: you can redistribute it and/or modify | |||||
| # it under the terms of the GNU General Public License as published by | |||||
| # the Free Software Foundation, either version 3 of the License, or | |||||
| # (at your option) any later version. | |||||
| # | |||||
| # This program is distributed in the hope that it will be useful, | |||||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| # GNU General Public License for more details. | |||||
| # | |||||
| # You should have received a copy of the GNU General Public License | |||||
| # along with this program. If not, see <http://www.gnu.org/licenses/>. | |||||
| # | |||||
| # | |||||
| # Astxx, the Asterisk C++ API and Utility Library. | |||||
| # Copyright (C) 2005, 2006 Matthew A. Nicholson | |||||
| # Copyright (C) 2006 Tim Blechmann | |||||
| # | |||||
| # This library is free software; you can redistribute it and/or | |||||
| # modify it under the terms of the GNU Lesser General Public | |||||
| # License version 2.1 as published by the Free Software Foundation. | |||||
| # | |||||
| # This library is distributed in the hope that it will be useful, | |||||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||||
| # Lesser General Public License for more details. | |||||
| # | |||||
| # You should have received a copy of the GNU Lesser General Public | |||||
| # License along with this library; if not, write to the Free Software | |||||
| # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||||
| import os | |||||
| import os.path | |||||
| import glob | |||||
| from fnmatch import fnmatch | |||||
| def DoxyfileParse(file_contents): | |||||
| """ | |||||
| Parse a Doxygen source file and return a dictionary of all the values. | |||||
| Values will be strings and lists of strings. | |||||
| """ | |||||
| data = {} | |||||
| import shlex | |||||
| lex = shlex.shlex(instream = file_contents, posix = True) | |||||
| lex.wordchars += "*+./-:" | |||||
| lex.whitespace = lex.whitespace.replace("\n", "") | |||||
| lex.escape = "" | |||||
| lineno = lex.lineno | |||||
| token = lex.get_token() | |||||
| key = token # the first token should be a key | |||||
| last_token = "" | |||||
| key_token = False | |||||
| next_key = False | |||||
| new_data = True | |||||
| def append_data(data, key, new_data, token): | |||||
| if new_data or len(data[key]) == 0: | |||||
| data[key].append(token) | |||||
| else: | |||||
| data[key][-1] += token | |||||
| while token: | |||||
| if token in ['\n']: | |||||
| if last_token not in ['\\']: | |||||
| key_token = True | |||||
| elif token in ['\\']: | |||||
| pass | |||||
| elif key_token: | |||||
| key = token | |||||
| key_token = False | |||||
| else: | |||||
| if token == "+=": | |||||
| if not data.has_key(key): | |||||
| data[key] = list() | |||||
| elif token == "=": | |||||
| data[key] = list() | |||||
| else: | |||||
| append_data( data, key, new_data, token ) | |||||
| new_data = True | |||||
| last_token = token | |||||
| token = lex.get_token() | |||||
| if last_token == '\\' and token != '\n': | |||||
| new_data = False | |||||
| append_data( data, key, new_data, '\\' ) | |||||
| # compress lists of len 1 into single strings | |||||
| for (k, v) in data.items(): | |||||
| if len(v) == 0: | |||||
| data.pop(k) | |||||
| # items in the following list will be kept as lists and not converted to strings | |||||
| if k in ["INPUT", "FILE_PATTERNS", "EXCLUDE_PATTERNS"]: | |||||
| continue | |||||
| if len(v) == 1: | |||||
| data[k] = v[0] | |||||
| return data | |||||
| def DoxySourceScan(node, env, path): | |||||
| """ | |||||
| Doxygen Doxyfile source scanner. This should scan the Doxygen file and add | |||||
| any files used to generate docs to the list of source files. | |||||
| """ | |||||
| default_file_patterns = [ | |||||
| '*.c', '*.cc', '*.cxx', '*.cpp', '*.c++', '*.java', '*.ii', '*.ixx', | |||||
| '*.ipp', '*.i++', '*.inl', '*.h', '*.hh ', '*.hxx', '*.hpp', '*.h++', | |||||
| '*.idl', '*.odl', '*.cs', '*.php', '*.php3', '*.inc', '*.m', '*.mm', | |||||
| '*.py', | |||||
| ] | |||||
| default_exclude_patterns = [ | |||||
| '*~', | |||||
| ] | |||||
| sources = [] | |||||
| data = DoxyfileParse(node.get_contents()) | |||||
| if data.get("RECURSIVE", "NO") == "YES": | |||||
| recursive = True | |||||
| else: | |||||
| recursive = False | |||||
| file_patterns = data.get("FILE_PATTERNS", default_file_patterns) | |||||
| exclude_patterns = data.get("EXCLUDE_PATTERNS", default_exclude_patterns) | |||||
| for node in data.get("INPUT", []): | |||||
| if os.path.isfile(node): | |||||
| sources.append(node) | |||||
| elif os.path.isdir(node): | |||||
| if recursive: | |||||
| for root, dirs, files in os.walk(node): | |||||
| for f in files: | |||||
| filename = os.path.join(root, f) | |||||
| pattern_check = reduce(lambda x, y: x or bool(fnmatch(filename, y)), file_patterns, False) | |||||
| exclude_check = reduce(lambda x, y: x and fnmatch(filename, y), exclude_patterns, True) | |||||
| if pattern_check and not exclude_check: | |||||
| sources.append(filename) | |||||
| else: | |||||
| for pattern in file_patterns: | |||||
| sources.extend(glob.glob("/".join([node, pattern]))) | |||||
| sources = map( lambda path: env.File(path), sources ) | |||||
| return sources | |||||
| def DoxySourceScanCheck(node, env): | |||||
| """Check if we should scan this file""" | |||||
| return os.path.isfile(node.path) | |||||
| def DoxyEmitter(source, target, env): | |||||
| """Doxygen Doxyfile emitter""" | |||||
| # possible output formats and their default values and output locations | |||||
| output_formats = { | |||||
| "HTML": ("YES", "html"), | |||||
| "LATEX": ("YES", "latex"), | |||||
| "RTF": ("NO", "rtf"), | |||||
| "MAN": ("YES", "man"), | |||||
| "XML": ("NO", "xml"), | |||||
| } | |||||
| data = DoxyfileParse(source[0].get_contents()) | |||||
| targets = [] | |||||
| out_dir = data.get("OUTPUT_DIRECTORY", ".") | |||||
| # add our output locations | |||||
| for (k, v) in output_formats.items(): | |||||
| if data.get("GENERATE_" + k, v[0]) == "YES": | |||||
| targets.append(env.Dir( os.path.join(out_dir, data.get(k + "_OUTPUT", v[1]))) ) | |||||
| # don't clobber targets | |||||
| for node in targets: | |||||
| env.Precious(node) | |||||
| # set up cleaning stuff | |||||
| for node in targets: | |||||
| env.Clean(node, node) | |||||
| return (targets, source) | |||||
| def generate(env): | |||||
| """ | |||||
| Add builders and construction variables for the | |||||
| Doxygen tool. This is currently for Doxygen 1.4.6. | |||||
| """ | |||||
| doxyfile_scanner = env.Scanner( | |||||
| DoxySourceScan, | |||||
| "DoxySourceScan", | |||||
| scan_check = DoxySourceScanCheck, | |||||
| ) | |||||
| import SCons.Builder | |||||
| doxyfile_builder = SCons.Builder.Builder( | |||||
| action = "cd ${SOURCE.dir} && ${DOXYGEN} ${SOURCE.file}", | |||||
| emitter = DoxyEmitter, | |||||
| target_factory = env.fs.Entry, | |||||
| single_source = True, | |||||
| source_scanner = doxyfile_scanner, | |||||
| ) | |||||
| env.Append(BUILDERS = { | |||||
| 'Doxygen': doxyfile_builder, | |||||
| }) | |||||
| env.AppendUnique( | |||||
| DOXYGEN = 'doxygen', | |||||
| ) | |||||
| def exists(env): | |||||
| """ | |||||
| Make sure doxygen exists. | |||||
| """ | |||||
| return env.Detect("doxygen") | |||||
| #!/usr/bin/python | |||||
| # | |||||
| # Copyright (C) 2007 Arnold Krille | |||||
| # | |||||
| # This file originates from FFADO (www.ffado.org) | |||||
| # | |||||
| # This program is free software: you can redistribute it and/or modify | |||||
| # it under the terms of the GNU General Public License as published by | |||||
| # the Free Software Foundation, either version 3 of the License, or | |||||
| # (at your option) any later version. | |||||
| # | |||||
| # This program is distributed in the hope that it will be useful, | |||||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| # GNU General Public License for more details. | |||||
| # | |||||
| # You should have received a copy of the GNU General Public License | |||||
| # along with this program. If not, see <http://www.gnu.org/licenses/>. | |||||
| # | |||||
| # | |||||
| # Astxx, the Asterisk C++ API and Utility Library. | |||||
| # Copyright (C) 2005, 2006 Matthew A. Nicholson | |||||
| # Copyright (C) 2006 Tim Blechmann | |||||
| # | |||||
| # This library is free software; you can redistribute it and/or | |||||
| # modify it under the terms of the GNU Lesser General Public | |||||
| # License version 2.1 as published by the Free Software Foundation. | |||||
| # | |||||
| # This library is distributed in the hope that it will be useful, | |||||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||||
| # Lesser General Public License for more details. | |||||
| # | |||||
| # You should have received a copy of the GNU Lesser General Public | |||||
| # License along with this library; if not, write to the Free Software | |||||
| # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||||
| import os | |||||
| import os.path | |||||
| import glob | |||||
| from fnmatch import fnmatch | |||||
| def DoxyfileParse(file_contents): | |||||
| """ | |||||
| Parse a Doxygen source file and return a dictionary of all the values. | |||||
| Values will be strings and lists of strings. | |||||
| """ | |||||
| data = {} | |||||
| import shlex | |||||
| lex = shlex.shlex(instream = file_contents, posix = True) | |||||
| lex.wordchars += "*+./-:" | |||||
| lex.whitespace = lex.whitespace.replace("\n", "") | |||||
| lex.escape = "" | |||||
| lineno = lex.lineno | |||||
| token = lex.get_token() | |||||
| key = token # the first token should be a key | |||||
| last_token = "" | |||||
| key_token = False | |||||
| next_key = False | |||||
| new_data = True | |||||
| def append_data(data, key, new_data, token): | |||||
| if new_data or len(data[key]) == 0: | |||||
| data[key].append(token) | |||||
| else: | |||||
| data[key][-1] += token | |||||
| while token: | |||||
| if token in ['\n']: | |||||
| if last_token not in ['\\']: | |||||
| key_token = True | |||||
| elif token in ['\\']: | |||||
| pass | |||||
| elif key_token: | |||||
| key = token | |||||
| key_token = False | |||||
| else: | |||||
| if token == "+=": | |||||
| if not data.has_key(key): | |||||
| data[key] = list() | |||||
| elif token == "=": | |||||
| data[key] = list() | |||||
| else: | |||||
| append_data( data, key, new_data, token ) | |||||
| new_data = True | |||||
| last_token = token | |||||
| token = lex.get_token() | |||||
| if last_token == '\\' and token != '\n': | |||||
| new_data = False | |||||
| append_data( data, key, new_data, '\\' ) | |||||
| # compress lists of len 1 into single strings | |||||
| for (k, v) in data.items(): | |||||
| if len(v) == 0: | |||||
| data.pop(k) | |||||
| # items in the following list will be kept as lists and not converted to strings | |||||
| if k in ["INPUT", "FILE_PATTERNS", "EXCLUDE_PATTERNS"]: | |||||
| continue | |||||
| if len(v) == 1: | |||||
| data[k] = v[0] | |||||
| return data | |||||
| def DoxySourceScan(node, env, path): | |||||
| """ | |||||
| Doxygen Doxyfile source scanner. This should scan the Doxygen file and add | |||||
| any files used to generate docs to the list of source files. | |||||
| """ | |||||
| default_file_patterns = [ | |||||
| '*.c', '*.cc', '*.cxx', '*.cpp', '*.c++', '*.java', '*.ii', '*.ixx', | |||||
| '*.ipp', '*.i++', '*.inl', '*.h', '*.hh ', '*.hxx', '*.hpp', '*.h++', | |||||
| '*.idl', '*.odl', '*.cs', '*.php', '*.php3', '*.inc', '*.m', '*.mm', | |||||
| '*.py', | |||||
| ] | |||||
| default_exclude_patterns = [ | |||||
| '*~', | |||||
| ] | |||||
| sources = [] | |||||
| data = DoxyfileParse(node.get_contents()) | |||||
| if data.get("RECURSIVE", "NO") == "YES": | |||||
| recursive = True | |||||
| else: | |||||
| recursive = False | |||||
| file_patterns = data.get("FILE_PATTERNS", default_file_patterns) | |||||
| exclude_patterns = data.get("EXCLUDE_PATTERNS", default_exclude_patterns) | |||||
| for node in data.get("INPUT", []): | |||||
| if os.path.isfile(node): | |||||
| sources.append(node) | |||||
| elif os.path.isdir(node): | |||||
| if recursive: | |||||
| for root, dirs, files in os.walk(node): | |||||
| for f in files: | |||||
| filename = os.path.join(root, f) | |||||
| pattern_check = reduce(lambda x, y: x or bool(fnmatch(filename, y)), file_patterns, False) | |||||
| exclude_check = reduce(lambda x, y: x and fnmatch(filename, y), exclude_patterns, True) | |||||
| if pattern_check and not exclude_check: | |||||
| sources.append(filename) | |||||
| else: | |||||
| for pattern in file_patterns: | |||||
| sources.extend(glob.glob("/".join([node, pattern]))) | |||||
| sources = map( lambda path: env.File(path), sources ) | |||||
| return sources | |||||
| def DoxySourceScanCheck(node, env): | |||||
| """Check if we should scan this file""" | |||||
| return os.path.isfile(node.path) | |||||
| def DoxyEmitter(source, target, env): | |||||
| """Doxygen Doxyfile emitter""" | |||||
| # possible output formats and their default values and output locations | |||||
| output_formats = { | |||||
| "HTML": ("YES", "html"), | |||||
| "LATEX": ("YES", "latex"), | |||||
| "RTF": ("NO", "rtf"), | |||||
| "MAN": ("YES", "man"), | |||||
| "XML": ("NO", "xml"), | |||||
| } | |||||
| data = DoxyfileParse(source[0].get_contents()) | |||||
| targets = [] | |||||
| out_dir = data.get("OUTPUT_DIRECTORY", ".") | |||||
| # add our output locations | |||||
| for (k, v) in output_formats.items(): | |||||
| if data.get("GENERATE_" + k, v[0]) == "YES": | |||||
| targets.append(env.Dir( os.path.join(out_dir, data.get(k + "_OUTPUT", v[1]))) ) | |||||
| # don't clobber targets | |||||
| for node in targets: | |||||
| env.Precious(node) | |||||
| # set up cleaning stuff | |||||
| for node in targets: | |||||
| env.Clean(node, node) | |||||
| return (targets, source) | |||||
| def generate(env): | |||||
| """ | |||||
| Add builders and construction variables for the | |||||
| Doxygen tool. This is currently for Doxygen 1.4.6. | |||||
| """ | |||||
| doxyfile_scanner = env.Scanner( | |||||
| DoxySourceScan, | |||||
| "DoxySourceScan", | |||||
| scan_check = DoxySourceScanCheck, | |||||
| ) | |||||
| import SCons.Builder | |||||
| doxyfile_builder = SCons.Builder.Builder( | |||||
| action = "cd ${SOURCE.dir} && ${DOXYGEN} ${SOURCE.file}", | |||||
| emitter = DoxyEmitter, | |||||
| target_factory = env.fs.Entry, | |||||
| single_source = True, | |||||
| source_scanner = doxyfile_scanner, | |||||
| ) | |||||
| env.Append(BUILDERS = { | |||||
| 'Doxygen': doxyfile_builder, | |||||
| }) | |||||
| env.AppendUnique( | |||||
| DOXYGEN = 'doxygen', | |||||
| ) | |||||
| def exists(env): | |||||
| """ | |||||
| Make sure doxygen exists. | |||||
| """ | |||||
| return env.Detect("doxygen") | |||||
| @@ -1,274 +0,0 @@ | |||||
| #!/usr/bin/python | |||||
| # | |||||
| # Copyright (C) 2007 Arnold Krille | |||||
| # | |||||
| # This file originates from FFADO (www.ffado.org) | |||||
| # | |||||
| # This program is free software: you can redistribute it and/or modify | |||||
| # it under the terms of the GNU General Public License as published by | |||||
| # the Free Software Foundation, either version 3 of the License, or | |||||
| # (at your option) any later version. | |||||
| # | |||||
| # This program is distributed in the hope that it will be useful, | |||||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| # GNU General Public License for more details. | |||||
| # | |||||
| # You should have received a copy of the GNU General Public License | |||||
| # along with this program. If not, see <http://www.gnu.org/licenses/>. | |||||
| # | |||||
| # | |||||
| # Taken from http://www.scons.org/wiki/UsingPkgConfig | |||||
| # and heavily modified | |||||
| # | |||||
| # | |||||
| # Checks for pkg-config | |||||
| # | |||||
| def CheckForPKGConfig( context, version='0.0.0' ): | |||||
| context.Message( "Checking for pkg-config (at least version %s)... " % version ) | |||||
| ret = context.TryAction( "pkg-config --atleast-pkgconfig-version=%s" %version )[0] | |||||
| context.Result( ret ) | |||||
| return ret | |||||
| # | |||||
| # Checks for the given package with an optional version-requirement | |||||
| # | |||||
| # The flags (which can be imported into the environment by env.MergeFlags(...) | |||||
| # are exported as env['NAME_FLAGS'] where name is built by removing all +,-,. | |||||
| # and upper-casing. | |||||
| # | |||||
| def CheckForPKG( context, name, version="" ): | |||||
| name2 = name.replace("+","").replace(".","").replace("-","") | |||||
| if version == "": | |||||
| context.Message( "Checking for %s... \t" % name ) | |||||
| ret = context.TryAction( "pkg-config --exists '%s'" % name )[0] | |||||
| else: | |||||
| context.Message( "Checking for %s (%s or higher)... \t" % (name,version) ) | |||||
| ret = context.TryAction( "pkg-config --atleast-version=%s '%s'" % (version,name) )[0] | |||||
| if ret: | |||||
| context.env['%s_FLAGS' % name2.upper()] = context.env.ParseFlags("!pkg-config --cflags --libs %s" % name) | |||||
| context.Result( ret ) | |||||
| return ret | |||||
| # | |||||
| # Checks for the existance of the package and returns the packages flags. | |||||
| # | |||||
| # This should allow caching of the flags so that pkg-config is called only once. | |||||
| # | |||||
| def GetPKGFlags( context, name, version="" ): | |||||
| import os | |||||
| if version == "": | |||||
| context.Message( "Checking for %s... \t" % name ) | |||||
| ret = context.TryAction( "pkg-config --exists '%s'" % name )[0] | |||||
| else: | |||||
| context.Message( "Checking for %s (%s or higher)... \t" % (name,version) ) | |||||
| ret = context.TryAction( "pkg-config --atleast-version=%s '%s'" % (version,name) )[0] | |||||
| if not ret: | |||||
| context.Result( ret ) | |||||
| return ret | |||||
| out = os.popen2( "pkg-config --cflags --libs %s" % name )[1] | |||||
| ret = out.read() | |||||
| context.Result( True ) | |||||
| return ret | |||||
| def GetPKGPrefix( context, name ): | |||||
| import os | |||||
| out = os.popen2( "pkg-config --variable=prefix %s" % name )[1] | |||||
| ret = out.read() | |||||
| ret = ret.replace ( "\n", "" ) | |||||
| context.Message( " getting prefix... \t" ) | |||||
| context.Result( True ) | |||||
| return ret | |||||
| def GetPKGExecPrefix( context, name ): | |||||
| import os | |||||
| out = os.popen2( "pkg-config --variable=exec_prefix %s" % name )[1] | |||||
| ret = out.read() | |||||
| ret = ret.replace ( "\n", "" ) | |||||
| context.Message( " getting exec prefix... \t" ) | |||||
| context.Result( True ) | |||||
| return ret | |||||
| def GetPKGIncludedir( context, name ): | |||||
| import os | |||||
| out = os.popen2( "pkg-config --variable=includedir %s" % name )[1] | |||||
| ret = out.read() | |||||
| ret = ret.replace ( "\n", "" ) | |||||
| context.Message( " getting include dir... \t" ) | |||||
| context.Result( True ) | |||||
| return ret | |||||
| def GetPKGLibdir( context, name ): | |||||
| import os | |||||
| out = os.popen2( "pkg-config --variable=libdir %s" % name )[1] | |||||
| ret = out.read() | |||||
| ret = ret.replace ( "\n", "" ) | |||||
| context.Message( " getting lib dir... \t" ) | |||||
| context.Result( True ) | |||||
| return ret | |||||
| def generate( env, **kw ): | |||||
| env['PKGCONFIG_TESTS' ] = { | |||||
| 'CheckForPKGConfig' : CheckForPKGConfig, | |||||
| 'CheckForPKG' : CheckForPKG, | |||||
| 'GetPKGFlags' : GetPKGFlags, | |||||
| 'GetPKGPrefix' : GetPKGPrefix, | |||||
| 'GetPKGExecPrefix' : GetPKGExecPrefix, | |||||
| 'GetPKGIncludedir' : GetPKGIncludedir, | |||||
| 'GetPKGLibdir' : GetPKGLibdir, | |||||
| } | |||||
| def exists( env ): | |||||
| return 1 | |||||
| #!/usr/bin/python | |||||
| # | |||||
| # Copyright (C) 2007 Arnold Krille | |||||
| # | |||||
| # This file originates from FFADO (www.ffado.org) | |||||
| # | |||||
| # This program is free software: you can redistribute it and/or modify | |||||
| # it under the terms of the GNU General Public License as published by | |||||
| # the Free Software Foundation, either version 3 of the License, or | |||||
| # (at your option) any later version. | |||||
| # | |||||
| # This program is distributed in the hope that it will be useful, | |||||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| # GNU General Public License for more details. | |||||
| # | |||||
| # You should have received a copy of the GNU General Public License | |||||
| # along with this program. If not, see <http://www.gnu.org/licenses/>. | |||||
| # | |||||
| # | |||||
| # Taken from http://www.scons.org/wiki/UsingPkgConfig | |||||
| # and heavily modified | |||||
| # | |||||
| # | |||||
| # Checks for pkg-config | |||||
| # | |||||
| def CheckForPKGConfig( context, version='0.0.0' ): | |||||
| context.Message( "Checking for pkg-config (at least version %s)... " % version ) | |||||
| ret = context.TryAction( "pkg-config --atleast-pkgconfig-version=%s" %version )[0] | |||||
| context.Result( ret ) | |||||
| return ret | |||||
| # | |||||
| # Checks for the given package with an optional version-requirement | |||||
| # | |||||
| # The flags (which can be imported into the environment by env.MergeFlags(...) | |||||
| # are exported as env['NAME_FLAGS'] where name is built by removing all +,-,. | |||||
| # and upper-casing. | |||||
| # | |||||
| def CheckForPKG( context, name, version="" ): | |||||
| name2 = name.replace("+","").replace(".","").replace("-","") | |||||
| if version == "": | |||||
| context.Message( "Checking for %s... \t" % name ) | |||||
| ret = context.TryAction( "pkg-config --exists '%s'" % name )[0] | |||||
| else: | |||||
| context.Message( "Checking for %s (%s or higher)... \t" % (name,version) ) | |||||
| ret = context.TryAction( "pkg-config --atleast-version=%s '%s'" % (version,name) )[0] | |||||
| if ret: | |||||
| context.env['%s_FLAGS' % name2.upper()] = context.env.ParseFlags("!pkg-config --cflags --libs %s" % name) | |||||
| context.Result( ret ) | |||||
| return ret | |||||
| # | |||||
| # Checks for the existance of the package and returns the packages flags. | |||||
| # | |||||
| # This should allow caching of the flags so that pkg-config is called only once. | |||||
| # | |||||
| def GetPKGFlags( context, name, version="" ): | |||||
| import os | |||||
| if version == "": | |||||
| context.Message( "Checking for %s... \t" % name ) | |||||
| ret = context.TryAction( "pkg-config --exists '%s'" % name )[0] | |||||
| else: | |||||
| context.Message( "Checking for %s (%s or higher)... \t" % (name,version) ) | |||||
| ret = context.TryAction( "pkg-config --atleast-version=%s '%s'" % (version,name) )[0] | |||||
| if not ret: | |||||
| context.Result( ret ) | |||||
| return ret | |||||
| out = os.popen2( "pkg-config --cflags --libs %s" % name )[1] | |||||
| ret = out.read() | |||||
| context.Result( True ) | |||||
| return ret | |||||
| def GetPKGPrefix( context, name ): | |||||
| import os | |||||
| out = os.popen2( "pkg-config --variable=prefix %s" % name )[1] | |||||
| ret = out.read() | |||||
| ret = ret.replace ( "\n", "" ) | |||||
| context.Message( " getting prefix... \t" ) | |||||
| context.Result( True ) | |||||
| return ret | |||||
| def GetPKGExecPrefix( context, name ): | |||||
| import os | |||||
| out = os.popen2( "pkg-config --variable=exec_prefix %s" % name )[1] | |||||
| ret = out.read() | |||||
| ret = ret.replace ( "\n", "" ) | |||||
| context.Message( " getting exec prefix... \t" ) | |||||
| context.Result( True ) | |||||
| return ret | |||||
| def GetPKGIncludedir( context, name ): | |||||
| import os | |||||
| out = os.popen2( "pkg-config --variable=includedir %s" % name )[1] | |||||
| ret = out.read() | |||||
| ret = ret.replace ( "\n", "" ) | |||||
| context.Message( " getting include dir... \t" ) | |||||
| context.Result( True ) | |||||
| return ret | |||||
| def GetPKGLibdir( context, name ): | |||||
| import os | |||||
| out = os.popen2( "pkg-config --variable=libdir %s" % name )[1] | |||||
| ret = out.read() | |||||
| ret = ret.replace ( "\n", "" ) | |||||
| context.Message( " getting lib dir... \t" ) | |||||
| context.Result( True ) | |||||
| return ret | |||||
| def generate( env, **kw ): | |||||
| env['PKGCONFIG_TESTS' ] = { | |||||
| 'CheckForPKGConfig' : CheckForPKGConfig, | |||||
| 'CheckForPKG' : CheckForPKG, | |||||
| 'GetPKGFlags' : GetPKGFlags, | |||||
| 'GetPKGPrefix' : GetPKGPrefix, | |||||
| 'GetPKGExecPrefix' : GetPKGExecPrefix, | |||||
| 'GetPKGIncludedir' : GetPKGIncludedir, | |||||
| 'GetPKGLibdir' : GetPKGLibdir, | |||||
| } | |||||
| def exists( env ): | |||||
| return 1 | |||||
| @@ -1,80 +0,0 @@ | |||||
| #!/usr/bin/python | |||||
| # | |||||
| # Copyright (C) 2007 Arnold Krille | |||||
| # | |||||
| # This file originates from FFADO (www.ffado.org) | |||||
| # | |||||
| # This program is free software: you can redistribute it and/or modify | |||||
| # it under the terms of the GNU General Public License as published by | |||||
| # the Free Software Foundation, either version 3 of the License, or | |||||
| # (at your option) any later version. | |||||
| # | |||||
| # This program is distributed in the hope that it will be useful, | |||||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| # GNU General Public License for more details. | |||||
| # | |||||
| # You should have received a copy of the GNU General Public License | |||||
| # along with this program. If not, see <http://www.gnu.org/licenses/>. | |||||
| # | |||||
| # | |||||
| # Taken from http://www.scons.org/wiki/ReplacementBuilder | |||||
| # | |||||
| from string import Template | |||||
| def replace_action(target, source, env): | |||||
| open( str(target[0]), 'w' ).write( Template( open( str(source[0]), 'r' ).read() ).safe_substitute( env ) ) | |||||
| return 0 | |||||
| def replace_string(target, source, env): | |||||
| return "building '%s' from '%s'" % ( str(target[0]), str(source[0]) ) | |||||
| def generate(env, **kw): | |||||
| action = env.Action( replace_action, replace_string ) | |||||
| env['BUILDERS']['ScanReplace'] = env.Builder( action=action, src_suffix='.in', single_source=True ) | |||||
| def exists(env): | |||||
| return 1 | |||||
| #!/usr/bin/python | |||||
| # | |||||
| # Copyright (C) 2007 Arnold Krille | |||||
| # | |||||
| # This file originates from FFADO (www.ffado.org) | |||||
| # | |||||
| # This program is free software: you can redistribute it and/or modify | |||||
| # it under the terms of the GNU General Public License as published by | |||||
| # the Free Software Foundation, either version 3 of the License, or | |||||
| # (at your option) any later version. | |||||
| # | |||||
| # This program is distributed in the hope that it will be useful, | |||||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| # GNU General Public License for more details. | |||||
| # | |||||
| # You should have received a copy of the GNU General Public License | |||||
| # along with this program. If not, see <http://www.gnu.org/licenses/>. | |||||
| # | |||||
| # | |||||
| # Taken from http://www.scons.org/wiki/ReplacementBuilder | |||||
| # | |||||
| from string import Template | |||||
| def replace_action(target, source, env): | |||||
| open( str(target[0]), 'w' ).write( Template( open( str(source[0]), 'r' ).read() ).safe_substitute( env ) ) | |||||
| return 0 | |||||
| def replace_string(target, source, env): | |||||
| return "building '%s' from '%s'" % ( str(target[0]), str(source[0]) ) | |||||
| def generate(env, **kw): | |||||
| action = env.Action( replace_action, replace_string ) | |||||
| env['BUILDERS']['ScanReplace'] = env.Builder( action=action, src_suffix='.in', single_source=True ) | |||||
| def exists(env): | |||||
| return 1 | |||||
| @@ -1,208 +0,0 @@ | |||||
| # | |||||
| # Copyright (C) 2007 Arnold Krille | |||||
| # Copyright (C) 2007 Pieter Palmers | |||||
| # Copyright (C) 2008 Marc-Olivier Barre | |||||
| # | |||||
| # This file originates from FFADO (www.ffado.org) | |||||
| # | |||||
| # This program is free software: you can redistribute it and/or modify | |||||
| # it under the terms of the GNU General Public License as published by | |||||
| # the Free Software Foundation, either version 3 of the License, or | |||||
| # (at your option) any later version. | |||||
| # | |||||
| # This program is distributed in the hope that it will be useful, | |||||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| # GNU General Public License for more details. | |||||
| # | |||||
| # You should have received a copy of the GNU General Public License | |||||
| # along with this program. If not, see <http://www.gnu.org/licenses/>. | |||||
| # | |||||
| import os | |||||
| import glob | |||||
| from string import Template | |||||
| def pkg_config_get_value(module, args): | |||||
| return env.backtick('pkg-config ' + args + ' ' + module).strip() | |||||
| def merge_pkg_config_append_string(env, envvar, module, args): | |||||
| value = pkg_config_get_value(module, args) | |||||
| #print value | |||||
| if env._dict.has_key(envvar): | |||||
| env._dict[envvar] += value | |||||
| else: | |||||
| env._dict[envvar] = value | |||||
| def merge_pkg_config_libs(env, module): | |||||
| for lib in pkg_config_get_value(module, "--libs").split(' '): | |||||
| if lib[:2] == '-l': | |||||
| env._dict['LIBS'].append(lib[2:]) | |||||
| elif lib[:2] == '-L': | |||||
| env._dict['LIBPATH'].append(lib[2:]) | |||||
| def merge_pkg_config_variable(env, envvar, module, pkgvar): | |||||
| merge_pkg_config_append_string(env, envvar, module, '--variable=' + pkgvar) | |||||
| def merge_pkg_config_std(env, module): | |||||
| merge_pkg_config_append_string(env, 'CCFLAGS', module, '--cflags') | |||||
| merge_pkg_config_libs(env, module) | |||||
| Import('env') | |||||
| # Paths where include files can be found | |||||
| env.AppendUnique(CPPPATH=['#/', '#/common', '#/common/jack']) | |||||
| # Needed libraries | |||||
| env.AppendUnique(LIBS=['rt', 'pthread']) | |||||
| # HACK: this should not be here ideally | |||||
| env.AppendUnique(CPPPATH=['#/linux','#/macosx']) | |||||
| # A symlinking command for our libraries' names | |||||
| symlinkcmd = 'rm -f $TARGET;ln -nsf $SOURCE.name $TARGET' | |||||
| # | |||||
| # Source files section | |||||
| # | |||||
| srcfiles_common_serverlib = [ | |||||
| 'JackActivationCount.cpp', | |||||
| 'JackAPI.cpp', | |||||
| 'JackAudioDriver.cpp', | |||||
| 'JackClient.cpp', | |||||
| 'JackConnectionManager.cpp', | |||||
| 'JackDriver.cpp', | |||||
| 'JackNetTool.cpp', | |||||
| 'JackEngine.cpp', | |||||
| 'JackEngineControl.cpp', | |||||
| 'JackError.cpp', | |||||
| 'JackExternalClient.cpp', | |||||
| 'JackFrameTimer.cpp', | |||||
| 'JackFreewheelDriver.cpp', | |||||
| 'JackGraphManager.cpp', | |||||
| 'JackInternalClient.cpp', | |||||
| 'JackPort.cpp', | |||||
| 'JackPosixSemaphore.cpp', | |||||
| 'JackPosixThread.cpp', | |||||
| 'JackFifo.cpp', | |||||
| 'JackLoopbackDriver.cpp', | |||||
| 'JackPortType.cpp', | |||||
| 'JackAudioPort.cpp', | |||||
| 'JackMidiPort.cpp', | |||||
| 'JackMidiAPI.cpp', | |||||
| 'JackServer.cpp', | |||||
| 'JackShmMem.cpp', | |||||
| 'JackThreadedDriver.cpp', | |||||
| 'JackWaitThreadedDriver.cpp', | |||||
| 'shm.c', | |||||
| 'JackSocket.cpp', | |||||
| 'JackSocketServerChannel.cpp', | |||||
| 'JackSocketNotifyChannel.cpp', | |||||
| 'JackSocketServerNotifyChannel.cpp', | |||||
| 'JackTime.c', | |||||
| 'JackServerAPI.cpp', | |||||
| 'JackGlobals.cpp', | |||||
| 'JackDriverLoader.cpp', | |||||
| 'JackDebugClient.cpp', | |||||
| 'JackTransportEngine.cpp', | |||||
| 'JackServerGlobals.cpp', | |||||
| 'timestamps.c', | |||||
| 'JackTools.cpp', | |||||
| 'ringbuffer.c', | |||||
| 'JackControl.cpp', | |||||
| 'JackMessageBuffer.cpp', | |||||
| 'JackProcessSync.cpp' | |||||
| ] | |||||
| srcfiles_common_clientlib = [ | |||||
| 'JackActivationCount.cpp', | |||||
| 'JackAPI.cpp', | |||||
| 'JackClient.cpp', | |||||
| 'JackConnectionManager.cpp', | |||||
| 'ringbuffer.c', | |||||
| 'JackServerLaunch.cpp', | |||||
| 'JackError.cpp', | |||||
| 'JackFrameTimer.cpp', | |||||
| 'JackGraphManager.cpp', | |||||
| 'JackLibClient.cpp', | |||||
| 'JackLibAPI.cpp', | |||||
| 'JackPort.cpp', | |||||
| 'JackPosixSemaphore.cpp', | |||||
| 'JackFifo.cpp', | |||||
| 'JackPortType.cpp', | |||||
| 'JackAudioPort.cpp', | |||||
| 'JackMidiPort.cpp', | |||||
| 'JackMidiAPI.cpp', | |||||
| 'JackEngineControl.cpp', | |||||
| 'JackPosixThread.cpp', | |||||
| 'JackShmMem.cpp', | |||||
| 'shm.c', | |||||
| 'JackSocket.cpp', | |||||
| 'JackSocketClientChannel.cpp', | |||||
| 'JackTime.c', | |||||
| 'JackGlobals.cpp', | |||||
| 'JackDebugClient.cpp', | |||||
| 'JackTransportEngine.cpp', | |||||
| 'timestamps.c', | |||||
| 'JackTools.cpp', | |||||
| 'JackMessageBuffer.cpp', | |||||
| 'JackProcessSync.cpp' | |||||
| ] | |||||
| jack_headers = [ | |||||
| 'intclient.h', | |||||
| 'jack.h', | |||||
| 'midiport.h', | |||||
| 'ringbuffer.h', | |||||
| 'statistics.h', | |||||
| 'thread.h', | |||||
| 'transport.h', | |||||
| 'types.h', | |||||
| 'control.h', | |||||
| 'jslist.h' | |||||
| ] | |||||
| # | |||||
| # Build/install section | |||||
| # | |||||
| # Libraries | |||||
| if env['ENABLE_DBUS']: | |||||
| merge_pkg_config_std(env, 'dbus-1') # actually we need this only for client lib | |||||
| # Each platform should get it's own environment | |||||
| libenv = env.Copy() | |||||
| if env['PLATFORM'] == 'posix': | |||||
| libenv.Append(SHLIBSUFFIX='.' + env['JACKAPI_VERSION']) | |||||
| libenv.Append(SHLINKFLAGS='-Wl,-soname,${str(TARGET.file).split(".")[0]}.so.' + str(env['JACKAPI_MAJOR_VERSION'])) | |||||
| libenv.AppendUnique(CCFLAGS = ['-fvisibility=hidden']) | |||||
| libenv.AppendUnique(CPPFLAGS = ['-fvisibility=hidden']) | |||||
| clientlib = libenv.SharedLibrary(env['CLIENTLIB'], srcfiles_common_clientlib) | |||||
| serverlib = libenv.SharedLibrary(env['SERVERLIB'], srcfiles_common_serverlib) | |||||
| env.Install( env['INSTALL_LIBDIR'], [clientlib, serverlib]) | |||||
| env.Alias('install', env['INSTALL_LIBDIR']) | |||||
| # Handle the way we name libraries on a POSIX system | |||||
| if env['PLATFORM'] == 'posix': | |||||
| libs = [(env['CLIENTLIB'], clientlib), (env['SERVERLIB'], serverlib)] | |||||
| for lib_name, lib in libs: | |||||
| env.Command('#/common/lib' + lib_name + '.so.' + str(env['JACKAPI_MAJOR_VERSION']), lib, symlinkcmd) | |||||
| env.Command('#/common/lib' + lib_name + '.so', '#/common/lib' + lib_name + '.so.' + str(env['JACKAPI_MAJOR_VERSION']), symlinkcmd) | |||||
| env.Command(env['INSTALL_LIBDIR'] + '/lib' + lib_name + '.so.' + str(env['JACKAPI_MAJOR_VERSION']), env['INSTALL_LIBDIR'] + '/lib' + lib_name + '.so.' + env['JACKAPI_VERSION'], symlinkcmd) | |||||
| env.Command(env['INSTALL_LIBDIR'] + '/lib' + lib_name + '.so', env['INSTALL_LIBDIR'] + '/lib' + lib_name + '.so.' + str(env['JACKAPI_MAJOR_VERSION']), symlinkcmd) | |||||
| env.Alias('install', env['INSTALL_LIBDIR'] + '/lib' + lib_name + '.so.' + str(env['JACKAPI_MAJOR_VERSION'])) | |||||
| # NetManager | |||||
| netmanagerenv = env.Copy() | |||||
| netmanagerenv.AppendUnique(CPPFLAGS = ['-fvisibility=hidden']) | |||||
| env.InstallAs(env['INSTALL_ADDON_DIR'] + '/netmanager.so', netmanagerenv.SharedLibrary('netmanager', 'JackNetManager.cpp')) | |||||
| env.Alias('install', env['INSTALL_ADDON_DIR'] + '/netmanager.so') | |||||
| # Headers | |||||
| for header in jack_headers: | |||||
| env.Install(env['INSTALL_INCLUDEDIR'], 'jack/' + header) | |||||
| @@ -1,98 +0,0 @@ | |||||
| # | |||||
| # Copyright (C) 2007 Arnold Krille | |||||
| # Copyright (C) 2007 Pieter Palmers | |||||
| # Copyright (C) 2008 Marc-Olivier Barre | |||||
| # | |||||
| # This file originates from FFADO (www.ffado.org) | |||||
| # | |||||
| # This program is free software: you can redistribute it and/or modify | |||||
| # it under the terms of the GNU General Public License as published by | |||||
| # the Free Software Foundation, either version 3 of the License, or | |||||
| # (at your option) any later version. | |||||
| # | |||||
| # This program is distributed in the hope that it will be useful, | |||||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| # GNU General Public License for more details. | |||||
| # | |||||
| # You should have received a copy of the GNU General Public License | |||||
| # along with this program. If not, see <http://www.gnu.org/licenses/>. | |||||
| # | |||||
| import os | |||||
| from string import Template | |||||
| Import('env') | |||||
| # paths where include files can be found | |||||
| env.AppendUnique(CPPPATH=['#/', '#/common']) | |||||
| # A symlinking command | |||||
| symlinkcmd = 'rm -f $TARGET;ln -nsf $SOURCE.name $TARGET' | |||||
| # | |||||
| # Source files section | |||||
| # | |||||
| example_programs = { | |||||
| 'jack_freewheel' : 'freewheel.c', | |||||
| 'jack_connect' : 'connect.c', | |||||
| 'jack_lsp' : 'lsp.c', | |||||
| 'jack_metro' : 'metro.c', | |||||
| 'jack_midiseq' : 'midiseq.c', | |||||
| 'jack_midisine' : 'midisine.c', | |||||
| 'jack_showtime' : 'showtime.c', | |||||
| 'jack_simple_client' : 'simple_client.c', | |||||
| 'jack_zombie' : 'zombie.c', | |||||
| 'jack_load' : 'ipload.c', | |||||
| 'jack_unload' : 'ipunload.c', | |||||
| 'jack_showtime' : 'showtime.c', | |||||
| 'jack_alias' : 'alias.c', | |||||
| 'jack_bufsize' : 'bufsize.c', | |||||
| 'jack_evmon' : 'evmon.c', | |||||
| 'jack_monitor_client' : 'monitor_client.c', | |||||
| } | |||||
| example_libs = { | |||||
| 'inprocess' : 'inprocess.c', | |||||
| } | |||||
| # Libraries to link | |||||
| extra_libs = {} | |||||
| for example_program in example_programs: | |||||
| extra_libs[example_program] = ['jack'] | |||||
| # TODO: we need to test for READLINE... is that even possible ? | |||||
| env['HAS_READLINE']=True | |||||
| if env['HAS_READLINE']: | |||||
| example_programs['jack_transport'] = 'transport.c' | |||||
| extra_libs['jack_transport'] = ['readline', 'jack', 'ncurses'] | |||||
| # TODO: we need to test for SNDFILE... | |||||
| env['HAS_SNDFILE']=True | |||||
| if env['HAS_SNDFILE']: | |||||
| example_programs['jack_rec'] = 'capture_client.c' | |||||
| extra_libs['jack_rec'] = ['sndfile', 'jack'] | |||||
| # | |||||
| # Build/install section | |||||
| # | |||||
| if env['BUILD_EXAMPLES']: | |||||
| clientenv = env.Copy() | |||||
| clientenv.PrependUnique(LIBPATH=env['build_base']) | |||||
| for example_program, example_program_source in example_programs.items(): | |||||
| clientenv.Program(example_program, example_program_source, LIBS=extra_libs[example_program]) | |||||
| if env['INSTALL_EXAMPLES']: | |||||
| clientenv.Install(env['INSTALL_BINDIR'], example_program) | |||||
| jack_disconnect_install_path = env['INSTALL_BINDIR'] + '/jack_disconnect' | |||||
| env.Command(jack_disconnect_install_path, 'jack_connect', symlinkcmd) | |||||
| env.Alias('install', jack_disconnect_install_path) | |||||
| for example_lib, example_lib_source in example_libs.items(): | |||||
| lib = clientenv.SharedLibrary(example_lib, example_lib_source) | |||||
| if clientenv['INSTALL_EXAMPLES']: | |||||
| env.InstallAs(env['INSTALL_ADDON_DIR'] + '/' + example_lib + '.so', lib) | |||||
| env.Alias('install', env['INSTALL_ADDON_DIR'] + '/' + example_lib + '.so') | |||||
| if env['ENABLE_DBUS']: | |||||
| clientenv.Install(env['BINDIR'], 'jack_control') | |||||
| @@ -1,92 +0,0 @@ | |||||
| # | |||||
| # Copyright (C) 2007 Arnold Krille | |||||
| # Copyright (C) 2007 Pieter Palmers | |||||
| # Copyright (C) 2008 Marc-Olivier Barre | |||||
| # | |||||
| # This file originates from FFADO (www.ffado.org) | |||||
| # | |||||
| # This program is free software: you can redistribute it and/or modify | |||||
| # it under the terms of the GNU General Public License as published by | |||||
| # the Free Software Foundation, either version 3 of the License, or | |||||
| # (at your option) any later version. | |||||
| # | |||||
| # This program is distributed in the hope that it will be useful, | |||||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| # GNU General Public License for more details. | |||||
| # | |||||
| # You should have received a copy of the GNU General Public License | |||||
| # along with this program. If not, see <http://www.gnu.org/licenses/>. | |||||
| # | |||||
| import os | |||||
| from string import Template | |||||
| Import( 'env' ) | |||||
| # paths where include files can be found | |||||
| env.AppendUnique( CPPPATH=['#/', '#/common', '#/common/jack', '#/linux'] ) | |||||
| # | |||||
| # Define the source files | |||||
| # | |||||
| srcfiles_linux_server = ['#/common/Jackdmp.cpp'] | |||||
| srcfiles_linux_alsa = [ | |||||
| 'JackAlsaDriver.cpp', | |||||
| 'alsa_rawmidi.c', | |||||
| 'alsa_seqmidi.c', | |||||
| 'alsa_midi_jackmp.cpp', | |||||
| 'memops.c', | |||||
| 'generic_hw.c', | |||||
| 'hdsp.c', | |||||
| 'hammerfall.c', | |||||
| 'ice1712.c' | |||||
| ] | |||||
| for i in range(len(srcfiles_linux_alsa)): | |||||
| srcfiles_linux_alsa[i] = 'alsa/%s' % srcfiles_linux_alsa[i] | |||||
| srcfiles_linux_freebob = ['freebob/JackFreebobDriver.cpp'] | |||||
| srcfiles_linux_ffado = ['firewire/JackFFADODriver.cpp'] | |||||
| srcfiles_linux_dummy = ['#/common/JackDummyDriver.cpp'] | |||||
| srcfiles_linux_net = ['#/common/JackNetDriver.cpp'] | |||||
| # | |||||
| # Start building | |||||
| # | |||||
| # build the server and its backends | |||||
| serverenv = env.Copy() | |||||
| serverenv.PrependUnique( LIBPATH=env['build_base'] ) | |||||
| serverenv.PrependUnique( LIBS=[env['SERVERLIB'], 'dl'] ) | |||||
| server = serverenv.Program(env['SERVER'], srcfiles_linux_server) | |||||
| serverenv.Install( env['INSTALL_BINDIR'], server ) | |||||
| driver_dir = env['INSTALL_ADDON_DIR'] + "/" | |||||
| drv = serverenv.SharedLibrary( 'jack_dummy', srcfiles_linux_dummy ) | |||||
| serverenv.InstallAs( driver_dir + "jack_dummy.so", drv ) | |||||
| drv = serverenv.SharedLibrary( 'jack_net', srcfiles_linux_net ) | |||||
| serverenv.InstallAs( driver_dir + "jack_net.so", drv ) | |||||
| if env['ENABLE_ALSA']: | |||||
| if not env.GetOption('clean'): | |||||
| serverenv.MergeFlags( env['ALSA_FLAGS'] ) | |||||
| drv = serverenv.SharedLibrary( 'jack_alsa', srcfiles_linux_alsa ) | |||||
| serverenv.InstallAs( driver_dir + "jack_alsa.so", drv ) | |||||
| if env['ENABLE_FREEBOB']: | |||||
| if not env.GetOption('clean'): | |||||
| serverenv.MergeFlags( env['FREEBOB_FLAGS'] ) | |||||
| drv = serverenv.SharedLibrary( 'jack_freebob', srcfiles_linux_freebob ) | |||||
| serverenv.InstallAs( driver_dir + "jack_freebob.so", drv ) | |||||
| if env['ENABLE_FIREWIRE']: | |||||
| if not env.GetOption('clean'): | |||||
| serverenv.MergeFlags( env['FFADO_FLAGS'] ) | |||||
| drv = serverenv.SharedLibrary( 'jack_firewire', srcfiles_linux_ffado ) | |||||
| serverenv.InstallAs( driver_dir + "jack_firewire.so", drv ) | |||||
| @@ -1,80 +0,0 @@ | |||||
| # | |||||
| # Copyright (C) 2008 Nedko Arnaudov | |||||
| # | |||||
| # This program is free software: you can redistribute it and/or modify | |||||
| # it under the terms of the GNU General Public License as published by | |||||
| # the Free Software Foundation, version 2 of the License. | |||||
| # | |||||
| # This program is distributed in the hope that it will be useful, | |||||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| # GNU General Public License for more details. | |||||
| # | |||||
| # You should have received a copy of the GNU General Public License | |||||
| # along with this program. If not, see <http://www.gnu.org/licenses/>. | |||||
| # | |||||
| import os | |||||
| from string import Template | |||||
| from SCons.Script.SConscript import SConsEnvironment | |||||
| def pkg_config_get_value(module, args): | |||||
| return env.backtick('pkg-config ' + args + ' ' + module).strip() | |||||
| def merge_pkg_config_append_string(env, envvar, module, args): | |||||
| value = pkg_config_get_value(module, args) | |||||
| #print value | |||||
| if env._dict.has_key(envvar): | |||||
| env._dict[envvar] += value | |||||
| else: | |||||
| env._dict[envvar] = value | |||||
| def merge_pkg_config_libs(env, module): | |||||
| for lib in pkg_config_get_value(module, "--libs").split(' '): | |||||
| if lib[:2] == '-l': | |||||
| env._dict['LIBS'].append(lib[2:]) | |||||
| elif lib[:2] == '-L': | |||||
| env._dict['LIBPATH'].append(lib[2:]) | |||||
| def merge_pkg_config_variable(env, envvar, module, pkgvar): | |||||
| merge_pkg_config_append_string(env, envvar, module, '--variable=' + pkgvar) | |||||
| def merge_pkg_config_std(env, module): | |||||
| merge_pkg_config_append_string(env, 'CCFLAGS', module, '--cflags') | |||||
| merge_pkg_config_libs(env, module) | |||||
| Import('env') | |||||
| jackenv = env.Copy() | |||||
| #print "LIBS (orig): " + repr(jackenv['LIBS']) | |||||
| #print "SERVERLIB: " + repr(jackenv['SERVERLIB']) | |||||
| jackenv.Append(LIBS=[jackenv['SERVERLIB'], 'dl', 'expat']) | |||||
| merge_pkg_config_variable(jackenv, 'DBUS_SERVICES_DIR', 'dbus-1', 'session_bus_services_dir') | |||||
| merge_pkg_config_std(jackenv, 'dbus-1') | |||||
| #print "CFLAGS: " + jackenv['CFLAGS'] | |||||
| #print "CCFLAGS: " + jackenv['CCFLAGS'] | |||||
| #print "LINKFLAGS: " + repr(jackenv['LINKFLAGS']) | |||||
| #print "LIBPATH: " + repr(jackenv['LIBPATH']) | |||||
| #print "LIBS: " + repr(jackenv['LIBS']) | |||||
| #print "DBUS_SERVICES_DIR: " + jackenv['DBUS_SERVICES_DIR'] | |||||
| jackenv.Install(env['INSTALL_BINDIR'], jackenv.Program('jackdbus', [ | |||||
| 'jackdbus.c', | |||||
| 'controller.c', | |||||
| 'controller_iface_configure.c', | |||||
| 'controller_iface_control.c', | |||||
| 'controller_iface_introspectable.c', | |||||
| 'controller_iface_patchbay.c', | |||||
| 'controller_iface_transport.c', | |||||
| 'xml.c', | |||||
| 'xml_expat.c', | |||||
| # 'xml_libxml.c', | |||||
| # 'xml_nop.c', | |||||
| 'xml_write_raw.c', | |||||
| 'sigsegv.c', | |||||
| ])) | |||||
| jackenv.ScanReplace('org.jackaudio.service.in') | |||||
| jackenv.Install(jackenv['DESTDIR'] + jackenv['DBUS_SERVICES_DIR'], 'org.jackaudio.service') | |||||
| jackenv.Alias('install', jackenv['DESTDIR'] + jackenv['DBUS_SERVICES_DIR']) | |||||
| @@ -1,56 +0,0 @@ | |||||
| # | |||||
| # Copyright (C) 2007 Arnold Krille | |||||
| # Copyright (C) 2007 Pieter Palmers | |||||
| # Copyright (C) 2008 Marc-Olivier Barre | |||||
| # | |||||
| # This file originates from FFADO (www.ffado.org) | |||||
| # | |||||
| # This program is free software: you can redistribute it and/or modify | |||||
| # it under the terms of the GNU General Public License as published by | |||||
| # the Free Software Foundation, either version 3 of the License, or | |||||
| # (at your option) any later version. | |||||
| # | |||||
| # This program is distributed in the hope that it will be useful, | |||||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| # GNU General Public License for more details. | |||||
| # | |||||
| # You should have received a copy of the GNU General Public License | |||||
| # along with this program. If not, see <http://www.gnu.org/licenses/>. | |||||
| # | |||||
| import os | |||||
| from string import Template | |||||
| Import('env') | |||||
| # Paths to include files | |||||
| env.AppendUnique(CPPPATH = ['#/', '#/common', '#/common/jack', '#/macosx']) | |||||
| # | |||||
| # Source files section | |||||
| # | |||||
| srcfiles_macosx_server = ['#/common/Jackdmp.cpp'] | |||||
| srcfiles_macosx_coreaudio = ['JackCoreAudioDriver.cpp'] | |||||
| srcfiles_macosx_dummy = ['#/common/JackDummyDriver.cpp'] | |||||
| # | |||||
| # Build/install section | |||||
| # | |||||
| # build the server and its backends | |||||
| serverenv = env.Copy() | |||||
| serverenv.PrependUnique( LIBPATH=env['build_base'] ) | |||||
| serverenv.PrependUnique( LIBS=[env['SERVERLIB'], 'dl'] ) | |||||
| server = serverenv.Program(env['SERVER'], srcfiles_macosx_server) | |||||
| serverenv.Install( env['INSTALL_BINDIR'], server ) | |||||
| drv = serverenv.SharedLibrary( 'jack_dummy', srcfiles_macosx_dummy ) | |||||
| serverenv.InstallAs( env['INSTALL_ADDON_DIR']+ '/jack_dummy.so', drv ) | |||||
| drv = serverenv.SharedLibrary( 'jack_coreaudio', srcfiles_macosx_coreaudio ) | |||||
| serverenv.InstallAs( env['INSTALL_ADDON_DIR']+ '/jack_coreaudio.so', drv ) | |||||
| @@ -1,67 +0,0 @@ | |||||
| # | |||||
| # Copyright (C) 2007 Arnold Krille | |||||
| # Copyright (C) 2007 Pieter Palmers | |||||
| # Copyright (C) 2008 Marc-Olivier Barre | |||||
| # | |||||
| # This file originates from FFADO (www.ffado.org) | |||||
| # | |||||
| # This program is free software: you can redistribute it and/or modify | |||||
| # it under the terms of the GNU General Public License as published by | |||||
| # the Free Software Foundation, either version 3 of the License, or | |||||
| # (at your option) any later version. | |||||
| # | |||||
| # This program is distributed in the hope that it will be useful, | |||||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| # GNU General Public License for more details. | |||||
| # | |||||
| # You should have received a copy of the GNU General Public License | |||||
| # along with this program. If not, see <http://www.gnu.org/licenses/>. | |||||
| # | |||||
| import os | |||||
| from string import Template | |||||
| Import('env') | |||||
| # Paths where include files can be found | |||||
| env.AppendUnique(CPPPATH=['#/', '#/common']) | |||||
| # | |||||
| # Source files section | |||||
| # | |||||
| test_programs = { | |||||
| 'synchroClient': [ | |||||
| 'testSynchroClient.cpp' | |||||
| ], | |||||
| 'synchroServer': [ | |||||
| 'testSynchroServer.cpp' | |||||
| ], | |||||
| 'synchroServerClient': [ | |||||
| 'testSynchroServerClient.cpp' | |||||
| ], | |||||
| 'testSem': [ | |||||
| 'testSem.cpp' | |||||
| ], | |||||
| 'jack_test': [ | |||||
| 'jack_test.cpp' | |||||
| ], | |||||
| } | |||||
| # Libraries to link | |||||
| extra_libs = {} | |||||
| for test_program in test_programs: | |||||
| extra_libs[test_program] = ['jackserver'] | |||||
| # | |||||
| # Build section | |||||
| # | |||||
| # build the tests | |||||
| testenv = env.Copy() | |||||
| testenv.PrependUnique(LIBPATH=env['build_base']) | |||||
| testenv.PrependUnique(LIBS=env['CLIENTLIB']) | |||||
| for test_program, test_program_source in test_programs.items(): | |||||
| testenv.Program(test_program, test_program_source) | |||||