X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=wscript;h=9b41223a847ece4806ead97fbad1990808bb6bdb;hb=de24d4f8b11b959a5155051a9f4a7b456b4ab465;hp=1bf6a0a8fba750613c7f9d67d4b49488130042e6;hpb=dde0848a984e06cbc1d4117d9cffa75c191f3b39;p=ardour.git diff --git a/wscript b/wscript index 1bf6a0a8fb..9b41223a84 100644 --- a/wscript +++ b/wscript @@ -44,6 +44,12 @@ def fetch_svn_revision (path): cmd = "LANG= svn info " + path + " | awk '/^Revision:/ { print $2}'" return commands.getoutput(cmd) +def fetch_gcc_version (): + cmd = "LANG= gcc --version" + output = commands.getoutput(cmd).splitlines() + version = output[0].split(' ')[2].split('.') + return version + def fetch_git_revision (path): cmd = "LANG= git log --abbrev HEAD^..HEAD " + path output = commands.getoutput(cmd).splitlines() @@ -301,7 +307,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 +321,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 +353,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,9 +378,16 @@ 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) - + + gcc_versions = fetch_gcc_version() + if Options.options.debug and gcc_versions[0] == '4' and gcc_versions[1] > '4': + print 'Version 4.5 of gcc is not ready for use when compiling Ardour with optimization.' + print 'Please use a different version or re-configure with --debug' + exit (1) + if sys.platform == 'darwin': # # Define OSX as a uselib to use when compiling @@ -454,7 +473,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 \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 +501,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 +532,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':