[Python-Dev] Apple PublicSource license [was: next vs darwin]

Steven Majewski sdm7g@Virginia.EDU
Wed, 30 Jan 2002 18:23:57 -0500 (EST)


I did another version of dynload_darwin that took a >10 line
function from the dlcompat/dlopen.c code which uses an undocumented
(at least in the man pages -- there's probably comments in the
Darwin source code) non-public way around the public/private
namespace problem we were having with the previous version.

I'm waiting for some folks on pythonmac-sig to test it and report
back. I'm guessing that this solves the problem without requiring
libdl. However it gets into the possible problem of including
another license.

Could someone who undestands these issues a bit more than I, look
at this:

Apple Public Source License:
http://www.publicsource.apple.com/apsl/

-- Steve

BTW: Here's the magic code I added from dlcompat/dlopen.c:
( On the one hand, it's fairly short and trivial. On the other,
  I wouldn't have had a clue about this without reading the code! )


/*
 * NSMakePrivateModulePublic() is not part of the public dyld API so we define
 * it here.  The internal dyld function pointer for
 * __dyld_NSMakePrivateModulePublic is returned so thats all that maters to get
 * the functionality need to implement the dlopen() interfaces.
 */
static
enum bool
NSMakePrivateModulePublic(
                          NSModule module)
{
  static enum bool (*p)(NSModule module) = NULL;

  if(p == NULL)
    _dyld_func_lookup("__dyld_NSMakePrivateModulePublic",
                      (unsigned long *)&p);
  if(p == NULL){
#ifdef DEBUG
    printf("_dyld_func_lookup of __dyld_NSMakePrivateModulePublic "
           "failed\n");
#endif
    return(FALSE);
  }
  return(p(module));
}