Compile svn for XDA

Download sources for subversion, apr, apr-util and sqlite3.

Extract them, compile each and install them

Compile svn with support for these packages.

 

 

cd ~/myapps
wget http://archive.apache.org/dist/subversion/subversion-1.7.7.tar.bz2
tar -jxvvf subversion-1.7.7.tar.bz2
wget http://archive.apache.org/dist/apr/apr-1.4.6.tar.gz
tar -xvvf apr-1.4.6.tar.gz
cd apr-1.4.6
./configure --prefix=/home/droidzone/myapps
make ; make install
cd ..
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/droidzone/myapps/lib
wget http://archive.apache.org/dist/apr/apr-util-1.5.1.tar.gz
tar -xvvf apr-util-1.5.1.tar.gz
cd apr-util-1.5.1
./configure --prefix=/home/droidzone/myapps --with-apr=/home/droidzone/myapps
make ; make install
cd ..
wget http://www.sqlite.org/sqlite-autoconf-3071401.tar.gz
tar -xvvf sqlite-autoconf-3071401.tar.gz
cd subversion-1.7.7
mkdir -p /home/droidzone/myapps/subversion-1.7.7/sqlite-amalgamation
cp ../sqlite-autoconf-3071401/sqlite3.c /home/droidzone/myapps/subversion-1.7.7/sqlite-amalgamation/sqlite3.c
./configure --prefix=/home/droidzone/myapps --with-apr=/home/droidzone/myapps --with-apr-util=/home/droidzone/myapps
make ; make install

[/code]


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Pushing a file via ftp and the bash command line to an ftp server

Since I work with the XDA server, I often have to work on stuff in the XDA server, finish it and upload it to my host. Now Goo.im conveniently offers a sftp access, that makes everything very easy. A simple scp command can transfer the file (already descibed elsewhere on my blog). However when it comes to transferring the files via simple ftp, things are a bit different. You need a bash scrip to do it.

I’ve used this script from  Ubuntuforums to suit my needs perfectly:

# The next 9 lines are lifted from mickwombat's script
#!/bin/sh
USERNAME="[email protected]"
PASSWORD="myftppassword"
SERVER="ftp.droidzone.in"
# Directory where file is located
DIR=$2
#  Filename of backup file to be transfered
FILE=$1
# login to ftp server and transfer file

curl -T $FILE -u $USERNAME:$PASSWORD $SERVER/$DIR/

This very neatly takes the file specified in the first argument, and transfers it to ftp.droidzone.in/dir where dir is the specified directory.


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Compile and install emacs in a non root Linux environment (XDA and Goo.im)

It’s a Non X, non root environment, typically the XDA build server, you can install and use emacs by the following commands:

mkdir ~/myapps
mkdir sources && cd sources
wget http://ftp.gnu.org/pub/gnu/emacs/emacs-24.2.tar.gz
tar -xvvf emacs-24.2.tar.gz
cd emacs-24.2
./configure --prefix=/home/droidzone/myapps --with-x-toolkit=no --with-xpm=no --with-jpeg=no --with-gif=no --with-tiff=no --with-png=no
make ; make install
export PATH=$PATH:/home/droidzone/myapps/emacs/bin

Compiling and using emacs on Goo.im requires a few additional steps.

If you try configuring emacs directly, you will encounter an error stating that:

