git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3075 0c269be4-1314-0410-8aa9-9f06e86f4224tags/1.9.1
| @@ -1,72 +1,39 @@ | |||||
| #! /usr/bin/env python | #! /usr/bin/env python | ||||
| # encoding: utf-8 | # encoding: utf-8 | ||||
| import Build | |||||
| import re | import re | ||||
| import os | import os | ||||
| def configure(conf): | def configure(conf): | ||||
| conf.check_tool('misc') | |||||
| e = conf.create_header_configurator() | |||||
| e.name = 'samplerate.h' | |||||
| e.define = 'HAVE_SAMPLERATE' | |||||
| e.run() | |||||
| conf.check_cc(header_name='samplerate.h', define_name="HAVE_SAMPLERATE") | |||||
| if conf.is_defined('HAVE_SAMPLERATE'): | if conf.is_defined('HAVE_SAMPLERATE'): | ||||
| conf.env['LIB_SAMPLERATE'] = ['samplerate'] | conf.env['LIB_SAMPLERATE'] = ['samplerate'] | ||||
| conf.env['BUILD_ADAPTER'] = conf.is_defined('HAVE_SAMPLERATE') | conf.env['BUILD_ADAPTER'] = conf.is_defined('HAVE_SAMPLERATE') | ||||
| # by default waf subst tool uses @VAR@ while scons legacy is ${VAR} | |||||
| # so we use same template as scons for now | |||||
| def subst_func(tsk): | |||||
| "Substitutes variables in a .in file" | |||||
| m4_re = re.compile('\$\{(\w+)\}', re.M) | |||||
| env = tsk.env() | |||||
| infile = tsk.m_inputs[0].abspath(env) | |||||
| outfile = tsk.m_outputs[0].abspath(env) | |||||
| file = open(infile, 'r') | |||||
| code = file.read() | |||||
| file.close() | |||||
| s = m4_re.sub(r'%(\1)s', code) | |||||
| dict = tsk.dict | |||||
| if not dict: | |||||
| names = m4_re.findall(code) | |||||
| for i in names: | |||||
| if env[i] and type(env[i]) is types.ListType : | |||||
| dict[i] = " ".join(env[i]) | |||||
| else: dict[i] = env[i] | |||||
| file = open(outfile, 'w') | |||||
| file.write(s % dict) | |||||
| file.close() | |||||
| return 0 | |||||
| def create_jack_process_obj(bld, target, sources, uselib = None): | def create_jack_process_obj(bld, target, sources, uselib = None): | ||||
| process = bld.create_obj('cpp', 'shlib') | |||||
| process = bld.new_task_gen('cxx', 'shlib') | |||||
| process.env['shlib_PATTERN'] = '%s.so' | process.env['shlib_PATTERN'] = '%s.so' | ||||
| process.defines = ['HAVE_CONFIG_H','SERVER_SIDE'] | process.defines = ['HAVE_CONFIG_H','SERVER_SIDE'] | ||||
| if bld.env()['IS_MACOSX']: | |||||
| if bld.env['IS_MACOSX']: | |||||
| env_includes = ['../macosx', '../posix', '../macosx/coreaudio'] | env_includes = ['../macosx', '../posix', '../macosx/coreaudio'] | ||||
| if bld.env()['IS_LINUX']: | |||||
| if bld.env['IS_LINUX']: | |||||
| env_includes = ['../linux', '../posix', '../linux/alsa'] | env_includes = ['../linux', '../posix', '../linux/alsa'] | ||||
| process.includes = ['.'] + env_includes + ['jack', '..'] | process.includes = ['.'] + env_includes + ['jack', '..'] | ||||
| process.name = target | process.name = target | ||||
| process.target = target | process.target = target | ||||
| process.source = sources | process.source = sources | ||||
| process.env.append_value("CPPFLAGS", "-fvisibility=hidden") | process.env.append_value("CPPFLAGS", "-fvisibility=hidden") | ||||
| if bld.env()['IS_MACOSX']: | |||||
| if bld.env['IS_MACOSX']: | |||||
| process.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc") | process.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc") | ||||
| #process.env.append_value("LINKFLAGS", "-arch i386 -arch ppc") | #process.env.append_value("LINKFLAGS", "-arch i386 -arch ppc") | ||||
| process.env.append_value("LINKFLAGS", "") | process.env.append_value("LINKFLAGS", "") | ||||
| process.inst_var = bld.env()['ADDON_DIR'] | |||||
| process.inst_dir = '/' | |||||
| #steph | |||||
| #process.inst_var = bld.env['ADDON_DIR'] | |||||
| #process.inst_dir = '/' | |||||
| process.install_path = '${ADDON_DIR}/' | |||||
| process.uselib_local = uselib.name | process.uselib_local = uselib.name | ||||
| return process | return process | ||||
| @@ -99,7 +66,7 @@ def build(bld): | |||||
| includes = ['.', './jack', '..'] | includes = ['.', './jack', '..'] | ||||
| uselib = ["PTHREAD"] | uselib = ["PTHREAD"] | ||||
| if bld.env()['IS_LINUX']: | |||||
| if bld.env['IS_LINUX']: | |||||
| common_libsources += [ | common_libsources += [ | ||||
| '../posix/JackPosixThread.cpp', | '../posix/JackPosixThread.cpp', | ||||
| '../posix/JackPosixSemaphore.cpp', | '../posix/JackPosixSemaphore.cpp', | ||||
| @@ -112,7 +79,7 @@ def build(bld): | |||||
| uselib.append('RT') | uselib.append('RT') | ||||
| uselib.append('DL') | uselib.append('DL') | ||||
| if bld.env()['IS_MACOSX']: | |||||
| if bld.env['IS_MACOSX']: | |||||
| common_libsources += [ | common_libsources += [ | ||||
| '../posix/JackProcessSync.cpp', | '../posix/JackProcessSync.cpp', | ||||
| '../posix/JackPosixThread.cpp', | '../posix/JackPosixThread.cpp', | ||||
| @@ -123,7 +90,7 @@ def build(bld): | |||||
| ] | ] | ||||
| includes = ['../macosx', '../macosx/RPC', '../posix'] + includes | includes = ['../macosx', '../macosx/RPC', '../posix'] + includes | ||||
| serverlib = bld.create_obj('cpp', 'shlib') | |||||
| serverlib = bld.new_task_gen('cxx', 'shlib') | |||||
| serverlib.features.append('cc') | serverlib.features.append('cc') | ||||
| serverlib.defines = ['HAVE_CONFIG_H','SERVER_SIDE'] | serverlib.defines = ['HAVE_CONFIG_H','SERVER_SIDE'] | ||||
| serverlib.includes = includes | serverlib.includes = includes | ||||
| @@ -141,8 +108,8 @@ def build(bld): | |||||
| 'JackLoopbackDriver.cpp', | 'JackLoopbackDriver.cpp', | ||||
| 'JackServer.cpp', | 'JackServer.cpp', | ||||
| 'JackThreadedDriver.cpp', | 'JackThreadedDriver.cpp', | ||||
| 'JackRestartThreadedDriver.cpp', | |||||
| 'JackWaitThreadedDriver.cpp', | |||||
| 'JackRestartThreadedDriver.cpp', | |||||
| 'JackWaitThreadedDriver.cpp', | |||||
| 'JackServerAPI.cpp', | 'JackServerAPI.cpp', | ||||
| 'JackDriverLoader.cpp', | 'JackDriverLoader.cpp', | ||||
| 'JackServerGlobals.cpp', | 'JackServerGlobals.cpp', | ||||
| @@ -151,7 +118,7 @@ def build(bld): | |||||
| 'JackNetInterface.cpp', | 'JackNetInterface.cpp', | ||||
| ] | ] | ||||
| if bld.env()['IS_LINUX']: | |||||
| if bld.env['IS_LINUX']: | |||||
| serverlib.source += [ | serverlib.source += [ | ||||
| '../posix/JackSocketServerChannel.cpp', | '../posix/JackSocketServerChannel.cpp', | ||||
| '../posix/JackSocketNotifyChannel.cpp', | '../posix/JackSocketNotifyChannel.cpp', | ||||
| @@ -159,7 +126,7 @@ def build(bld): | |||||
| '../posix/JackNetUnixSocket.cpp', | '../posix/JackNetUnixSocket.cpp', | ||||
| ] | ] | ||||
| if bld.env()['IS_MACOSX']: | |||||
| if bld.env['IS_MACOSX']: | |||||
| serverlib.source += [ | serverlib.source += [ | ||||
| '../macosx/JackMachServerChannel.cpp', | '../macosx/JackMachServerChannel.cpp', | ||||
| '../macosx/JackMachNotifyChannel.cpp', | '../macosx/JackMachNotifyChannel.cpp', | ||||
| @@ -169,19 +136,19 @@ def build(bld): | |||||
| '../posix/JackNetUnixSocket.cpp', | '../posix/JackNetUnixSocket.cpp', | ||||
| ] | ] | ||||
| serverlib.vnum = bld.env()['JACK_API_VERSION'] | |||||
| serverlib.vnum = bld.env['JACK_API_VERSION'] | |||||
| serverlib.env.append_value("CPPFLAGS", "-fvisibility=hidden") | serverlib.env.append_value("CPPFLAGS", "-fvisibility=hidden") | ||||
| if bld.env()['IS_MACOSX']: | |||||
| if bld.env['IS_MACOSX']: | |||||
| serverlib.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc") | serverlib.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc") | ||||
| #serverlib.env.append_value("LINKFLAGS", "-framework CoreAudio -framework vecLib -single_module -arch i386 -arch ppc") | #serverlib.env.append_value("LINKFLAGS", "-framework CoreAudio -framework vecLib -single_module -arch i386 -arch ppc") | ||||
| serverlib.env.append_value("LINKFLAGS", "-framework CoreAudio -framework vecLib -single_module") | serverlib.env.append_value("LINKFLAGS", "-framework CoreAudio -framework vecLib -single_module") | ||||
| serverlib.env.append_value("LINKFLAGS", "-compatibility_version 1 -current_version 1") | serverlib.env.append_value("LINKFLAGS", "-compatibility_version 1 -current_version 1") | ||||
| clientlib = bld.create_obj('cpp', 'shlib') | |||||
| clientlib = bld.new_task_gen('cxx', 'shlib') | |||||
| clientlib.features.append('cc') | clientlib.features.append('cc') | ||||
| clientlib.defines = 'HAVE_CONFIG_H' | clientlib.defines = 'HAVE_CONFIG_H' | ||||
| clientlib.uselib = uselib | clientlib.uselib = uselib | ||||
| if bld.env()['BUILD_JACKDBUS'] == True: | |||||
| if bld.env['BUILD_JACKDBUS'] == True: | |||||
| clientlib.uselib.append('DBUS-1') | clientlib.uselib.append('DBUS-1') | ||||
| clientlib.includes = includes | clientlib.includes = includes | ||||
| clientlib.name = 'clientlib' | clientlib.name = 'clientlib' | ||||
| @@ -192,13 +159,13 @@ def build(bld): | |||||
| 'JackLibAPI.cpp', | 'JackLibAPI.cpp', | ||||
| ] | ] | ||||
| if bld.env()['IS_LINUX']: | |||||
| if bld.env['IS_LINUX']: | |||||
| clientlib.source += [ | clientlib.source += [ | ||||
| '../posix/JackSocketClientChannel.cpp', | '../posix/JackSocketClientChannel.cpp', | ||||
| '../posix/JackPosixServerLaunch.cpp', | '../posix/JackPosixServerLaunch.cpp', | ||||
| ] | ] | ||||
| if bld.env()['IS_MACOSX']: | |||||
| if bld.env['IS_MACOSX']: | |||||
| clientlib.source += [ | clientlib.source += [ | ||||
| '../macosx/JackMachClientChannel.cpp', | '../macosx/JackMachClientChannel.cpp', | ||||
| '../macosx/RPC/JackRPCEngineUser.c', | '../macosx/RPC/JackRPCEngineUser.c', | ||||
| @@ -206,9 +173,9 @@ def build(bld): | |||||
| '../posix/JackPosixServerLaunch.cpp', | '../posix/JackPosixServerLaunch.cpp', | ||||
| ] | ] | ||||
| clientlib.vnum = bld.env()['JACK_API_VERSION'] | |||||
| clientlib.vnum = bld.env['JACK_API_VERSION'] | |||||
| clientlib.env.append_value("CPPFLAGS", "-fvisibility=hidden") | clientlib.env.append_value("CPPFLAGS", "-fvisibility=hidden") | ||||
| if bld.env()['IS_MACOSX']: | |||||
| if bld.env['IS_MACOSX']: | |||||
| clientlib.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc") | clientlib.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc") | ||||
| #clientlib.env.append_value("LINKFLAGS", "-framework CoreAudio -framework vecLib -single_module -arch i386 -arch ppc") | #clientlib.env.append_value("LINKFLAGS", "-framework CoreAudio -framework vecLib -single_module -arch i386 -arch ppc") | ||||
| clientlib.env.append_value("LINKFLAGS", "-framework CoreAudio -framework vecLib -single_module") | clientlib.env.append_value("LINKFLAGS", "-framework CoreAudio -framework vecLib -single_module") | ||||
| @@ -219,30 +186,30 @@ def build(bld): | |||||
| net_adapter_sources = [ | net_adapter_sources = [ | ||||
| 'JackResampler.cpp', | 'JackResampler.cpp', | ||||
| 'JackLibSampleRateResampler.cpp', | 'JackLibSampleRateResampler.cpp', | ||||
| 'JackAudioAdapter.cpp', | |||||
| 'JackAudioAdapter.cpp', | |||||
| 'JackAudioAdapterInterface.cpp', | 'JackAudioAdapterInterface.cpp', | ||||
| 'JackNetAdapter.cpp', | 'JackNetAdapter.cpp', | ||||
| ] | ] | ||||
| if bld.env()['BUILD_ADAPTER'] == True: | |||||
| if bld.env['BUILD_ADAPTER'] == True: | |||||
| process = create_jack_process_obj(bld, 'netadapter', net_adapter_sources, serverlib) | process = create_jack_process_obj(bld, 'netadapter', net_adapter_sources, serverlib) | ||||
| process.uselib = 'SAMPLERATE' | process.uselib = 'SAMPLERATE' | ||||
| audio_adapter_sources = [ | audio_adapter_sources = [ | ||||
| 'JackResampler.cpp', | 'JackResampler.cpp', | ||||
| 'JackLibSampleRateResampler.cpp', | 'JackLibSampleRateResampler.cpp', | ||||
| 'JackAudioAdapter.cpp', | |||||
| 'JackAudioAdapter.cpp', | |||||
| 'JackAudioAdapterInterface.cpp', | 'JackAudioAdapterInterface.cpp', | ||||
| 'JackAudioAdapterFactory.cpp', | 'JackAudioAdapterFactory.cpp', | ||||
| ] | ] | ||||
| if bld.env()['BUILD_ADAPTER'] and bld.env()['IS_MACOSX']: | |||||
| if bld.env['BUILD_ADAPTER'] and bld.env['IS_MACOSX']: | |||||
| audio_adapter_sources += ['../macosx/coreaudio/JackCoreAudioAdapter.cpp'] | audio_adapter_sources += ['../macosx/coreaudio/JackCoreAudioAdapter.cpp'] | ||||
| process = create_jack_process_obj(bld, 'audioadapter', audio_adapter_sources, serverlib) | process = create_jack_process_obj(bld, 'audioadapter', audio_adapter_sources, serverlib) | ||||
| process.env.append_value("LINKFLAGS", "-framework CoreAudio -framework AudioUnit -framework AudioToolbox -framework CoreServices") | process.env.append_value("LINKFLAGS", "-framework CoreAudio -framework AudioUnit -framework AudioToolbox -framework CoreServices") | ||||
| process.uselib = 'SAMPLERATE' | process.uselib = 'SAMPLERATE' | ||||
| if bld.env()['BUILD_ADAPTER'] and bld.env()['IS_LINUX']: | |||||
| if bld.env['BUILD_ADAPTER'] and bld.env['IS_LINUX']: | |||||
| audio_adapter_sources += ['../linux/alsa/JackAlsaAdapter.cpp'] | audio_adapter_sources += ['../linux/alsa/JackAlsaAdapter.cpp'] | ||||
| process = create_jack_process_obj(bld, 'audioadapter', audio_adapter_sources, serverlib) | process = create_jack_process_obj(bld, 'audioadapter', audio_adapter_sources, serverlib) | ||||
| process.uselib = ['ALSA', 'SAMPLERATE'] | process.uselib = ['ALSA', 'SAMPLERATE'] | ||||
| @@ -250,18 +217,20 @@ def build(bld): | |||||
| #audio_adapter_sources += ['../windows/JackPortAudioAdapter.cpp'] | #audio_adapter_sources += ['../windows/JackPortAudioAdapter.cpp'] | ||||
| #process = create_jack_process_obj(bld, 'audioadapter', audio_adapter_sources, serverlib) | #process = create_jack_process_obj(bld, 'audioadapter', audio_adapter_sources, serverlib) | ||||
| install_files('PREFIX', 'include/jack', 'jack/*.h') | |||||
| bld.install_files('${PREFIX}/include/jack', 'jack/*.h') | |||||
| # process jack.pc.in -> jack.pc | # process jack.pc.in -> jack.pc | ||||
| obj = bld.create_obj('subst') | |||||
| import misc | |||||
| obj = bld.new_task_gen('subst') | |||||
| obj.source = '../jack.pc.in' | obj.source = '../jack.pc.in' | ||||
| obj.target = 'jack.pc' | obj.target = 'jack.pc' | ||||
| obj.dict = {'PREFIX': bld.env()['PREFIX'], | |||||
| 'LIBDIR': os.path.normpath(bld.env()['PREFIX'] + '/lib'), | |||||
| 'INCLUDEDIR': os.path.normpath(bld.env()['PREFIX'] + '/include'), | |||||
| obj.dict = {'PREFIX': bld.env['PREFIX'], | |||||
| 'LIBDIR': os.path.normpath(bld.env['PREFIX'] + '/lib'), | |||||
| 'INCLUDEDIR': os.path.normpath(bld.env['PREFIX'] + '/include'), | |||||
| 'SERVERLIB': serverlib.target, | 'SERVERLIB': serverlib.target, | ||||
| 'JACK_VERSION': bld.env()['JACK_VERSION'], | |||||
| 'JACK_VERSION': bld.env['JACK_VERSION'], | |||||
| } | } | ||||
| obj.inst_var = bld.env()['PREFIX'] | |||||
| obj.inst_dir = '/lib/pkgconfig/' | |||||
| obj.fun = subst_func # @VAR@ -> ${VAR} | |||||
| obj.install_path = '${PREFIX}/lib/pkgconfig/' | |||||
| #steph | |||||
| #obj.fun = subst_func # @VAR@ -> ${VAR} | |||||
| obj.fun = misc.subst_func | |||||
| @@ -1,3 +1,3 @@ | |||||
| [D-BUS Service] | [D-BUS Service] | ||||
| Name=org.jackaudio.service | Name=org.jackaudio.service | ||||
| Exec=${BINDIR}/jackdbus auto | |||||
| Exec=@BINDIR@/jackdbus auto | |||||
| @@ -1,72 +1,40 @@ | |||||
| #! /usr/bin/env python | #! /usr/bin/env python | ||||
| # encoding: utf-8 | # encoding: utf-8 | ||||
| import Params | |||||
| import os.path | import os.path | ||||
| import Options | |||||
| import re # subst_func | import re # subst_func | ||||
| def set_options(opt): | def set_options(opt): | ||||
| 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') | 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') | ||||
| def configure(conf): | def configure(conf): | ||||
| conf.check_pkg('dbus-1', pkgvars=['session_bus_services_dir']) | |||||
| # conf.check_pkg('dbus-1', pkgvars=['session_bus_services_dir']) | |||||
| # Needs a fix : nedko ?? | |||||
| conf.check_cfg(package='dbus-1', pkgvars=['session_bus_services_dir']) | |||||
| if Params.g_options.enable_pkg_config_dbus_service_dir: | |||||
| if Options.options.enable_pkg_config_dbus_service_dir: | |||||
| conf.env['DBUS_SERVICES_DIR'] = conf.env['DBUS-1_SESSION_BUS_SERVICES_DIR'][0] | conf.env['DBUS_SERVICES_DIR'] = conf.env['DBUS-1_SESSION_BUS_SERVICES_DIR'][0] | ||||
| else: | else: | ||||
| conf.env['DBUS_SERVICES_DIR'] = os.path.normpath(conf.env['PREFIX'] + '/share/dbus-1/services') | conf.env['DBUS_SERVICES_DIR'] = os.path.normpath(conf.env['PREFIX'] + '/share/dbus-1/services') | ||||
| conf.check_tool('misc') | conf.check_tool('misc') | ||||
| e = conf.create_header_configurator() | |||||
| e.name = 'expat.h' | |||||
| e.define = 'HAVE_EXPAT' | |||||
| e.run() | |||||
| conf.check(header_name='expat.h', define_name="HAVE_EXPAT") | |||||
| if conf.is_defined('HAVE_EXPAT'): | if conf.is_defined('HAVE_EXPAT'): | ||||
| conf.env['LIB_EXPAT'] = ['expat'] | conf.env['LIB_EXPAT'] = ['expat'] | ||||
| conf.env['BUILD_JACKDBUS'] = conf.is_defined('HAVE_EXPAT') and conf.is_defined('HAVE_DBUS_1') | conf.env['BUILD_JACKDBUS'] = conf.is_defined('HAVE_EXPAT') and conf.is_defined('HAVE_DBUS_1') | ||||
| # by default waf subst tool uses @VAR@ while scons legacy is ${VAR} | |||||
| # so we use same template as scons for now | |||||
| def subst_func(tsk): | |||||
| "Substitutes variables in a .in file" | |||||
| m4_re = re.compile('\$\{(\w+)\}', re.M) | |||||
| env = tsk.env() | |||||
| infile = tsk.m_inputs[0].abspath(env) | |||||
| outfile = tsk.m_outputs[0].abspath(env) | |||||
| file = open(infile, 'r') | |||||
| code = file.read() | |||||
| file.close() | |||||
| s = m4_re.sub(r'%(\1)s', code) | |||||
| dict = tsk.dict | |||||
| if not dict: | |||||
| names = m4_re.findall(code) | |||||
| for i in names: | |||||
| if env[i] and type(env[i]) is types.ListType : | |||||
| dict[i] = " ".join(env[i]) | |||||
| else: dict[i] = env[i] | |||||
| file = open(outfile, 'w') | |||||
| file.write(s % dict) | |||||
| file.close() | |||||
| return 0 | |||||
| def build(bld): | def build(bld): | ||||
| if bld.env()["BUILD_JACKDBUS"] != True: | |||||
| if bld.env["BUILD_JACKDBUS"] != True: | |||||
| return | return | ||||
| obj = bld.create_obj('cc', 'program') | |||||
| if bld.env()['IS_LINUX']: | |||||
| obj = bld.new_task_gen('cc', 'program') | |||||
| if bld.env['IS_LINUX']: | |||||
| sysdeps_dbus_include = ['../linux', '../posix'] | sysdeps_dbus_include = ['../linux', '../posix'] | ||||
| if bld.env()['IS_MACOSX']: | |||||
| if bld.env['IS_MACOSX']: | |||||
| sysdeps_dbus_include = ['../macosx', '../posix'] | sysdeps_dbus_include = ['../macosx', '../posix'] | ||||
| obj.includes = sysdeps_dbus_include + ['.', '../', '../common', '../common/jack'] | obj.includes = sysdeps_dbus_include + ['.', '../', '../common', '../common/jack'] | ||||
| @@ -85,18 +53,18 @@ def build(bld): | |||||
| 'xml_write_raw.c', | 'xml_write_raw.c', | ||||
| 'sigsegv.c', | 'sigsegv.c', | ||||
| ] | ] | ||||
| if bld.env()['IS_LINUX']: | |||||
| if bld.env['IS_LINUX']: | |||||
| obj.uselib = 'PTHREAD DL RT DBUS-1 EXPAT' | obj.uselib = 'PTHREAD DL RT DBUS-1 EXPAT' | ||||
| if bld.env()['IS_MACOSX']: | |||||
| if bld.env['IS_MACOSX']: | |||||
| obj.uselib = 'PTHREAD DL DBUS-1 EXPAT' | obj.uselib = 'PTHREAD DL DBUS-1 EXPAT' | ||||
| obj.uselib_local = 'serverlib' | obj.uselib_local = 'serverlib' | ||||
| obj.target = 'jackdbus' | obj.target = 'jackdbus' | ||||
| # process org.jackaudio.service.in -> org.jackaudio.service | # process org.jackaudio.service.in -> org.jackaudio.service | ||||
| obj = bld.create_obj('subst') | |||||
| import misc | |||||
| obj = bld.new_task_gen('subst') | |||||
| obj.source = 'org.jackaudio.service.in' | obj.source = 'org.jackaudio.service.in' | ||||
| obj.target = 'org.jackaudio.service' | obj.target = 'org.jackaudio.service' | ||||
| obj.dict = {'BINDIR': bld.env()['PREFIX'] + '/bin'} | |||||
| obj.inst_var = bld.env()['DBUS_SERVICES_DIR'] | |||||
| obj.inst_dir = '/' | |||||
| obj.fun = subst_func # @VAR@ -> ${VAR} | |||||
| obj.dict = {'BINDIR': bld.env['PREFIX'] + '/bin'} | |||||
| obj.install_path = '${DBUS_SERVICES_DIR}/' | |||||
| obj.fun = misc.subst_func | |||||
| @@ -27,26 +27,17 @@ example_libs = { | |||||
| } | } | ||||
| def configure(conf): | def configure(conf): | ||||
| e = conf.create_header_configurator() | |||||
| e.name = 'sndfile.h' | |||||
| e.define = 'HAVE_SNDFILE' | |||||
| e.run() | |||||
| e = conf.check_cc(header_name='sndfile.h', define_name="HAVE_SNDFILE") | |||||
| if conf.is_defined('HAVE_SNDFILE'): | if conf.is_defined('HAVE_SNDFILE'): | ||||
| conf.env['LIB_SNDFILE'] = ['sndfile'] | conf.env['LIB_SNDFILE'] = ['sndfile'] | ||||
| e = conf.create_header_configurator() | |||||
| e.name = 'ncurses.h' | |||||
| e.define = 'HAVE_NCURSES' | |||||
| e.run() | |||||
| e = conf.check_cc(header_name='ncurses.h', define_name="HAVE_NCURSES") | |||||
| if conf.is_defined('HAVE_NCURSES'): | if conf.is_defined('HAVE_NCURSES'): | ||||
| conf.env['LIB_NCURSES'] = ['ncurses'] | conf.env['LIB_NCURSES'] = ['ncurses'] | ||||
| e = conf.create_library_configurator() | |||||
| e.name = 'readline' | |||||
| e.define = 'HAVE_READLINE' | |||||
| e.run() | |||||
| e = conf.check_cc(lib='readline', define_name="HAVE_READLINE") | |||||
| if conf.is_defined('HAVE_READLINE'): | if conf.is_defined('HAVE_READLINE'): | ||||
| conf.env['LIB_READLINE'] = ['readline'] | conf.env['LIB_READLINE'] = ['readline'] | ||||
| @@ -56,20 +47,20 @@ def configure(conf): | |||||
| conf.env['BUILD_EXAMPLE_CLIENT_REC'] = conf.is_defined('HAVE_SNDFILE') | conf.env['BUILD_EXAMPLE_CLIENT_REC'] = conf.is_defined('HAVE_SNDFILE') | ||||
| def build(bld): | def build(bld): | ||||
| if bld.env()['IS_LINUX']: | |||||
| if bld.env['IS_LINUX']: | |||||
| os_incdir = ['../linux', '../posix'] | os_incdir = ['../linux', '../posix'] | ||||
| if bld.env()['IS_MACOSX']: | |||||
| if bld.env['IS_MACOSX']: | |||||
| os_incdir = ['../macosx', '../posix'] | os_incdir = ['../macosx', '../posix'] | ||||
| for example_program, example_program_source in example_programs.items(): | for example_program, example_program_source in example_programs.items(): | ||||
| prog = bld.create_obj('cpp', 'program') | |||||
| prog = bld.new_task_gen('cxx', 'program') | |||||
| prog.features.append('cc') | prog.features.append('cc') | ||||
| prog.includes = os_incdir + ['../common/jack', '../common'] | prog.includes = os_incdir + ['../common/jack', '../common'] | ||||
| prog.source = example_program_source | prog.source = example_program_source | ||||
| if bld.env()['IS_MACOSX']: | |||||
| if bld.env['IS_MACOSX']: | |||||
| prog.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc") | prog.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc") | ||||
| #prog.env.append_value("LINKFLAGS", "-arch i386 -arch ppc") | #prog.env.append_value("LINKFLAGS", "-arch i386 -arch ppc") | ||||
| prog.env.append_value("LINKFLAGS", "") | prog.env.append_value("LINKFLAGS", "") | ||||
| if bld.env()['IS_LINUX']: | |||||
| if bld.env['IS_LINUX']: | |||||
| prog.uselib = 'RT' | prog.uselib = 'RT' | ||||
| if example_program == 'jack_server_control': | if example_program == 'jack_server_control': | ||||
| prog.uselib_local = 'serverlib' | prog.uselib_local = 'serverlib' | ||||
| @@ -77,51 +68,50 @@ def build(bld): | |||||
| prog.uselib_local = 'clientlib' | prog.uselib_local = 'clientlib' | ||||
| prog.target = example_program | prog.target = example_program | ||||
| #if bld.env()['BUILD_EXAMPLE_CLIENT_TRANSPORT'] | |||||
| if bld.env()['BUILD_EXAMPLE_CLIENT_TRANSPORT'] == True and bld.env()['IS_LINUX'] == True: | |||||
| prog = bld.create_obj('cc', 'program') | |||||
| #if bld.env['BUILD_EXAMPLE_CLIENT_TRANSPORT'] | |||||
| if bld.env['BUILD_EXAMPLE_CLIENT_TRANSPORT'] == True and bld.env['IS_LINUX'] == True: | |||||
| prog = bld.new_task_gen('cc', 'program') | |||||
| prog.includes = os_incdir + ['../common/jack', '../common'] | prog.includes = os_incdir + ['../common/jack', '../common'] | ||||
| prog.source = 'transport.c' | prog.source = 'transport.c' | ||||
| if bld.env()['IS_MACOSX']: | |||||
| if bld.env['IS_MACOSX']: | |||||
| prog.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc") | prog.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc") | ||||
| #prog.env.append_value("LINKFLAGS", "-arch i386 -arch ppc") | #prog.env.append_value("LINKFLAGS", "-arch i386 -arch ppc") | ||||
| prog.env.append_value("LINKFLAGS", "") | prog.env.append_value("LINKFLAGS", "") | ||||
| if bld.env()['IS_LINUX']: | |||||
| if bld.env['IS_LINUX']: | |||||
| prog.uselib = 'RT READLINE NCURSES' | prog.uselib = 'RT READLINE NCURSES' | ||||
| if bld.env()['IS_MACOSX']: | |||||
| if bld.env['IS_MACOSX']: | |||||
| prog.uselib = 'READLINE NCURSES' | prog.uselib = 'READLINE NCURSES' | ||||
| prog.uselib_local = 'clientlib' | prog.uselib_local = 'clientlib' | ||||
| prog.target = 'jack_transport' | prog.target = 'jack_transport' | ||||
| if bld.env()['BUILD_EXAMPLE_CLIENT_REC'] == True: | |||||
| prog = bld.create_obj('cc', 'program') | |||||
| if bld.env['BUILD_EXAMPLE_CLIENT_REC'] == True: | |||||
| prog = bld.new_task_gen('cc', 'program') | |||||
| prog.includes = os_incdir + ['../common/jack', '../common'] | prog.includes = os_incdir + ['../common/jack', '../common'] | ||||
| prog.source = 'capture_client.c' | prog.source = 'capture_client.c' | ||||
| if bld.env()['IS_MACOSX']: | |||||
| if bld.env['IS_MACOSX']: | |||||
| prog.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc") | prog.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc") | ||||
| #prog.env.append_value("LINKFLAGS", "-arch i386 -arch ppc") | #prog.env.append_value("LINKFLAGS", "-arch i386 -arch ppc") | ||||
| prog.env.append_value("LINKFLAGS", "") | prog.env.append_value("LINKFLAGS", "") | ||||
| if bld.env()['IS_LINUX']: | |||||
| if bld.env['IS_LINUX']: | |||||
| prog.uselib = 'RT SNDFILE' | prog.uselib = 'RT SNDFILE' | ||||
| if bld.env()['IS_MACOSX']: | |||||
| if bld.env['IS_MACOSX']: | |||||
| prog.uselib = 'SNDFILE' | prog.uselib = 'SNDFILE' | ||||
| prog.uselib_local = 'clientlib' | prog.uselib_local = 'clientlib' | ||||
| prog.target = 'jack_rec' | prog.target = 'jack_rec' | ||||
| for example_lib, example_lib_source in example_libs.items(): | for example_lib, example_lib_source in example_libs.items(): | ||||
| lib = bld.create_obj('cc', 'shlib') | |||||
| lib = bld.new_task_gen('cc', 'shlib') | |||||
| lib.env['shlib_PATTERN'] = '%s.so' | lib.env['shlib_PATTERN'] = '%s.so' | ||||
| lib.includes = os_incdir + ['../common/jack', '../common'] | lib.includes = os_incdir + ['../common/jack', '../common'] | ||||
| lib.target = example_lib | lib.target = example_lib | ||||
| lib.source = example_lib_source | lib.source = example_lib_source | ||||
| if bld.env()['IS_MACOSX']: | |||||
| if bld.env['IS_MACOSX']: | |||||
| lib.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc") | lib.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc") | ||||
| #lib.env.append_value("LINKFLAGS", "-arch i386 -arch ppc") | #lib.env.append_value("LINKFLAGS", "-arch i386 -arch ppc") | ||||
| lib.env.append_value("LINKFLAGS", "") | lib.env.append_value("LINKFLAGS", "") | ||||
| lib.uselib_local = 'serverlib' | lib.uselib_local = 'serverlib' | ||||
| lib.inst_var = bld.env()['ADDON_DIR'] | |||||
| lib.inst_dir = '/' | |||||
| lib.install_path = '${ADDON_DIR}/' | |||||
| symlink_as('PREFIX', 'jack_connect', 'bin/jack_disconnect') | |||||
| bld.symlink_as('${PREFIX}/jack_connect', 'bin/jack_disconnect') | |||||
| install_files('PREFIX', 'bin', 'jack_control', chmod=0755) | |||||
| bld.install_files('${PREFIX}/bin', 'jack_control', chmod=0755) | |||||
| @@ -1,11 +1,11 @@ | |||||
| prefix=${PREFIX} | |||||
| exec_prefix=${PREFIX} | |||||
| libdir=${LIBDIR} | |||||
| includedir=${INCLUDEDIR} | |||||
| server_libs=-L${LIBDIR} -l${SERVERLIB} | |||||
| prefix=@PREFIX@ | |||||
| exec_prefix=@PREFIX@ | |||||
| libdir=@LIBDIR@ | |||||
| includedir=@INCLUDEDIR@ | |||||
| server_libs=-L@LIBDIR@ -l@SERVERLIB@ | |||||
| Name: jack | Name: jack | ||||
| Description: the Jack Audio Connection Kit: a low-latency synchronous callback-based media server | Description: the Jack Audio Connection Kit: a low-latency synchronous callback-based media server | ||||
| Version: ${JACK_VERSION} | |||||
| Libs: -L${LIBDIR} -ljack | |||||
| Cflags: -I${INCLUDEDIR} | |||||
| Version: @JACK_VERSION@ | |||||
| Libs: -L@LIBDIR@ -ljack | |||||
| Cflags: -I@INCLUDEDIR@ | |||||
| @@ -2,31 +2,30 @@ | |||||
| # encoding: utf-8 | # encoding: utf-8 | ||||
| def configure(conf): | def configure(conf): | ||||
| conf.check_pkg('alsa', vnum = '1.0.0') | |||||
| conf.check_cfg(package='alsa', atleast_version='1.0.0', args='--cflags --libs') | |||||
| conf.env['BUILD_DRIVER_ALSA'] = conf.is_defined('HAVE_ALSA') | conf.env['BUILD_DRIVER_ALSA'] = conf.is_defined('HAVE_ALSA') | ||||
| conf.check_pkg('libfreebob', vnum = '1.0.0') | |||||
| conf. check_cfg(package='libfreebob', atleast_version='1.0.0', args='--cflags --libs') | |||||
| conf.env['BUILD_DRIVER_FREEBOB'] = conf.is_defined('HAVE_LIBFREEBOB') | conf.env['BUILD_DRIVER_FREEBOB'] = conf.is_defined('HAVE_LIBFREEBOB') | ||||
| conf.check_pkg('libffado', vnum = '1.999.17') | |||||
| conf. check_cfg(package='libffado', atleast_version='1.999.17', args='--cflags --libs') | |||||
| conf.env['BUILD_DRIVER_FFADO'] = conf.is_defined('HAVE_LIBFFADO') | conf.env['BUILD_DRIVER_FFADO'] = conf.is_defined('HAVE_LIBFFADO') | ||||
| def create_jack_driver_obj(bld, target, sources, uselib = None): | def create_jack_driver_obj(bld, target, sources, uselib = None): | ||||
| driver = bld.create_obj('cpp', 'shlib') | |||||
| driver = bld.new_task_gen('cxx', 'shlib') | |||||
| driver.features.append('cc') | driver.features.append('cc') | ||||
| driver.env['shlib_PATTERN'] = 'jack_%s.so' | driver.env['shlib_PATTERN'] = 'jack_%s.so' | ||||
| driver.defines = ['HAVE_CONFIG_H','SERVER_SIDE'] | driver.defines = ['HAVE_CONFIG_H','SERVER_SIDE'] | ||||
| driver.includes = ['.', '../linux', '../posix', '../common', '../common/jack'] | driver.includes = ['.', '../linux', '../posix', '../common', '../common/jack'] | ||||
| driver.target = target | driver.target = target | ||||
| driver.source = sources | driver.source = sources | ||||
| driver.inst_var = bld.env()['ADDON_DIR'] | |||||
| driver.inst_dir = '/' | |||||
| driver.install_path = '${ADDON_DIR}/' | |||||
| if uselib: | if uselib: | ||||
| driver.uselib = uselib | driver.uselib = uselib | ||||
| return driver | return driver | ||||
| def build(bld): | def build(bld): | ||||
| jackd = bld.create_obj('cpp', 'program') | |||||
| jackd = bld.new_task_gen('cxx', 'program') | |||||
| jackd.includes = ['../linux', '../posix', '../common/jack', '../common'] | jackd.includes = ['../linux', '../posix', '../common/jack', '../common'] | ||||
| jackd.defines = 'HAVE_CONFIG_H' | jackd.defines = 'HAVE_CONFIG_H' | ||||
| jackd.source = ['../common/Jackdmp.cpp'] | jackd.source = ['../common/Jackdmp.cpp'] | ||||
| @@ -36,7 +35,7 @@ def build(bld): | |||||
| create_jack_driver_obj(bld, 'dummy', '../common/JackDummyDriver.cpp') | create_jack_driver_obj(bld, 'dummy', '../common/JackDummyDriver.cpp') | ||||
| if bld.env()['BUILD_DRIVER_ALSA'] == True: | |||||
| if bld.env['BUILD_DRIVER_ALSA'] == True: | |||||
| create_jack_driver_obj(bld, 'alsa', ['alsa/JackAlsaDriver.cpp', | create_jack_driver_obj(bld, 'alsa', ['alsa/JackAlsaDriver.cpp', | ||||
| 'alsa/alsa_rawmidi.c', | 'alsa/alsa_rawmidi.c', | ||||
| 'alsa/alsa_seqmidi.c', | 'alsa/alsa_seqmidi.c', | ||||
| @@ -48,10 +47,10 @@ def build(bld): | |||||
| 'alsa/ice1712.c' | 'alsa/ice1712.c' | ||||
| ], "ALSA") | ], "ALSA") | ||||
| if bld.env()['BUILD_DRIVER_FREEBOB'] == True: | |||||
| if bld.env['BUILD_DRIVER_FREEBOB'] == True: | |||||
| create_jack_driver_obj(bld, 'freebob', 'freebob/JackFreebobDriver.cpp', "LIBFREEBOB") | create_jack_driver_obj(bld, 'freebob', 'freebob/JackFreebobDriver.cpp', "LIBFREEBOB") | ||||
| if bld.env()['BUILD_DRIVER_FFADO'] == True: | |||||
| if bld.env['BUILD_DRIVER_FFADO'] == True: | |||||
| create_jack_driver_obj(bld, 'firewire', 'firewire/JackFFADODriver.cpp', "LIBFFADO") | create_jack_driver_obj(bld, 'firewire', 'firewire/JackFFADODriver.cpp', "LIBFFADO") | ||||
| create_jack_driver_obj(bld, 'net', '../common/JackNetDriver.cpp') | create_jack_driver_obj(bld, 'net', '../common/JackNetDriver.cpp') | ||||
| @@ -2,30 +2,31 @@ | |||||
| # encoding: utf-8 | # encoding: utf-8 | ||||
| def create_jack_driver_obj(bld, target, sources, uselib = None): | def create_jack_driver_obj(bld, target, sources, uselib = None): | ||||
| driver = bld.create_obj('cpp', 'shlib') | |||||
| driver = bld.new_task_gen('cxx', 'shlib') | |||||
| driver.features.append('cc') | driver.features.append('cc') | ||||
| driver.env['shlib_PATTERN'] = 'jack_%s.so' | driver.env['shlib_PATTERN'] = 'jack_%s.so' | ||||
| driver.defines = ['HAVE_CONFIG_H','SERVER_SIDE'] | driver.defines = ['HAVE_CONFIG_H','SERVER_SIDE'] | ||||
| driver.includes = ['.', '../macosx', '../posix', '../common', '../common/jack'] | driver.includes = ['.', '../macosx', '../posix', '../common', '../common/jack'] | ||||
| driver.target = target | driver.target = target | ||||
| driver.source = sources | driver.source = sources | ||||
| driver.inst_var = bld.env()['ADDON_DIR'] | |||||
| driver.inst_dir = '/' | |||||
| driver.install_path = '${ADDON_DIR}/' | |||||
| driver.uselib_local = 'serverlib' | driver.uselib_local = 'serverlib' | ||||
| if uselib: | if uselib: | ||||
| driver.uselib = uselib | driver.uselib = uselib | ||||
| return driver | return driver | ||||
| def create_jack_audio_driver_obj(bld, target, sources, uselib = None): | def create_jack_audio_driver_obj(bld, target, sources, uselib = None): | ||||
| driver = bld.create_obj('cpp', 'shlib') | |||||
| driver = bld.new_task_gen('cxx', 'shlib') | |||||
| driver.features.append('cc') | driver.features.append('cc') | ||||
| driver.env['shlib_PATTERN'] = 'jack_%s.so' | driver.env['shlib_PATTERN'] = 'jack_%s.so' | ||||
| driver.defines = 'HAVE_CONFIG_H' | driver.defines = 'HAVE_CONFIG_H' | ||||
| driver.includes = ['.', '../macosx', '../posix', '../common', '../common/jack'] | driver.includes = ['.', '../macosx', '../posix', '../common', '../common/jack'] | ||||
| driver.target = target | driver.target = target | ||||
| driver.source = sources | driver.source = sources | ||||
| driver.inst_var = bld.env()['ADDON_DIR'] | |||||
| driver.inst_dir = '/' | |||||
| #steph | |||||
| #driver.inst_var = bld.env['ADDON_DIR'] | |||||
| #driver.inst_dir = '/' | |||||
| driver.install_path = '${ADDON_DIR}/' | |||||
| driver.uselib_local = 'serverlib' | driver.uselib_local = 'serverlib' | ||||
| driver.env.append_value("LINKFLAGS", "-framework CoreAudio -framework CoreServices -framework AudioUnit") | driver.env.append_value("LINKFLAGS", "-framework CoreAudio -framework CoreServices -framework AudioUnit") | ||||
| if uselib: | if uselib: | ||||
| @@ -33,7 +34,7 @@ def create_jack_audio_driver_obj(bld, target, sources, uselib = None): | |||||
| return driver | return driver | ||||
| def build(bld): | def build(bld): | ||||
| jackd = bld.create_obj('cpp', 'program') | |||||
| jackd = bld.new_task_gen('cxx', 'program') | |||||
| jackd.includes = ['.', '../macosx', '../posix', '../common', '../common/jack'] | jackd.includes = ['.', '../macosx', '../posix', '../common', '../common/jack'] | ||||
| jackd.defines = 'HAVE_CONFIG_H' | jackd.defines = 'HAVE_CONFIG_H' | ||||
| jackd.source = ['../common/Jackdmp.cpp'] | jackd.source = ['../common/Jackdmp.cpp'] | ||||
| @@ -48,7 +49,7 @@ def build(bld): | |||||
| portaudio_src = [ | portaudio_src = [ | ||||
| '../windows/JackPortAudioDriver.cpp', | '../windows/JackPortAudioDriver.cpp', | ||||
| '../windows/JackPortAudioDevices.cpp', | |||||
| '../windows/JackPortAudioDevices.cpp', | |||||
| ] | ] | ||||
| #create_jack_audio_driver_obj(bld, 'portaudio', portaudio_src) | #create_jack_audio_driver_obj(bld, 'portaudio', portaudio_src) | ||||
| @@ -13,16 +13,16 @@ test_programs = { | |||||
| def build(bld): | def build(bld): | ||||
| for test_program, test_program_sources in test_programs.items(): | for test_program, test_program_sources in test_programs.items(): | ||||
| prog = bld.create_obj('cpp', 'program') | |||||
| prog = bld.new_task_gen('cxx', 'program') | |||||
| prog.features.append('cc') | prog.features.append('cc') | ||||
| if bld.env()['IS_MACOSX']: | |||||
| if bld.env['IS_MACOSX']: | |||||
| prog.includes = ['../macosx', '../posix', '../common/jack', '../common'] | prog.includes = ['../macosx', '../posix', '../common/jack', '../common'] | ||||
| if bld.env()['IS_LINUX']: | |||||
| if bld.env['IS_LINUX']: | |||||
| prog.includes = ['../linux', '../posix', '../common/jack', '../common'] | prog.includes = ['../linux', '../posix', '../common/jack', '../common'] | ||||
| prog.source = test_program_sources | prog.source = test_program_sources | ||||
| if bld.env()['IS_LINUX']: | |||||
| if bld.env['IS_LINUX']: | |||||
| prog.uselib = 'RT' | prog.uselib = 'RT' | ||||
| if bld.env()['IS_MACOSX']: | |||||
| if bld.env['IS_MACOSX']: | |||||
| prog.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc") | prog.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc") | ||||
| #prog.env.append_value("LINKFLAGS", "-arch i386 -arch ppc") | #prog.env.append_value("LINKFLAGS", "-arch i386 -arch ppc") | ||||
| prog.env.append_value("LINKFLAGS", "") | prog.env.append_value("LINKFLAGS", "") | ||||
| @@ -2,10 +2,10 @@ | |||||
| # encoding: utf-8 | # encoding: utf-8 | ||||
| import os | import os | ||||
| import Params | |||||
| import Utils | |||||
| import Options | |||||
| import commands | import commands | ||||
| from Configure import g_maxlen | |||||
| #g_maxlen = 40 | |||||
| g_maxlen = 40 | |||||
| import shutil | import shutil | ||||
| import Task | import Task | ||||
| import re | import re | ||||
| @@ -24,7 +24,7 @@ def display_msg(msg, status = None, color = None): | |||||
| g_maxlen = max(g_maxlen, len(msg)) | g_maxlen = max(g_maxlen, len(msg)) | ||||
| if status: | if status: | ||||
| print "%s :" % msg.ljust(g_maxlen), | print "%s :" % msg.ljust(g_maxlen), | ||||
| Params.pprint(color, status) | |||||
| Utils.pprint(color, status) | |||||
| else: | else: | ||||
| print "%s" % msg.ljust(g_maxlen) | print "%s" % msg.ljust(g_maxlen) | ||||
| @@ -43,7 +43,7 @@ def create_svnversion_gen(bld, header='svnversion.h', define=None): | |||||
| #cls.before = 'cxx' | #cls.before = 'cxx' | ||||
| def sg(self): | def sg(self): | ||||
| rt = Params.h_file(self.m_outputs[0].abspath(self.env())) | |||||
| rt = Utils.h_file(self.outputs[0].abspath(self.env())) | |||||
| return rt | return rt | ||||
| cls.signature = sg | cls.signature = sg | ||||
| @@ -53,9 +53,9 @@ def create_svnversion_gen(bld, header='svnversion.h', define=None): | |||||
| #cls.cache_sig = property(sg, None) | #cls.cache_sig = property(sg, None) | ||||
| cls.cache_sig = None | cls.cache_sig = None | ||||
| tsk = cls('svnversion', bld.env().copy()) | |||||
| tsk.m_inputs = [] | |||||
| tsk.m_outputs = [bld.path.find_or_declare(header)] | |||||
| tsk = cls('svnversion') | |||||
| tsk.inputs = [] | |||||
| tsk.outputs = [bld.path.find_or_declare(header)] | |||||
| tsk.prio = 1 # execute this task first | tsk.prio = 1 # execute this task first | ||||
| def set_options(opt): | def set_options(opt): | ||||
| @@ -71,15 +71,15 @@ def set_options(opt): | |||||
| opt.sub_options('dbus') | opt.sub_options('dbus') | ||||
| def configure(conf): | def configure(conf): | ||||
| platform = conf.detect_platform() | |||||
| platform = Utils.detect_platform() | |||||
| conf.env['IS_MACOSX'] = platform == 'darwin' | conf.env['IS_MACOSX'] = platform == 'darwin' | ||||
| conf.env['IS_LINUX'] = platform == 'linux' | conf.env['IS_LINUX'] = platform == 'linux' | ||||
| if conf.env['IS_LINUX']: | if conf.env['IS_LINUX']: | ||||
| Params.pprint('CYAN', "Linux detected") | |||||
| Utils.pprint('CYAN', "Linux detected") | |||||
| if conf.env['IS_MACOSX']: | if conf.env['IS_MACOSX']: | ||||
| Params.pprint('CYAN', "MacOS X detected") | |||||
| Utils.pprint('CYAN', "MacOS X detected") | |||||
| conf.check_tool('compiler_cxx') | conf.check_tool('compiler_cxx') | ||||
| conf.check_tool('compiler_cc') | conf.check_tool('compiler_cc') | ||||
| @@ -87,7 +87,7 @@ def configure(conf): | |||||
| conf.sub_config('common') | conf.sub_config('common') | ||||
| if conf.env['IS_LINUX']: | if conf.env['IS_LINUX']: | ||||
| conf.sub_config('linux') | conf.sub_config('linux') | ||||
| if Params.g_options.dbus: | |||||
| if Options.options.dbus: | |||||
| conf.sub_config('dbus') | conf.sub_config('dbus') | ||||
| conf.sub_config('example-clients') | conf.sub_config('example-clients') | ||||
| @@ -97,11 +97,11 @@ def configure(conf): | |||||
| conf.env['JACK_API_VERSION'] = JACK_API_VERSION | conf.env['JACK_API_VERSION'] = JACK_API_VERSION | ||||
| conf.env['JACK_VERSION'] = VERSION | conf.env['JACK_VERSION'] = VERSION | ||||
| conf.env['BUILD_DOXYGEN_DOCS'] = Params.g_options.doxygen | |||||
| conf.env['BUILD_WITH_MONITOR'] = Params.g_options.monitor | |||||
| conf.env['BUILD_DOXYGEN_DOCS'] = Options.options.doxygen | |||||
| conf.env['BUILD_WITH_MONITOR'] = Options.options.monitor | |||||
| conf.define('CLIENT_NUM', Params.g_options.clients) | |||||
| conf.define('PORT_NUM', Params.g_options. ports) | |||||
| conf.define('CLIENT_NUM', Options.options.clients) | |||||
| conf.define('PORT_NUM', Options.options. ports) | |||||
| conf.define('ADDON_DIR', os.path.normpath(conf.env['PREFIX'] + '/lib/jack')) | conf.define('ADDON_DIR', os.path.normpath(conf.env['PREFIX'] + '/lib/jack')) | ||||
| conf.define('JACK_LOCATION', os.path.normpath(conf.env['PREFIX'] + '/bin')) | conf.define('JACK_LOCATION', os.path.normpath(conf.env['PREFIX'] + '/bin')) | ||||
| @@ -148,64 +148,65 @@ def configure(conf): | |||||
| if conf.env['DBUS_SERVICES_DIR'] != conf.env['DBUS-1_SESSION_BUS_SERVICES_DIR'][0]: | if conf.env['DBUS_SERVICES_DIR'] != conf.env['DBUS-1_SESSION_BUS_SERVICES_DIR'][0]: | ||||
| print Params.g_colors['RED'] + "WARNING: D-Bus session services directory as reported by pkg-config is" | |||||
| print Params.g_colors['RED'] + "WARNING:", | |||||
| print Params.g_colors['CYAN'] + conf.env['DBUS-1_SESSION_BUS_SERVICES_DIR'][0] | |||||
| print Params.g_colors['RED'] + 'WARNING: but service file will be installed in' | |||||
| print Params.g_colors['RED'] + "WARNING:", | |||||
| print Params.g_colors['CYAN'] + conf.env['DBUS_SERVICES_DIR'] | |||||
| print Params.g_colors['RED'] + 'WARNING: You may need to adjust your D-Bus configuration after installing jackdbus' | |||||
| print Logs.g_colors['RED'] + "WARNING: D-Bus session services directory as reported by pkg-config is" | |||||
| print Logs.g_colors['RED'] + "WARNING:", | |||||
| print Logs.g_colors['CYAN'] + conf.env['DBUS-1_SESSION_BUS_SERVICES_DIR'][0] | |||||
| print Logs.g_colors['RED'] + 'WARNING: but service file will be installed in' | |||||
| print Logs.g_colors['RED'] + "WARNING:", | |||||
| print Logs.g_colors['CYAN'] + conf.env['DBUS_SERVICES_DIR'] | |||||
| print Logs.g_colors['RED'] + 'WARNING: You may need to adjust your D-Bus configuration after installing jackdbus' | |||||
| print 'WARNING: You can override dbus service install directory' | print 'WARNING: You can override dbus service install directory' | ||||
| print 'WARNING: with --enable-pkg-config-dbus-service-dir option to this script' | print 'WARNING: with --enable-pkg-config-dbus-service-dir option to this script' | ||||
| print Params.g_colors['NORMAL'], | |||||
| print Logs.g_colors['NORMAL'], | |||||
| def build(bld): | def build(bld): | ||||
| if not os.access('svnversion.h', os.R_OK): | |||||
| create_svnversion_gen(bld) | |||||
| # Needs a fix : nedko ?? | |||||
| #if not os.access('svnversion.h', os.R_OK): | |||||
| # create_svnversion_gen(bld) | |||||
| # process subfolders from here | # process subfolders from here | ||||
| bld.add_subdirs('common') | bld.add_subdirs('common') | ||||
| if bld.env()['IS_LINUX']: | |||||
| if bld.env['IS_LINUX']: | |||||
| bld.add_subdirs('linux') | bld.add_subdirs('linux') | ||||
| if bld.env()['BUILD_JACKDBUS'] == True: | |||||
| if bld.env['BUILD_JACKDBUS'] == True: | |||||
| bld.add_subdirs('dbus') | bld.add_subdirs('dbus') | ||||
| bld.add_subdirs('example-clients') | bld.add_subdirs('example-clients') | ||||
| bld.add_subdirs('tests') | bld.add_subdirs('tests') | ||||
| if bld.env()['IS_MACOSX']: | |||||
| if bld.env['IS_MACOSX']: | |||||
| bld.add_subdirs('macosx') | bld.add_subdirs('macosx') | ||||
| bld.add_subdirs('example-clients') | bld.add_subdirs('example-clients') | ||||
| bld.add_subdirs('tests') | bld.add_subdirs('tests') | ||||
| if bld.env()['BUILD_JACKDBUS'] == True: | |||||
| if bld.env['BUILD_JACKDBUS'] == True: | |||||
| bld.add_subdirs('dbus') | bld.add_subdirs('dbus') | ||||
| if bld.env()['BUILD_DOXYGEN_DOCS'] == True: | |||||
| share_dir = bld.env().get_destdir() + Params.g_build.env()['PREFIX'] + '/share/jack-audio-connection-kit' | |||||
| if bld.env['BUILD_DOXYGEN_DOCS'] == True: | |||||
| share_dir = bld.env.get_destdir() + Build.bld.env()['PREFIX'] + '/share/jack-audio-connection-kit' | |||||
| html_docs_source_dir = "build/default/html" | html_docs_source_dir = "build/default/html" | ||||
| html_docs_install_dir = share_dir + '/reference/html/' | html_docs_install_dir = share_dir + '/reference/html/' | ||||
| if Params.g_commands['install']: | |||||
| if Options.commands['install']: | |||||
| if os.path.isdir(html_docs_install_dir): | if os.path.isdir(html_docs_install_dir): | ||||
| Params.pprint('CYAN', "Removing old doxygen documentation installation...") | |||||
| Utils.pprint('CYAN', "Removing old doxygen documentation installation...") | |||||
| shutil.rmtree(html_docs_install_dir) | shutil.rmtree(html_docs_install_dir) | ||||
| Params.pprint('CYAN', "Removing old doxygen documentation installation done.") | |||||
| Params.pprint('CYAN', "Installing doxygen documentation...") | |||||
| Utils.pprint('CYAN', "Removing old doxygen documentation installation done.") | |||||
| Utils.pprint('CYAN', "Installing doxygen documentation...") | |||||
| shutil.copytree(html_docs_source_dir, html_docs_install_dir) | shutil.copytree(html_docs_source_dir, html_docs_install_dir) | ||||
| Params.pprint('CYAN', "Installing doxygen documentation done.") | |||||
| elif Params.g_commands['uninstall']: | |||||
| Params.pprint('CYAN', "Uninstalling doxygen documentation...") | |||||
| Utils.pprint('CYAN', "Installing doxygen documentation done.") | |||||
| elif Options.commands['uninstall']: | |||||
| Utils.pprint('CYAN', "Uninstalling doxygen documentation...") | |||||
| if os.path.isdir(share_dir): | if os.path.isdir(share_dir): | ||||
| shutil.rmtree(share_dir) | shutil.rmtree(share_dir) | ||||
| Params.pprint('CYAN', "Uninstalling doxygen documentation done.") | |||||
| elif Params.g_commands['clean']: | |||||
| Utils.pprint('CYAN', "Uninstalling doxygen documentation done.") | |||||
| elif Options.commands['clean']: | |||||
| if os.access(html_docs_source_dir, os.R_OK): | if os.access(html_docs_source_dir, os.R_OK): | ||||
| Params.pprint('CYAN', "Removing doxygen generated documentation...") | |||||
| Utils.pprint('CYAN', "Removing doxygen generated documentation...") | |||||
| shutil.rmtree(html_docs_source_dir) | shutil.rmtree(html_docs_source_dir) | ||||
| Params.pprint('CYAN', "Removing doxygen generated documentation done.") | |||||
| elif Params.g_commands['build']: | |||||
| Utils.pprint('CYAN', "Removing doxygen generated documentation done.") | |||||
| elif Options.commands['build']: | |||||
| if not os.access(html_docs_source_dir, os.R_OK): | if not os.access(html_docs_source_dir, os.R_OK): | ||||
| os.popen("doxygen").read() | os.popen("doxygen").read() | ||||
| else: | else: | ||||
| Params.pprint('CYAN', "doxygen documentation already built.") | |||||
| Utils.pprint('CYAN', "doxygen documentation already built.") | |||||
| def dist_hook(): | def dist_hook(): | ||||
| os.remove('svnversion_regenerate.sh') | os.remove('svnversion_regenerate.sh') | ||||