Changeset 1629 for zzuf


Ignore:
Timestamp:
Jan 8, 2007, 10:49:57 PM (13 years ago)
Author:
Sam Hocevar
Message:
  • Tru64 loader support (_RLD_LIST).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/src/zzuf.c

    r1624 r1629  
    614614{
    615615    char *libpath, *tmp;
    616     int len = strlen(progpath);
    617 #ifdef __APPLE__
     616    int ret, len = strlen(progpath);
     617#if defined __APPLE__
    618618#   define FILENAME "libzzuf.dylib"
     619#   define EXTRAINFO ""
    619620#   define PRELOAD "DYLD_INSERT_LIBRARIES"
    620621    setenv("DYLD_FORCE_FLAT_NAMESPACE", "1", 1);
     622#elif defined __osf__
     623#   define FILENAME "libzzuf.so"
     624#   define EXTRAINFO ":DEFAULT"
     625#   define PRELOAD "_RLD_LIST"
    621626#else
    622627#   define FILENAME "libzzuf.so"
     628#   define EXTRAINFO ""
    623629#   define PRELOAD "LD_PRELOAD"
    624630#endif
    625631
    626     libpath = malloc(len + strlen("/.libs/" FILENAME) + 1);
     632    libpath = malloc(len + strlen("/.libs/" FILENAME EXTRAINFO) + 1);
    627633    strcpy(libpath, progpath);
     634
    628635    tmp = strrchr(libpath, '/');
    629636    strcpy(tmp ? tmp + 1 : libpath, ".libs/" FILENAME);
    630     if(access(libpath, R_OK) == 0)
     637    ret = access(libpath, R_OK);
     638
     639    strcpy(tmp ? tmp + 1 : libpath, ".libs/" FILENAME EXTRAINFO);
     640    if(ret == 0)
    631641        setenv(PRELOAD, libpath, 1);
    632642    else
    633         setenv(PRELOAD, LIBDIR "/" FILENAME, 1);
     643        setenv(PRELOAD, LIBDIR "/" FILENAME EXTRAINFO, 1);
    634644    free(libpath);
    635645}
Note: See TracChangeset for help on using the changeset viewer.