From a729f9297b5daae1e53731c93dd13b5ae2723a31 Mon Sep 17 00:00:00 2001 From: ellson Date: Sun, 22 May 2011 14:19:22 +0000 Subject: [PATCH] apply patch ito support rlocatability on Macs from Thomas Keller --- lib/gvc/gvconfig.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/lib/gvc/gvconfig.c b/lib/gvc/gvconfig.c index d4617ead0..e1eb3b90c 100644 --- a/lib/gvc/gvconfig.c +++ b/lib/gvc/gvconfig.c @@ -49,6 +49,10 @@ static int glob (GVC_t * gvc, char*, int, int (*errfunc)(const char *, int), glo #endif #endif +#ifdef __APPLE__ +#include +#endif + #include "memory.h" #include "const.h" #include "types.h" @@ -293,8 +297,25 @@ char * gvconfig_libdir(GVC_t * gvc) *s = '\0'; libdir = line; #else - /* this only works on linux, other systems will get GVLIBDIR only */ - libdir = GVLIBDIR; + libdir = GVLIBDIR; +#ifdef __APPLE__ + uint32_t i, c = _dyld_image_count(); + for (i=0; i