Difference between revisions of "Build Environment"

From ReactOS Wiki
Jump to: navigation, search
m
m (Protected "Build Environment": High traffic page: The de-facto official RosBE download page ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
(108 intermediate revisions by 42 users not shown)
Line 1: Line 1:
*How to [http://vmlinux.org/jakov/ros/cross_mingw.html Cross Compile to MinGW] on Linux/BSD
+
To build ReactOS you will need a suitable build environment. Currently ReactOS Source Code is able to be compiled using both open source (gcc, mingw, …), and Microsoft's compiler tools, with the official ReactOS Build Environment (RosBE) being recommended. If you want to report problems, please first make sure that you use the latest version of the ReactOS Build Environment.
  
 +
== Download the Build Environment ==
  
== Required files ==
+
There are two ReactOS Build Environments available, a version for Windows NT-compatible operating systems (Windows XP, Windows Vista, 7, etc.) and a version for Unix-compatible operating systems (Linux, FreeBSD, etc.).
  
For latest releases go to http://www.mingw.org/download.shtml and download the following files:
+
=== Windows ===
* [http://prdownloads.sf.net/mingw/MinGW-3.1.0-1.exe?download MinGW-3.1.0-1.exe]
+
----
* [http://prdownloads.sf.net/mingw/gcc-core-3.3.3-20040217-1.tar.gz?download gcc-core-3.3.3-20040217-1.tar.gz]
+
<span style="font-size: 12pt; font-weight: bold; ">[[File:RosBE.png|32px]]
* [http://prdownloads.sf.net/mingw/gcc-g++-3.3.3-20040217-1.tar.gz?download gcc-g++-3.3.3-20040217-1.tar.gz]
+
[http://sourceforge.net/projects/reactos/files/RosBE-Windows/i386/{{RosBE-Windows-Version}}/RosBE-{{RosBE-Windows-Version}}.exe/download ReactOS Build Environment for Windows NT-compatible OS ''Version {{RosBE-Windows-Version}}'']
* [http://prdownloads.sf.net/mingw/gcc-objc-3.3.3-20040217-1.tar.gz?download gcc-objc-3.3.3-20040217-1.tar.gz]
+
</span>
* [http://prdownloads.sf.net/mingw/w32api-2.5.tar.gz?download w32api-2.5.tar.gz]
+
* For older versions, please have a look at our [http://sourceforge.net/projects/reactos/files/RosBE-Windows/i386/ ReactOS SourceForge project page]
* [http://prdownloads.sourceforge.net/mingw/binutils-2.15.94-20050118-1.tar.gz?download binutils-2.15.94-20050118-1.tar.gz]
+
----
* [http://www.kernel.org/pub/software/devel/nasm/ NASM]
 
* [http://prdownloads.sf.net/mingw/mingw32-make-3.80.0-3.exe?download make-3.80.0-3.exe]
 
  
If you wish to use GCC 3.4.1, instead, please see the [[GCC 3.4.1 Issues]] page. Please note that newer binutils packages namely 2.15.91 have problems with forward linking export functions and therefore will not build ReactOS properly.
+
=== Unix and Linux ===
 +
----
 +
<span style="font-size: 12pt; font-weight: bold;">[[File:RosBE.png|32px]]
 +
[http://downloads.sourceforge.net/reactos/RosBE-Unix-{{RosBE-Unix-Version}}.tar.bz2 ReactOS Build Environment for Unix-compatible Operating Systems ''Version {{RosBE-Unix-Version}}'']</span>
 +
* For older versions, please have a look at our [http://sourceforge.net/projects/reactos/files/RosBE-Unix/ ReactOS SourceForge project page]
 +
* '''System Requirements:''' Please look at the <tt>README</tt> file for detailed information about the needed packages and other requirements.
 +
----
 +
== Next Steps ==
  
You can also try the ReactOS Build Environment Setup - it includes everything (compiler, linker, ...) which is needed to build ReactOS:
+
After setting up your build environment, see [[Building ReactOS]] for downloading source and further information.
* [http://blight.reactos.at/reactos-be/ReactOS%20Build%20Environment%200.1-3.4.2.exe ReactOS Build Environment 0.1-3.4.2.exe]
 
  
== Building ReactOS ==
+
== Included Utilities ==
  
Run the make file from the root directory of ReactOS. In order to build a bootable ISO image, you must first build freeldr then run "make install" ; next you must run "make bootcd" from the root ReactOS directory. The ISO image will be located in the root ReactOS directory when it is finsihed.
+
All these Information can be found in RosBE, too by typing <code>help</code>.
  
In a reactos/windows build environment ''mingw32-make'' must be used instead of ''make''
+
=== <code>BASEDIR</code> ===
  
== Installation ==
+
Small command which immediately sets you back to the ReactOS Source Base Directory.
  
First run MinGW-3.1.0-1.exe then unpack the other tarballs into the directory which you had installed MinGW.
+
=== <code>CHARCH</code> ===
  
== Build Options ==
+
Change the Architecture to build ReactOS for, for the current RosBE session.
 +
Possible Architectures are right now:
 +
* '''i386'''
 +
* '''amd64'''
  
See the top-level Makefile for documentation on the build targets and environment variables available to configure desired build options.
+
=== <code>CHDEFDIR</code> ===
  
== Optional stuff ==
+
Change the ReactOS source directory for the current RosBE session.
  
'''Subversion Client'''
+
* '''previous''': Switch to the previous ReactOS source directory.
  
Get yourself a Subversion client and download the sources from the Subversion repository.
+
=== <code>CHDEFGCC</code> ===
  
'''Patching'''
+
Usage: <code>chdefgcc [PATH] [TYPE]</code>
 +
Change the MinGW/GCC directory for the current RosBE session.
  
You can use WinMerge to see changes in source code visually. This is particularly useful for submitting and reviewing patches.
+
* '''Path''': Path to set the Host or Target GCC to.
 +
* '''Type''': Set it to "target" or "host"
  
* [http://prdownloads.sourceforge.net/winmerge/WinMergeSetup.2.1.5.14.exe?download WinMergeSetup.2.1.5.14.exe]
+
=== <code>RADDR2LINE</code> ===
 +
<!--the template does not work her so well -->
 +
''Main article: [[Debugging#Translating Addresses|Debugging – Translating Addresses]]''
  
# Create a new directory. For example ''C:\mingw''.
+
Usage: <code>raddr2line [FILE] [ADDRESS]</code>
# Extract the files mentioned above in the directory you just created. It is important that you extract ''gcc-update.zip'' last because it overwrites the buggy ''gcc.exe'' from ''gcc-2.95.3-fastcall.zip''.
+
Translates program addresses into file names and line numbers to assist developers with finding specific bugs in ReactOS. If either of the options is not given you will be prompted for it.
# In your install directory (''C:\mingw'' in this example), you fill find the file ''mingw32.bat''. Change the line that updates the ''PATH'' variable according to your install directory (add ''C:\mingw\bin'' in this example).
 
# Run ''mingw32.bat'' before you want to use mingw. You can call it from ''autoexec.bat'' or you can call it whenever you open a shell window.
 
  
== See also ==
+
* '''FILE''': This can be either a fully specified path or just the file name [you can use a partial name ie. ntdll*] of the executable to be analyzed. When using just a file the current directory and all sub-directories are searched.
*[[Build Troubleshooting]]
+
* '''ADDRESS''': The address to be translated.
*[[HOWTO/setup a build environment for Windows]]
+
 
*[[HOWTO/setup a build environment for Linux]]
+
=== <code>SCUT</code> ===
 +
 
 +
Simple utility for managing different directory locations. SCUT can be used to quickly change from one directory to another inside the BE prompt, making it easier to go to source in another directory. Included in both the Windows and Unix BEs.
 +
You can pass the following parameters to scut:
 +
 
 +
* '''list''': Lists all shortcuts currently available.
 +
* '''add''': Adds a shortcut to the list.
 +
* '''edit''': Edits a shortcut on the list.
 +
* '''rem''': Removes a shortcut from the list.
 +
* '''def''': Switches to the default directory location, which is enabled on every start of RosBE.
 +
 
 +
If you want to use a directory shortcut, for example one with the name ''trunk'', just enter ''scut trunk'' and the program will switch to the directory you set for this shortcut.
 +
 
 +
=== <code>SSVN</code> ===
 +
 
 +
This command is '''not used anymore''', see [[Building ReactOS#Getting a Working Copy]].
 +
 
 +
Windows ONLY.
 +
Creates, updates or cleans up your ReactOS source tree or shows the revision number of the local and online trees.
 +
 
 +
* '''update''': Updates to HEAD revision or to a specific one when the second parameter specifies one.
 +
* '''create''': Creates a new ReactOS source tree.
 +
* '''rosapps''': Creates/Updates a ReactOS RosApps source tree.
 +
* '''rostests''': Creates/Updates a ReactOS RosTests source tree.
 +
* '''cleanup''': Cleans up and fixes errors in the source tree.
 +
* '''status''': Show the current local and online revision numbers.
 +
 
 +
=== <code>UPDATE</code> ===
 +
 
 +
Windows ONLY.
 +
Updates all files of RosBE to the most recent files.
 +
 
 +
* '''delete X''': Deletes Update Nr X.
 +
* '''info X''': Shows info about Update Nr X.
 +
* '''nr X''': Re/Installs Update Nr X.
 +
* '''reset''': Removes the Updates Cache. Not recommended.
 +
* '''status''': Shows the recent status of available, non installed updates.
 +
 
 +
== Questions or Problems? ==
 +
 
 +
If you have problems or questions concerning the Build Environment, it's the best to ask in the [irc://irc.freenode.net/reactos-rosbe #reactos-rosbe] or [irc://irc.freenode.net/reactos #reactos] IRC channels.
 +
 
 +
Otherwise you can also try to contact [[Daniel Reimer]] (Windows version), [[Colin Finck]] (Unix version) directly.
 +
 
 +
[[Category:Building]]
 +
[[Category:Tutorial]]

Revision as of 09:49, 15 August 2019

To build ReactOS you will need a suitable build environment. Currently ReactOS Source Code is able to be compiled using both open source (gcc, mingw, …), and Microsoft's compiler tools, with the official ReactOS Build Environment (RosBE) being recommended. If you want to report problems, please first make sure that you use the latest version of the ReactOS Build Environment.

Download the Build Environment

There are two ReactOS Build Environments available, a version for Windows NT-compatible operating systems (Windows XP, Windows Vista, 7, etc.) and a version for Unix-compatible operating systems (Linux, FreeBSD, etc.).

Windows


RosBE.png ReactOS Build Environment for Windows NT-compatible OS Version 2.2.1


Unix and Linux


RosBE.png ReactOS Build Environment for Unix-compatible Operating Systems Version 2.2.1

  • For older versions, please have a look at our ReactOS SourceForge project page
  • System Requirements: Please look at the README file for detailed information about the needed packages and other requirements.

Next Steps

After setting up your build environment, see Building ReactOS for downloading source and further information.

Included Utilities

All these Information can be found in RosBE, too by typing help.

BASEDIR

Small command which immediately sets you back to the ReactOS Source Base Directory.

CHARCH

Change the Architecture to build ReactOS for, for the current RosBE session. Possible Architectures are right now:

  • i386
  • amd64

CHDEFDIR

Change the ReactOS source directory for the current RosBE session.

  • previous: Switch to the previous ReactOS source directory.

CHDEFGCC

Usage: chdefgcc [PATH] [TYPE] Change the MinGW/GCC directory for the current RosBE session.

  • Path: Path to set the Host or Target GCC to.
  • Type: Set it to "target" or "host"

RADDR2LINE

Main article: Debugging – Translating Addresses

Usage: raddr2line [FILE] [ADDRESS] Translates program addresses into file names and line numbers to assist developers with finding specific bugs in ReactOS. If either of the options is not given you will be prompted for it.

  • FILE: This can be either a fully specified path or just the file name [you can use a partial name ie. ntdll*] of the executable to be analyzed. When using just a file the current directory and all sub-directories are searched.
  • ADDRESS: The address to be translated.

SCUT

Simple utility for managing different directory locations. SCUT can be used to quickly change from one directory to another inside the BE prompt, making it easier to go to source in another directory. Included in both the Windows and Unix BEs. You can pass the following parameters to scut:

  • list: Lists all shortcuts currently available.
  • add: Adds a shortcut to the list.
  • edit: Edits a shortcut on the list.
  • rem: Removes a shortcut from the list.
  • def: Switches to the default directory location, which is enabled on every start of RosBE.

If you want to use a directory shortcut, for example one with the name trunk, just enter scut trunk and the program will switch to the directory you set for this shortcut.

SSVN

This command is not used anymore, see Building ReactOS#Getting a Working Copy.

Windows ONLY. Creates, updates or cleans up your ReactOS source tree or shows the revision number of the local and online trees.

  • update: Updates to HEAD revision or to a specific one when the second parameter specifies one.
  • create: Creates a new ReactOS source tree.
  • rosapps: Creates/Updates a ReactOS RosApps source tree.
  • rostests: Creates/Updates a ReactOS RosTests source tree.
  • cleanup: Cleans up and fixes errors in the source tree.
  • status: Show the current local and online revision numbers.

UPDATE

Windows ONLY. Updates all files of RosBE to the most recent files.

  • delete X: Deletes Update Nr X.
  • info X: Shows info about Update Nr X.
  • nr X: Re/Installs Update Nr X.
  • reset: Removes the Updates Cache. Not recommended.
  • status: Shows the recent status of available, non installed updates.

Questions or Problems?

If you have problems or questions concerning the Build Environment, it's the best to ask in the #reactos-rosbe or #reactos IRC channels.

Otherwise you can also try to contact Daniel Reimer (Windows version), Colin Finck (Unix version) directly.