  
  ## Compilation rules
  %.$(STATIC_O): $(srcdir)/%.c
-

+## Additional flags when building libraries and with threads
+THREADSCPPFLAGS = -D_REENTRANT -D_THREAD_SAFE
+LIBCPPFLAGS =
@@ -28,40 +21,24 @@
 
 ## Compiler switch to embed a runtime search path
-LD_RPATH=	-I
-LD_RPATH_PRE=	
+LD_RPATH=	
+LD_RPATH_PRE =
 
-## enable the shared lib loader
-LDFLAGS += -Wl,-bbigtoc
+## Force RPATH=$ORIGIN to locate own dependencies w/o need for LD_LIBRARY_PATH
+## (incl. the C++ runtime libs potentially found in the URE lib dir):
+#ENABLE_RPATH=YES
+#RPATHLDFLAGS=${LD_RPATH_PRE}'$$ORIGIN:$$ORIGIN/../ure-link/lib'
+
+#SH#  ENABLE_RPATH=YES
+#SH#  RPATHLDFLAGS="${LD_RPATH_PRE}'$$ORIGIN:$$ORIGIN/../ure-link/lib'"
 
 ## These are the library specific LDFLAGS
 LDFLAGSICUDT=-nodefaultlibs -nostdlib

 
 # Certain files don't compile in -ansi mode (e.g. umutex.c, toolutil.c, and cdatatst.c)
 CFLAGS += -D_ALL_SOURCE
@@ -13,84 +10,30 @@
 GEN_DEPS.c=	$(CC) -E -MM $(DEFS) $(CPPFLAGS)
 GEN_DEPS.cc=	$(CXX) -E -MM $(DEFS) $(CPPFLAGS)
 
-## Commands to link
-## We need to use the C++ linker, even when linking C programs, since
