'linker-debuggable' : '',
# Flags required when building a non-debug optimized build
'nondebuggable' : '-DNDEBUG',
- # Flags required to enable profiling at runtime
- 'profile' : '-pg',
+ # Flags required to enable profiling at runtime with optimized builds
+ 'profile' : [ '-fno-omit-frame-pointer' ],
+ # Flags required to enable gprofile profiling
+ 'gprofile' : '-pg',
# Flags required to disable warnings about unused arguments to function calls
'silence-unused-arguments' : '',
# Flags required to use SSE unit for general math
'debuggable' : ['/DDEBUG', '/Od', '/Zi', '/MDd', '/Gd', '/EHsc'],
'linker-debuggable' : ['/DEBUG', '/INCREMENTAL' ],
'nondebuggable' : ['/DNDEBUG', '/Ob1', '/MD', '/Gd', '/EHsc'],
- 'profile' : '',
+ 'profile' : '/Oy-',
'sse' : '/arch:SSE',
'silence-unused-arguments' : '',
'sse' : '',
linker_flags.append('-fsanitize=address')
if opt.gprofile:
- debug_flags = [ flags_dict['profile'] ]
+ debug_flags = [ flags_dict['gprofile'] ]
# OSX
if platform == 'darwin':
if opt.debug_symbols:
optimization_flags += flags_dict['debuggable']
+ if opt.profile:
+ optimization_flags += flags_dict['profile']
+
if opt.stl_debug:
cxx_flags.append("-D_GLIBCXX_DEBUG")
help='Build MIME type and .desktop files as per freedesktop.org standards (will be placed in build/gtk2_ardour)')
opt.add_option('--freebie', action='store_true', default=False, dest='freebie',
help='Build a version suitable for distribution as a zero-cost binary')
+ opt.add_option('--profile', action='store_true', default=False, dest='profile',
+ help='Compile for use with profiling tools requiring a frame pointer')
opt.add_option('--gprofile', action='store_true', default=False, dest='gprofile',
help='Compile for use with gprofile')
opt.add_option('--libjack', type='string', default="auto", dest='libjack_link',
conf.env['CFLAGS'] = []
conf.env['CXXFLAGS'] = []
+ # freedesktop translations needs itstool > 1.0.3 (-j option)
+ if Options.options.freedesktop:
+ output = subprocess.Popen("itstool --version", shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines()
+ o = output[0].decode('utf-8')
+ version = o.split(' ')[1].split('.')
+ # use distutils.version.StrictVersion or something python to check >= 1.0.4
+ # but first make sure that all build-hosts (incl. OSX-10.5/PPC) have that python lib.
+ # lazy approach: just use major version 2.X.X
+ if version[0] < "2":
+ print("--freedesktop requires itstool > 2.0.0 to translate files.")
+ sys.exit(-1)
+
conf.env['VERSION'] = VERSION
conf.env['MAJOR'] = MAJOR
conf.env['MINOR'] = MINOR
have_rf64_riff_support = conf.check_cc(fragment = '''
#include <sndfile.h>
-int main () { int x = SFC_AUTO_DOWNGRADE_RF64; return 0; }
+int main () { int x = SFC_RF64_AUTO_DOWNGRADE; return 0; }
''',
features = 'c',
mandatory = False,