From: matz@... (Yukihiro Matsumoto) Date: 2002-10-16T00:13:07+09:00 Subject: [ruby-dev:18526] Forward: Patch for MacOS X dln.c $B$^$D$b$H(B $B$f$-$R$m$G$9(B $B$3$s$I$O(BMac OS X$B$K$D$$$F$G$9!#(B $B$&!<$s!"$h$/$o$+$i$J$$!#(B ------- Start of forwarded message ------- Posted: Sun, 13 Oct 2002 16:35:24 -0400 From: Luc B.ANilanger Subject: Patch for MacOS X dln.c To: ruby-core-ctl@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 00541 - --Apple-Mail-11-404121901 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed I have a patch for the dynamic linker in MacOS X, which permit to load the extension bundle linked dynamically against optional library (libiconv, readline and gdbm). The Patch is not from me, but from "Peter O'Gorman" . We worked around the issue when I tried to import the ruby 1.7 dev version in the darwinport tree. The patch is in attachment and is included in the message. - --- dln.c Sat Oct 12 21:20:36 2002 +++ dln.c Sat Oct 12 21:34:36 2002 @@ -90,7 +90,7 @@ int eaccess(); - -#if defined(HAVE_DLOPEN) && !defined(USE_DLN_A_OUT) && !defined(_AIX) +#if defined(HAVE_DLOPEN) && !defined(USE_DLN_A_OUT) && !defined(_AIX) && !defined(__APPLE__) /* dynamic load with dlopen() */ # define USE_DLN_DLOPEN #endif @@ -1430,10 +1430,14 @@ /* lookup the initial function */ /*NSIsSymbolNameDefined require function name without "_" */ - - if(NSIsSymbolNameDefined(buf + 1)) { +/* if(NSIsSymbolNameDefined(buf + 1)) { rb_loaderror("Failed to lookup Init function %.200s",file); } - - + Yeah, right, it helps if you use the right test... +*/ + if(!NSIsSymbolNameDefined(buf)) { + rb_loaderror("Failed to lookup Init function %.200s",file); + } /* NSLookupAndBindSymbol require function name with "_" !! */ init_fct = NSAddressOfSymbol(NSLookupAndBindSymbol(buf)); (*init_fct)(); - --Apple-Mail-11-404121901 Content-Disposition: attachment; filename=patch-dln.c Content-Transfer-Encoding: 7bit Content-Type: text/plain; x-unix-mode=0644; name="patch-dln.c" - --- dln.c Sat Oct 12 21:20:36 2002 +++ dln.c Sat Oct 12 21:34:36 2002 @@ -90,7 +90,7 @@ int eaccess(); - -#if defined(HAVE_DLOPEN) && !defined(USE_DLN_A_OUT) && !defined(_AIX) +#if defined(HAVE_DLOPEN) && !defined(USE_DLN_A_OUT) && !defined(_AIX) && !defined(__APPLE__) /* dynamic load with dlopen() */ # define USE_DLN_DLOPEN #endif @@ -1430,10 +1430,14 @@ /* lookup the initial function */ /*NSIsSymbolNameDefined require function name without "_" */ - - if(NSIsSymbolNameDefined(buf + 1)) { +/* if(NSIsSymbolNameDefined(buf + 1)) { rb_loaderror("Failed to lookup Init function %.200s",file); } - - + Yeah, right, it helps if you use the right test... +*/ + if(!NSIsSymbolNameDefined(buf)) { + rb_loaderror("Failed to lookup Init function %.200s",file); + } /* NSLookupAndBindSymbol require function name with "_" !! */ init_fct = NSAddressOfSymbol(NSLookupAndBindSymbol(buf)); (*init_fct)(); - --Apple-Mail-11-404121901 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed - -- Luc Belanger (450) 773-2649 luc.belanger@acm.org - -- Luc Belanger (450) 773-2649 luc.belanger@acm.org - --Apple-Mail-11-404121901-- ------- End of forwarded message -------