| 24 | |
| 25 | |
| 26 | |
| 27 | == General approach == |
| 28 | |
| 29 | For most (reasonable) GNU/Linux programs, we can assume that they are distributed with a `./configure` script. |
| 30 | The purpose of this script is to check the environment and prepare `Makefile`s needed for actual compilation. |
| 31 | In order to build the application for HelenOS we "only" need to persuade the `configure` script to cross-compile it and use HelenOS specific compiler flags and link with `libposix`. |
| 32 | |
| 33 | |
| 34 | Although this seems as a simple task because `configure` offers parameters/variables for exactly this, there are several obstacles. |
| 35 | |
| 36 | * HelenOS currently uses Linux ABI and thus the cross-compiler used gives the impression that the target is GNU/Linux system. This could lead to some false expectations. |
| 37 | * There is a lot of compiler/linker flags that are passed. The amount itself obscures a reasonable editing of the command line. |
| 38 | * HelenOS works mostly with static libraries. When linking with static libraries, their order is important and they typically need to come after object files for proper linking. That is not always possible to specify with plain `LDFLAGS` or `CFLAGS` settings. |
| 39 | |
| 40 | The above means that either patching or some build scripts is sometimes necessary or that the invocation line for `configure` is rather complex (or both). |
| 41 | To simplify the above and, foremost, to allow repeatable builds, the so called Coastline was created. |
| 42 | |
| 43 | == Coastline == |
| 44 | |
| 45 | Currently, Coastline is hosted as a separate Git [https://github.com/vhotspur/coastline repository on GitHub]. |
| 46 | |
| 47 | TODO: |
| 48 | |
| 49 | * principles |
| 50 | * extracting the flags |
| 51 | * caching built libraries |
| 52 | * harbours |
| 53 | * usage |
| 54 | * writing harbour files |