I am trying to build python 64 bit from source on solaris10.
After searching in net for a while. I tried using CFLAGS=-m64 LDFLAGS=-m64 while executing ./configure.But getting errors like wrong ELFCLASS32
Tried the below 
./configure  CFLAGS=-m64 LDFLAGS=-m64
But no luck. And make is throwing errror like  "make: Fatal error: Command failed for target `libinstall'"
I am suspecting this is regarding gcc
TIA
The problem is you are linking your 64-bit program with 32-bit libraries. That is what the WRONGELFCLASS error is all about.
Unfortunately, the default on Solaris tends to be to generate 32-bit libraries. Make sure you generate 64-bit libraries with -m64 and use the file command on the generated .o files to verify they are 64-bit libraries.  The 64-bit libraries are in subdirectory 64/ for each library directory (such as /usr/lib/64/).
How to build 64 bit python from source on solaris