Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tdishr/TdiExtPython.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ inline static void initialize()
_putenv_s("PyLib", envsym);
#else
envsym = "python2.7";
#ifdef MACOS_ARM64
const char *aspath = "/opt/local/lib/libpython2.7.dylib"; // (MW) TODO: for MacPorts version
#else
const char *aspath = "/usr/lib/python2.7.so.1";
#endif
setenv("PyLib", envsym, B_FALSE);
#endif
fprintf(stderr,
Expand Down Expand Up @@ -169,9 +173,15 @@ inline static void initialize()
}
else
{
#ifdef MACOS_ARM64
lib = strcpy((char *)malloc(strlen(envsym) + 10), "lib");
strcat(lib, envsym);
strcat(lib, ".dylib");
#else
lib = strcpy((char *)malloc(strlen(envsym) + 7), "lib");
strcat(lib, envsym);
strcat(lib, ".so");
#endif
}
#endif
handle = dlopen(lib, RTLD_NOW | RTLD_GLOBAL);
Expand Down