wiki:doc-devel/slang-16Mcolors-32bits

Version 2 (modified by mooffie, 8 years ago) (diff)

forgot to mention $COLORTERM

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

wget http://www.jedsoft.org/releases/slang/old/slang-2.3.0.tar.gz
tar zxvf slang-2.3.0.tar.gz
cd slang-2.3.0

wget http://midnight-commander.org/raw-attachment/ticket/3145/slang-truecolor-demo.patch
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
make install

rm -rf ~/slang-dev

Compiling MC:

cd /PATH/TO/YOUR/MC-BUILD-DIR

../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
make install

# Download a sample 16M skin (if you don't have one already):
cd $HOME/local-mc16Mcolors/share/mc/skins
wget http://midnight-commander.org/raw-attachment/ticket/3724/seasons-spring16M.ini

# Run mc:
export LD_LIBRARY_PATH=$HOME/local-slang/lib
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.