wscript: make fat build optional
authorPaul Brossier <piem@piem.org>
Mon, 31 Mar 2014 02:53:29 +0000 (23:53 -0300)
committerPaul Brossier <piem@piem.org>
Mon, 31 Mar 2014 02:53:29 +0000 (23:53 -0300)
wscript

diff --git a/wscript b/wscript
index cd41fd5..c3b3fe6 100644 (file)
--- a/wscript
+++ b/wscript
@@ -72,6 +72,9 @@ def options(ctx):
     add_option_enable_disable(ctx, 'double', default = False,
             help_str = 'compile in double precision mode',
             help_disable_str = 'compile in single precision mode (default)')
     add_option_enable_disable(ctx, 'double', default = False,
             help_str = 'compile in double precision mode',
             help_disable_str = 'compile in single precision mode (default)')
+    add_option_enable_disable(ctx, 'fat', default = False,
+            help_str = 'build fat binaries (darwin only)',
+            help_disable_str = 'do not build fat binaries (default)')
 
     ctx.add_option('--with-target-platform', type='string',
             help='set target platform for cross-compilation', dest='target_platform')
 
     ctx.add_option('--with-target-platform', type='string',
             help='set target platform for cross-compilation', dest='target_platform')
@@ -102,7 +105,7 @@ def configure(ctx):
         ctx.define('HAVE_WIN_HACKS', 1)
         ctx.env['cshlib_PATTERN'] = 'lib%s.dll'
 
         ctx.define('HAVE_WIN_HACKS', 1)
         ctx.env['cshlib_PATTERN'] = 'lib%s.dll'
 
-    if target_platform == 'darwin':
+    if target_platform == 'darwin' and ctx.options.enable_fat:
         ctx.env.CFLAGS += ['-arch', 'i386', '-arch', 'x86_64']
         ctx.env.LINKFLAGS += ['-arch', 'i386', '-arch', 'x86_64']
 
         ctx.env.CFLAGS += ['-arch', 'i386', '-arch', 'x86_64']
         ctx.env.LINKFLAGS += ['-arch', 'i386', '-arch', 'x86_64']