X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=autowaf.py;h=f98cad1adaaf0165861410052bbfca4b16901549;hb=79c918fd6aace3f5d94fe61973819574489ca755;hp=413a5fa24f529acf3466e66c625076baee3551aa;hpb=9f7f0f79a3e8776164e7ae73eb4f40fce11e6539;p=ardour.git diff --git a/autowaf.py b/autowaf.py index 413a5fa24f..f98cad1ada 100644 --- a/autowaf.py +++ b/autowaf.py @@ -11,6 +11,8 @@ import misc import os import subprocess import sys +import glob + from TaskGen import feature, before, after global g_is_child @@ -37,8 +39,10 @@ def set_options(opt): return opt.tool_options('compiler_cc') opt.tool_options('compiler_cxx') - opt.add_option('--debug', action='store_true', default=False, dest='debug', - help="Build debuggable binaries [Default: False]") + opt.add_option('--debug', action='store_true', default=True, dest='debug', + help="Build debuggable binaries [Default: True]") + opt.add_option('--optimize', action='store_false', default=True, dest='debug', + help="Build optimized binaries [Default: False]") opt.add_option('--strict', action='store_true', default=False, dest='strict', help="Use strict compiler flags and show all warnings [Default: False]") opt.add_option('--docs', action='store_true', default=False, dest='docs', @@ -436,3 +440,41 @@ def shutdown(): try: os.popen("/sbin/ldconfig") except: pass +def build_i18n(bld,srcdir,dir,name,sources): + pwd = bld.get_curdir() + os.chdir(os.path.join (srcdir, dir)) + + pot_file = '%s.pot' % name + + args = [ 'xgettext', + '--keyword=_', + '--keyword=N_', + '--from-code=UTF-8', + '-o', pot_file, + '--copyright-holder="Paul Davis"' ] + args += sources + print 'Updating ', pot_file + os.spawnvp (os.P_WAIT, 'xgettext', args) + + po_files = glob.glob ('po/*.po') + languages = [ po.replace ('.po', '') for po in po_files ] + + for po_file in po_files: + args = [ 'msgmerge', + '--update', + po_file, + pot_file ] + print 'Updating ', po_file + os.spawnvp (os.P_WAIT, 'msgmerge', args) + + for po_file in po_files: + mo_file = po_file.replace ('.po', '.mo') + args = [ 'msgfmt', + '-c', + '-f', + '-o', + mo_file, + po_file ] + print 'Generating ', po_file + os.spawnvp (os.P_WAIT, 'msgfmt', args) + os.chdir (pwd)