Prevent note creation drags with no movement of the pointer. May fix #3159.
[ardour.git] / wscript
diff --git a/wscript b/wscript
index 1bf6a0a8fba750613c7f9d67d4b49488130042e6..f7fe4adee0ebb75ec521f725c78fb9fc38ec0885 100644 (file)
--- a/wscript
+++ b/wscript
@@ -301,7 +301,9 @@ def set_compiler_flags (conf,opt):
        #
 
        conf.env.append_value('CCFLAGS', [ '-D_LARGEFILE64_SOURCE', '-D_LARGEFILE_SOURCE' ])
+       conf.env.append_value('CCFLAGS', [ '-D_FILE_OFFSET_BITS=64', '-D_FILE_OFFSET_BITS=64' ])
        conf.env.append_value('CXXFLAGS', [ '-D_LARGEFILE64_SOURCE', '-D_LARGEFILE_SOURCE' ])
+       conf.env.append_value('CXXFLAGS', [ '-D_FILE_OFFSET_BITS=64', '-D_FILE_OFFSET_BITS=64' ])
        if opt.nls:
                conf.env.append_value('CXXFLAGS', '-DENABLE_NLS')
                conf.env.append_value('CCFLAGS', '-DENABLE_NLS')
@@ -313,6 +315,8 @@ def set_compiler_flags (conf,opt):
 
 def set_options(opt):
        autowaf.set_options(opt)
