|
|
Setting up a Rockbox development environment using Interix
OverviewThis is a description of how to set up a development environment using Interix. Interix is also known as Microsoft Services for Unix (SFU) resp. Microsoft Services for Unix Applications (SUA). %W% WARNING: This method is not recommended for users unfamiliar with the Unix command line. It is meant as an alternative to using Cygwin for users who want to experiment. Also, this method is only usable on the Windows versions stated in step 1, other versions won't work. Note that this environment is currently limited to making target builds. No simulator support, SAPI voice file build support, or manual build support yet. SAPI support will be added soon (requires adapting voice.pl).Step 1: Download the SFU main package and required hotfixesFor Windows 2000 Professional, Windows 2000 Server, Windows XP Professional, and Windows Server 2003 (non-R2) you will need to download SFU 3.5 from Microsoft. SFU 3.5 is what this description is based on. Windows Server 2003 R2 includes SUA 5.2, which can be enabled via Software->Add/Remove Windows features. It will prompt to download the tools package after enabling the basic functionality. You will need to adjust the following steps a bit, but the basic method should be the same. Likewise, Windows Vista Ultimate and Enterprise include SUA 6.0, and Windows 7 Ultimate and Enterprise include SUA 6.1. For SFU 3.5, you will also need to request and download the following hotfixes (they're provided free of charge, but you need to give a valid email address):
Step 2: Install the basic environmentThe following steps need to be performed as a local administrator! Run the SFU installer. You need to perform a custom installation, and select the following components:
C:\<long-hexadecimal-number> , C:\temp\ext<NNNN> (there will be two ext<NNNN> folders in temp). These exist because the hotfixes do not clean up properly. Delete them.
Now you need to check and (very likely) fix /etc/resolv.conf to point to your DNS server, otherwise the following steps won't work.
Step 3: Download and install the Interopsystems developer bundleDownload the developer bundle from www.suacommunity.com into a directory with no spaces in the path. The following steps need to be performed as a local administrator! Install the package. It will take some time, and ask a few questions during the process:
<C:\Documents and Settings>\All Users\<Start menu>\<Programs>\Windows Services for UNIX (replace parts in <> with the correct values for your language version of Windows), and duplicate the "Korn Shell" shortcut. Rename the duplicate shortcut to "Bourne Again Shell", and edit the following properties:
Step 4: Configure and fix up the environmentThe following steps need to be performed as a local administrator! You can use "su" to become Administrator within bash. Since the default shell in Interix is ksh, but you probably want bash, use the following command:su Administrator -c bash
Check whether perl is properly installed: which perl If perl isn't found (happened reproducably during my tests) the bundle installer goofed, and you need to fix it: pkg_update -Lr perl
Make a symlink so that perl is found where many scripts expect it: ln -s /usr/local/bin/perl /usr/bin/perl
SFU 3.5 only: SFU 3.5 comes without inttypes.h and stdint.h, however, these are needed for rockbox tools and sims and all kinds of other stuff. Download inttypes-sfu3.5.zip, extract it and put both .h files into /usr/include.
Edit /etc/profile.lcl You'll probably want the following settings:
# Set a home directory within the SFU path if available if [ -d /home/$USERNAME ]; then export HOME="/home/$USERNAME" cd $HOME fi # Shell dependent settings case "echo "_$0" | /usr/bin/tr '[:upper:]' '[:lower:]' | /usr/bin/sed -e 's/^_//'" in bash | -bash | */bash ) # Set a default prompt of: user@host and current_directory export PS1='\[\e]0;\w\a\] \[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\] \$ ' ;; * ) # Sorry, this shell has no defaults in /etc/profile.lcl # feel free to add your own. export PS1='$ ' ;; esacUsing a directory without spaces as the home directory for users will avoid a lot of trouble. You need to create the directories and set the proper permissions. Note that the username must be capitalized the exact same way as it is used for logging into windows. Step 5: Build an up-to-date GNU makeThe following steps need to be performed as a local administrator! The version of GNU make shipped with the Interopsystems developer bundle is outdated. We want GNU make 3.81 for optimum build performance. Check the installed version:pkg_info gmake If it shows GNU make version 3.81, skip the rest of step 5 Uninstall the bundled version of GNU make: pkg_delete gmake-3.80.1-bin
Download the GNU make sources
Unpack the source and cd into the directory./configure --program-prefix=g make make install
On newer SUA versions, old config.guess scripts are unable to guess system type, and configure will fail. You can either specify build type explicitly (eg. --build=i586-pc-interix6.1 ) or replace config.guess scripts with a newer version. The bundle installs a suitable version at /usr/local/share/automake-1.11/config.guess
Step 6: Perform initial SVN checkout and build the crosscompilersStart bash, and check out rockbox SVN. Then cd into tools/. Since Interix already has a lot of stuff in /usr/local, and also puts its own GCC unter /opt, it is recommended to put the crosscompilers under /opt as well. Edit rockboxdev.sh accordingly.
Step 7: Adjust the user environmentEdit~/.profile , and add the path(s) to the crosscompiler(s) you've just built.
In order to be able to use non-ASCII characters in bash (e.g. German umlauts), edit ~/.inputrc and add the follwing lines:
set meta-flag on set convert-meta off set input-meta on set output-meta onClose bash and restart it. Done. happy hacking :-) Usage hints
r6 - 02 Apr 2021 - 20:46:06 - UnknownUser
Copyright © by the contributing authors.
|