Fix build with -fPIE Upstream's build system does not differentiate between the flags used for building shared libraries and those used for building shared libraries. As a result, it uses -fPIC everywhere, which is incompatible with -fPIE. To allow -fPIE to work for binaries, we must pass -fPIC to shared objects only and filter -fPIE and -pie out of CFLAGS and LDFLAGS when passed to shared libraries.
Fix compilation with glusterfs >= 6 GlusterFS 6 (API version 7.6) changed the signatures for some functions, by extending their signatures. This breaks tgt's build, so fix it by checking the GlusterFS API version and re-defining the affected functions.