Fix thinko in cscript option defaults.
[dcpomatic.git] / wscript
diff --git a/wscript b/wscript
index b11eea0959eedba4a71767943622f4ede5383e4b..501bd4fb983df6544a71db6e4c1eb2817a5b119b 100644 (file)
--- a/wscript
+++ b/wscript
@@ -42,14 +42,13 @@ if this_version == '':
 else:
     VERSION = this_version[1:].strip()
 
-print('Version: %s' % VERSION)
-
 def options(opt):
     opt.load('compiler_cxx')
     opt.load('winres')
 
     opt.add_option('--enable-debug',      action='store_true', default=False, help='build with debugging information and without optimisation')
     opt.add_option('--disable-gui',       action='store_true', default=False, help='disable building of GUI tools')
+    opt.add_option('--player-only',       action='store_true', default=False, help='just build the player; no other tools')
     opt.add_option('--disable-tests',     action='store_true', default=False, help='disable building of tests')
     opt.add_option('--install-prefix',                         default=None,  help='prefix of where DCP-o-matic will be installed')
     opt.add_option('--target-windows',    action='store_true', default=False, help='set up to do a cross-compile to make a Windows package')
@@ -66,6 +65,7 @@ def options(opt):
     opt.add_option('--static-curl',       action='store_true', default=False, help='link statically to libcurl')
     opt.add_option('--workaround-gssapi', action='store_true', default=False, help='link to gssapi_krb5')
     opt.add_option('--force-cpp11',       action='store_true', default=False, help='force use of C++11')
+    opt.add_option('--variant',           help='build variant', choices=['swaroop'])
 
 def configure(conf):
     conf.load('compiler_cxx')
@@ -75,6 +75,7 @@ def configure(conf):
 
     # Save conf.options that we need elsewhere in conf.env
     conf.env.DISABLE_GUI = conf.options.disable_gui
+    conf.env.PLAYER_ONLY = conf.options.player_only
     conf.env.DISABLE_TESTS = conf.options.disable_tests
     conf.env.TARGET_WINDOWS = conf.options.target_windows
     conf.env.TARGET_OSX = sys.platform == 'darwin'
@@ -115,6 +116,9 @@ def configure(conf):
     else:
         conf.env.append_value('CXXFLAGS', '-O2')
 
+    if conf.options.variant is not None:
+        conf.env.append_value('CXXFLAGS', '-DDCPOMATIC_VARIANT_%s' % conf.options.variant.upper())
+
     #
     # Windows/Linux/OS X specific
     #
@@ -566,6 +570,7 @@ def configure(conf):
     # Other stuff
 
     conf.find_program('msgfmt', var='MSGFMT')
+    conf.check(header_name='valgrind/memcheck.h', mandatory=False)
 
     datadir = conf.env.DATADIR
     if not datadir:
@@ -607,15 +612,17 @@ def configure(conf):
 
     Logs.pprint('YELLOW', '')
 
-def download_supporters():
+def download_supporters(can_fail):
     last_date = subprocess.Popen(shlex.split('git log -1 --format=%%ai %s' % last_version), stdout=subprocess.PIPE).communicate()[0]
-    r = os.system('curl -f https://dcpomatic.com/supporters.cc?%s > src/wx/supporters.cc' % urlencode({"until": last_date.strip()}))
-    if (r >> 8) != 0:
-        raise Exception("Could not download supporters list")
+    r = os.system('curl -s -f https://dcpomatic.com/supporters.cc?%s > src/wx/supporters.cc' % urlencode({"until": last_date.strip()}))
+    if (r >> 8) == 0:
+        r = os.system('curl -s -f https://dcpomatic.com/subscribers.cc?%s > src/wx/subscribers.cc' % urlencode({"until": last_date.strip()}))
+    if (r >> 8) != 0 and can_fail:
+        raise Exception("Could not download supporters lists")
 
 def build(bld):
     create_version_cc(VERSION, bld.env.CXXFLAGS)
-    download_supporters()
+    download_supporters(not bld.env.DEBUG)
 
     bld.recurse('src')
     bld.recurse('graphics')