Changes between Version 3 and Version 4 of BuildNomDarwin
- Timestamp:
- Apr 21, 2008, 11:46:04 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BuildNomDarwin
v3 v4 16 16 Macports ([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. 17 17 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 '''.bash rc''' 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.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 '''.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. 19 19 20 20 * Update your Macports installation by typing '''sudo port selfupdate''' in the terminal. … … 24 24 === kBuild === 25 25 26 The build system is built on [http://svn.netlabs.org/kbuild/wiki kBuild]. To get it running just checkout the trunk: 27 26 The 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: 28 27 {{{ 29 svn co http://svn.netlabs.org/repos/kbuild/trunk .28 svn co http://svn.netlabs.org/repos/kbuild/trunk/kBuild kBuild 30 29 }}} 31 30 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). 31 After 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'. 33 35 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 36 The 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}}}). 44 37 45 38 == Compiling It == 46 47 Make sure you have setup the environment by running '''kBuild/env.sh'''.48 39 49 40 Cd into the root of NOM, the '''trunk''' directory. … … 52 43 53 44 {{{ 54 ./kmk45 kmk 55 46 }}} 56 47 57 Compilation should succeed without errors. 48 Compilation should succeed without errors. You will find the result in {{{./out/debug.x86/release/installed/}}}. 58 49 59 === Compile a debug build === 50 If you get the error "-bash: kmk: command not found", go back a step and make sure you've setup kBuild correctly. 60 51 61 Set the following environment variable to create a debug build: 52 === Build Types - debug and release === 62 53 63 {{{ 64 BUILD_TYPE=debug 65 }}} 54 By 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 }}} 58 Or you can set it in the shell environment like this: 59 {{{ 60 export KBUILD_TYPE=debug 61 kmk 62 }}} 66 63 67 === Compile a release build === 64 The output from a debug build can be found in {{{./out/darwin.x86/debug/installed/}}}. 68 65 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)/''. 66 KBUILD_TYPE can also be set to '''release'''. 80 67 81 68 … … 100 87 101 88 The executable ''nom-test'' performs some basic tests of the object system. 89 To run (from a release build): 90 {{{ 91 ./out/darwin.x86/release/installed/bin/nom-test 92 }}} 102 93 103 94 Running it shouldn't show any errors.