Remove non-JACK midi++ ports.
[ardour.git] / autowaf.py
index f9b2109806d7041471cd7d97ce7c8e4f28d82c9a..93f0910eb284322ac3bfaa6dd1619a8ecbe09b3b 100644 (file)
@@ -10,6 +10,7 @@ import Configure
 import Options
 import Utils
 import sys
+import glob
 from TaskGen import feature, before, after
 
 global g_is_child
@@ -81,18 +82,8 @@ def check_header(conf, name, define='', mandatory=False):
                else:
                        conf.check(header_name=name, mandatory=mandatory)
 
-def check_tool(conf, name):
-       "Check for a tool iff it hasn't been checked for yet"
-       if type(conf.env['AUTOWAF_TOOLS']) != dict:
-               conf.env['AUTOWAF_TOOLS'] = {}
-
-       checked = conf.env['AUTOWAF_TOOLS']
-       if not name in checked:
-               conf.check_tool(name)
-               checked[name] = True
-
 def nameify(name):
-       return name.replace('/', '_').replace('++', 'PP').replace('-', '_')
+       return name.replace('/', '_').replace('++', 'PP').replace('-', '_').replace('.', '_')
 
 def check_pkg(conf, name, **args):
        if not 'mandatory' in args:
@@ -133,13 +124,14 @@ def configure(conf):
                conf.env.append_value('CCFLAGS', vals.split())
                conf.env.append_value('CXXFLAGS', vals.split())
        conf.line_just = 43
-       check_tool(conf, 'misc')
-       check_tool(conf, 'compiler_cc')
-       check_tool(conf, 'compiler_cxx')
+       conf.check_tool('misc')
+       conf.check_tool('compiler_cc')
+       conf.check_tool('compiler_cxx')
        conf.env['BUILD_DOCS'] = Options.options.build_docs
        conf.env['DEBUG'] = Options.options.debug
        conf.env['STRICT'] = Options.options.strict
        conf.env['PREFIX'] = os.path.abspath(os.path.expanduser(os.path.normpath(conf.env['PREFIX'])))
+
        if Options.options.bundle:
                conf.env['BUNDLE'] = True
                conf.define('BUNDLE', 1)
@@ -239,7 +231,7 @@ def use_lib(bld, obj, libs):
                        inc_flag = '-iquote ' + os.path.join(abssrcdir, l.lower())
                        for f in ['CCFLAGS', 'CXXFLAGS']:
                                if not inc_flag in bld.env[f]:
-                                       bld.env.prepend_value(f, inc_flag)
+                                       bld.env.append_value(f, inc_flag)
                else:
                        if hasattr(obj, 'uselib'):
                                obj.uselib += ' ' + l
@@ -336,6 +328,7 @@ def build_dox(bld, name, version, srcdir, blddir):
        }
        obj.install_path = ''
        out1 = bld.new_task_gen('command-output')
+       out1.dependencies = [obj]
        out1.stdout = '/doc/doxygen.out'
        out1.stdin = '/doc/reference.doxygen' # whatever..
        out1.command = 'doxygen'
@@ -374,6 +367,43 @@ def build_version_files(header_path, source_path, domain, major, minor, micro):
                
        return None
 
+# Internationalisation (gettext)
+def build_i18n(bld,dir,name,sources):
+       pwd = bld.get_curdir()
+       os.chdir(pwd)
+
+       pot_file = '%s.pot' % name
+
+       args = [ 'xgettext',
+                '--keyword=_',
+                '--keyword=N_',
+                '--from-code=UTF-8',
+                '-o', pot_file,
+                '--copyright-holder="Paul Davis"' ]
+       args += sources
+       Utils.pprint('GREEN', 'Updating ' + pot_file, sep='')
+       os.spawnvp (os.P_WAIT, 'xgettext', args)
+       
+       po_files = glob.glob ('po/*.po')
+       
+       for po_file in po_files:
+               args = [ 'msgmerge',
+                        '--update',
+                        po_file,
+                        pot_file ]
+               Utils.pprint('GREEN', 'Updating ' + po_file, sep='')
+               os.spawnvp (os.P_WAIT, 'msgmerge', args)
+               
+       for po_file in po_files:
+               mo_file = po_file.replace ('.po', '.mo')
+               args = [ 'msgfmt',
+                        '-c',
+                        '-o',
+                        mo_file,
+                        po_file ]
+               Utils.pprint('GREEN', 'Generating ' + po_file)
+               os.spawnvp (os.P_WAIT, 'msgfmt', args)
+
 def shutdown():
        # This isn't really correct (for packaging), but people asking is annoying
        if Options.commands['install']: