Ignore:
Timestamp:
Jan 27, 2012, 7:55:05 PM (8 years ago)
Author:
rme
Message:

On Darwin, if the default image isn't found, assume we're in an
application bundle and try to load it from ".../Resources/ccl/".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/pmcl-kernel.c

    r15159 r15187  
    9898#include <mach-o/dyld.h>
    9999#include <dlfcn.h>
     100#include <libgen.h>
    100101#endif
    101102
     
    960961#endif
    961962
    962 
     963#ifdef DARWIN
     964char *
     965bundle_image_name(char *orig)
     966{
     967  char *base = basename(orig);
     968  char *dir = dirname(orig);
     969  char path[MAXPATHLEN];
     970
     971  snprintf(path, MAXPATHLEN, "%s/../Resources/ccl/%s", dir, base);
     972  return path_by_appending_image(path);
     973}
     974#endif
    963975
    964976char *program_name = NULL;
     
    19241936    } else {
    19251937      image_name = default_image_name(real_executable_name);
     1938#ifdef DARWIN
     1939      if (!probe_file(image_name)) {
     1940        image_name = bundle_image_name(real_executable_name);
     1941      }
     1942#endif
    19261943    }
    19271944  }
Note: See TracChangeset for help on using the changeset viewer.