Commit e0281d82 authored by Adrian Knoth's avatar Adrian Knoth Committed by GitHub
Browse files

Merge pull request #190 from jackaudio/waf-macosx-fixes

Waf macosx fixes
parents 4cf826c8 cf48eedf
sudo: false
os:
- osx
- linux
language:
- cpp
compiler:
- gcc
install:
- sudo apt-get install libsamplerate-dev libsndfile-dev libasound2-dev
- clang
addons:
apt:
packages:
- libsamplerate-dev
- libsndfile-dev
- libasound2-dev
before_install:
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew outdated pkg-config || brew upgrade pkg-config; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install aften; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install libsamplerate; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install libsndfile; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install opus; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install readline; fi
script:
- ./waf configure --alsa
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then ./waf configure --alsa; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then ./waf configure --opus=no --readline=no; fi
- ./waf build
matrix:
exclude:
- os: osx
compiler: gcc
......@@ -133,6 +133,4 @@ WAFLIB_STRIP_EXTRAS="
valadoc
why
win32_opts
xcode
xcode6
"
......@@ -17,12 +17,14 @@ def configure(conf):
conf.check(function_name='timeGetDevCaps', header_name=['windows.h', 'mmsystem.h'], lib='winmm', uselib_store="WINMM", define_name='HAVE_MMSYSTEM_H')
conf.check(function_name='EnumProcesses', header_name=['windows.h', 'psapi.h'], lib='psapi', uselib_store="PSAPI", define_name='HAVE_PSAPI_H')
def create_jack_process_obj(bld, target, sources, uselib = None):
def create_jack_process_obj(bld, target, sources, uselib = None, framework = None):
process = bld(features = ['cxx', 'cxxshlib'])
if not bld.env['IS_WINDOWS']:
process.env['cxxshlib_PATTERN'] = '%s.so'
process.defines = ['HAVE_CONFIG_H','SERVER_SIDE']
if bld.env['IS_MACOSX']:
if framework:
process.framework = framework
env_includes = ['../macosx', '../posix', '../macosx/coreaudio']
if bld.env['IS_LINUX']:
env_includes = ['../linux', '../posix', '../linux/alsa']
......@@ -37,8 +39,6 @@ def create_jack_process_obj(bld, target, sources, uselib = None):
if bld.env['IS_LINUX']:
process.env.append_value("CPPFLAGS", "-fvisibility=hidden")
if bld.env['IS_MACOSX']:
process.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc -arch x86_64")
#process.env.append_value("LINKFLAGS", "-arch i386 -arch ppc -arch x86_64")
process.env.append_value("CPPFLAGS", "-fvisibility=hidden")
process.install_path = '${ADDON_DIR}/'
process.use = [uselib.name]
......@@ -113,8 +113,10 @@ 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/JackPosixSemaphore.cpp',
'../posix/JackSocket.cpp',
'../macosx/JackMachTime.c',
]
......@@ -135,6 +137,8 @@ def build(bld):
uselib.append('WINMM')
clientlib = bld(features = ['c', 'cxx', 'cxxshlib', 'cshlib'])
if bld.env['IS_MACOSX']:
clientlib.framework = ['CoreAudio', 'Accelerate']
clientlib.defines = 'HAVE_CONFIG_H'
clientlib.use = uselib
if bld.env['IS_WINDOWS']:
......@@ -185,10 +189,7 @@ def build(bld):
if bld.env['IS_MACOSX']:
clientlib.env.append_value("CPPFLAGS", "-fvisibility=hidden")
clientlib.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc -arch x86_64")
#clientlib.env.append_value("LINKFLAGS", "-framework CoreAudio -framework vecLib -single_module -arch i386 -arch ppc -arch x86_64"
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")
......@@ -199,6 +200,8 @@ def build(bld):
return
serverlib = bld(features = ['c', 'cxx', 'cxxshlib', 'cshlib'])
if bld.env['IS_MACOSX']:
serverlib.framework = ['CoreAudio', 'CoreFoundation', 'Accelerate']
serverlib.defines = ['HAVE_CONFIG_H','SERVER_SIDE']
serverlib.includes = includes
serverlib.name = 'serverlib'
......@@ -285,16 +288,15 @@ def build(bld):
if bld.env['IS_MACOSX']:
serverlib.env.append_value("CPPFLAGS", "-fvisibility=hidden")
serverlib.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc -arch x86_64")
#serverlib.env.append_value("LINKFLAGS", "-framework CoreAudio -framework vecLib -single_module -arch i386 -arch ppc -arch x86_64")
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']:
netlib = bld(features = ['c', 'cxx', 'cxxshlib', 'cshlib'])
if bld.env['IS_MACOSX']:
netlib.framework = ['CoreAudio']
netlib.defines = ['HAVE_CONFIG_H','SERVER_SIDE']
netlib.includes = includes
netlib.name = 'netlib'
......@@ -303,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}'
......@@ -327,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']
......@@ -360,10 +364,19 @@ def build(bld):
]
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")
process.use = 'SAMPLERATE'
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']:
audio_adapter_sources += ['../linux/alsa/JackAlsaAdapter.cpp']
......
......@@ -66,14 +66,13 @@ def build(bld):
else:
use = ['clientlib']
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
if bld.env['IS_MACOSX']:
prog.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc -arch x86_64")
#prog.env.append_value("LINKFLAGS", "-arch i386 -arch ppc -arch x86_64")
prog.env.append_value("LINKFLAGS", "")
if bld.env['IS_LINUX']:
prog.use += ['RT', 'M']
if bld.env['IS_SUN']:
......@@ -86,10 +85,6 @@ def build(bld):
prog.includes = os_incdir + ['../common/jack', '../common']
prog.source = 'transport.c'
prog.use = ['clientlib']
if bld.env['IS_MACOSX']:
prog.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc -arch x86_64")
#prog.env.append_value("LINKFLAGS", "-arch i386 -arch ppc -arch x86_64")
prog.env.append_value("LINKFLAGS", "")
if bld.env['IS_LINUX']:
prog.use += ['RT', 'READLINE']
if bld.env['IS_MACOSX']:
......@@ -104,9 +99,6 @@ def build(bld):
prog.source = 'capture_client.c'
prog.use = ['clientlib']
if bld.env['IS_MACOSX']:
prog.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc -arch x86_64")
#prog.env.append_value("LINKFLAGS", "-arch i386 -arch ppc -arch x86_64")
prog.env.append_value("LINKFLAGS", "")
prog.use += ['SNDFILE']
if bld.env['IS_LINUX']:
prog.use += ['RT', 'SNDFILE']
......@@ -147,10 +139,6 @@ def build(bld):
lib.includes = os_incdir + ['../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 -arch x86_64")
#lib.env.append_value("LINKFLAGS", "-arch i386 -arch ppc -arch x86_64")
lib.env.append_value("LINKFLAGS", "")
if bld.env['IS_SUN']:
lib.env.append_value("LINKFLAGS", "-lm")
lib.use = 'serverlib'
......
......@@ -70,7 +70,7 @@ typedef unsigned char Boolean;
#include "JackPosixThread.h"
#ifndef MY_TARGET_OS_IPHONE
#include <CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h>
#include <MacTypes.h>
#endif
#include <mach/thread_policy.h>
......
......@@ -22,8 +22,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#include <string>
#include <CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h>
#include <CoreServices/../Frameworks/CarbonCore.framework/Headers/Debugging.h>
#include <MacTypes.h>
namespace Jack {
......
......@@ -18,6 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <sstream>
#include <Foundation/Foundation.h>
#include "JackError.h"
#include "JackCoreMidiUtil.h"
......@@ -25,13 +26,15 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
std::string
Jack::GetMacOSErrorString(OSStatus status)
{
const char *message = GetMacOSStatusErrorString(status);
if (! message) {
std::stringstream stream;
stream << "error (code: '" << status << "')";
return stream.str();
NSError *error = [NSError errorWithDomain:NSOSStatusErrorDomain code:status userInfo:nil];
NSString *errorString = [error localizedDescription];
std::string returnString;
if (errorString){
returnString = std::string([errorString UTF8String]);
} else {
returnString = std::string("No error");
}
return std::string(message);
return returnString;
}
void
......
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