Changes between Version 3 and Version 4 of BuildNomDarwin


Ignore:
Timestamp:
Apr 21, 2008, 11:46:04 PM (17 years ago)
Author:
bird
Comment:

kBuild usage correction.

Legend:

Unmodified
Added
Removed
Modified
  • BuildNomDarwin

    v3 v4  
    1616Macports ([http://www.macports.org]) has to be installed to get the necessary libraries. Download the dmg for your OS release and run the included installer. You have to supply an administrator password during installation.
    1717
    18 The installer is supposed to add the necessary directories to your path environment variable. At least on my system this failed, maybe because I don't have any '''.profile''' file but use '''.bashrc''' and '''bash_profile'''. Try ''man port'' in a new terminal window (make sure the terminal app was not yet running). If this fails you have to add the necessary info by hand. See the  Macports page for further info.
     18The installer is supposed to add the necessary directories to your path environment variable. At least on my system this failed, maybe because I don't have any '''.profile''' file but use '''.bash_profile'''. Try ''man port'' in a new terminal window (make sure the terminal app was not yet running). If this fails you have to add the necessary info by hand. See the  Macports page for further info.
    1919
    2020 * Update your Macports installation by typing '''sudo port selfupdate''' in the terminal.
     
    2424=== kBuild ===
    2525
    26 The build system is built on [http://svn.netlabs.org/kbuild/wiki kBuild]. To get it running just checkout the trunk:
    27 
     26The build system is [http://svn.netlabs.org/kbuild/wiki kBuild].  Until kBuild 0.1.3 is released and a mac ports file has been created, we will be using the binary release that's on the kBuild trunk in the kBuild sub-directory. You can check this out standing in the NOM trunk (just make sure it goes into a subdirectory), or you can give it its own place outside the NOM tree. Whichever you choose, run the following to get the stuff:
    2827  {{{
    29   svn co http://svn.netlabs.org/repos/kbuild/trunk .
     28     svn co http://svn.netlabs.org/repos/kbuild/trunk/kBuild kBuild
    3029  }}}
    3130
    32 Maybe this is kind of overkill but it works and you have everything to build the most recent version on your own (note that it's generally not advised to use the trunk version for production stuff).
     31After checking out kBuild, you will have to make sure that you have some easy way of getting to {{{kBuild/bin/darwin.x86/kmk}}} from the command line. There a number of options:
     32  * Add it the {{{kBuild/bin/darwin.x86/}}} directory to the '''PATH''' via .bash_profile or .profile.
     33  * Create an '''alias''' {{{kmk=/wherever/kBuild/bin/darwin.x86/kmk}}}.
     34  * Or run '''kBuild/env.sh''' to create a new shell instance with the changed 'PATH'.
    3335
    34 Note that there is no need to build kBuild because the trunk is coming with binaries for your platform.
    35 
    36 After you have kBuild just run
    37 
    38  {{{
    39     kBuild/env.sh
    40  }}}
    41 
    42 to setup the environment and you're set to compile NOM.
    43 
     36The last option is currently the most common one. Note that {{{kBuild/env.sh}}} has a number of options that can be useful for scripting and such (like {{{--full}}}).
    4437
    4538== Compiling It ==
    46 
    47 Make sure you have setup the environment by running '''kBuild/env.sh'''.
    4839
    4940Cd into the root of NOM, the '''trunk''' directory.
     
    5243
    5344  {{{
    54      ./kmk
     45     kmk
    5546  }}}
    5647
    57 Compilation should succeed without errors.
     48Compilation should succeed without errors. You will find the result in {{{./out/debug.x86/release/installed/}}}.
    5849
    59 === Compile a debug build ===
     50If you get the error "-bash: kmk: command not found", go back a step and make sure you've setup kBuild correctly.
    6051
    61 Set the following environment variable to create a debug build:
     52=== Build Types - debug and release  ===
    6253
    63   {{{
    64       BUILD_TYPE=debug
    65   }}}
     54By default kBuild will create a '''release''' build for you. For development and debugging it is recommended to use a '''debug''' build. You select this by the '''KBUILD_TYPE''' variable. You can either specify it on the '''kmk''' command line like this:
     55 {{{
     56     kmk KBUILD_TYPE=debug
     57 }}}
     58Or you can set it in the shell environment like this:
     59 {{{
     60     export KBUILD_TYPE=debug
     61     kmk
     62 }}}
    6663
    67 === Compile a release build ===
     64The output from a debug build can be found in {{{./out/darwin.x86/debug/installed/}}}.
    6865
    69 Set the following environment variable to create a debug build:
    70 
    71   {{{
    72       BUILD_TYPE=release
    73   }}}
    74 
    75 Note that release builds are default.
    76 
    77 The output can be found here:
    78 
    79   ''out/$(BUILD_TARGET).$(BUILD_TARGET_ARCH)/$(BUILD_TYPE)/kBuild/bin/$(BUILD_TARGET_ARCH).$(BUILD_TARGET)/''.
     66KBUILD_TYPE can also be set to '''release'''.
    8067
    8168
     
    10087
    10188The executable ''nom-test'' performs some basic tests of the object system.
     89To run (from a release build):
     90 {{{
     91     ./out/darwin.x86/release/installed/bin/nom-test
     92 }}}
    10293
    10394Running it shouldn't show any errors.