Index: src/io/sink.c
===================================================================
--- src/io/sink.c	(revision dba9b331884f175429fc65227d7e0600e999e5dc)
+++ src/io/sink.c	(revision 9209c7960180903a723b8dd55d57bdbc1a0a3448)
@@ -24,7 +24,7 @@
 #include "fmat.h"
 #include "io/sink.h"
-#ifdef __APPLE__
+#ifdef HAVE_SINK_APPLE_AUDIO
 #include "io/sink_apple_audio.h"
-#endif /* __APPLE__ */
+#endif /* HAVE_SINK_APPLE_AUDIO */
 #ifdef HAVE_SNDFILE
 #include "io/sink_sndfile.h"
@@ -57,5 +57,5 @@
 aubio_sink_t * new_aubio_sink(char_t * uri, uint_t samplerate) {
   aubio_sink_t * s = AUBIO_NEW(aubio_sink_t);
-#ifdef __APPLE__
+#ifdef HAVE_SINK_APPLE_AUDIO
   s->sink = (void *)new_aubio_sink_apple_audio(uri, samplerate);
   if (s->sink) {
@@ -70,5 +70,5 @@
     return s;
   }
-#endif /* __APPLE__ */
+#endif /* HAVE_SINK_APPLE_AUDIO */
 #if HAVE_SNDFILE
   s->sink = (void *)new_aubio_sink_sndfile(uri, samplerate);
Index: src/io/sink_apple_audio.c
===================================================================
--- src/io/sink_apple_audio.c	(revision dba9b331884f175429fc65227d7e0600e999e5dc)
+++ src/io/sink_apple_audio.c	(revision 9209c7960180903a723b8dd55d57bdbc1a0a3448)
@@ -21,5 +21,5 @@
 #include "config.h"
 
-#ifdef __APPLE__
+#ifdef HAVE_SINK_APPLE_AUDIO
 
 #include "aubio_priv.h"
@@ -267,3 +267,3 @@
 }
 
-#endif /* __APPLE__ */
+#endif /* HAVE_SINK_APPLE_AUDIO */
Index: src/io/source.c
===================================================================
--- src/io/source.c	(revision dba9b331884f175429fc65227d7e0600e999e5dc)
+++ src/io/source.c	(revision 9209c7960180903a723b8dd55d57bdbc1a0a3448)
@@ -27,7 +27,7 @@
 #include "io/source_avcodec.h"
 #endif /* HAVE_LIBAV */
-#ifdef __APPLE__
+#ifdef HAVE_SOURCE_APPLE_AUDIO
 #include "io/source_apple_audio.h"
-#endif /* __APPLE__ */
+#endif /* HAVE_SOURCE_APPLE_AUDIO */
 #ifdef HAVE_SNDFILE
 #include "io/source_sndfile.h"
@@ -71,5 +71,5 @@
   }
 #endif /* HAVE_LIBAV */
-#ifdef __APPLE__
+#ifdef HAVE_SOURCE_APPLE_AUDIO
   s->source = (void *)new_aubio_source_apple_audio(uri, samplerate, hop_size);
   if (s->source) {
@@ -83,5 +83,5 @@
     return s;
   }
-#endif /* __APPLE__ */
+#endif /* HAVE_SOURCE_APPLE_AUDIO */
 #if HAVE_SNDFILE
   s->source = (void *)new_aubio_source_sndfile(uri, samplerate, hop_size);
Index: src/io/source_apple_audio.c
===================================================================
--- src/io/source_apple_audio.c	(revision dba9b331884f175429fc65227d7e0600e999e5dc)
+++ src/io/source_apple_audio.c	(revision 9209c7960180903a723b8dd55d57bdbc1a0a3448)
@@ -19,6 +19,8 @@
 */
 
-#ifdef __APPLE__
 #include "config.h"
+
+#ifdef HAVE_SOURCE_APPLE_AUDIO
+
 #include "aubio_priv.h"
 #include "fvec.h"
@@ -303,3 +305,3 @@
 }
 
-#endif /* __APPLE__ */
+#endif /* HAVE_SOURCE_APPLE_AUDIO */
Index: src/io/utils_apple_audio.c
===================================================================
--- src/io/utils_apple_audio.c	(revision dba9b331884f175429fc65227d7e0600e999e5dc)
+++ src/io/utils_apple_audio.c	(revision 9209c7960180903a723b8dd55d57bdbc1a0a3448)
@@ -1,3 +1,5 @@
-#ifdef __APPLE__
+#include "config.h"
+
+#if defined(HAVE_SOURCE_APPLE_AUDIO) || defined(HAVE_SINK_APPLE_AUDIO)
 
 // CFURLRef, CFURLCreateWithFileSystemPath, ...
@@ -53,3 +55,3 @@
 }
 
-#endif /* __APPLE__ */
+#endif /* defined(HAVE_SOURCE_APPLE_AUDIO) || defined(HAVE_SINK_APPLE_AUDIO) */
Index: wscript
===================================================================
--- wscript	(revision dba9b331884f175429fc65227d7e0600e999e5dc)
+++ wscript	(revision 9209c7960180903a723b8dd55d57bdbc1a0a3448)
@@ -106,11 +106,13 @@
         ctx.env.CFLAGS += ['-arch', 'i386', '-arch', 'x86_64']
         ctx.env.LINKFLAGS += ['-arch', 'i386', '-arch', 'x86_64']
+
+    if target_platform in [ 'darwin', 'ios', 'iosimulator']:
         ctx.env.FRAMEWORK = ['CoreFoundation', 'AudioToolbox', 'Accelerate']
+        ctx.define('HAVE_SOURCE_APPLE_AUDIO', 1)
+        ctx.define('HAVE_SINK_APPLE_AUDIO', 1)
         ctx.define('HAVE_ACCELERATE', 1)
 
     if target_platform in [ 'ios', 'iosimulator' ]:
-        ctx.define('HAVE_ACCELERATE', 1)
         ctx.define('TARGET_OS_IPHONE', 1)
-        ctx.env.FRAMEWORK = ['CoreFoundation', 'AudioToolbox', 'Accelerate']
         SDKVER="7.0"
         MINSDKVER="6.1"
