dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Search | Go
Wiki > Main > RockboxDevelopment > CygwinDevelopment

Setting up a cygwin Rockbox development environment

This is outdated and should not be used anymore. On Windows use WSL or a Virtual Machine instead.

LinusNielsenFeltzing has created precompiled Cygwin packages for the SH-1, 68K/Coldfire and ARM cross GCC tools.


New and inexperienced users may find the brief outline on this page insufficient to get up and running. If so, try the CygwinInstallWithScreenShots page

Step 1: Download the cygwin installer

Go to the cygwin home page, and download setup.exe from there ("Install or update now!").

Step 2: Install the base development environment

Run the setup.exe you just downloaded. If you are unsure about the questions asked by the installer, just choose the default, until you get to package selection. That bit is important.

Step 2.1: Package selection.

When you are asked to select the packages to install, select the following : (Make sure you leave the selection for "Base" untouched)

  • Archive - zip
  • Archive - unzip
  • Devel - binutils
  • Devel - gcc
  • Devel - gcc-g++
  • Devel - gcc-mingw-core
  • Devel - gdb (if you want to debug simulator code)
  • Devel - libiconv
  • Devel - make
  • Devel - mingw-runtime
  • Devel - patchutils
  • Devel - git
  • Editors - nano (to change the cross compiler path)
  • Interpreters - perl
  • Net - Curl
  • Text - tetex-base (if you want to build the manual)
  • Text - tetex-extra (if you want to build the manual)
  • X11 - libfreetype-devel (if you want to convert ttf to anti-aliased fonts)
  • X11 - libfreetype6 (if you want to convert ttf to anti-aliased fonts)

Step 3: Build the cross compilers (all modern devices)

Most new developers will want to compile for ARM. Unfortunately, we do NOT provide prebuilt ARM or Coldfire compiler binaries suitable for building rockbox, and attempting to use the ones in the installer will most likely fail.

If you want to build for an ARM or Coldfire target, you can skip the rest of this guide and follow the instructions here to build the latest compiler: CrossCompiler. Cygwin is slow, so a compiler build may take several hours. It is possible to speed up the process by telling make to run multiple jobs in parallel, but that may cause failures because Cygwin may be slightly unstable.

Step 3: Select the Rockbox mirror site and install prebuilt cross compilers (SH1 only)

Start the Setup program again. When the installer prompts you for a mirror site URL, enter in the "User URL" field and click "Add".

In case you encounter an error regarding missing .sig file, supply the -X (--no-verify) command-line flag when using Cygwin's setup.exe. This can be added into the command-line invocation in a Windows shortcut, for convenience.

Select the packages you need. We suggest you select all of them, since you will be needing them when test compiling your code for all Rockbox targets. They should be listed as follows:

  • Devel - sdl (for the uisimulator)
  • Devel - sh-elf-binutils
  • Devel - sh-elf-gcc

Step 4: Add the cross-compiler directory to your path

To successfully compile Rockbox, the cross compiler directory has to be in your path. This is automatically done by the installation script, but if that fails for some reason, there are a couple ways of doing so, here's one:

Edit using nano or vi (not Notepad or Wordpad in Windows) /etc/profile and add ":/opt/sh/bin:/opt/m68k/bin:/opt/arm/bin" (without the quotation marks) to the end of the line that says:
so that it reads:
Save the changes, exit cygwin and restart cygwin.

An alternative way is to temporarily tell the compiler to accept commands from your build directory (where you wish to build rockbox). This can be done by typing the following into cygwin, after navigating to your build directory
export PATH=/usr/local/arm-elf/bin:$PATH
Note that you have to type this in everytime you wish to compile rockbox.

Done. Happy hacking!

Step 5: Add inputenx to your teTeX installation

To be able to build the manual you will need to manually install inputenx (required since r27481). Please download inputenx.dtx and follow the instructions below:

1) Unpacking. The .dtx file is a self-extracting docstrip archive. The fi les are extracted by running the .dtx through plain TEX:
tex inputenx.dtx

2) Copy all extracted file to the path

3) If your TEX distribution (teTEX, mikTEX, . . . ) relies on file name databases, you must refresh these. For example, teTEX users run

Step 6: Update SDL on your cygwin installation

You might need to update SDL, if the rockbox simulation does not compile (e.g. missing SDL_stdinc.h).

1) Download the current SDL package SDL-1.2.14 (or newer).

2) Uncompress the package to a local path, enter this path, compile and install it:
./configure && make && make install

Using a newer gcc

Although the simulator is built in Cygwin, it is actually built as a standard Windows application, without Cygwin dependencies. The old Cygwin gcc 3.4.4 compiler from the gcc package accepted the -mno-cygwin option for building ordinary Windows execurables instead of Cygwin executables. That switch was supplied from sdl-config. If you try to use an SDL binary, the sdl-config will not supply the switch. The newer compiler from the gcc4 package does not accept the -mno-cygwin option.

When not using the old compiler, a separate Cygwin to MinGW cross compiler must be installed. Two packages are available: mingw-gcc-core and mingw64-i686-gcc-core. Either will work, but mingw-gcc-core is a better choice because it produces fewer warnings. To use the cross-compiler, explicitly specify it on the command line:
CROSS_COMPILE=i686-pc-mingw32- ../tools/configure

It is possible to use the pre-compiled SDL library from the SDL site. Get the MinGW development package, currently SDL-devel-1.2.15-mingw32.tar.gz. Note that sdl-config contains paths which must match where the files are installed.

Related links

For further instructions about compiling rockbox with Cygwin, see the SimpleGuideToCompiling page.

r46 - 10 Apr 2022 - 13:37:40 - DominikRiebeling

Copyright © by the contributing authors.