wscript: add option to build fat binary on mac
authorPaul Brossier <piem@piem.org>
Sun, 15 Jul 2012 21:09:59 +0000 (15:09 -0600)
committerPaul Brossier <piem@piem.org>
Sun, 15 Jul 2012 21:09:59 +0000 (15:09 -0600)
wscript

diff --git a/wscript b/wscript
index 246c42e..a00a5fc 100644 (file)
--- a/wscript
+++ b/wscript
@@ -68,6 +68,12 @@ def configure(ctx):
   if Options.platform == 'win32':
     ctx.env['shlib_PATTERN'] = 'lib%s.dll'
 
+  if Options.platform == 'macfat':
+    ctx.env.CFLAGS += ['-arch', 'i386', '-arch', 'x86_64']
+    ctx.env.LINKFLAGS += ['-arch', 'i386', '-arch', 'x86_64']
+    ctx.env.CC = 'llvm-gcc-4.2'
+    ctx.env.LINK_CC = 'llvm-gcc-4.2'
+
   # check for required headers
   ctx.check(header_name='stdlib.h')
   ctx.check(header_name='stdio.h')