| 37 | == New Bootstrapping Steps (src/gmakenew) == |
| 38 | |
| 39 | 1. Modify env.sh to accept the uname output. |
| 40 | A kBuild BUILD_TARGET / BUILD_PLATFORM OS name must be decided upon at this point. If the architecture and/or processor is new to kBuild, new (unique) names need to be found here as well. |
| 41 | 1. Modify header.kmk to accept and correctly configure the platform / target OS. |
| 42 | 1. Run kBuild/env.sh to configure the kBuild environment. |
| 43 | 1. Port and bootstrap kmk. |
| 44 | The bootstrap kmk build is made using the GNU automake/autoconf setup of GNU make. Which means that the initial port of the kmk code has to be done in that environment. Since porting isn't a common day thing, nor is bootstrapping this is just something we have to live with. |
| 45 | 1. The source is derived from the GNU make CVS and not a GNU make tarball. This means all the auto-stuff has to be created first. Run this from the src/gmake directory: |
| 46 | {{{ |
| 47 | autoreconf -i |
| 48 | }}} |
| 49 | For solving problems check out the autoreconf manual page and README.cvs. |
| 50 | 1. Create a subdirectory {{{obj}}} for to do the build within. This avoids confusion later and simplifies cleanup. Enter the directory. |
| 51 | 1. Run configure: |
| 52 | {{{ |
| 53 | ../configure |
| 54 | }}} |
| 55 | 1. Build it: |
| 56 | {{{ |
| 57 | make |
| 58 | }}} |
| 59 | Don't expect it to build on the first try on a new platform. Fix build errors and repeat until success or you give up in frustration... |
| 60 | 1. Copy (or symlink) the resulting {{{kmk}}} to {{{kBuild/bin/$BUILD_TARGET.$BUILD_TARGET_ARCH/}}}. You may have to create this directory first. |
| 61 | 1. The kmk bootstrapping is now done (unless of course, bugs in the port needs addressing). |
| 62 | 1. Copy or symlink a bournshell compatible shell (ash is preferred) to {{{kBuild/bin/$BUILD_TARGET.$BUILD_TARGET_ARCH/kmk_ash}}}. {{{/bin/sh}}} or {{{/bin/bash}}} |
| 63 | is usually a good choice. |
| 64 | 1. Configure/Port and build the kmk, ash, sed, and kDep* (all found in source) using the bootstrap kmk. It's recommended to take one directory at a time and start with kmk since that's almost done now. The job that's required for each directory is roughly this: |
| 65 | 1. Check if anything special is required in Makefile.kmk for your OS. |
| 66 | 1. If it's a autoconf based tool run configure to (re)generate the config.h for your OS. |
| 67 | These are usually cached as {{{config.h.$(BUILD_TARGET)}}} files. |
| 68 | Note. You might wish to check if it builds and checks out cleanly in the autoconf/automake framework. |
| 69 | ''Applies to sed and kmk/gmake.'' |
| 70 | 1. Try build: |
| 71 | {{{ |
| 72 | kmk |
| 73 | }}} |
| 74 | Address build errors (and warnings) until it builds successfully. |
| 75 | 1. If it's a autoconf/automake based tool and it got a testharness/suite, it is recommended to test the binary you've just built in it. |
| 76 | ''Applies to sed and to some degree kmk/gmake.'' |
| 77 | 1. Copy the resulting binary/binaries to {{{kBuild/bin/$BUILD_TARGET.$BUILD_TARGET_ARCH/}}}. |
| 78 | 1. Move on to the next tool. |
| 79 | 1. When everything builds and you've copied the new binaries to the kBuild/bin/x.y location, it's time to rebuild everything using the new binaries. |
| 80 | 1. Remove the {{{out/}}} directory found in the root of the kBuild tree. |
| 81 | 1. Run {{{kmk}}} from the root. |
| 82 | 1. Replace binaries in {{{kBuild/bin/$BUILD_TARGET.$BUILD_TARGET_ARCH/}}} with the new ones from {{{out/$BUILD_TARGET.$BUILD_TARGET_ARCH/$BUILD_TYPE/kBuild/bin/$BUILD_TARGET.$BUILD_TARGET_ARCH/}}}. |
| 83 | 1. It doesn't hurt to repeat this sequence once more. |
| 84 | 1. Create patches and submit to bird along with a release build of the tools binaries. |
| 85 | |
| 86 | |