Tag Archives: LIBDIR

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$

I needed fuseiso to mount .iso files in a non root ssh envt.

So I needed to compile fuseiso first.

To compile fuseiso, you need to first compile libfuse.

cd ~/sources
wget http://nchc.dl.sourceforge.net/project/fuseiso/fuseiso/20070708/fuseiso-20070708.tar.bz2 (Dynamic link)
tar -jxvvf fuseiso-20070708.tar.bz2
cd fuseiso-20070708/
mkdir ~/myapps/fuse
./configure --prefix=/home/droidzone/myapps/fuse

 

This led to an error stating that it needed libfuse.

cd ..
wget http://nchc.dl.sourceforge.net/project/fuse/fuse-2.X/2.9.2/fuse-2.9.2.tar.gz
tar -xvvf fuse-2.9.2.tar.gz
cd fuse-2.9.2/
./configure --prefix=/home/droidzone/myapps/fuse
make
make install

Interestingly the program errored out, as even though I had given a prefix directory, it seemed to be trying to install certain stuff in root directiries. Even more interestingly I found that even though it terminated with an error, I found the following compilation message:

Libraries have been installed in:
/home/droidzone/myapps/fuse/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’

Sure enough, it seemed to have compiled all headers and libraries fine. So I decided to try building fuseiso anyway.

cd ../fuseiso-20070708

export LD_LIBRARY_PATH="/home/droidzone/myapps/fuse/lib"
export LD_RUN_PATH="/home/droidzone/myapps/fuse/lib"
export LDFLAGS="-L/home/droidzone/myapps/fuse/lib"
export CPPFLAGS="-I/home/droidzone/myapps/fuse/include"

./configure --prefix=/home/droidzone/myapps/fuse
make

Though it configured fine, it errored out during make

Package fuse was not found in the pkg-config search path.
Perhaps you should add the directory containing `fuse.pc’
to the PKG_CONFIG_PATH environment variable
No package ‘fuse’ found
Package glib-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `glib-2.0.pc’
to the PKG_CONFIG_PATH environment variable
No package ‘glib-2.0’ found

I needed to export these flags because it seemed to have difficulty while configuring, in locatin these libraries and includes of libfuse.

 

Installing GCC: Manual One
============

First decide on a prefix directory (installation dir)

export $P=that dir path

export $PREFIX=that dir path

Install GMP first
============

with:

wget http://ftp.gnu.org/gnu/gmp/gmp-5.0.5.tar.bz2

tar -jxvvf  gmp-5.0.5.tar.bz2

cd gmp-5.0.5
./configure --prefix=$P --enable-cxx
make ; make install
export LD_LIBRARY_PATH=/home/users/d/dr/droidzone/hostusr/lib
export LD_RUN_PATH=/home/users/d/dr/droidzone/hostusr/lib

cd ..

 

Note the following compiler message:
Libraries have been installed in:
/home/droidzone/buildtools/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’

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.

Install PPL next
============
PPL depends on GMP, so specify its location

./configure --prefix=$P --with-gmp-prefix=$P

I think that something has changed with PPL 1.0. Because it doesnt seem to recognize the option –with-gmp-prefix

I needed:

./configure --prefix=$PREFIX --with-gmp=$PREFIX

 

make ; make install

 

Install MPFR
============

wget http://www.mpfr.org/mpfr-current/mpfr-3.1.1.tar.bz2
tar -jxvvf mpfr-3.1.1.tar.bz2
cd mpfr-3.1.1
./configure --prefix=/home/users/d/dr/droidzone/hostusr --with-gmp=/home/users/d/dr/droidzone/hostusr
make ; make install

I think that something has

