Compile and install mc in a non root Linux environment (XDA and Goo.im)-WIP

Get the source:

mkdir ~/sources && cd ~/sources

wget http://ftp.gnu.org/gnu/mc/mc-4.6.1.tar.gz

tar -xvvf mc-4.6.1.tar.gz
cd ~/sources/mc-4.6.1
./configure –prefix=/home/droidzone/myapps

Error:
checking for pkg-config… no
*** The pkg-config script could not be found. Make sure it is
*** in your path, or set the PKG_CONFIG environment variable
*** to the full path to pkg-config.
*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config.
checking for glib-config… no
checking for glib12-config… no
checking for glib-config… no
checking for GLIB – version >= 1.2.6… no
*** The glib-config script installed by GLIB could not be found
*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the GLIB_CONFIG environment variable to the
*** full path to glib-config.
configure: error: Test for glib failed.
GNU Midnight Commander requires glib 1.2.6 or above.

So install pkg-config:
cd ~/sources
wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.27.1.tar.gz
tar -xvvf pkg-config-0.27.1.tar.gz
cd pkg-config-0.27.1/
./configure –prefix=/home/droidzone/myapps –with-internal-glib
make && make install

Confirm that it works:
[email protected]:~/sources/pkg-config-0.27.1$ which pkg-config
/home/droidzone/myapps/bin/pkg-config

Now retry installing mc:
cd ~/sources/mc-4.6.1
./configure –prefix=/home/droidzone/myapps

Error:
checking for pkg-config… /home/droidzone/myapps/bin/pkg-config
checking for glib-2.0… checking for glib-config… no
checking for glib12-config… no
checking for glib-config… no
checking for GLIB – version >= 1.2.6… no
*** The glib-config script installed by GLIB could not be found
*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the GLIB_CONFIG environment variable to the
*** full path to glib-config.
configure: error: Test for glib failed.
GNU Midnight Commander requires glib 1.2.6 or above.

Ok, install glib now:
cd ~/sources
wget http://ftp.acc.umu.se/pub/GNOME/sources/glib/2.34/glib-2.34.0.tar.xz
tar -Jxvvf glib-2.34.0.tar.xz
cd glib-2.34.0/
./configure –prefix=/home/droidzone/myapps

Error:
checking for inflate in -lz… no
configure: error: *** Working zlib library and headers not found ***

cd ~/sources
wget http://zlib.net/zlib-1.2.7.tar.gz
tar -xvvf zlib-1.2.7.tar.gz
cd zlib-1.2.7/
./configure –prefix=/home/droidzone/myapps
make && make install

Now retried glib installation, to be met with another error:
checking for LIBFFI… no
configure: error: Package requirements (libffi >= 3.0.0) were not met:

No package ‘libffi’ found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables LIBFFI_CFLAGS
and LIBFFI_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

wget ftp://sourceware.org/pub/libffi/libffi-3.0.11.tar.gz
tar -xvvf
cd libffi-3.0.11
./configure –prefix=/home/droidzone/myapps
make && make install
———————————————————————-
Libraries have been installed in:
/home/droidzone/myapps/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR’
flag during linking and do at least one of the following:
– add LIBDIR to the `LD_LIBRARY_PATH’ environment variable
during execution
– add LIBDIR to the `LD_RUN_PATH’ environment variable
during linking
– use the `-Wl,-rpath -Wl,LIBDIR’ linker flag
– have your system administrator add LIBDIR to `/etc/ld.so.conf’

export LD_LIBRARY_PATH=/home/droidzone/myapps/lib

Rerying glib config:
checking for msgfmt… no
configure: error:
*** You must have either have gettext support in your C library, or use the
*** GNU gettext library. (http://www.gnu.org/software/gettext/gettext.html

Gettext make led to errors:
/home/droidzone/myapps/lib/libncurses.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[4]: *** [libgettextlib.la] Error 1
make[4]: Leaving directory `/home/droidzone/sources/gettext-0.18.1.1/gettext-tools/gnulib-lib’
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/droidzone/sources/gettext-0.18.1.1/gettext-tools/gnulib-lib’
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/droidzone/sources/gettext-0.18.1.1/gettext-tools’
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/droidzone/sources/gettext-0.18.1.1/gettext-tools’
make: *** [all-recursive] Error 1
[email protected]:~/sources/gettext-0.18.1.1$