Commit 8ed3e822 authored by ethe's avatar ethe
Browse files

Fixed linking errors with frameworks for OSX

parent 7dbf04ca
......@@ -111,8 +111,9 @@ def build(bld):
'timestamps.c',
'../posix/JackPosixProcessSync.cpp',
'../posix/JackPosixThread.cpp',
'../macosx/JackMachThread.cpp',
'../macosx/JackMachSemaphore.cpp',
'../posix/JackPosixMutex.cpp',
'../macosx/JackMachThread.mm',
'../macosx/JackMachSemaphore.mm',
'../posix/JackSocket.cpp',
'../macosx/JackMachTime.c',
]
......@@ -132,7 +133,10 @@ def build(bld):
uselib.append('PSAPI')
uselib.append('WINMM')
clientlib = bld(features = ['c', 'cxx', 'cxxshlib', 'cshlib'])
if bld.env['IS_MACOSX']:
clientlib = bld(features = ['c', 'cxx', 'cxxshlib', 'cshlib'], framework = ['CoreAudio', 'Accelerate'])
else:
clientlib = bld(features = ['c', 'cxx', 'cxxshlib', 'cshlib'])
clientlib.defines = 'HAVE_CONFIG_H'
clientlib.use = uselib
if bld.env['IS_WINDOWS']:
......@@ -183,8 +187,7 @@ def build(bld):
if bld.env['IS_MACOSX']:
clientlib.env.append_value("CPPFLAGS", "-fvisibility=hidden")
clientlib.env.append_value("LINKFLAGS", "-framework CoreAudio -framework vecLib -single_module")
clientlib.env.append_value("LINKFLAGS", "-compatibility_version 1 -current_version 1")
clientlib.env.append_value("LINKFLAGS", "-single_module")
if bld.env['IS_SUN']:
clientlib.env.append_value("LINKFLAGS", "-lnsl -lsocket")
......@@ -194,7 +197,10 @@ def build(bld):
# we don't want to build other stuff in this variant
return
serverlib = bld(features = ['c', 'cxx', 'cxxshlib', 'cshlib'])
if bld.env['IS_MACOSX']:
serverlib = bld(features = ['c', 'cxx', 'cxxshlib', 'cshlib'], framework = ['CoreAudio', 'CoreFoundation', 'Accelerate'])
else:
serverlib = bld(features = ['c', 'cxx', 'cxxshlib', 'cshlib'])
serverlib.defines = ['HAVE_CONFIG_H','SERVER_SIDE']
serverlib.includes = includes
serverlib.name = 'serverlib'
......@@ -281,14 +287,16 @@ def build(bld):
if bld.env['IS_MACOSX']:
serverlib.env.append_value("CPPFLAGS", "-fvisibility=hidden")
serverlib.env.append_value("LINKFLAGS", "-framework CoreAudio -framework CoreFoundation -framework vecLib -single_module")
serverlib.env.append_value("LINKFLAGS", "-compatibility_version 1 -current_version 1")
serverlib.env.append_value("LINKFLAGS", "-single_module")
if bld.env['IS_SUN']:
serverlib.env.append_value("LINKFLAGS", "-lnsl -lsocket")
if bld.env['BUILD_NETLIB'] == True:
netlib = bld(features = ['c', 'cxx', 'cxxshlib', 'cshlib'])
if bld.env['IS_MACOSX']:
netlib = bld(features = ['c', 'cxx', 'cxxshlib', 'cshlib'], framework = ['CoreAudio'])
else:
netlib = bld(features = ['c', 'cxx', 'cxxshlib', 'cshlib'])
netlib.defines = ['HAVE_CONFIG_H','SERVER_SIDE']
netlib.includes = includes
netlib.name = 'netlib'
......@@ -297,6 +305,8 @@ def build(bld):
if bld.env['IS_WINDOWS']:
netlib.install_path = '${BINDIR}'
netlib.use += ['WS2_32', 'WINMM']
elif bld.env['IS_MACOSX']:
netlib.install_path = '${LIBDIR}'
else:
netlib.use += ['RT']
netlib.install_path = '${LIBDIR}'
......@@ -321,8 +331,8 @@ def build(bld):
if bld.env['IS_MACOSX']:
netlib.source += ['../posix/JackNetUnixSocket.cpp','../posix/JackPosixThread.cpp', '../posix/JackPosixMutex.cpp', '../macosx/JackMachThread.cpp', '../macosx/JackMachTime.c']
netlib.env.append_value("LINKFLAGS", "-framework CoreAudio -single_module")
netlib.source += ['../posix/JackNetUnixSocket.cpp','../posix/JackPosixThread.cpp', '../posix/JackPosixMutex.cpp', '../macosx/JackMachThread.mm', '../macosx/JackMachTime.c']
netlib.env.append_value("LINKFLAGS", "-single_module")
if bld.env['IS_WINDOWS']:
netlib.source += ['../windows/JackNetWinSocket.cpp','../windows/JackWinThread.cpp', '../windows/JackMMCSS.cpp', '../windows/JackWinTime.c']
......@@ -353,10 +363,19 @@ def build(bld):
'JackAudioAdapterFactory.cpp',
]
if bld.env['BUILD_ADAPTER'] and bld.env['IS_MACOSX']:
audio_adapter_sources += ['../macosx/coreaudio/JackCoreAudioAdapter.cpp']
process = create_jack_process_obj(bld, 'audioadapter', audio_adapter_sources, serverlib)
process.env.append_value("LINKFLAGS", "-framework CoreAudio -framework AudioUnit -framework AudioToolbox -framework CoreServices")
if bld.env['BUILD_ADAPTER'] and bld.env['IS_MACOSX'] and False:
audio_adapter_sources += ['../macosx/coreaudio/JackCoreAudioAdapter.mm']
process = create_jack_process_obj(bld,
'audioadapter',
audio_adapter_sources,
serverlib,
framework = [
"CoreAudio",
"AudioUnit",
"AudioToolbox",
"CoreServices"
]
)
process.use = 'SAMPLERATE'
if bld.env['BUILD_ADAPTER'] and bld.env['IS_LINUX'] and bld.env['BUILD_DRIVER_ALSA']:
......
......@@ -65,7 +65,10 @@ def build(bld):
else:
use = ['clientlib']
prog = bld(features='c cprogram')
if bld.env['IS_MACOSX']:
prog = bld(features='c cprogram', framework = ["Foundation"])
else:
prog = bld(features='c cprogram')
prog.includes = os_incdir + ['../common/jack', '../common']
prog.source = example_program_source
prog.use = use
......
......@@ -455,6 +455,7 @@ def options(opt):
def configure(conf):
conf.load('compiler_cxx')
conf.load('compiler_c')
if Options.options.dist_target == 'auto':
platform = sys.platform
conf.env['IS_MACOSX'] = platform == 'darwin'
......@@ -471,6 +472,7 @@ def configure(conf):
if conf.env['IS_MACOSX']:
Logs.pprint('CYAN', "MacOS X detected")
conf.check(lib='aften', uselib='AFTEN', define_name='AFTEN')
if conf.env['IS_SUN']:
Logs.pprint('CYAN', "SunOS detected")
......@@ -700,7 +702,9 @@ def build_jackd(bld):
includes = ['.', 'common', 'common/jack'],
target = 'jackd',
source = ['common/Jackdmp.cpp'],
use = ['serverlib'])
use = ['serverlib'],
framework = ['CoreFoundation']
)
if bld.env['BUILD_JACKDBUS']:
jackd.source += ['dbus/audio_reserve.c', 'dbus/reserve.c']
......@@ -710,7 +714,6 @@ def build_jackd(bld):
jackd.use += ['DL', 'M', 'PTHREAD', 'RT', 'STDC++']
if bld.env['IS_MACOSX']:
bld.framework = ['CoreFoundation']
jackd.use += ['DL', 'PTHREAD']
if bld.env['IS_SUN']:
......@@ -801,19 +804,20 @@ def build_drivers(bld):
]
coreaudio_src = [
'macosx/coreaudio/JackCoreAudioDriver.cpp'
'macosx/coreaudio/JackCoreAudioDriver.mm',
'common/JackAC3Encoder.cpp'
]
coremidi_src = [
'macosx/coremidi/JackCoreMidiInputPort.cpp',
'macosx/coremidi/JackCoreMidiOutputPort.cpp',
'macosx/coremidi/JackCoreMidiPhysicalInputPort.cpp',
'macosx/coremidi/JackCoreMidiPhysicalOutputPort.cpp',
'macosx/coremidi/JackCoreMidiVirtualInputPort.cpp',
'macosx/coremidi/JackCoreMidiVirtualOutputPort.cpp',
'macosx/coremidi/JackCoreMidiPort.cpp',
'macosx/coremidi/JackCoreMidiUtil.cpp',
'macosx/coremidi/JackCoreMidiDriver.cpp'
'macosx/coremidi/JackCoreMidiInputPort.mm',
'macosx/coremidi/JackCoreMidiOutputPort.mm',
'macosx/coremidi/JackCoreMidiPhysicalInputPort.mm',
'macosx/coremidi/JackCoreMidiPhysicalOutputPort.mm',
'macosx/coremidi/JackCoreMidiVirtualInputPort.mm',
'macosx/coremidi/JackCoreMidiVirtualOutputPort.mm',
'macosx/coremidi/JackCoreMidiPort.mm',
'macosx/coremidi/JackCoreMidiUtil.mm',
'macosx/coremidi/JackCoreMidiDriver.mm'
]
ffado_src = [
......@@ -930,13 +934,15 @@ def build_drivers(bld):
bld,
target = 'coreaudio',
source = coreaudio_src,
use = ['AFTEN'],
framework = ['AudioUnit', 'CoreAudio', 'CoreServices'])
create_driver_obj(
bld,
target = 'coremidi',
source = coremidi_src,
framework = ['AudioUnit', 'CoreMIDI', 'CoreServices'])
use = ['serverlib'], # FIXME: Is this needed?
framework = ['AudioUnit', 'CoreMIDI', 'CoreServices', 'Foundation'])
if bld.env['IS_SUN']:
create_driver_obj(
......@@ -1078,3 +1084,9 @@ def dist(ctx):
# This code blindly assumes it is working in the toplevel source directory.
if not os.path.exists('svnversion.h'):
os.system('./svnversion_regenerate.sh svnversion.h')
from waflib import TaskGen
@TaskGen.extension('.mm')
def mm_hook(self, node):
"""Alias .mm files to be compiled the same as .cpp files, gcc will do the right thing."""
return self.create_compiled_task('cxx', node)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment