From 2ba12f04838bcd540dc117484e600ef9c049d23d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pi=C3=B1a=20Colada?= Date: Wed, 26 May 2021 23:16:36 +0530 Subject: [PATCH] Updated Developer guides (markdown) --- Developer-guides.md | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/Developer-guides.md b/Developer-guides.md index 48de604..f936bb0 100644 --- a/Developer-guides.md +++ b/Developer-guides.md @@ -170,7 +170,11 @@ 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. +In this example we will compile `nnn` on Ubuntu 20.04 with + +- [netbsd-curses](https://github.com/sabotage-linux/netbsd-curses) +- [musl-fts](https://github.com/void-linux/musl-fts) +- [musl libc](https://www.musl-libc.org/) Discussion [thread](https://github.com/sabotage-linux/netbsd-curses/issues/46). The last known [good netbsd-curses commit](https://github.com/sabotage-linux/netbsd-curses/commit/f1fa19a1f36a25d0971b3d08449303e6af6f3da5) before a stuck cursor at status bar issue is introduced. @@ -180,27 +184,37 @@ Discussion [thread](https://github.com/sabotage-linux/netbsd-curses/issues/46). sudo apt install musl musl-dev musl-tools -#### Get netbsd-curses - - git clone https://github.com/sabotage-linux/netbsd-curses --depth=1 - -#### Compile the shared and static libraries +#### Get netbsd-curses and compile the shared and static libraries + git clone https://github.com/sabotage-linux/netbsd-curses cd netbsd-curses - sudo mkdir /opt/netbsd-curses + git checkout f1fa19a1f36a25d0971b3d08449303e6af6f3da5 make CC=musl-gcc CFLAGS="-O3 -Wall -fPIC" -j4 all - sudo cp libcurses/libcurses.so libterminfo/libterminfo.so /opt/netbsd-curses/ + sudo mkdir /opt/nnn-libs + sudo cp libcurses/libcurses.so libterminfo/libterminfo.so /opt/nnn-libs/ make clean make CC=musl-gcc CFLAGS=-O3 LDFLAGS=-static all-static - sudo cp libcurses/libcurses.a libterminfo/libterminfo.a /opt/netbsd-curses/ + sudo cp libcurses/libcurses.a libterminfo/libterminfo.a /opt/nnn-libs/ + +#### Get musl-fts and compile the shared and static binaries + + git clone https://github.com/void-linux/musl-fts --depth=1 + cd musl-fts + ./bootstrap.sh + ./configure + make CC=musl-gcc CFLAGS=-O3 LDFLAGS=-static -j$(($(nproc)+1)) + sudo cp .libs/libfts.a /opt/nnn-libs/ + mkae clean + make CC=musl-gcc CFLAGS=-O3 -j$(($(nproc)+1)) + sudo cp .libs/libfts.so.0.0.0 /opt/nnn-libs/libfts.so #### Compile `nnn` # shared - musl-gcc -O3 -DNORL -DNOMOUSE -std=c11 -Wall -Wextra -Wshadow -I/path_to/netbsd-curses/libcurses -o nnn src/nnn.c -Wl,-Bsymbolic-functions -L/opt/netbsd-curses -lcurses -lterminfo + musl-gcc -O3 -DNORL -DNOMOUSE -std=c11 -Wall -Wextra -Wshadow -I/path_to/netbsd-curses/libcurses -I/path_to/musl-fts -o nnn src/nnn.c -Wl,-Bsymbolic-functions -lpthread -L/opt/nnn-libs -lcurses -lterminfo -lfts # shared custom - musl-gcc -O3 -DNORL -DNOLC -DNOMOUSE -DNOBATCH -DNOFIFO -DTOURBIN_QSORT -DNOSSN -DNOUG -DNOX11 -std=c11 -Wall -Wextra -Wshadow -march=corei7 -I/path_to/netbsd-curses/libcurses -o nnn src/nnn.c -Wl,-Bsymbolic-functions -L/opt/netbsd-curses -lcurses -lterminfo + musl-gcc -O3 -DNORL -DNOLC -DNOMOUSE -DNOBATCH -DNOFIFO -DTOURBIN_QSORT -DNOSSN -DNOUG -DNOX11 -std=c11 -Wall -Wextra -Wshadow -march=corei7 -I/path_to/netbsd-curses/libcurses -I/path_to/musl-fts -o nnn src/nnn.c -Wl,-Bsymbolic-functions -lpthread -L/opt/nnn-libs -lcurses -lterminfo -lfts # Note: For static compilation append `-static` to the above commands