Thanks for feedback , I have settled the problem.
It is due to the environment variable problem, since I copy the code blocks source using "sudo" to /usr/share/codeblocks , and I use sudo to do the compilation , the profile environment variable is different . I found that by hacking into "configure" script
Therefore , I copy those source to ~/codeblocks-rc2 , and compile , now it passes the wx-config stage but stuck at creating makefile.
After refering to the thread by northtar
http://forums.codeblocks.org/index.php/topic,1227.0.html
I run the following commands before compilation
find . -type f -and -not -name "*.png" -and -not -name "*.bmp" | sed "s/.*/\"\\0\"/" | xargs dos2unix
find . -type f -and -not -name "*.cpp" -and -not -name "*.h" -and -not -name "*.png" -and -not -name "*.bmp" | sed "s/.*/\"\\0\"/" | xargs dos2unix
and the compilation success.
The only problem later is the authority problem to access the program files that installed to /usr/local/share , it can be easily solved by granting the authotiry of the folders to the default user in Ubuntu .