os x port initial

compiling on Mavericks
1、add endian.h for OS X
2、sh-3.2 bulltin echo does not support '-n' option, fixed
3、fix the ldflags for ld64
Hi, this PR is still work in progress?
This hard-coded path assumes Homebrew environment?
If so, `$(brew --prefix gettext)/lib` is more better.