diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-12-12 10:06:59 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-12-12 10:06:59 -0500 |
commit | 1676789907b95aa8d5bf6cc2ce62aa66a80b9aae (patch) | |
tree | 7c84f3eb9a4d400a26f29461d40bd50ba32ae8d4 | |
parent | 88732abd0177f9ee9f4be780e3ffe724ef798c64 (diff) | |
parent | fd1eb73ef21e8a938e34ca49378a866c381c48e3 (diff) |
fix merge conflicts from master
-rw-r--r-- | gtk2_ardour/editor_regions.cc | 8 | ||||
-rw-r--r-- | gtk2_ardour/gtk_pianokeyboard.c | 6 | ||||
-rw-r--r-- | gtk2_ardour/plugin_selector.cc | 11 | ||||
-rw-r--r-- | libs/ardour/ardour/utils.h | 1 | ||||
-rw-r--r-- | libs/ardour/export_channel.cc | 2 | ||||
-rw-r--r-- | libs/ardour/linux_vst_support.cc | 10 | ||||
-rw-r--r-- | libs/ardour/lv2_plugin.cc | 16 | ||||
-rw-r--r-- | libs/ardour/utils.cc | 35 | ||||
-rw-r--r-- | libs/backends/jack/jack_audiobackend.cc | 10 | ||||
-rw-r--r-- | wscript | 177 |
10 files changed, 159 insertions, 117 deletions
diff --git a/gtk2_ardour/editor_regions.cc b/gtk2_ardour/editor_regions.cc index 72a0da2909..bf13bd5a65 100644 --- a/gtk2_ardour/editor_regions.cc +++ b/gtk2_ardour/editor_regions.cc @@ -1115,7 +1115,7 @@ EditorRegions::sorter (TreeModel::iterator a, TreeModel::iterator b) switch (_sort_type) { case ByName: - cmp = g_strcasecmp (region1->name().c_str(), region2->name().c_str()); + cmp = region1->name().compare(region2->name()); break; case ByLength: @@ -1140,7 +1140,7 @@ EditorRegions::sorter (TreeModel::iterator a, TreeModel::iterator b) break; case BySourceFileName: - cmp = g_strcasecmp (region1->source()->name().c_str(), region2->source()->name().c_str()); + cmp = region1->source()->name().compare(region2->source()->name()); break; case BySourceFileLength: @@ -1153,9 +1153,9 @@ EditorRegions::sorter (TreeModel::iterator a, TreeModel::iterator b) case BySourceFileFS: if (region1->source()->name() == region2->source()->name()) { - cmp = g_strcasecmp (region1->name().c_str(), region2->name().c_str()); + cmp = region1->name().compare(region2->name()); } else { - cmp = g_strcasecmp (region1->source()->name().c_str(), region2->source()->name().c_str()); + cmp = region1->source()->name().compare(region2->source()->name()); } break; } diff --git a/gtk2_ardour/gtk_pianokeyboard.c b/gtk2_ardour/gtk_pianokeyboard.c index a8561cc6bd..34bf184249 100644 --- a/gtk2_ardour/gtk_pianokeyboard.c +++ b/gtk2_ardour/gtk_pianokeyboard.c @@ -740,13 +740,13 @@ piano_keyboard_set_keyboard_layout(PianoKeyboard *pk, const char *layout) { assert(layout); - if (!g_strcasecmp(layout, "QWERTY")) { + if (!g_ascii_strcasecmp(layout, "QWERTY")) { bind_keys_qwerty(pk); - } else if (!g_strcasecmp(layout, "QWERTZ")) { + } else if (!g_ascii_strcasecmp(layout, "QWERTZ")) { bind_keys_qwertz(pk); - } else if (!g_strcasecmp(layout, "AZERTY")) { + } else if (!g_ascii_strcasecmp(layout, "AZERTY")) { bind_keys_azerty(pk); } else { diff --git a/gtk2_ardour/plugin_selector.cc b/gtk2_ardour/plugin_selector.cc index ebfcc677ac..bb96c7f392 100644 --- a/gtk2_ardour/plugin_selector.cc +++ b/gtk2_ardour/plugin_selector.cc @@ -37,6 +37,7 @@ #include "ardour/plugin_manager.h" #include "ardour/plugin.h" +#include "ardour/utils.h" #include "ardour_ui.h" #include "plugin_selector.h" @@ -538,13 +539,13 @@ struct PluginMenuCompareByCreator { bool operator() (PluginInfoPtr a, PluginInfoPtr b) const { int cmp; - cmp = g_strcasecmp (a->creator.c_str(), b->creator.c_str()); + cmp = cmp_nocase_utf8 (a->creator, b->creator); if (cmp < 0) { return true; } else if (cmp == 0) { /* same creator ... compare names */ - if (g_strcasecmp (a->name.c_str(), b->name.c_str()) < 0) { + if (cmp_nocase_utf8 (a->name, b->name) < 0) { return true; } } @@ -556,7 +557,7 @@ struct PluginMenuCompareByName { bool operator() (PluginInfoPtr a, PluginInfoPtr b) const { int cmp; - cmp = g_strcasecmp (a->name.c_str(), b->name.c_str()); + cmp = cmp_nocase_utf8 (a->name, b->name); if (cmp < 0) { return true; @@ -574,13 +575,13 @@ struct PluginMenuCompareByCategory { bool operator() (PluginInfoPtr a, PluginInfoPtr b) const { int cmp; - cmp = g_strcasecmp (a->category.c_str(), b->category.c_str()); + cmp = cmp_nocase_utf8 (a->category, b->category); if (cmp < 0) { return true; } else if (cmp == 0) { /* same category ... compare names */ - if (g_strcasecmp (a->name.c_str(), b->name.c_str()) < 0) { + if (cmp_nocase_utf8 (a->name, b->name) < 0) { return true; } } diff --git a/libs/ardour/ardour/utils.h b/libs/ardour/ardour/utils.h index bf91d4d57e..4bf97fd2e5 100644 --- a/libs/ardour/ardour/utils.h +++ b/libs/ardour/ardour/utils.h @@ -57,6 +57,7 @@ static inline float f_max(float x, float a) { std::string bump_name_once(const std::string& s, char delimiter); int cmp_nocase (const std::string& s, const std::string& s2); +int cmp_nocase_utf8 (const std::string& s1, const std::string& s2); int touch_file(std::string path); diff --git a/libs/ardour/export_channel.cc b/libs/ardour/export_channel.cc index 8c5a7e4abe..296bfc9022 100644 --- a/libs/ardour/export_channel.cc +++ b/libs/ardour/export_channel.cc @@ -131,7 +131,7 @@ RegionExportChannelFactory::RegionExportChannelFactory (Session * session, Audio mixdown_buffer.reset (new Sample [frames_per_cycle]); gain_buffer.reset (new Sample [frames_per_cycle]); - memset (gain_buffer.get(), 1.0, sizeof (Sample) * frames_per_cycle); + std::fill_n (gain_buffer.get(), frames_per_cycle, Sample (1.0)); break; case Processed: diff --git a/libs/ardour/linux_vst_support.cc b/libs/ardour/linux_vst_support.cc index 1fccf79968..9d36905f48 100644 --- a/libs/ardour/linux_vst_support.cc +++ b/libs/ardour/linux_vst_support.cc @@ -242,7 +242,15 @@ vstfx_load (const char *path) /*Find the main entry point into the plugin*/ - if ((fhandle->main_entry = (main_entry_t) dlsym(fhandle->dll, "main")) == 0) + fhandle->main_entry = (main_entry_t) dlsym(fhandle->dll, "main"); + + if (fhandle->main_entry == 0) { + if ((fhandle->main_entry = (main_entry_t) dlsym(fhandle->dll, "VSTPluginMain")) != 0) { + PBD::warning << path << _(": is a VST >= 2.4 - this plugin may or may not function correctly with this version of Ardour.") << endmsg; + } + } + + if (fhandle->main_entry == 0) { /*If it can't be found, unload the plugin and return a 0 handle*/ diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index da514f92e4..a1d9de1e53 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -1162,10 +1162,14 @@ LV2Plugin::write_from_ui(uint32_t index, * e.g 48kSPS / 128fpp -> audio-periods = 375 Hz * ui-periods = 25 Hz (SuperRapidScreenUpdate) * default minimumSize = 32K (see LV2Plugin::allocate_atom_event_buffers() - * -> 15 * 32K - * it is safe to overflow (but the plugin state may be inconsistent). + * + * it is NOT safe to overflow (msg.size will be misinterpreted) */ - rbs = max((size_t) 32768 * 6, rbs); + uint32_t bufsiz = 32768; + if (_atom_ev_buffers && _atom_ev_buffers[0]) { + bufsiz = lv2_evbuf_get_capacity(_atom_ev_buffers[0]); + } + rbs = max((size_t) bufsiz * 8, rbs); _from_ui = new RingBuffer<uint8_t>(rbs); } @@ -1194,8 +1198,12 @@ LV2Plugin::enable_ui_emmission() { if (!_to_ui) { /* see note in LV2Plugin::write_from_ui() */ + uint32_t bufsiz = 32768; + if (_atom_ev_buffers && _atom_ev_buffers[0]) { + bufsiz = lv2_evbuf_get_capacity(_atom_ev_buffers[0]); + } size_t rbs = _session.engine().raw_buffer_size(DataType::MIDI) * NBUFS; - rbs = max((size_t) 32768 * 8, rbs); + rbs = max((size_t) bufsiz * 8, rbs); _to_ui = new RingBuffer<uint8_t>(rbs); } } diff --git a/libs/ardour/utils.cc b/libs/ardour/utils.cc index 0c98461974..aa06912913 100644 --- a/libs/ardour/utils.cc +++ b/libs/ardour/utils.cc @@ -232,6 +232,41 @@ cmp_nocase (const string& s, const string& s2) return (s2.size() == s.size()) ? 0 : (s.size() < s2.size()) ? -1 : 1; } +int cmp_nocase_utf8 (const string& s1, const string& s2) +{ + const char *cstr1 = s1.c_str(); + const char *cstr2 = s2.c_str(); + gchar *cstr1folded = NULL; + gchar *cstr2folded = NULL; + int retval; + + if (!g_utf8_validate (cstr1, -1, NULL) || + !g_utf8_validate (cstr2, -1, NULL)) { + // fall back to comparing ASCII + return g_ascii_strcasecmp (cstr1, cstr2); + } + + cstr1folded = g_utf8_casefold (cstr1, -1); + cstr2folded = g_utf8_casefold (cstr2, -1); + + if (cstr1folded && cstr2folded) { + retval = strcmp (cstr1folded, cstr2folded); + } else { + // this shouldn't happen, make the best of it + retval = g_ascii_strcasecmp (cstr1, cstr2); + } + + if (cstr1folded) { + g_free (cstr1folded); + } + + if (cstr2folded) { + g_free (cstr2folded); + } + + return retval; +} + int touch_file (string path) { diff --git a/libs/backends/jack/jack_audiobackend.cc b/libs/backends/jack/jack_audiobackend.cc index 1ceb794dc5..f34cd746f0 100644 --- a/libs/backends/jack/jack_audiobackend.cc +++ b/libs/backends/jack/jack_audiobackend.cc @@ -765,6 +765,7 @@ int JACKAudioBackend::jack_sync_callback (jack_transport_state_t state, jack_position_t* pos) { TransportState tstate; + bool tstate_valid = true; switch (state) { case JackTransportRolling: @@ -777,12 +778,17 @@ JACKAudioBackend::jack_sync_callback (jack_transport_state_t state, jack_positio tstate = TransportStarting; break; case JackTransportStopped: - default: tstate = TransportStopped; break; + default: + // ignore "unofficial" states like JackTransportNetStarting (jackd2) + tstate_valid = false; + break; } - return engine.sync_callback (tstate, pos->frame); + if (tstate_valid) { + return engine.sync_callback (tstate, pos->frame); + } return true; } @@ -133,7 +133,17 @@ def set_compiler_flags (conf,opt): # build_host_supports_sse = False + + # Flags necessary for building + compiler_flags = [] # generic + c_flags = [] # C-specific + cxx_flags = [] # C++-specific + linker_flags = [] + + # Optimization flags (overridable) optimization_flags = [] + + # Debugging flags debug_flags = [] u = os.uname () @@ -146,10 +156,10 @@ def set_compiler_flags (conf,opt): if conf.options.cxx11: conf.check_cxx(cxxflags=["-std=c++11"]) - conf.env.append_unique('CXXFLAGS', ['-std=c++11']) + cxx_flags.append('-std=c++11') if platform == "darwin": - conf.env.append_unique('CXXFLAGS', ['-stdlib=libc++']) - conf.env.append_unique('LINKFLAGS', ['-lc++']) + cxx_flags.append('-stdlib=libc++') + link_flags.append('-lc++') # Prevents visibility issues in standard headers conf.define("_DARWIN_C_SOURCE", 1) @@ -157,7 +167,7 @@ def set_compiler_flags (conf,opt): # Silence warnings about the non-existing osx clang compiler flags # -compatibility_version and -current_version. These are Waf # generated and not needed with clang - conf.env.append_unique ("CXXFLAGS", ["-Qunused-arguments"]) + cxx_flags.append("-Qunused-arguments") if opt.gprofile: debug_flags = [ '-pg' ] @@ -183,16 +193,15 @@ def set_compiler_flags (conf,opt): else: conf.env['build_target'] = 'mountainlion' else: - if re.search ("x86_64", cpu) != None: - conf.env['build_target'] = 'x86_64' - elif re.search("i[0-5]86", cpu) != None: - conf.env['build_target'] = 'i386' - elif re.search("powerpc", cpu) != None: - conf.env['build_target'] = 'powerpc' - elif re.search("arm", cpu) != None: - conf.env['build_target'] = 'arm' + match = re.search( + "(?P<cpu>i[0-6]86|x86_64|powerpc|ppc|ppc64|arm|s390x?)", + cpu) + if (match): + conf.env['build_target'] = match.group("cpu") + if re.search("i[0-5]86", conf.env['build_target']): + conf.env['build_target'] = "i386" else: - conf.env['build_target'] = 'i686' + conf.env['build_target'] = 'none' else: conf.env['build_target'] = opt.dist_target @@ -201,8 +210,7 @@ def set_compiler_flags (conf,opt): # stupid OS X 10.6 has a bug in math.h that prevents llrint and friends # from being visible. # - debug_flags.append ('-U__STRICT_ANSI__') - optimization_flags.append ('-U__STRICT_ANSI__') + compiler_flags.append ('-U__STRICT_ANSI__') if cpu == 'powerpc' and conf.env['build_target'] != 'none': # @@ -214,12 +222,12 @@ def set_compiler_flags (conf,opt): if platform == 'darwin': # optimization_flags.extend ([ "-mcpu=7450", "-faltivec"]) # to support g3s but still have some optimization for above - optimization_flags.extend ([ "-mcpu=G3", "-mtune=7450"]) + compiler_flags.extend ([ "-mcpu=G3", "-mtune=7450"]) else: - optimization_flags.extend ([ "-mcpu=7400", "-maltivec", "-mabi=altivec"]) + compiler_flags.extend ([ "-mcpu=7400", "-maltivec", "-mabi=altivec"]) else: - optimization_flags.extend([ "-mcpu=750", "-mmultiple" ]) - optimization_flags.extend (["-mhard-float", "-mpowerpc-gfxopt"]) + compiler_flags.extend([ "-mcpu=750", "-mmultiple" ]) + compiler_flags.extend (["-mhard-float", "-mpowerpc-gfxopt"]) optimization_flags.extend (["-Os"]) elif ((re.search ("i[0-9]86", cpu) != None) or (re.search ("x86_64", cpu) != None)) and conf.env['build_target'] != 'none': @@ -232,8 +240,7 @@ def set_compiler_flags (conf,opt): # if (re.search ("(i[0-9]86|x86_64)", cpu) != None): - debug_flags.append ("-DARCH_X86") - optimization_flags.append ("-DARCH_X86") + compiler_flags.append ("-DARCH_X86") if platform == 'linux' : @@ -247,32 +254,29 @@ def set_compiler_flags (conf,opt): x86_flags = flag_line.split (": ")[1:][0].split () if "mmx" in x86_flags: - optimization_flags.append ("-mmmx") + compiler_flags.append ("-mmmx") if "sse" in x86_flags: build_host_supports_sse = True if "3dnow" in x86_flags: - optimization_flags.append ("-m3dnow") + compiler_flags.append ("-m3dnow") if cpu == "i586": - optimization_flags.append ("-march=i586") + compiler_flags.append ("-march=i586") elif cpu == "i686": - optimization_flags.append ("-march=i686") + compiler_flags.append ("-march=i686") if not is_clang and ((conf.env['build_target'] == 'i686') or (conf.env['build_target'] == 'x86_64')) and build_host_supports_sse: - optimization_flags.extend (["-msse", "-mfpmath=sse", "-DUSE_XMMINTRIN"]) - debug_flags.extend (["-msse", "-mfpmath=sse", "-DUSE_XMMINTRIN"]) + compiler_flags.extend (["-msse", "-mfpmath=sse", "-DUSE_XMMINTRIN"]) # end of processor-specific section # optimization section if conf.env['FPU_OPTIMIZATION']: if sys.platform == 'darwin': - optimization_flags.append ("-DBUILD_VECLIB_OPTIMIZATIONS"); - debug_flags.append ("-DBUILD_VECLIB_OPTIMIZATIONS"); - conf.env.append_value('LINKFLAGS', "-framework Accelerate") + compiler_flags.append("-DBUILD_VECLIB_OPTIMIZATIONS"); + linker_flags.append("-framework Accelerate") elif conf.env['build_target'] == 'i686' or conf.env['build_target'] == 'x86_64': - optimization_flags.append ("-DBUILD_SSE_OPTIMIZATIONS") - debug_flags.append ("-DBUILD_SSE_OPTIMIZATIONS") + compiler_flags.append ("-DBUILD_SSE_OPTIMIZATIONS") if not build_host_supports_sse: print("\nWarning: you are building Ardour with SSE support even though your system does not support these instructions. (This may not be an error, especially if you are a package maintainer)") @@ -291,9 +295,9 @@ def set_compiler_flags (conf,opt): if opt.lxvst: if conf.env['build_target'] == 'x86_64': - conf.env.append_value('CXXFLAGS', "-DLXVST_64BIT") + compiler_flags.append("-DLXVST_64BIT") else: - conf.env.append_value('CXXFLAGS', "-DLXVST_32BIT") + compiler_flags.append("-DLXVST_32BIT") # # a single way to test if we're on OS X @@ -303,18 +307,15 @@ def set_compiler_flags (conf,opt): conf.define ('IS_OSX', 1) # force tiger or later, to avoid issues on PPC which defaults # back to 10.1 if we don't tell it otherwise. - - conf.env.append_value('CFLAGS', "-DMAC_OS_X_VERSION_MIN_REQUIRED=1040") - conf.env.append_value('CXXFLAGS', "-DMAC_OS_X_VERSION_MIN_REQUIRED=1040") - conf.env.append_value('CXXFLAGS', '-mmacosx-version-min=10.4') - conf.env.append_value('CFLAGS', '-mmacosx-version-min=10.4') + compiler_flags.extend( + ("-DMAC_OS_X_VERSION_MIN_REQUIRED=1040", + '-mmacosx-version-min=10.4')) elif conf.env['build_target'] in [ 'lion', 'mountainlion' ]: - conf.env.append_value('CFLAGS', "-DMAC_OS_X_VERSION_MIN_REQUIRED=1070") - conf.env.append_value('CXXFLAGS', "-DMAC_OS_X_VERSION_MIN_REQUIRED=1070") - conf.env.append_value('CXXFLAGS', '-mmacosx-version-min=10.7') - conf.env.append_value('CFLAGS', '-mmacosx-version-min=10.7') + compiler_flags.extend( + ("-DMAC_OS_X_VERSION_MIN_REQUIRED=1070", + '-mmacosx-version-min=10.7')) else: conf.define ('IS_OSX', 0) @@ -351,26 +352,15 @@ def set_compiler_flags (conf,opt): "-fstrength-reduce" ] - if opt.debug: - conf.env.append_value('CFLAGS', debug_flags) - conf.env.append_value('CXXFLAGS', debug_flags) - conf.env.append_value('LINKFLAGS', debug_flags) - else: - conf.env.append_value('CFLAGS', optimization_flags) - conf.env.append_value('CXXFLAGS', optimization_flags) - conf.env.append_value('LINKFLAGS', optimization_flags) - if opt.stl_debug: - conf.env.append_value('CXXFLAGS', "-D_GLIBCXX_DEBUG") + cxx_flags.append("-D_GLIBCXX_DEBUG") if conf.env['DEBUG_RT_ALLOC']: - conf.env.append_value('CFLAGS', '-DDEBUG_RT_ALLOC') - conf.env.append_value('CXXFLAGS', '-DDEBUG_RT_ALLOC') - conf.env.append_value('LINKFLAGS', '-ldl') + compiler_flags.append('-DDEBUG_RT_ALLOC') + linker_flags.append('-ldl') if conf.env['DEBUG_DENORMAL_EXCEPTION']: - conf.env.append_value('CFLAGS', '-DDEBUG_DENORMAL_EXCEPTION') - conf.env.append_value('CXXFLAGS', '-DDEBUG_DENORMAL_EXCEPTION') + compiler_flags.append('-DDEBUG_DENORMAL_EXCEPTION') if opt.universal: if opt.generic: @@ -378,62 +368,55 @@ def set_compiler_flags (conf,opt): sys.exit (1) else: if not Options.options.nocarbon: - conf.env.append_value('CFLAGS', ["-arch", "i386", "-arch", "ppc"]) - conf.env.append_value('CXXFLAGS', ["-arch", "i386", "-arch", "ppc"]) - conf.env.append_value('LINKFLAGS', ["-arch", "i386", "-arch", "ppc"]) + compiler_flags.extend(("-arch", "i386", "-arch", "ppc")) + linker_flags.extend(("-arch", "i386", "-arch", "ppc")) else: - conf.env.append_value('CFLAGS', ["-arch", "x86_64", "-arch", "i386", "-arch", "ppc"]) - conf.env.append_value('CXXFLAGS', ["-arch", "x86_64", "-arch", "i386", "-arch", "ppc"]) - conf.env.append_value('LINKFLAGS', ["-arch", "x86_64", "-arch", "i386", "-arch", "ppc"]) + compiler_flags.extend( + ("-arch", "x86_64", "-arch", "i386", "-arch", "ppc")) + linker_flags.extend( + ("-arch", "x86_64", "-arch", "i386", "-arch", "ppc")) else: if opt.generic: - conf.env.append_value('CFLAGS', ['-arch', 'i386']) - conf.env.append_value('CXXFLAGS', ['-arch', 'i386']) - conf.env.append_value('LINKFLAGS', ['-arch', 'i386']) + compiler_flags.extend(('-arch', 'i386')) + linker_flags.extend(('-arch', 'i386')) # # warnings flags # - conf.env.append_value('CFLAGS', [ '-Wall', - '-Wpointer-arith', - '-Wcast-qual', - '-Wcast-align', - '-Wstrict-prototypes', - '-Wmissing-prototypes' - ]) - - conf.env.append_value('CXXFLAGS', [ '-Wall', - '-Wpointer-arith', - '-Wcast-qual', - '-Wcast-align', - '-Woverloaded-virtual' - ]) + compiler_flags.extend( + ('-Wall', '-Wpointer-arith', '-Wcast-qual', '-Wcast-align')) + c_flags.extend(('-Wstrict-prototypes', '-Wmissing-prototypes')) + cxx_flags.append('-Woverloaded-virtual') # # more boilerplate # - conf.env.append_value('CFLAGS', '-DBOOST_SYSTEM_NO_DEPRECATED') - conf.env.append_value('CXXFLAGS', '-DBOOST_SYSTEM_NO_DEPRECATED') - # need ISOC9X for llabs() - conf.env.append_value('CFLAGS', '-D_ISOC9X_SOURCE') - conf.env.append_value('CFLAGS', '-D_LARGEFILE64_SOURCE') - conf.env.append_value('CFLAGS', '-D_FILE_OFFSET_BITS=64') # need ISOC9X for llabs() - conf.env.append_value('CXXFLAGS', '-D_ISOC9X_SOURCE') - conf.env.append_value('CXXFLAGS', '-D_LARGEFILE64_SOURCE') - conf.env.append_value('CXXFLAGS', '-D_FILE_OFFSET_BITS=64') + compiler_flags.extend( + ('-DBOOST_SYSTEM_NO_DEPRECATED', '-D_ISOC9X_SOURCE', + '-D_LARGEFILE64_SOURCE', '-D_FILE_OFFSET_BITS=64')) + cxx_flags.extend( + ('-D__STDC_LIMIT_MACROS', '-D__STDC_FORMAT_MACROS', + '-DCANVAS_COMPATIBILITY', '-DCANVAS_DEBUG')) + + if opt.nls: + compiler_flags.append('-DENABLE_NLS') - conf.env.append_value('CXXFLAGS', '-D__STDC_LIMIT_MACROS') - conf.env.append_value('CXXFLAGS', '-D__STDC_FORMAT_MACROS') - conf.env.append_value('CXXFLAGS', '-DCANVAS_COMPATIBILITY') - conf.env.append_value('CXXFLAGS', '-DCANVAS_DEBUG') + if opt.debug: + conf.env.append_value('CFLAGS', debug_flags) + conf.env.append_value('CXXFLAGS', debug_flags) + else: + conf.env.append_value('CFLAGS', optimization_flags) + conf.env.append_value('CXXFLAGS', optimization_flags) - if opt.nls: - conf.env.append_value('CXXFLAGS', '-DENABLE_NLS') - conf.env.append_value('CFLAGS', '-DENABLE_NLS') + conf.env.append_value('CFLAGS', compiler_flags) + conf.env.append_value('CFLAGS', c_flags) + conf.env.append_value('CXXFLAGS', compiler_flags) + conf.env.append_value('CXXFLAGS', cxx_flags) + conf.env.append_value('LINKFLAGS', linker_flags) #---------------------------------------------------------------- |