OSX: proper scons config and linking weak for jackOSX and errorhandling
authorJens Verwiebe <info@jensverwiebe.de>
Mon, 12 Dec 2011 22:17:02 +0000 (22:17 +0000)
committerJens Verwiebe <info@jensverwiebe.de>
Mon, 12 Dec 2011 22:17:02 +0000 (22:17 +0000)
SConstruct
build_files/scons/config/darwin-config.py
intern/audaspace/jack/AUD_JackDevice.h

index 0bd7dc7044642432134ca2308bde8f38dfddbb35..d8db597d1c6d956081cb913c5c985816e61a3b43 100644 (file)
@@ -272,7 +272,7 @@ if 'blenderlite' in B.targets:
         if k not in B.arguments:
             env[k] = v
 
-# Extended OSX_SDK and 3D_CONNEXION_CLIENT_LIBRARY detection for OSX
+# Extended OSX_SDK and 3D_CONNEXION_CLIENT_LIBRARY and JAckOSX detection for OSX
 if env['OURPLATFORM']=='darwin':
     print B.bc.OKGREEN + "Detected Xcode version: -- " + B.bc.ENDC + env['XCODE_CUR_VER'][:9] + " --"
     print "Available " + env['MACOSX_SDK_CHECK']
@@ -291,6 +291,16 @@ if env['OURPLATFORM']=='darwin':
         else:
             env.Append(LINKFLAGS=['-Xlinker','-weak_framework','-Xlinker','3DconnexionClient'])
 
+    # for now, Mac builders must download and install the JackOSX framework 
+    # necessary header file lives here when installed:
+    # /Library/Frameworks/Jackmp.framework/Versions/A/Headers/jack.h
+    if env['WITH_BF_JACK'] == 1:
+        if not os.path.exists('/Library/Frameworks/Jackmp.framework'):
+            print "JackOSX install not found, disabling WITH_BF_JACK" # avoid build errors !
+            env['WITH_BF_JACK'] = 0
+        else:
+            env.Append(LINKFLAGS=['-Xlinker','-weak_framework','-Xlinker','Jackmp'])
+
 if env['WITH_BF_OPENMP'] == 1:
         if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
                 env['CCFLAGS'].append('/openmp')
index e0b8822ce367897d481bcabc9e2d2a61f6898b24..b84890fbba367b2fe4320c3b7a42494c5c19f91a 100644 (file)
@@ -148,12 +148,12 @@ BF_CXX = '/usr'
 WITH_BF_STATICCXX = False
 BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
 
-# TODO - set proper paths here (add precompiled to lib/ ? )
-WITH_BF_JACK = False
-BF_JACK = '/usr'
-BF_JACK_INC = '${BF_JACK}/include/jack'
+# we use simply jack framework
+WITH_BF_JACK = True
+BF_JACK = '/Library/Frameworks/Jackmp.framework'
+BF_JACK_INC = '${BF_JACK}/headers'
 BF_JACK_LIB = 'jack'
-BF_JACK_LIBPATH = '${BF_JACK}/lib'
+BF_JACK_LIBPATH = '${BF_JACK}'
 
 WITH_BF_SNDFILE = True
 BF_SNDFILE = LIBDIR + '/sndfile'
index 3813685dbb6bd66620d07595dbd1b9b0fc7e1199..6373d4f9d6df5b41d5c5930638b9096ba2de6728 100644 (file)
 
 #include <string>
 
+#if defined(__APPLE__) // always first include for jack weaklinking !
+#include <weakjack.h>
+#endif
+
 #include <jack.h>
 #include <ringbuffer.h>