Now, Install MPC (http://www.multiprecision.org/?prog=mpc&page=download)
================
Install MPFR and GMP first

, and then specify their path for MPC!

wget http://www.multiprecision.org/mpc/download/mpc-1.0.1.tar.gz
tar -xvvf mpc-1.0.1.tar.gz
cd mpc-1.0.1
./configure --prefix=$P --with-gmp=$P --with-mpfr=$P
make
make install

Now, install CLOOG-PPL (For Graphite Loop Optimizations) http://www.cloog.org/
========================

wget http://www.bastoul.net/cloog/pages/download/cloog-0.17.0.tar.gz
./configure --prefix=$P --with-gmp=$P --with-ppl=$P
make
make install

 

Now, Install GCC http://ftp.gnu.org/gnu/gcc/

================
cd ~/depend/gcc-4.6.2/ ;
export LD_LIBRARY_PATH=/home/users/d/dr/droidzone/hostusr/lib:/home/users/d/dr/droidzone/hostusr:$LD_LIBRARY_PATH ; ./configure –prefix=$P –with-gmp=$P –with-ppl=$P –with-cloog=$P –with-mpc=$P –with-mpfr=$P
make

Libraries have been installed in:
/home/users/d/dr/droidzone/hostusr/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’

———————————————————————-
Libraries have been installed in:
/home/users/d/dr/droidzone/hostusr/libexec/gcc/x86_64-unknown-linux-gnu/4.6.2

/home/users/d/dr/droidzone/hostusr/lib/../lib64

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’

ERROR (gcc build)
=====

-fvisibility=hidden -DHIDE_EXPORTS
In file included from /home/users/d/dr/droidzone/depend/gcc-4.6.2/host-x86_64-unknown-linux-gnu/gcc/include-fixed/features.h:361:0,
from /usr/include/stdio.h:28,
from ../../.././libgcc/../gcc/tsystem.h:87,
from ../../.././libgcc/../gcc/libgcc2.c:29:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory
compilation terminated.
make[5]: *** [_muldi3.o] Error 1
make[5]: Leaving directory `/home/users/d/dr/droidzone/depend/gcc-4.6.2/x86_64-unknown-linux-gnu/32/libgcc’
make[4]: *** [multi-do] Error 1
make[4]: Leaving directory `/home/users/d/dr/droidzone/depend/gcc-4.6.2/x86_64-unknown-linux-gnu/libgcc’
make[3]: *** [all-multi] Error 2
make[3]: Leaving directory `/home/users/d/dr/droidzone/depend/gcc-4.6.2/x86_64-unknown-linux-gnu/libgcc’
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory `/home/users/d/dr/droidzone/depend/gcc-4.6.2′
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/users/d/dr/droidzone/depend/gcc-4.6.2′
make: *** [all] Error 2

FIX
===
./configure with –disable-multilib

./configure –prefix=/home/users/d/dr/droidzone/hostusrgcc –with-gmp=/home/users/d/dr/droidzone/hostusr –with-ppl=/home/users/d/dr/droidzone/hostusr –with-cloog=/home/users/d/dr/droidzone/hostusr –with-mpc=/home/users/d/dr/droidzone/hostusr –with-mpfr=/home/users/d/dr/droidzone/hostusr –disable-multilib

ERROR
=====
Autoconf installed but “installed autoconf does not work”

Fix
===
Autoconf 2.13 required by Smitna’s script was too old. Soln was to compile and install a newer version.

Error on compiling glibc with new gcc
=====================================
if test -r /home/users/d/dr/droidzone/hostusr/include/gnu/stubs-64.h && cmp -s /home/users/d/dr/droidzone/depend/glibcb/stubs.h /home/users/d/dr/droidzone/hostusr/include/gnu/stubs-64.h;
then echo ‘stubs.h unchanged’;
else /home/users/d/dr/droidzone/hostusr/bin/install -c -m 644 /home/users/d/dr/droidzone/depend/glibcb/stubs.h /home/users/d/dr/droidzone/hostusr/include/gnu/stubs-64.h; fi
rm -f /home/users/d/dr/droidzone/depend/glibcb/stubs.h
/home/users/d/dr/droidzone/depend/glibcb/elf/sln /home/users/d/dr/droidzone/depend/glibcb/elf/symlink.list
rm -f /home/users/d/dr/droidzone/depend/glibcb/elf/symlink.list
rm: error while loading shared libraries: /home/users/d/dr/droidzone/hostusr/lib/libc.so.6: ELF file OS ABI invalid
make[1]: *** [install-symbolic-link] Error 127
make[1]: Leaving directory `/home/users/d/dr/droidzone/depend/glibc-2.14′
make: *** [install] Error 2

Compile binutils
./configure –prefix=/home/users/d/dr/droidzone/hostusr –with-mpc=/home/users/d/dr/droidzone/hostusr –with-ppl=/home/users/d/dr/droidzone/hostusr –with-mpfr=/home/users/d/dr/droidzone/hostusr –with-gmp=/home/users/d/dr/droidzone/hostusr –with-cloog=/home/users/d/dr/droidzone/hostusr

configure: error: in `/home/users/d/dr/droidzone/depend/binutils-2.22′:
configure: error: C compiler cannot create executables
See `config.log’ for more details.

One should follow a specific order to compile GCC, making sure that all dependencies are compiled properly. Some dependencies depend on others. In general the packages required to compile GCC properly are

Essential prerequisites:

Autoconf
Automake
M4

Direct Dependencies

GMP (requires -cxx option)
PPL (dep: GMP)
MPFR (dep: GMP)
MPC (dep: GMP, MPFR)
CLOOG-PPL (dep: GMP,PPL)

Install GMP first
============

./configure --prefix=/home/users/d/dr/droidzone/hostusr --enable-cxx
make ; make install[/code]

Install PPL next

============
PPL depends on GMP, so specify its location

./configure --prefix=/home/users/d/dr/droidzone/hostusr --with-gmp-prefix=/home/users/d/dr/droidzone/hostusr[/code]
make ; make install

Install MPFR

============

./configure --prefix=/home/users/d/dr/droidzone/hostusr --with-gmp=/home/users/d/dr/droidzone/hostusr
make ; make install[/code]

Now, Install MPC

================
Install MPFR and GMP first

, and then specify their path for MPC!

./configure --prefix=/home/users/d/dr/droidzone/hostusr --with-gmp=/home/users/d/dr/droidzone/hostusr --with-mpfr=/home/users/d/dr/droidzone/hostusr
make ; make install[/code]

Now, install CLOOG-PPL (For Graphite Loop Optimizations)

========================

./configure --prefix=/home/users/d/dr/droidzone/hostusr --with-gmp=/home/users/d/dr/droidzone/hostusr --with-ppl=/home/users/d/dr/droidzone/hostusr[/code]

Now, Install GCC

================

export LD_LIBRARY_PATH=/home/users/d/dr/droidzone/hostusr/lib:$LD_LIBRARY_PATH[/code]

./configure --prefix=/home/users/d/dr/droidzone/hostusr --with-gmp=/home/users/d/dr/droidzone/hostusr --with-ppl=/home/users/d/dr/droidzone/hostusr --with-cloog=/home/users/d/dr/droidzone/hostusr --with-mpc=/home/users/d/dr/droidzone/hostusr --with-mpfr=/home/users/d/dr/droidzone/hostusr --disable-multilib[/code]

Finally I found that GCC needs Glibc. Glibc needs Binutils!

Now, Install Binutils

================

./configure --prefix=/home/users/d/dr/droidzone/hostusr --with-gmp=/home/users/d/dr/droidzone/hostusr--with-ppl=/home/users/d/dr/droidzone/hostusr --with-cloog=/home/users/d/dr/droidzone/hostusr --with-mpc=/home/users/d/dr/droidzone/hostusr --with-mpfr=/home/users/d/dr/droidzone/hostusr
make ; make install
[/code]

You have to do a make clean if you get errors

Errors likely

However, with this, I got a specific error after around 10 minutes of building!

checking for x86_64-unknown-linux-gnu-gcc... /home/users/d/dr/droidzone/depend/gcc-4.6.2/host-x86_64-unknown-linux-gnu/gcc/xgcc -B/home/users/d/dr/droidzone/depend/gcc-4.6.2/host-x86_64-unknown-linux-gnu/gcc/ -B/home/users/d/dr/droidzone/hostusr/x86_64-unknown-linux-gnu/bin/ -B/home/users/d/dr/droidzone/hostusr/x86_64-unknown-linux-gnu/lib/ -isystem /home/users/d/dr/droidzone/hostusr/x86_64-unknown-linux-gnu/include -isystem /home/users/d/dr/droidzone/hostusr/x86_64-unknown-linux-gnu/sys-include
checking for suffix of object files... configure: error: in `/home/users/d/dr/droidzone/depend/gcc-4.6.2/x86_64-unknown-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory `/home/users/d/dr/droidzone/depend/gcc-4.6.2'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/users/d/dr/droidzone/depend/gcc-4.6.2'
make: *** [all] Error 2
[/code]
This means you had to pass LIB path.

Then I got another one..

In file included from /home/users/d/dr/droidzone/depend/gcc-4.6.2/host-x86_64-unknown-linux-gnu/gcc/include-fixed/features.h:361:0,
from /usr/include/stdio.h:28,
from ../../.././libgcc/../gcc/tsystem.h:87,
from ../../.././libgcc/../gcc/libgcc2.c:29:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory
[/code]

FIX
===

./configure for gcc with --disable-multilib[/code]

./configure --prefix=/home/users/d/dr/droidzone/hostusr --with-gmp=/home/users/d/dr/droidzone/hostusr --with-ppl=/home/users/d/dr/droidzone/hostusr --with-cloog=/home/users/d/dr/droidzone/hostusr --with-mpc=/home/users/d/dr/droidzone/hostusr --with-mpfr=/home/users/d/dr/droidzone/hostusr --disable-multilib[/code]

For this, the following bit of information is useful:

Some other useful info:

Libraries have been installed in:
/home/users/d/dr/droidzone/hostusr/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'[/code]