20 | | [[BR]] |
21 | | It is '''recommended you install MinGW, MSYS and MSYS DTK''' before you install the RTEMS Tools. The autotools installer builds autoconf and automake before installing them on your computer. There is no safe way to build autoconf using a cross-build on a Linux host. To build the autotools packages on Windows MSYS and MSYS DTK are required. The autotools installer checks for them and aborts installation if they do not exist. Read the section [wiki:MinGW_Tools_for_Windows#Setting_Up_MinGW Setting Up MinGW] for details. |
22 | | ---- |
23 | | Before you use these tools install MinGW and MSYS as described above plus also install an newer GNU M4 tools (http://downloads.sourceforge.net/mingw/m4-1.4.7-MSYS.tar.bz2). In the MSYS shell enter: |
24 | | |
25 | | cd / |
26 | | tar -xvjf /c/my-download/m4-1.4.7-MSYS.tar.bz2 |
27 | | |
28 | | where the file has been downloaded to {{{c:\my-download</code>. If you do not have the correct M4 installed the building of autoconf will fail. You can observe this in the Windows CMD shell window when it says: |
29 | | |
30 | | <blockquote><blockquote><blockquote>{{{ |
31 | | DO NOT CLOSE DO NOT CLOSE |
32 | | |
33 | | Warning: this command window will automatically close. |
34 | | |
35 | | Build output: C:/opt/rtems-4.9/Packages/Source/at-log.txt |
36 | | |
37 | | configure: error: no acceptable m4 could be found in $PATH. |
38 | | GNU M4 1.4.5 or later is required; 1.4.11 is recommended |
39 | | error: configuring autoconf-2.62 |
40 | | ERROR: code '222'. Press Any Key to continue |
41 | | }}}</blockquote></blockquote></blockquote> |
42 | | |
43 | | Pressing any key will continue how-ever the autoconf and/or automake will not be correct. You should exit the installer and install the required M4 program. |
44 | | ---- |
45 | | For a detailed walk through of the installer take a look at [wiki:TBR/Delete/Installing_MinGW_RTEMS_Tools Installing MinGW RTEMS Tools]. |
46 | | |
47 | | The source code for the tools is under the GNU GPL and can be found here http://www.rtems.org/ftp/pub/rtems/windows/4.9/build-4/source. The installers and tools are built and packaged on a Linux Fedora (FC9) computer and the scripts are all provided in the RTEMS source code. Instructions on using the scripts can be found in [wiki:Building/MingwTools Building MinGW Tools]. |
48 | | |
49 | | The RTEMS Tools are all installed into the default path of <tt>c:\opt\rtems-4.9</tt>. The version number changes with each release. To test the tools run the <tt>rtems.bat</tt> file. This will open a Windows Command prompt (cmd) with a valid path to the installed tools. You can find the <tt>rtems.bat</tt> under the install point or in the '''RTEMS 4.9''' menu under the '''Start Menu'''. Enter the GCC command for your tool set. For example the RTEMS 4.9 ARM GCC command is: |
50 | | |
51 | | RTEMS C:\opt\rtems-4.9> arm-rtems4.9-gcc |
52 | | arm-rtems4.9-gcc: no input files |
53 | | |
54 | | A few batch files and a script file are installed into the install point. The first is called <tt>rtems-env.bat</tt>. It sets up the path and environment variables you need to run the RTEMS tools. The second is <tt>rtems.bat</tt>. It will open a Windows command box with the RTEMS tools path and environment set. The last is <tt>sh-run.bat</tt>. You can call this batch file from your editor when you want to compile within the editor. You need to install the MinGW and MSYS packages to use this batch file. For example: |
55 | | |
56 | | c:\rtems\arm\sh-run.bat ./vs-make.sh /c/opt/src/rtems/app all |
57 | | |
58 | | can be used with Visual Studio and an external make project to compile an application in <tt>c:\opt\src\rtems\app</tt>. The script <tt>vs-make.sh</tt> will change directory and invoke GNU make converting the GCC error messages to the MS format that Visual Studio understands. |
59 | | = RTEMS 4.10 Tools = |
| 14 | = Introduction = |
68 | | The tools as installed do not need any extra packages, DLLs or installs to work. You could use any available make program or tools to build any RTEMS application. If you want some excellent tools or wish to build RTEMS on Windows the MinGW project provides just what you need. You can find the MinGW project at http://www.mingw.org/. |
69 | | |
70 | | The MinGW project has 3 packages we are interested in using. You should install them before you install the RTEMS Tools. The first MinGW package contains a Windows native GCC compiler, and GNU make (called mingw32-make). The second package is MSYS for Minimal SYStem (MSYS), and the third is the Minimal SYStem Developers Tool Kit (MSYS DTK). MSYS is a stand alone package based on the excellent and successful Cygwin package but simplified to providing a self hosted mingw32 target POSIX style environment. It provides a shell with enough functionality to run {{{configure</code> scripts from the autoconf package. It is simpler to install and setup than the larger more complex Cygwin package. |
71 | | |
72 | | <blockquote> |
73 | | [http://prdownloads.sf.net/mingw/MinGW-5.1.3.exe?download MinGW Tools]<br /> |
74 | | [http://prdownloads.sf.net/mingw/MSYS-1.0.10.exe?download MSYS Installer]<br /> |
75 | | [http://prdownloads.sf.net/mingw/msysDTK-1.0.0.exe?download MinGW MSYS Developers Tool Kit] |
76 | | </blockquote> |
77 | | |
78 | | Click on the above and install each package. The default settings for these package should be ok for most users. If there are problems with the above links or to check for other MinGW packages, visit the [http://www.mingw.org/download.shtml MinGW Download Site] which should refer you to the [http://sourceforge.net/project/showfiles.php?group_id=2435 MinGW Sourceforge Files page]. |
79 | | |
80 | | <blockquote> |
81 | | '''WARNING:''' ''If you uninstall the MinGW package it currently deletes everything under the install directory. It is recommended you use the standard install point and do not place any files you need to keep under that directory.'' |
82 | | </blockquote> |
83 | | |
84 | | It is advised to set up a home directory that MSYS can use and if you do not the MSYS shell will use a default one for your login name. If you create a home directory MSYS will use it. To create a home directory simply create a '''HOME''' environment variable. For Windows 2000 and Windows XP open the ''System'' icon on the ''Control Panel'', select the ''Advanced'' tab then the ''Environment Variables'' button. Add a ''New'' environment variable for your login called '''HOME''' and point it to the home directory you wish to use. It could point to a network drive that is a real Unix home directory, your Windows home directory under ''Documents and Settings'' that becomes part of a roaming profile, or just a directory local to the disk. |
85 | | |
86 | | If you have Cygwin installed, or another package which contains Cygwin you should consider removing any paths to those packages from your global path variable and using batch files to set paths specifically. It can be confusing if you end up mixing MSYS and Cygwin executables in the same environment. The installed batch file <tt>rtems.bat</tt> shows how you can manage specific paths for MinGW and RTEMS. |
87 | | |
88 | | The MSYS shell can run the RTEMS {{{configure</code> script. You can use the MSYS shell which you can find as a menu or Desktop icon. This is just like a Unix shell so you need to know some basic Unix commands to use. You can also run {{{configure</code> from a Windows command prompt started with the <tt>rtems.bat</tt> file by placing ''sh'' before the {{{configure</code> command. |
89 | | |
90 | | If you wish to modify RTEMS and/or need to run autoconf, automake or any of the autotools you will need to install the ''MinGW MSYS Developers Tool kit''. |
91 | | |
92 | | The RTEMS installer checks to see if the MSYS <tt>/etc/fstab</tt> is present and appends the install path the tools are built with as a mount to the install point you set in the installer. The <tt>/etc/fstab</tt> will have the following entry (rtems4.9) for the default install point: |
93 | | |
94 | | C:/opt/rtems-4.9 /opt/rtems-4.9 |
95 | | |
96 | | The install tries hard to locate MSYS. If it does not find it please let us know. |
97 | | = Building RTEMS = |
| 23 | This page targets a single user with a Windows machine who wishes to play with a real-time OS. This user is independent with no corporate support and she wants to build her desired board support package from a RTEMS release TAR-file or CVS. Only default installation paths are used so if the user wishes to access support on MinGW or MSYS mailing lists she has the standard set up and lay out for those forums. If you wish to contain all the RTEMS installed files in a common location you may find the hints in the [wiki:#Advanced_Users Advanced Users] section useful. |
| 24 | = Base Installation = |
129 | | $ export PATH=/c/opt/rtems-4.9/bin:$PATH |
130 | | $ mkdir -p /c/opt/src/rtems |
131 | | $ cd /c/opt/src/rtems |
132 | | $ tar jxf /c/downloads\rtems\rtems-4.9.0.tar.bz2 |
133 | | $ cd rtems-4.9.0 |
134 | | $ ./bootstrap |
135 | | $ cd .. |
136 | | $ mkdir i386 |
137 | | $ cd i386 |
138 | | $ ../rtems-4.9.0/configure --target=m68k-rtems4.9 --enable-multilib --prefix=/c/opt/src/rtems/i386 |
139 | | $ make all install |
| 48 | |
| 49 | Follow the instructions of the installer to install [http://www.mingw.org/wiki/MSYS MSYS]. All default values from the installer are suitable. Continue with the post install process and enter the MinGW installation location from above. |
| 50 | <center>[[Image(msys-post-install.jpg)]]</center> |
| 51 | |
| 52 | If you have Cygwin installed or another package which contains Cygwin you should consider removing any paths to those packages from your global path variable and using batch files to set paths specifically. It can be confusing if you end up mixing MSYS and Cygwin executables in the same environment. The batch file <tt>rtems.bat</tt> shows how you can manage specific paths for MinGW and RTEMS (this file is part of the RTEMS Tools). |
| 53 | |
| 54 | To avoid trouble you need to set a home directory for the MSYS shell. The home directory path must not contain any space characters. The default home directory is derived from your login name, so it may contain space characters. Open the file <tt>C:\msys\1.0\etc\profile</tt> with a capable editor. The standard Windows editors Notepad and WordPad are not suitable. In the next picture the open source editor [http://notepad-plus.sourceforge.net/uk/site.htm notepad++] is used to highlight the changes. Set the <tt>HOME</tt> environment variable to the fixed location <tt>/c/home</tt> (or whatever you want). In the [wiki:#MSYS_Shell Advanced Users] section you find more information regarding the home directory. |
| 55 | <center>[[Image(msys-home.jpg)]]</center> |
| 56 | = MSYS - Developer Tool Kit = |
| 57 | |
| 58 | |
| 59 | Follow the instructions of the installer to install the MSYS - DTK. For the installation location you should choose the one of your MSYS installation like: |
| 60 | <center><tt>C:\msys\1.0</tt></center> |
| 61 | For all other settings the default values from the installer are suitable. |
| 62 | = MSYS - M4 = |
| 63 | |
| 64 | |
| 65 | The Autotools used for RTEMS require a recent version of M4. The current MSYS release delivers an outdated version so we have to upgrade it manually. We assume that you have downloaded the M4 package into the directory <tt>C:\download</tt>. Now open a Windows command shell (''cmd.exe'') and type in the following three commands (the '>' prompt indicates the Windows command shell): |
| 66 | |
| 67 | > cd C:\msys\1.0 |
| 68 | > set PATH=C:\msys\1.0\bin;%PATH% |
| 69 | > tar xjf /c/download/m4-1.4.7-MSYS.tar.bz2 |
| 70 | |
| 71 | Alternatively you can use a MSYS shell (''Start > All Programs > MinGW > MSYS > msys'') with the commands below (the '$' prompt indicates the MSYS shell): |
| 72 | |
| 73 | $ cd / |
| 74 | $ tar xjf /c/download/m4-1.4.7-MSYS.tar.bz2 |
| 75 | |
| 76 | You can also use an archive extractor like [http://www.izarc.org IZArc] to extract the bzip2 compressed TAR-file into <tt>C:\msys\1.0</tt>. |
| 77 | |
| 78 | You can verify the installation of M4 with the following command in a shell: |
| 79 | |
| 80 | m4 --version |
| 81 | |
| 82 | It should produce the following output: |
| 83 | |
| 84 | GNU M4 1.4.7 |
| 85 | Copyright (C) 2006 Free Software Foundation, Inc. |
| 86 | This is free software; see the source for copying conditions. There is NO |
| 87 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 88 | |
| 89 | Written by Rene' Seindal. |
| 90 | = RTEMS Tools Installation = |
| 91 | |
| 92 | = Download = |
| 93 | |
| 94 | |
| 95 | Choose your desired RTEMS Tools release: |
| 96 | *[http://www.rtems.org/ftp/pub/rtems/windows/4.10/build-1/rtems4.10-tools-1.exe RTEMS 4.10 Tools Installer] |
| 97 | *[http://www.rtems.org/ftp/pub/rtems/windows/4.9/build-5/rtems4.9-tools-5.exe RTEMS 4.9 Tools Installer] |
| 98 | *[http://www.rtems.org/ftp/pub/rtems/windows/4.8/build-17/rtems4.8-tools-17.exe RTEMS 4.8 Tools Installer] |
| 99 | Other releases are available in the [http://www.rtems.org/ftp/pub/rtems/windows RTEMS Tools] directory. |
| 100 | = Installation = |
| 101 | |
| 102 | |
| 103 | Follow the instructions of the installer to download and install the RTEMS Tools. You may deselect the subpackages that you do not need. For all settings the default values from the installer are suitable. If you have problems with the ''Autoconf and Automake'' subpackage installation see above to the [wiki:#MSYS_-_M4 MSYS - M4] section. After the installation check the file <tt>C:\msys\1.0\etc\fstab</tt> if it is suitable for you, see also [wiki:#MSYS_Shell MSYS Shell]. In case of trouble you may have a look at the [http://www.rtems.org/wiki/index.php/Installing_MinGW_RTEMS_Tools| RTEMS Tools Installation Guide]. |
| 104 | = Update = |
| 105 | |
| 106 | |
| 107 | Remove all currently installed builds of the corresponding RTEMS release with the uninstaller and install the new build afterwards. |
| 108 | = RTEMS Build = |
| 109 | |
| 110 | |
| 111 | We will use the [http://www.rtems.org/ftp/pub/rtems/4.9.1/rtems-4.9.1.tar.bz2 RTEMS 4.9.1] release here and assume that all tools from above are installed. If you use a CVS version make sure that the Unix to DOS line endings conversion was switched off during the checkout and do not forget the bootstrap. |
| 112 | |
| 113 | The build will be done in a Windows command shell (''cmd.exe''). Execute the following commands within a Windows command shell to build for example the PSIM board support package (the '>' prompt indicates the Windows command shell): |
| 114 | |
| 115 | > set PATH=C:\opt\rtems-4.9\bin;C:\MinGW\bin;C:\msys\1.0\bin;%PATH% |
| 116 | > tar xjf /c/download/rtems-4.9.1.tar.bz2 |
| 117 | > mkdir rtems-4.9.1-psim |
| 118 | > cd rtems-4.9.1-psim |
| 119 | > sh ../rtems-4.9.1/configure --target=powerpc-rtems4.9 --enable-rtemsbsp=psim --enable-cxx --enable-tests=samples |
| 120 | > make install |
| 121 | |
| 122 | Alternatively you can use a MSYS shell (''Start > All Programs > MinGW > MSYS > msys''). Execute the following commands within a MSYS shell to build for example the PSIM board support package (the '$' prompt indicates the MSYS shell): |
| 123 | |
| 124 | $ export PATH="/opt/rtems-4.9/bin:$PATH" |
| 125 | $ tar xjf /c/download/rtems-4.9.1.tar.bz2 |
| 126 | $ mkdir rtems-4.9.1-psim |
| 127 | $ cd rtems-4.9.1-psim |
| 128 | $ ../rtems-4.9.1/configure --target=powerpc-rtems4.9 --enable-rtemsbsp=psim --enable-cxx --enable-tests=samples |
| 129 | $ make install |
| 130 | |
| 131 | It is recommended to use a fresh build directory for each configuration. See also [wiki:Building/RTEMS Building RTEMS]. |
| 132 | = Advanced Users = |
| 133 | |
| 134 | = Installation Root Directory = |
| 135 | |
| 136 | |
| 137 | You can use common root directory for all packages and tools like: |
| 138 | |
| 139 | <center><tt>C:\rtems-mingw</tt></center> |
| 140 | |
| 141 | This root directory must not contain any space characters in its path. With a common root directory you have everything that is related to RTEMS in one place and the various packages are not scattered over your Windows root device. Ths installation may then look like this: |
| 142 | |
| 143 | *<tt>C:\rtems-mingw\MinGW</tt> |
| 144 | *<tt>C:\rtems-mingw\MSYS</tt> |
| 145 | *<tt>C:\rtems-mingw\opt\rtems-4.9</tt> |
| 146 | |
| 147 | Your <tt>C:\rtems-mingw\MSYS\etc\fstab</tt> should contain this: |
| 148 | C:/rtems-mingw/MinGW /mingw |
| 149 | C:/rtems-mingw/opt /opt |
| 150 | = MSYS Shell = |
| 151 | |
| 152 | |
| 153 | The MSYS shell can run the RTEMS configure script. After the installation you can start the MSYS shell via the start menu (''Start > All Programs > MinGW > MSYS > msys'') or a Desktop icon. It is just like a Unix shell so you need to know some basic Unix commands to use. You can also run <tt>configure</tt> from a Windows command prompt started with the <tt>rtems.bat</tt> file by placing <tt>sh</tt> before the <tt>configure</tt> command. |
| 154 | |
| 155 | The MSYS shell provides a Unix like view to the Windows filesystem. The MSYS shell root directory <tt>/</tt> is mapped to the MSYS installation location <tt>C:\msys\1.0</tt>. Windows device characters are mapped from <tt>/c/directory/file.txt</tt> to <tt>C:\directory\file.txt</tt>. You can add mount points via the <tt>mount</tt> command or the <tt>C:\msys\1.0\etc\fstab</tt> file. The <tt>fstab</tt> file should contain this: |
| 156 | C:/MinGW /mingw |
| 157 | C:/opt /opt |
| 158 | |
| 159 | It is advised to set up a home directory that the MSYS shell can use. If you do nothing the MSYS shell will use a default one for your login name. The home directory should not contain any space characters in its path. You can use a global <tt>HOME</tt> environment variable or edit the MSYS profile. |
| 160 | |
| 161 | To edit the MSYS profile open the file <tt>C:\msys\1.0\etc\profile</tt> with a capable editor and set the <tt>HOME</tt> variable to the fixed location <tt>/c/home</tt> (or whatever you want). |
| 162 | |
| 163 | Advanced users in a Windows networked environment where home directories are resident on the network can use the user's global <tt>HOME</tt> environment variable. Make sure that this does not interfere with other programs like Cygwin. For Windows 2000 and Windows XP open the ''System'' icon on the ''Control Panel'', select the ''Advanced'' tab then the ''Environment Variables'' button. Add a ''New'' environment variable for your login called <tt>HOME</tt> and point it to the home directory you wish to use. If you use this method to set a home directory you do not need to change MSYS's profile. |
| 164 | = Miscellaneous = |
| 165 | |
| 166 | = Trouble Shooting = |
| 167 | |
| 168 | |
| 169 | Space characters in the install paths or the home directory may cause problems. You should avoid them. |
| 170 | |
| 171 | Do not use the Unix to DOS line ending conversion for CVS checkouts. |
| 172 | |
| 173 | If you have trouble with MSYS when building RTEMS check what virus or spyware detection software you have. The ''PC Tools Spyware Doctor'' has been giving someone problems. The machine loses all resources. Turing off Spyware Doctor does not help, it had to be uninstalled. |
| 174 | |
| 175 | If you experience, that the shell crashes sometimes, resulting in a stack dump, you might want to check whether you have a Logitech webcam (or similar) installed on your system. Killing the process <tt>lvprcsrv.exe</tt> in the ''Windows Task Manager'' might help in these situations. |
| 176 | |
| 177 | If you encounter an error like this |
| 178 | |
| 179 | Couldn't reserve space for cygwin's heap, Win32 error 6 |
| 180 | |
| 181 | try to use a 1.0.11 version of the MSYS DLL and base files. |
| 182 | |
| 183 | An outdated version of M4 causes a problem during the RTEMS Autotools installation. You notices this if a window like this pops up: |
| 184 | <center>[[Image(msys-m4.jpg)]]</center> |
| 185 | Pressing any key will continue but the installation of the Autotools will not be correct. You should exit the installer and install the required M4 program, see also [wiki:#MSYS_-_M4 MSYS - M4]. |