switch around library order to better support static linkage
merge trunk