Replaced custom build scripts with TEA scripts.

Removed custom build scripts and replaced with latest TEA config files.
Updated pkgIndex.tcl.in to support static builds.
Incorporated relevant previous build macros into scripts.