mirror of
https://github.com/jarun/nnn.git
synced 2024-11-30 14:51:28 +00:00
Updated Developer guides (markdown)
parent
fec754626c
commit
a3480b8b71
|
@ -168,6 +168,46 @@ Install the packages `libncurses-devel` and `libreadline-devel` and compile `nnn
|
||||||
|
|
||||||
Install plugins and use the program option `-x`.
|
Install plugins and use the program option `-x`.
|
||||||
|
|
||||||
|
## Compile with musl libc
|
||||||
|
|
||||||
|
In this example we will compile `nnn` with [netbsd-curses](https://github.com/sabotage-linux/netbsd-curses) and [musl libc](https://www.musl-libc.org/) on Ubuntu 20.04.
|
||||||
|
|
||||||
|
#### Install musl
|
||||||
|
|
||||||
|
sudo apt install musl musl-dev musl-tools
|
||||||
|
|
||||||
|
#### Get netbsd-curses
|
||||||
|
|
||||||
|
git clone https://github.com/sabotage-linux/netbsd-curses --depth=1
|
||||||
|
cd netbsd-curses
|
||||||
|
|
||||||
|
#### Compile the shared and static libraries
|
||||||
|
|
||||||
|
make CC=musl-gcc CFLAGS="-O3 -Wall -fPIC" -j4 all
|
||||||
|
sudo cp libcurses/libcurses.so libterminfo/libterminfo.so
|
||||||
|
make clean
|
||||||
|
make CC=musl-gcc make CFLAGS=-O3 LDFLAGS=-static all-static
|
||||||
|
sudo cp libcurses/libcurses.a libterminfo/libterminfo.a
|
||||||
|
|
||||||
|
#### Compile `nnn`
|
||||||
|
|
||||||
|
# Dynamic
|
||||||
|
musl-gcc -O3 -DNORL -I/path_to/netbsd-curses/libcurses -o nnn src/nnn.c -Wl,-Bsymbolic-functions -L/opt/netbsd-curses -lcurses -lterminfo
|
||||||
|
|
||||||
|
# Dynamic custom
|
||||||
|
musl-gcc -O3 -DNORL -DNOLOCALE -DNOMOUSE -DNOBATCH -DNOFIFO -DTOURBIN_QSORT -DNOSSN -DNOUG -DNOX11 -march=corei7 -I/path_to/netbsd-curses/libcurses -o nnn src/nnn.c -Wl,-Bsymbolic-functions -L/opt/netbsd-curses -lcurses -lterminfo
|
||||||
|
|
||||||
|
# Note: For static compilation append `--static` to the above commands
|
||||||
|
|
||||||
|
# Strip the binary
|
||||||
|
strip nnn
|
||||||
|
|
||||||
|
#### Results
|
||||||
|
|
||||||
|
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
|
||||||
|
18754 vaio 20 0 2076 1692 976 S 0.0 0.0 0:00.01 ./nnn -dn
|
||||||
|
18952 vaio 20 0 1236 840 356 S 0.0 0.0 0:00.01 ./nnn-static -dn
|
||||||
|
|
||||||
## Cross-compile for Android
|
## Cross-compile for Android
|
||||||
|
|
||||||
This section applies to Linux as host, Android on arm64 target and an xterm-256color terminal.
|
This section applies to Linux as host, Android on arm64 target and an xterm-256color terminal.
|
||||||
|
|
Loading…
Reference in a new issue