I have tried ./configure --enable-unicode and ./configure --enable-unicode=ucs4 but the command import sys; print sys.maxunicode is still 65535.
How should I fix this and compile Python with 4-byte unicode enabled?
We can re-compile already installed python with 4-byte Unicode or 2-byte Unicode
Full Flow
after downloading python2.7.x and extracting it.

go to directory Python2.7.x (in my case it is Python2.7.10)

2.fire command "sudo ./configure --enable-unicode=ucs4" or "sudo ./configure --enable-unicode=ucs2" which ever you want.
now you can check if it is UCS2 or UCS4 as below
1.go to terminal
2.type python and enter
now enter following commands



import sys
      print sys.maxunicode



if output is 1114111 then it is UCS4 
otherwise if output is 65535 then it is UCS2
How to recompile Python2.7 with 4-byte unicode enabled?