Last modified 2 years ago Last modified on 02/01/17 14:21:50

How to use 16M colors on 32-bits systems

MC 4.8.19 onward supports 16 millions colors.

Only, however, if you're using S-Lang 2.3.1 and up on a 64-bits system.

That's exactly the problem: if you're on a 32-bits system, you're toast. (This is supposed to be fixed in some futuristic "version 3" of S-Lang.)

This page shows how to compile S-Lang with 16M colors on a 32-bits system, and how to compile MC against it.

Compiling & installing S-Lang:

rm -rf ~/slang-dev
mkdir ~/slang-dev
cd ~/slang-dev

tar zxvf slang-2.3.0.tar.gz
cd slang-2.3.0

patch -p1 < slang-truecolor-demo.patch

# Let MC know we support 16M colors:
perl -i -pe 's/#define SLANG_VERSION 20300/#define SLANG_VERSION 30000/' src/slang.h
# Remove duplicate declarations (gives compiler warnings):
perl -i -pe '$skip || s/SL_EXTERN int SLrline_get_update_client_data \(SLrline_Type \*, VOID_STAR \*\);// && ($skip=1)' src/slang.h

./configure --prefix=$HOME/local-slang

make static
make install-static

rm -rf ~/slang-dev

Compiling MC:


../configure \
  --prefix=$HOME/local-mc16Mcolors \
  --with-screen=slang \
  --with-slang-includes=$HOME/local-slang/include \
  --with-slang-libs=$HOME/local-slang/lib \
  CFLAGS="-g -O0"

make install

# Download a sample 16M skin (if you don't have one already):
cd $HOME/local-mc16Mcolors/share/mc/skins

# Run mc:
export TERM=xterm-256color        # if it's not already so.
export COLORTERM=truecolor        # if it's not already so.
$HOME/local-mc16Mcolors/bin/mc    # Or: /PATH/TO/YOUR/MC-BUILD-DIR/src/mc
# ...then go to Options >> Appearance and choose the 16M skin.

Static vs shared S-Lang library

The instructions above compile & install a static library of S-Lang. If you want a shared library, replace "make static; make install-static" with "make; make install", and before running mc do "export LD_LIBRARY_PATH=$HOME/local-slang/lib".