Changeset 773ab3f in rtems-source-builder


Ignore:
Timestamp:
Feb 24, 2016, 3:18:42 AM (4 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.11
Children:
a7691f0
Parents:
c434884
git-author:
Chris Johns <chrisj@…> (02/24/16 03:18:42)
git-committer:
Chris Johns <chrisj@…> (02/24/16 06:34:54)
Message:

Fix sb-bootrap to run on Windows using MSYS2.

Prepend 'sh' to the command so the autoreconf runs in a shell.

Is the first item in the path is a reference to MSYS2 remove it.

Closes #2613.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source-builder/sb/bootstrap.py

    rc434884 r773ab3f  
    8787        try:
    8888            try:
    89                 self.output = subprocess.check_output(self.cmd, cwd = self.cwd)
     89                if os.name == 'nt':
     90                    cmd = ['sh', '-c'] + self.cmd
     91                else:
     92                    cmd = self.cmd
     93                self.output = subprocess.check_output(cmd, cwd = path.host(self.cwd))
    9094            except subprocess.CalledProcessError, cpe:
    9195                self.exit_code = cpe.returncode
     
    9397            except OSError, ose:
    9498                raise error.general('bootstrap failed: %s in %s: %s' % \
    95                                         (' '.join(self.cmd), self.cwd, (str(ose))))
     99                                        (' '.join(cmd), path.host(self.cwd), (str(ose))))
    96100            except KeyboardInterrupt:
    97101                pass
     
    241245def run(args):
    242246    try:
     247        #
     248        # On Windows MSYS2 prepends a path to itself to the environment
     249        # path. This means the RTEMS specific automake is not found and which
     250        # breaks the bootstrap. We need to remove the prepended path. Also
     251        # remove any ACLOCAL paths from the environment.
     252        #
     253        if os.name == 'nt':
     254            cspath = os.environ['PATH'].split(os.pathsep)
     255            if 'msys' in cspath[0] and cspath[0].endswith('bin'):
     256                os.environ['PATH'] = os.pathsep.join(cspath[1:])
     257            if 'ACLOCAL_PATH' in os.environ:
     258                os.environ['ACLOCAL_PATH'].clear()
    243259        optargs = { '--rtems':       'The RTEMS source directory',
    244260                    '--preinstall':  'Preinstall AM generation' }
Note: See TracChangeset for help on using the changeset viewer.