From c0673497a657e134fc958bea97a58d591cb7ed7d Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 27 Apr 2016 19:58:54 -0400 Subject: [PATCH] add a new configure-time for Cocoa live resizing macros These were added in 10.6 but we're trying to be nice and look for the feature, not some version --- gtk2_ardour/wscript | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/gtk2_ardour/wscript b/gtk2_ardour/wscript index 4543bc022a..76992a25be 100644 --- a/gtk2_ardour/wscript +++ b/gtk2_ardour/wscript @@ -1,6 +1,7 @@ #!/usr/bin/env python from waflib.extras import autowaf as autowaf from waflib import Options, TaskGen +from waflib.ConfigSet import ConfigSet import waflib.Logs as Logs, waflib.Utils as Utils import os import shutil @@ -11,11 +12,18 @@ from waflib.Task import Task from waflib.Tools import winres import subprocess import glob +import copy # Mandatory variables top = '.' out = 'build' +from waflib import TaskGen +@TaskGen.extension('.m') +def m_hook(self, node): + """Alias .m files to be compiled the same as .c files, gcc will do the right thing.""" + return self.create_compiled_task('c', node) + path_prefix = 'gtk2_ardour/' gtk2_ardour_sources = [ @@ -322,6 +330,26 @@ def configure(conf): autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.1', mandatory=False) autowaf.check_pkg(conf, 'fontconfig', uselib_store='FONTCONFIG') + + if sys.platform == 'darwin': + retval = conf.run_c_code (code='#include \n\ + int main(void) { (void) NSWindowWillStartLiveResizeNotification; return 0; }\n', + env = conf.env.derive (), + features = [ 'c' ], + compiler = 'cc', + compile_filename='test.m', + msg = 'Checking for Cocoa live resizing constants', + okmsg = 'ok', + errmsg = 'too old - AU plugin windows will be fixed size', + mandatory = False, + ) + + if retval == 0: + autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'ok') + conf.define ('HAVE_COCOA_LIVE_RESIZING', 1) + else: + autowaf.display_msg (conf, 'Checking for Cocoa live resizing constants', 'too old - AU plugin windows will be fixed size') + conf.write_config_header('gtk2ardour-config.h', remove=False) bak = conf.env['define_key']