Index: linkers/wscript
===================================================================
--- linkers/wscript	(revision 2f11c3631d3bcaf5447019bb4784c231f079285b)
+++ linkers/wscript	(revision 0382b6863be01ad365d7ae272b61cfef4870f631)
@@ -1,2 +1,32 @@
+#
+# RTEMS Tools Project (http://www.rtems.org/)
+# Copyright 2014, 2015 Chris Johns (chrisj@rtems.org)
+# All rights reserved.
+#
+# This file is part of the RTEMS Tools package in 'rtems-tools'.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
 #
 # RTEMS Linker build script.
Index: rtemstoolkit/elftoolchain/libelf/mmap_win32.c
===================================================================
--- rtemstoolkit/elftoolchain/libelf/mmap_win32.c	(revision 2f11c3631d3bcaf5447019bb4784c231f079285b)
+++ rtemstoolkit/elftoolchain/libelf/mmap_win32.c	(revision 0382b6863be01ad365d7ae272b61cfef4870f631)
@@ -1,4 +1,4 @@
 /*-
- * Copyright (c) 2011 Chris Johns <chrisj@rtems.org>
+ * Copyright (c) 2011, 2015 Chris Johns <chrisj@rtems.org>
  * All rights reserved.
  *
@@ -40,4 +40,5 @@
 #include <errno.h>
 #include <stdint.h>
+#include <io.h>
 #include <windows.h>
 
Index: rtemstoolkit/wscript
===================================================================
--- rtemstoolkit/wscript	(revision 2f11c3631d3bcaf5447019bb4784c231f079285b)
+++ rtemstoolkit/wscript	(revision 0382b6863be01ad365d7ae272b61cfef4870f631)
@@ -1,2 +1,32 @@
+#
+# RTEMS Tools Project (http://www.rtems.org/)
+# Copyright 2014, 2015 Chris Johns (chrisj@rtems.org)
+# All rights reserved.
+#
+# This file is part of the RTEMS Tools package in 'rtems-tools'.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
 #
 # RTEMS Toolkit build script.
@@ -23,4 +53,6 @@
     conf_libiberty(conf)
     conf_libelf(conf)
+
+    conf.find_program('m4')
 
     conf.check(header_name='sys/wait.h',  features = 'c', mandatory = False)
@@ -139,13 +171,5 @@
 def bld_libelf(bld, conf):
     libelf = 'elftoolchain/libelf/'
-
-    #
-    # Work around the ${SRC} having Windows slashes which the MSYS m4 does not
-    # understand.
-    #
-    if sys.platform == 'win32':
-        m4_rule = 'type ${SRC} | m4 -D SRCDIR=../rtemstoolkit/' + libelf[:-1] + '> ${TGT}"'
-    else:
-        m4_rule = 'm4 -D SRCDIR=../rtemstoolkit/' + libelf[:-1] + ' ${SRC} > ${TGT}'
+    m4_rule = '${M4} -D SRCDIR=../rtemstoolkit/' + libelf[:-1] + ' ${SRC} > ${TGT}'
     if bld.env.DEST_OS == 'win32':
         includes = ['win32']
Index: tester/rt/console.py
===================================================================
--- tester/rt/console.py	(revision 2f11c3631d3bcaf5447019bb4784c231f079285b)
+++ tester/rt/console.py	(revision 0382b6863be01ad365d7ae272b61cfef4870f631)
@@ -34,16 +34,26 @@
 
 import errno
-import fcntl
 import os
 import threading
 import time
 
-import stty
+#
+# Not available on Windows. Not sure what this means.
+#
+if os.name != 'nt':
+    import fcntl
+    import stty
+else:
+    fcntl = None
+    stty = None
 
 def save():
-    return stty.save()
+    if stty is not None:
+        return stty.save()
+    return None
 
 def restore(attributes):
-    stty.restore(attributes)
+    if attributes is not None and stty is not None:
+        stty.restore(attributes)
 
 class console(object):
@@ -92,6 +102,7 @@
         if self._tracing():
             print ':: tty close', self.dev
-        fcntl.fcntl(me.tty.fd, fcntl.F_SETFL,
-                    fcntl.fcntl(me.tty.fd, fcntl.F_GETFL) & ~os.O_NONBLOCK)
+        if fcntl is not None:
+            fcntl.fcntl(me.tty.fd, fcntl.F_SETFL,
+                        fcntl.fcntl(me.tty.fd, fcntl.F_GETFL) & ~os.O_NONBLOCK)
         self.close()
 
@@ -100,6 +111,7 @@
             if self._tracing():
                 print ':: tty runner started', self.dev
-            fcntl.fcntl(me.tty.fd, fcntl.F_SETFL,
-                        fcntl.fcntl(me.tty.fd, fcntl.F_GETFL) | os.O_NONBLOCK)
+            if fcntl is not None:
+                fcntl.fcntl(me.tty.fd, fcntl.F_SETFL,
+                            fcntl.fcntl(me.tty.fd, fcntl.F_GETFL) | os.O_NONBLOCK)
             line = ''
             while me.running:
Index: tester/rt/gdb.py
===================================================================
--- tester/rt/gdb.py	(revision 2f11c3631d3bcaf5447019bb4784c231f079285b)
+++ tester/rt/gdb.py	(revision 0382b6863be01ad365d7ae272b61cfef4870f631)
@@ -36,5 +36,4 @@
 import Queue
 import sys
-import termios
 import threading
 
Index: tester/rtems-test
===================================================================
--- tester/rtems-test	(revision 2f11c3631d3bcaf5447019bb4784c231f079285b)
+++ tester/rtems-test	(revision 0382b6863be01ad365d7ae272b61cfef4870f631)
@@ -34,5 +34,6 @@
 parent = os.path.dirname(base)
 rtems = os.path.join(parent, 'share', 'rtems')
-sys.path = [base, parent, rtems] + sys.path
+tester = os.path.join(parent, 'share', 'rtems', 'tester')
+sys.path = [parent, rtems, tester] + sys.path
 
 try:
Index: tester/wscript
===================================================================
--- tester/wscript	(revision 2f11c3631d3bcaf5447019bb4784c231f079285b)
+++ tester/wscript	(revision 0382b6863be01ad365d7ae272b61cfef4870f631)
@@ -61,10 +61,10 @@
                   'rt/test.py',
                   'rt/version.py'],
-        install_path = '${PREFIX}/share/rtems/rt')
+        install_path = '${PREFIX}/share/rtems/tester')
     bld(features = 'py',
         source = ['rt/pygdb/__init__.py',
                   'rt/pygdb/mi_parser.py',
                   'rt/pygdb/spark.py'],
-        install_path = '${PREFIX}/share/rtems/rt/pygdb')
+        install_path = '${PREFIX}/share/rtems/tester')
     bld.install_files('${PREFIX}/bin', ['rtems-test'], chmod = 0o755)
 
Index: wscript
===================================================================
--- wscript	(revision 2f11c3631d3bcaf5447019bb4784c231f079285b)
+++ wscript	(revision 0382b6863be01ad365d7ae272b61cfef4870f631)
@@ -1,5 +1,5 @@
 #
 # RTEMS Tools Project (http://www.rtems.org/)
-# Copyright 2014 Chris Johns (chrisj@rtems.org)
+# Copyright 2014, 2015 Chris Johns (chrisj@rtems.org)
 # All rights reserved.
 #
