Index: include/Make/Compile.make
===================================================================
--- include/Make/Compile.make	(revision 62377)
+++ include/Make/Compile.make	(working copy)
@@ -20,7 +20,7 @@
 linker_cxx = $(call linker_x,$(CXX))
 linker = $(call linker_x,$(LINK))
 
-ALL_CFLAGS = $(LFS_CFLAGS) $(EXTRA_CFLAGS) $(NLS_CFLAGS) $(DEFS) $(EXTRA_INC) $(INC)
+ALL_CFLAGS = $(LFS_CFLAGS) $(EXTRA_CFLAGS) $(NLS_CFLAGS) $(DEFS) $(EXTRA_INC) $(INC) -DRELDIR=\"$(RELDIR)\"
 
 compiler_x = $(1) $(2) $(ALL_CFLAGS) -o $@ -c $<
 compiler_c = $(call compiler_x,$(CC),$(COMPILE_FLAGS_C) $($*_c_FLAGS))
Index: include/defs/gis.h
===================================================================
--- include/defs/gis.h	(revision 62377)
+++ include/defs/gis.h	(working copy)
@@ -81,9 +81,9 @@
 #endif
 
 #ifndef CTYPESGEN
-#define G_malloc(n)     G__malloc(__FILE__, __LINE__, (n))
-#define G_calloc(m, n)  G__calloc(__FILE__, __LINE__, (m), (n))
-#define G_realloc(p, n) G__realloc(__FILE__, __LINE__, (p), (n))
+#define G_malloc(n)     G__malloc(RELDIR "/" __FILE__, __LINE__, (n))
+#define G_calloc(m, n)  G__calloc(RELDIR "/" __FILE__, __LINE__, (m), (n))
+#define G_realloc(p, n) G__realloc(RELDIR "/" __FILE__, __LINE__, (p), (n))
 #else
 #define G_malloc(n)     G__malloc("<ctypesgen>", 0, (n))
 #define G_calloc(m, n)  G__calloc("<ctypesgen>", 0, (m), (n))
