CXXFLAGS="$CXXFLAGS $PCH_FLAGS -fPIC -DPIC"
Hmm, it doesn't appear twice for files in sdk/scripting but it does for sdk/*. Will you have a look at the Makefile.am files and see what's different?