-----Original Message----- From: Jonathan Wakely [mailto:jwakely.gcc@xxxxxxxxx] Sent: Sunday, February 12, 2012 1:55 AM To: Prashant Batra (prbatra) Cc: gcc-help@xxxxxxxxxxx Subject: Re: help needed for builing gcc tool-chain On 11 February 2012 19:17, Prashant Batra (prbatra) wrote: > Thanks, Jonathan, > > I am able to install gcc 4.1.2 with following configuration: > ../gcc-4.1.2/configure --prefix=/auto/nobackup-bgl-mitg-dev56/prbatra/fresh/build/ --enable-languages=c,c++,objc > > Now, the tool-chain is present in "prefix" directory. > > In second try, to make the tool-chain relocatable, I used --with-sysroot=<prefix-dir> while configuring. GCC is always relocatable, you can move the installation and it will work in a different location. > It fails saying /usr/include directory is not present in the <prefix-dir>. > Have I missed something again? Did you read the docs for --with-sysroot? It tells the build process to use the headers and libraries under the sysroot directory instead of the ones in /usr - so if you have no headers and libraries in the sysroot directory then it will fail to find them. [Prashant] I configured it like - ../gcc-4.1.2/configure --prefix=/auto/nobackup-bgl-mitg-dev56/prbatra/fresh2/build/ --with-sysroot=/auto/nobackup-bgl-mitg-dev56/prbatra/fresh2/build/sysroo t --enable-languages=c,c++,objc The contents of sysroot dir are- ls ../build/sysroot/ include lib lib64 libexec So I have copied the include and libs into the sysroot failure. Still it fails saying - "The directory that should contain system headers does not exist:" One more doubt in general: The documentation of --with-sysroot says "sysroot will be searched for target system headers, libraries and run time objects", but I am building gcc at this stage, so if I am building gcc forsome target, how are these target system headers be present there"