Refactor object and library build, and only build PIC libraries when PIC_CFLAGS is defined
diff --git a/configure.ac b/configure.ac
index 0f0de90..0ed0494 100644
--- a/configure.ac
+++ b/configure.ac
@@ -202,6 +202,7 @@
 DSO_LDFLAGS='-shared -Wl,-soname,$(@F)'
 RPATH='-Wl,-rpath,$(1)'
 SOREV='$(SO).$(REV)'
+PIC_CFLAGS='-fPIC -DPIC'
 
 dnl Heap profiling uses the log(3) function.
 LIBS="$LIBS -lm"
@@ -287,6 +288,7 @@
 AC_SUBST([lib])
 AC_SUBST([DSO_LDFLAGS])
 AC_SUBST([SOREV])
+AC_SUBST([PIC_CFLAGS])
 
 JE_COMPILABLE([__attribute__ syntax],
               [static __attribute__((unused)) void foo(void){}],