configure: error: The required function `tputs' was not found in any library.
These libraries were tried: libncurses, libterminfo, libtermcap, libcurses.
Please try installing whichever of these libraries is most appropriate
for your system, together with its header files.
For example, a libncurses-dev(el) or similar package.[/code]
This is because ncurses library is missing in the Goo server.

So, first download GNU Ncurses and install it:
cd ~/sources
wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz
tar -xvvf ncurses-5.9.tar.gz
cd ncurses-5.9
./configure --prefix=/home/droidzone/myapps
make
make install

After this, compile Emacs setting the env flag properly to the location where you installed Ncurses

cd ../emacs-24.2
env LDFLAGS=-L/home/droidzone/myapps/lib ./configure --prefix=/home/droidzone/myapps --with-x-toolkit=no --with-xpm=no --with-jpeg=no --with-gif=no --with-tiff=no --with-png=no
make
make install

It is possible to achieve the same by setting
export LD_LIBRARY_PATH=/home/droidzone/myapps/lib before compiling.

 

Compiling mc on Goo

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.

 

On trying to configure pkg-config:

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

./configure: line 13557: --exists: command not found
configure: error: pkg-config and "glib-2.0 >= 2.16" not found, please set GLIB_CFLAGS and GLIB_LIBS to the correct values or pass --with-internal-glib to configure
[email protected]:~/temp/pkg-config-0.27.1$ c

Now, pkg-config configures fine.

Glibc..

configure error

configure: error: linker with -z relro support required

 


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Setting up SSH key access for Goo.im and Xda Build server

Goo.im sends a username and password for SSH access. Xda build server however does not provide a username and password, but uses SSH keys exclusively.

In Putty->Session:

HostName: upload.goo.im [Or the Xda server: server.xda-developers.com (fake hostname)]

Port: 2222 [ 22 for XDA]

Connection type: SSH

Putty/Connection/Data:

Auto-login username: [your username]

Save your Settings under Sessions and exit.

Putty/Connection/SSH/Auth:

Private Key for Authentication: If you’re using the XDA server, you should now point it to the location of your private key. If using Goo, then you should now create your key pair.

Before using the private key, login with these details to the server. Enter your goo.im password when prompted. Once logged in, enter the following at the Bash cmd line:

wget http://goo.im/devs/drmacinyasha/goo/add-goo.sh; chmod a+x add-goo.sh; ./add-goo.sh

Now, follow the prompts to generate a new Public key/Private key pair. These will be stored in the hidden directory ~/.ssh/ as id_goo and id_goo.pub

Copy the private key to the root directory:

cp .ssh/id_goo ~/

Now, setup FTP access on Filezilla:

Filezilla

Site Manager/New Site/

Host: upload.goo.im

Port: [leave blank]

User: [your username]

Password: [your goo.im password]

Ok>

Site Manager/Connect

 

On connecting, you can view the private key you copied. Copy it to your PC.

Open Puttygen.exe.

Puttygen

Puttygen/Conversions

Import key>Choose the Openssh key you copied (id_goo)

Save private key>Choose a new .ppk filename

This will be the Putty private key corresponding to your Openssh key.

Putty

In Putty/Session:

Load the Setting you saved previously.

Putty/Connection/SSH/Auth:

Private Key for Authentication: [Choose the .ppk file you generated]

Save the Session settings.

Click Open to start your SSH session on Goo.im.


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

CSS: Aligning text and images on the same line

This can be done by floating the elements. An example is the footer of this page.

 

<div id="copytextdz_left">All rights reserved.</div>

<div style="float:left;width:250px">
  <div style="float:left;">
     <img src="http://droidzone.in/images/siteimages/single_50x50.png"></img>
  </div>
  <div id="copytextdz_center">
    Hosted by <a href="https://www.kazi-networks.com/">Kazi Networks</a>
   </div>
</div>

<div id="copytextdz_right">Copyright © 2009-2013 Droidzone.in
</div>
<div style="clear:both;">
</div>

 


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.
Using SSH service on Sourceforge

Using SSH service on Sourceforge

Sourceforge’s ssh service is one of the best, even though it is free. The traffic speed is great too.

Using Putty on Windows 7

Generating a Key

Download Puttygen, the key generator for Putty from here.

Run Puttygen

At the bottom section for Parameters, choose key type as “SSH2-DSA” (Not SSH2-RSA)

Click on Generate Button

When prompted, move the mouse over the blank space to “generate randomness”

Enter [email protected] for the key comment

You can now enter a passphrase. Since I dislike having to type a passphrase every time I connect to Sourceforge, I omit the passphrase.

Save private and public keys after giving them suggestive names. Do NOT close Puttygen.

Visit the Key posting page on Sourceforge

 

 

You can see a listbox where you can type in. If you have previous keys listed, you can view them there.

In the box, click anywhere on the last line, press the |END| key, and hit |RETURN|

Go back to Puttygen, after hovering the mouse over the Box titled “Public key for pasting into OpenSSH authorized keys file”, right click and choose Select All, then Copy to clipboard.

 

Go back to the box in Sourceforge account, and paste the key on a new line. Do not hit |ENTER| at the end. Click on th “Update” button.

Your key has now been added. Now we can configure Putty.

 

Configure Putty

Download Putty from here

Open Putty

Session

Hostname: shell.sourceforge.net

Port: 22

Connection type: SSH (Already selected)

 Connection

– Data

Login Details:

Autologin username: myusername,myprojectname  (Note that this is username and project seperated by a comma. Yes, the project name is to be entered as part of username in Putty)

 

SSH

Data to send to server:

Remote Command: create (Dont forget this step!)

Preferred SSH Protocol version: 1

SSH > Auth

Private key file for authentication: Choose the “private” key you saved earlier.

Go back to Session, and under Saved Sessions, type in a name for the session, like “sourceforge”, unless you want to configure your client each time.

Connection Keepalive (Optional)

While using an SSH connection over Putty, and waiting for long processes like a repo sync or a Rom compilation to be over, you may occasionally find that the session has automatically disconnected. Of course this could be due to your net connection. Occasionally it’s that the connection times out. The connection can be kept alive by the following:

Connection>Options controlling the connection>Seconds between Keepalives>20

 

Hit Open to get started, and accept the certificate if prompted.

 

Transferring files to and from Sourceforge using SFTP on Filezilla

 

Download Filezilla from here (Dynamic link to latest file)

Install Filezilla

Open the Site Manager

New Site:

Host: frs.sourceforge.net

Protocol: SFTP

Port: Leave blank

Logon type: Normal

User: username,projectname

Password: your sourceforge account password

Press Connect, trust the host key when prompted

You will be shown your site’s project directory. You can switch your default remote directory, on the advanced tab of Connection Manager

Eg: Mine is /home/users/e/er/ergomone/ergoproject

 

Important locations on Sourceforge:

User’s web space: /home/user-web/username

Project web space:  /home/frs/project/s/su/supernovakernel/ (“s/su” will change if Project name does not begin with “su”)


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.
Configuring SSH access to Sourceforge (Windows)

Configuring SSH access to Sourceforge (Windows)

Download Putty and Puttygen from here

Run Puttygen, generate an SSH key pair:

  1. Run Puttygen
  2. Click generate key
  3. Move mouse randomly over the whitespace area and wait for key generation
  4. Save your private key. You may skip the passphrase if you’re going to use the key in an automated script.
  5. Save your public key
  6. Open the Sourceforge SSH key posting page.
  7. Copy the complete public key from ssh-rsa to [email protected] to clipboard
  8. On the key posting page, go to the end of the line containing your last posted key. Hit enter, paste the copied key.
  9. Click on Update

Run Putty.exe and enter the following details:

Session

Host name: shell.sourceforge.net
Connection Type: SSH

Connection

SSH

Remote Command: create

Data

Auto-login username: user,project

Under Sessions, enter a name and Save session details
Click on Create


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Sourceforge developer environment setup

PATH=$PATH:/home/users/d/dr/droidzone/hostusr
alias m=make
alias mi=”make install”

autoconf
./configure –prefix=/home/users/d/dr/droidzone/hostusr

automake
./configure –prefix=/home/users/d/dr/droidzone/hostusr

LD_LIBRARY_PATH=/home/users/d/dr/droidzone/hostusr/lib:$LD_LIBRARY_PATH

libtool
./configure –prefix=/home/users/d/dr/droidzone/hostusr
make
make install

libffi
./configure –prefix=/home/users/d/dr/droidzone/hostusr
make
make install

m4
./configure –prefix=/home/users/d/dr/droidzone/hostusr
make
make install

gmp
./configure –prefix=/home/users/d/dr/droidzone/hostusr –enable-cxx
make
make install

export LD_LIBRARY_PATH=/home/users/d/dr/droidzone/hostusr/lib:$LD_LIBRARY_PATH
export LD_RUN_PATH=/home/users/d/dr/droidzone/hostusr/lib:$LD_RUN_PATH

ppl
./configure –prefix=/home/users/d/dr/droidzone/hostusr –with-gmp-prefix=/home/users/d/dr/droidzone/hostusr

make ; make install

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

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

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


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Building a host toolchain without sudo or apt

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.


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Compiling GCC for Sourceforge Host

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]


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.