+       opt.add_option('--program-name', type='string', action='store', default='Ardour', dest='program_name',
+                       help='The user-visible name of the program being built')
        opt.add_option('--arch', type='string', action='store', dest='arch',
                        help='Architecture-specific compiler flags')
        opt.add_option('--boost-sp-debug', action='store_true', default=False, dest='boost_sp_debug',
@@ -343,6 +347,8 @@ def set_options(opt):
        opt.add_option('--no-nls', action='store_false', dest='nls')
        opt.add_option('--stl-debug', action='store_true', default=False, dest='stl_debug',
                        help='Build with debugging for the STL')
+       opt.add_option('--test', action='store_true', default=False, dest='build_tests', 
+                       help="Build unit tests")
        opt.add_option('--tranzport', action='store_true', default=False, dest='tranzport',
                        help='Compile with support for Frontier Designs Tranzport (if libusb is available)')
        opt.add_option('--universal', action='store_true', default=False, dest='universal',
@@ -366,6 +372,7 @@ def sub_config_and_use(conf, name, has_objects = True):
 
 def configure(conf):
        create_stored_revision()
+        conf.env['VERSION'] = VERSION
        autowaf.set_recursive()
        autowaf.configure(conf)
        
@@ -454,7 +461,19 @@ def configure(conf):
 
        if Options.options.boost_sp_debug:
                conf.env.append_value('CXXFLAGS', '-DBOOST_SP_ENABLE_DEBUG_HOOKS')
-       
+
+       autowaf.check_header(conf, 'boost/signals2.hpp', mandatory = True)
+
+       autowaf.check_header(conf, 'jack/session.h', define="JACK_SESSION")
+
+       conf.check_cc(fragment = "#include <boost/version.hpp>\nint main(void) { return (BOOST_VERSION >= 103900 ? 0 : 1); }\n",
+                     execute = "1",
+                     mandatory = True,
+                     msg = 'Checking for boost library >= 1.39',
+                     okmsg = 'ok',
+                     errmsg = 'too old\nPlease install boost version 1.39 or higher.')
+
+       autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT', atleast_version='1.12.0', mandatory=False)
        autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2')
        autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD', atleast_version='2.2')
        autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.14.0')
@@ -470,7 +489,7 @@ def configure(conf):
 
        conf.env.append_value('CCFLAGS', '-DWAF_BUILD')
        conf.env.append_value('CXXFLAGS', '-DWAF_BUILD')
-
+       
        autowaf.print_summary(conf)
        opts = Options.options
        autowaf.display_header('Ardour Configuration')
@@ -501,24 +520,63 @@ def configure(conf):
        if opts.nls:
                conf.define ('ENABLE_NLS', 1)
        autowaf.display_msg(conf, 'Tranzport', opts.tranzport)
+       if opts.build_tests:
+               conf.env['BUILD_TESTS'] = opts.build_tests
+               autowaf.display_msg(conf, 'Unit Tests', bool(conf.env['BUILD_TESTS']) and bool (conf.env['HAVE_CPPUNIT']))
        if opts.tranzport:
                conf.define('TRANZPORT', 1)
        autowaf.display_msg(conf, 'Universal Binary', opts.universal)
        autowaf.display_msg(conf, 'VST Support', opts.vst)
        if opts.vst:
                conf.define('VST_SUPPORT', 1)
+       if bool(conf.env['JACK_SESSION']):
+               conf.define ('HAVE_JACK_SESSION', 1)
        autowaf.display_msg(conf, 'Wiimote Support', opts.wiimote)
        if opts.wiimote:
                conf.define('WIIMOTE',1)
        if opts.windows_key:
                conf.define('WINDOWS_KEY', opts.windows_key)
        autowaf.display_msg(conf, 'Windows Key', opts.windows_key)
+        conf.env['PROGRAM_NAME'] = opts.program_name
+        autowaf.display_msg(conf, 'Program Name', opts.program_name)
 
        set_compiler_flags (conf, Options.options)
 
        autowaf.display_msg(conf, 'C Compiler flags', conf.env['CCFLAGS'])
        autowaf.display_msg(conf, 'C++ Compiler flags', conf.env['CXXFLAGS'])
 
+       # and dump the same stuff to a file for use in the build
+
+       config_text = open ('libs/ardour/config_text.cc',"w")
+       config_text.write ('#include "ardour/ardour.h"\n\nnamespace ARDOUR {\nconst char* const ardour_config_info = "\\n\\\n')
+       config_text.write ("Install prefix "); config_text.write (str (conf.env['PREFIX'])); config_text.write ("\\n\\\n")
+       config_text.write ("Debuggable build "); config_text.write (str (str(conf.env['DEBUG']))); config_text.write ("\\n\\\n")
+       config_text.write ("Strict compiler flags "); config_text.write (str (str(conf.env['STRICT']))); config_text.write ("\\n\\\n")
+       config_text.write ("Build documentation "); config_text.write (str (str(conf.env['BUILD_DOCS']))); config_text.write ("\\n\\\n")
+       config_text.write ('Build Target '); config_text.write (str (conf.env['build_target'])); config_text.write ("\\n\\\n")
+       config_text.write ('Architecture flags '); config_text.write (str (opts.arch)); config_text.write ("\\n\\\n")
+       config_text.write ('Aubio '); config_text.write (str (bool(conf.env['HAVE_AUBIO']))); config_text.write ("\\n\\\n")
+       config_text.write ('AudioUnits '); config_text.write (str (opts.audiounits)); config_text.write ("\\n\\\n")
+       config_text.write ('CoreAudio '); config_text.write (str (bool(conf.env['HAVE_COREAUDIO']))); config_text.write ("\\n\\\n")
+       config_text.write ('FPU Optimization '); config_text.write (str (opts.fpu_optimization)); config_text.write ("\\n\\\n")
+       config_text.write ('Freedesktop Files '); config_text.write (str (opts.freedesktop)); config_text.write ("\\n\\\n")
+       config_text.write ('Freesound '); config_text.write (str (opts.freesound)); config_text.write ("\\n\\\n")
+       config_text.write ('GtkOSX '); config_text.write (str (opts.gtkosx)); config_text.write ("\\n\\\n")
+       config_text.write ('LV2 Support '); config_text.write (str (bool(conf.env['HAVE_SLV2']))); config_text.write ("\\n\\\n")
+       config_text.write ('Rubberband '); config_text.write (str (bool(conf.env['HAVE_RUBBERBAND']))); config_text.write ("\\n\\\n")
+       config_text.write ('Samplerate '); config_text.write (str (bool(conf.env['HAVE_SAMPLERATE']))); config_text.write ("\\n\\\n")
+       config_text.write ('Soundtouch '); config_text.write (str (bool(conf.env['HAVE_SOUNDTOUCH']))); config_text.write ("\\n\\\n")
+       config_text.write ('Translation '); config_text.write (str (opts.nls)); config_text.write ("\\n\\\n")
+       config_text.write ('Tranzport '); config_text.write (str (opts.tranzport)); config_text.write ("\\n\\\n")
+       config_text.write ('Universal Binary '); config_text.write (str (opts.universal)); config_text.write ("\\n\\\n")
+       config_text.write ('VST Support '); config_text.write (str (opts.vst)); config_text.write ("\\n\\\n")
+       config_text.write ('Wiimote Support '); config_text.write (str (opts.wiimote)); config_text.write ("\\n\\\n")
+       config_text.write ('Windows Key '); config_text.write (str (opts.windows_key)); config_text.write ("\\n\\\n")
+       config_text.write ('C Compiler flags '); config_text.write (str (conf.env['CCFLAGS'])); config_text.write ("\\n\\\n")
+       config_text.write ('C++ Compiler flags '); config_text.write (str (conf.env['CXXFLAGS'])); config_text.write ("\\n\\\n")
+       config_text.write ('";}\n')
+       config_text.close ()
+
 def build(bld):
        autowaf.set_recursive()
        if sys.platform == 'darwin':