summaryrefslogtreecommitdiff
path: root/Tools/gtk/gtkdoc.py
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/gtk/gtkdoc.py')
-rw-r--r--Tools/gtk/gtkdoc.py28
1 files changed, 17 insertions, 11 deletions
diff --git a/Tools/gtk/gtkdoc.py b/Tools/gtk/gtkdoc.py
index 5aff6fc9b..48f862a31 100644
--- a/Tools/gtk/gtkdoc.py
+++ b/Tools/gtk/gtkdoc.py
@@ -141,7 +141,6 @@ class GTKDoc(object):
self._write_version_xml()
self._run_gtkdoc_scan()
self._run_gtkdoc_scangobj()
- self._run_gtkdoc_mktmpl()
self._run_gtkdoc_mkdb()
if not html:
@@ -185,7 +184,7 @@ class GTKDoc(object):
def _run_command(self, args, env=None, cwd=None, print_output=True, ignore_warnings=False):
if print_output:
- self.logger.info("Running %s", args[0])
+ self.logger.debug("Running %s", args[0])
self.logger.debug("Full command args: %s", str(args))
process = subprocess.Popen(args, env=env, cwd=cwd,
@@ -195,9 +194,15 @@ class GTKDoc(object):
if print_output:
if stdout:
- sys.stdout.write(stdout.encode("utf-8"))
+ try:
+ sys.stdout.write(stdout.encode("utf-8"))
+ except UnicodeDecodeError:
+ sys.stdout.write(stdout)
if stderr:
- sys.stderr.write(stderr.encode("utf-8"))
+ try:
+ sys.stderr.write(stderr.encode("utf-8"))
+ except UnicodeDecodeError:
+ sys.stderr.write(stderr)
if process.returncode != 0:
raise Exception('%s produced a non-zero return code %i'
@@ -238,14 +243,14 @@ class GTKDoc(object):
copy_file_replacing_existing(os.path.join(src, path),
os.path.join(dest, path))
- self.logger.info('Copying template files to output directory...')
+ self.logger.debug('Copying template files to output directory...')
self._create_directory_if_nonexistent(self.output_dir)
copy_all_files_in_directory(self.doc_dir, self.output_dir)
if not html:
return
- self.logger.info('Copying HTML files to output directory...')
+ self.logger.debug('Copying HTML files to output directory...')
html_src_dir = os.path.join(self.doc_dir, 'html')
html_dest_dir = os.path.join(self.output_dir, 'html')
self._create_directory_if_nonexistent(html_dest_dir)
@@ -307,7 +312,11 @@ class GTKDoc(object):
env = os.environ
ldflags = self.ldflags
if self.library_path:
- ldflags = ' "-L%s" ' % self.library_path + ldflags
+ additional_ldflags = ''
+ for arg in env.get('LDFLAGS', '').split(' '):
+ if arg.startswith('-L'):
+ additional_ldflags = '%s %s' % (additional_ldflags, arg)
+ ldflags = ' "-L%s" %s ' % (self.library_path, additional_ldflags) + ldflags
current_ld_library_path = env.get('LD_LIBRARY_PATH')
if current_ld_library_path:
env['RUN'] = 'LD_LIBRARY_PATH="%s:%s" ' % (self.library_path, current_ld_library_path)
@@ -328,10 +337,6 @@ class GTKDoc(object):
self._run_command(['gtkdoc-scangobj', '--module=%s' % self.module_name],
env=env, cwd=self.output_dir)
- def _run_gtkdoc_mktmpl(self):
- args = ['gtkdoc-mktmpl', '--module=%s' % self.module_name]
- self._run_command(args, cwd=self.output_dir)
-
def _run_gtkdoc_mkdb(self):
sgml_file = os.path.join(self.output_dir, self.main_sgml_file)
self._raise_exception_if_file_inaccessible(sgml_file)
@@ -373,6 +378,7 @@ class GTKDoc(object):
def _run_gtkdoc_fixxref(self):
args = ['gtkdoc-fixxref',
+ '--module=%s' % self.module_name,
'--module-dir=html',
'--html-dir=html']
args.extend(['--extra-dir=%s' % extra_dir for extra_dir in self.cross_reference_deps])