-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'jpellegrini-cross-compile'
- Loading branch information
Showing
5 changed files
with
54 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Cross-compiling STklos | ||
|
||
## How to cross-compile | ||
|
||
Cross-compilation is just like compilation | ||
|
||
``` | ||
./configure prefix=some-tmp-dir CC=some-C-compiler CFLAGS=your-c-flags ... | ||
make | ||
make install | ||
``` | ||
|
||
The relevant environment variables are described in the output | ||
of `configure --help`. | ||
|
||
***However:*** | ||
|
||
* You *need* a STklos binary in order to compile STklos. When not | ||
cross-compiling, | ||
- the binary is generated as `src/stklos` | ||
- the build proceeds using `src/stklos` as the STklos binary that | ||
can be used to compile `.stk` files | ||
However, when cross-compiling `src/stklos` will be a binary for a | ||
different (target) architecture, and the build will fail, unless we | ||
have a native STklos in the system that can be used instead. | ||
|
||
* Put the full path of the STklos binary in the `STKLOS_BINARY` | ||
variable when calling `make`: | ||
|
||
``` | ||
./configure --prefix=/usr/some/place | ||
make `STKLOS_BINARY=/usr/local/bin/stklos` | ||
make install | ||
``` | ||
|
||
Now you can copy the `usr/some/place` directory to the target machine. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters