diff options
Diffstat (limited to 'source-builder/pkg-config')
-rwxr-xr-x | source-builder/pkg-config | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/source-builder/pkg-config b/source-builder/pkg-config index c2378d6..d2afff0 100755 --- a/source-builder/pkg-config +++ b/source-builder/pkg-config @@ -1,7 +1,7 @@ #! /usr/bin/env python # # RTEMS Tools Project (http://www.rtems.org/) -# Copyright 2014 Chris Johns (chrisj@rtems.org) +# Copyright 2014-2016 Chris Johns (chrisj@rtems.org) # All rights reserved. # # This file is part of the RTEMS Tools package in 'rtems-tools'. @@ -29,6 +29,8 @@ # POSSIBILITY OF SUCH DAMAGE. # +from __future__ import print_function + import os import sys @@ -42,13 +44,13 @@ except: try: import argparse except: - print >> sys.stderr, "Incorrect Source Builder installation" + print("Incorrect Source Builder installation", file = sys.stderr) sys.exit(1) try: import pkgconfig except ImportError: - print >> sys.stderr, "Incorrect Source Builder installation" + print("Incorrect Source Builder installation", file = sys.stderr) sys.exit(1) # @@ -81,12 +83,12 @@ def log(s, lf = True): out = sys.stdout if lf: if out != sys.stdout and trace_stdout: - print s - print >> out, s + print(s) + print(s, file = out) else: if out != sys.stdout and trace_stdout: - print s, - print >> out, s, + print(s, end = '', flush = True) + print(out, s, end = '', flush = True) def run(argv): @@ -191,13 +193,13 @@ def run(argv): if ec == 0: if args.cflags: if len(flags['cflags']): - print flags['cflags'] + print(flags['cflags']) log('cflags: %s' % (flags['cflags'])) else: log('cflags: empty') if args.libs: if len(flags['libs']): - print flags['libs'] + print(flags['libs']) log('libs: %s' % (flags['libs'])) else: log('libs: empty') @@ -215,9 +217,9 @@ try: ec = run(sys.argv) log('ec = %d' % (ec)) except ImportError: - print >> sys.stderr, "incorrect package config installation" + print("incorrect package config installation", file = sys.stderr) sys.exit(1) except pkgconfig.error, e: - print >> sys.stderr, 'error: %s' % (e) + print('error: %s' % (e), file = sys.stderr) sys.exit(1) sys.exit(ec) |