Skip to content

Commit edbd57e

Browse files
committed
Add continuous integration with Travis-CI.
1 parent 4844d27 commit edbd57e

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
sudo: required
2+
dist: trusty
3+
language: python
4+
python:
5+
- "2.7"
6+
before_install:
7+
- sudo apt-get -qq update
8+
- sudo apt-get install -y gperf gcc-multilib
9+
script: ./toolchain-m68k --quiet build

toolchain-m68k

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from fnmatch import fnmatch
66
from glob import glob
7-
from logging import info
7+
from logging import info, getLogger
88
from os import environ
99
import argparse
1010
import logging
@@ -47,7 +47,6 @@ MULTILIB = [('', []),
4747
['-fbaserel', '-DSMALL_DATA', '-m68020', '-m68881']),
4848
('libb32/libm020', ['-fbaserel32', '-DSMALL_DATA', '-m68020'])]
4949

50-
5150
from common import * # NOQA
5251

5352

@@ -259,6 +258,12 @@ def build():
259258

260259
CC = find_executable(CC)
261260
CXX = find_executable(CXX)
261+
FLAGS = '-g -O2'
262+
263+
if getLogger().isEnabledFor(logging.DEBUG):
264+
FLAGS += ' -Wall'
265+
else:
266+
FLAGS += ' -w'
262267

263268
environ['CC'] = CC
264269
environ['CXX'] = CXX
@@ -375,7 +380,7 @@ def build():
375380
config.guess script knows nothing about x86-64 or darwin.
376381
"""
377382

378-
with env(CC=CC, CXX=CXX, CFLAGS='-g -O2 -Wall', CXXFLAGS='-g -O2 -Wall'):
383+
with env(CC=CC, CXX=CXX, CFLAGS=FLAGS, CXXFLAGS=FLAGS):
379384
configure('{binutils}',
380385
'--prefix={prefix}',
381386
'--infodir={prefix}/{target}/info',
@@ -393,7 +398,7 @@ def build():
393398
unpack('{ixemul}', top_dir='ixemul')
394399
patch('{ixemul}')
395400

396-
with env(CC=CC, CXX=CXX, CFLAGS='-g -O2 -Wall', CXXFLAGS='-g -O2 -Wall'):
401+
with env(CC=CC, CXX=CXX, CFLAGS=FLAGS, CXXFLAGS=FLAGS):
397402
configure('{gcc}',
398403
'--prefix={prefix}',
399404
'--infodir={prefix}/{target}/info',
@@ -462,7 +467,7 @@ def build():
462467
make('{clib2}', makefile='GNUmakefile.68k')
463468
install_clib2()
464469

465-
with env(CC=CC, CXX=CXX, CFLAGS='-g -O2 -Wall', CXXFLAGS='-g -O2 -Wall'):
470+
with env(CC=CC, CXX=CXX, CFLAGS=FLAGS, CXXFLAGS=FLAGS):
466471
make('{gcc}', 'all-target',
467472
MAKEINFO='makeinfo', CFLAGS_FOR_TARGET='-noixemul')
468473
make('{gcc}', 'install-target',
@@ -682,6 +687,7 @@ if __name__ == "__main__":
682687
help='desired binutils version')
683688
parser.add_argument('--gcc', choices=['2.95.3'], default='2.95.3',
684689
help='desired gcc version')
690+
parser.add_argument('-q', '--quiet', action='store_true')
685691
parser.add_argument('--prefix', type=str, default=None,
686692
help='installation directory')
687693
args = parser.parse_args()
@@ -718,6 +724,9 @@ if __name__ == "__main__":
718724
archives=path.join('{top}', '.build-m68k', 'archives'),
719725
submodules=path.join('{top}', 'submodules'))
720726

727+
if args.quiet:
728+
getLogger().setLevel(logging.INFO)
729+
721730
if args.prefix is not None:
722731
setvar(target=args.prefix)
723732

0 commit comments

Comments
 (0)