Commit 3f0c8752 authored by sletz's avatar sletz
Browse files

On OSX waf now compiles Universal Binaries.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2536 0c269be4-1314-0410-8aa9-9f06e86f4224
parent c380ee7b
......@@ -21,6 +21,10 @@ Romain Moret
Jackdmp changes log
---------------------------
2008-06-18 Stephane Letz <letz@grame.fr>
* On OSX waf now compiles Universal Binaries.
2008-06-17 Stephane Letz <letz@grame.fr>
* Driver class hierarchy simplification.
......
......@@ -134,7 +134,7 @@ def build(bld):
serverlib.env.append_value("CPPFLAGS", "-fvisibility=hidden")
if bld.env()['IS_MACOSX']:
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")
serverlib.env.append_value("LINKFLAGS", "-framework CoreAudio -framework vecLib -single_module -arch i386 -arch ppc")
clientlib = bld.create_obj('cpp', 'shlib')
clientlib.features.append('cc')
......@@ -168,7 +168,7 @@ def build(bld):
clientlib.env.append_value("CPPFLAGS", "-fvisibility=hidden")
if bld.env()['IS_MACOSX']:
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")
clientlib.env.append_value("LINKFLAGS", "-framework CoreAudio -framework vecLib -single_module -arch i386 -arch ppc")
netmanagerlib = bld.create_obj('cpp', 'shlib')
netmanagerlib.env['shlib_PATTERN'] = '%s.so'
......@@ -177,6 +177,9 @@ def build(bld):
netmanagerlib.target = 'netmanager'
netmanagerlib.source = 'JackNetManager.cpp'
netmanagerlib.env.append_value("CPPFLAGS", "-fvisibility=hidden")
if bld.env()['IS_MACOSX']:
netmanagerlib.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc")
netmanagerlib.env.append_value("LINKFLAGS", "-arch i386 -arch ppc")
netmanagerlib.inst_var = bld.env()['ADDON_DIR']
netmanagerlib.inst_dir = '/'
if bld.env()['IS_MACOSX']: # is this really macosx sepcific?
......
......@@ -54,19 +54,28 @@ def configure(conf):
conf.env['BUILD_EXAMPLE_CLIENT_REC'] = conf.is_defined('HAVE_SNDFILE')
def build(bld):
for example_program, example_program_source in example_programs.items():
prog = bld.create_obj('cc', 'program')
prog.includes = ['../common/jack', '../common']
prog.source = example_program_source
if bld.env()['IS_MACOSX']:
prog.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc")
prog.env.append_value("LINKFLAGS", "-arch i386 -arch ppc")
if bld.env()['IS_LINUX']:
prog.uselib = 'RT'
prog.uselib_local = 'clientlib'
prog.target = example_program
if bld.env()['BUILD_EXAMPLE_CLIENT_TRANSPORT'] == True:
#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')
prog.includes = ['../common/jack', '../common']
prog.source = 'transport.c'
if bld.env()['IS_MACOSX']:
prog.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc")
prog.env.append_value("LINKFLAGS", "-arch i386 -arch ppc")
if bld.env()['IS_LINUX']:
prog.uselib = 'RT READLINE NCURSES'
if bld.env()['IS_MACOSX']:
......@@ -78,6 +87,9 @@ def build(bld):
prog = bld.create_obj('cc', 'program')
prog.includes = ['../common/jack', '../common']
prog.source = 'capture_client.c'
if bld.env()['IS_MACOSX']:
prog.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc")
prog.env.append_value("LINKFLAGS", "-arch i386 -arch ppc")
if bld.env()['IS_LINUX']:
prog.uselib = 'RT SNDFILE'
if bld.env()['IS_MACOSX']:
......@@ -91,6 +103,9 @@ def build(bld):
lib.includes = ['../common/jack', '../common']
lib.target = example_lib
lib.source = example_lib_source
if bld.env()['IS_MACOSX']:
lib.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc")
lib.env.append_value("LINKFLAGS", "-arch i386 -arch ppc")
lib.uselib_local = 'clientlib'
lib.inst_var = bld.env()['ADDON_DIR']
lib.inst_dir = '/'
......
......@@ -35,20 +35,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
namespace Jack
{
static void PrintStreamDesc(AudioStreamBasicDescription *inDesc)
{
jack_log("- - - - - - - - - - - - - - - - - - - -");
jack_log(" Sample Rate:%f", inDesc->mSampleRate);
jack_log(" Format ID:%.*s", (int) sizeof(inDesc->mFormatID), (char*)&inDesc->mFormatID);
jack_log(" Format Flags:%lX", inDesc->mFormatFlags);
jack_log(" Bytes per Packet:%ld", inDesc->mBytesPerPacket);
jack_log(" Frames per Packet:%ld", inDesc->mFramesPerPacket);
jack_log(" Bytes per Frame:%ld", inDesc->mBytesPerFrame);
jack_log(" Channels per Frame:%ld", inDesc->mChannelsPerFrame);
jack_log(" Bits per Channel:%ld", inDesc->mBitsPerChannel);
jack_log("- - - - - - - - - - - - - - - - - - - -");
}
static void printError(OSStatus err)
{
switch (err) {
......@@ -215,7 +201,11 @@ OSStatus JackCoreAudioDriver::MeasureCallback(AudioDeviceID inDevice,
{
JackCoreAudioDriver* driver = (JackCoreAudioDriver*)inClientData;
AudioDeviceStop(driver->fDeviceID, MeasureCallback);
#ifdef MAC_OS_X_VERSION_10_5
AudioDeviceDestroyIOProcID(driver->fDeviceID, driver->fMesureCallbackID);
#else
AudioDeviceRemoveIOProc(driver->fDeviceID, MeasureCallback);
#endif
jack_log("JackCoreAudioDriver::MeasureCallback called");
JackMachThread::GetParams(&driver->fEngineControl->fPeriod, &driver->fEngineControl->fComputation, &driver->fEngineControl->fConstraint);
// Setup threadded based log function
......@@ -868,7 +858,11 @@ int JackCoreAudioDriver::AddListeners()
void JackCoreAudioDriver::RemoveListeners()
{
#ifdef MAC_OS_X_VERSION_10_5
AudioDeviceDestroyIOProcID(fDeviceID, fMesureCallbackID);
#else
AudioDeviceRemoveIOProc(fDeviceID, MeasureCallback);
#endif
AudioDeviceRemovePropertyListener(fDeviceID, 0, true, kAudioDeviceProcessorOverload, DeviceNotificationCallback);
AudioDeviceRemovePropertyListener(fDeviceID, 0, true, kAudioHardwarePropertyDevices, DeviceNotificationCallback);
AudioDeviceRemovePropertyListener(fDeviceID, 0, true, kAudioDevicePropertyNominalSampleRate, DeviceNotificationCallback);
......@@ -1068,8 +1062,11 @@ int JackCoreAudioDriver::Start()
{
jack_log("JackCoreAudioDriver::Start");
JackAudioDriver::Start();
#ifdef MAC_OS_X_VERSION_10_5
OSStatus err = AudioDeviceCreateIOProcID(fDeviceID, MeasureCallback, this, &fMesureCallbackID);
#else
OSStatus err = AudioDeviceAddIOProc(fDeviceID, MeasureCallback, this);
#endif
if (err != noErr)
return -1;
......@@ -1090,7 +1087,11 @@ int JackCoreAudioDriver::Stop()
{
jack_log("JackCoreAudioDriver::Stop");
AudioDeviceStop(fDeviceID, MeasureCallback);
#ifdef MAC_OS_X_VERSION_10_5
AudioDeviceDestroyIOProcID(fDeviceID, fMesureCallbackID);
#else
AudioDeviceRemoveIOProc(fDeviceID, MeasureCallback);
#endif
return (AudioOutputUnitStop(fAUHAL) == noErr) ? 0 : -1;
}
......
......@@ -72,7 +72,11 @@ class JackCoreAudioDriver : public JackAudioDriver
bool fMonitor;
float fIOUsage;
#ifdef MAC_OS_X_VERSION_10_5
AudioDeviceIOProcID fMesureCallbackID;
#endif
static OSStatus Render(void *inRefCon,
AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp *inTimeStamp,
......
......@@ -17,6 +17,9 @@ def build(bld):
prog.source = test_program_sources
if bld.env()['IS_LINUX']:
prog.uselib = 'RT'
if bld.env()['IS_MACOSX']:
prog.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc")
prog.env.append_value("LINKFLAGS", "-arch i386 -arch ppc")
prog.uselib_local = 'clientlib'
prog.target = test_program
if test_program != 'jack_test':
......
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