When I got my Mac and with it my introduction to the wonderful world of Mac OS X, coming from a Linux background, among the first things I tried to install was the GNU Midnight Commander, mc. mc is a very efficient console file manager which makes manipulating files and browsing your system a breeze. Those of us who spent a good part of their lives using Norton Commander and its countless clones on various operating systems simply can't feel at home without a tool like it.
Back in the Mac OS X 10.2.x days, compiling mc on your own wasn't for the faint of heart. I too have almost given up hope on getting it to work when I noticed that the nice people at the Fink project have it. Unfortunately, the Fink copy is barely usable, with the Fink project seemingly more interested in the GUI part of mc - there is a graphical counterpart which is an integral part of the GNOME desktop. Not exactly what I wanted. All this means you end up with a dozen unnecessary packages getting installed on your system, along with a console version which you'll find yourself starting as:
screen /sw/bin/mc
... just to get a proper display and your function keys working. Unfortunately, using screen immediately adds two disadvantages: you lose Contrl-O, which requires an xterm Terminal; also, after quitting, you get returned to the directory you originally started from instead of where you were last working in mc. And this is just in addition to the seemingly absent subshell support - the command prompt in mc was always stuck displaying a mere $ sign instead of my complete bash prompt.
The great news is that you no longer have to put up with all these deficiencies, thanks to the improvements in Panther and mc, you can now compile your own copy without a hitch! Read on to see how.
NOTE: If you do have Fink, you can comfortably install glib with it and skip right ahead to STEP 2.
STEP 0: Install some prerequisites
pkgconfig is needed to compile glib, a library mc relies on. Download the latest version from its official site. Currently, it's pkgconfig-0.15.0.tar.gz. Then unpack, compile & install:
% tar -xvzf ~/Desktop/pkgconfig-0.15.0.tar.gz
% cd pkgconfig-0.15.0/
% ./configure
% make
% sudo make install
You'll also need GNU gettext, which can be found in this folder: gettext-0.13.tar.gz.
The same tired routine:
% tar -xvzf ~/Desktop/gettext-0.13.tar.gz
% cd gettext-0.13/
% ./configure
% make
% sudo make install
STEP 1: Install glib
% tar -xvjf ~/Desktop/glib-2.2.3.tar.bz2
% cd glib-2.2.3/
% ./configure
% make
% sudo make install
STEP 2: Install mc
% tar -xvzf ~/Desktop/mc-4.6.1-pre1.tar.gz
% cd mc-4.6.1-pre1/
% ./configure --without-x --with-screen=ncurses
% make
% sudo make install
And that was it, you should now have a fully functional copy of mc on your Mac. Midnight Commander finally works as well on OS X as you are used to from the bundled copy in your favorite Linux distro. The same limitations apply as to most anything in the BSD subsystem: mc can't read nor copy file type/creator codes or resource forks; it sees application bundles as what they really are - directories, and the hidden system folders aren't hidden at all. Just remember that you can open a Finder window for the directory you're currently in by typing open ..
% mc -e filename
Mac OS X Hints
http://hints.macworld.com/article.php?story=20040112172024838