Changeset 2534 for zzuf


Ignore:
Timestamp:
Jul 16, 2008, 11:52:08 AM (12 years ago)
Author:
Sam Hocevar
Message:
  • zzuf.c: retrieve library object name from libtool's .la file so we don't need to hardcode .so, .sl, .dylib etc. for various platforms.
Location:
zzuf/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/msvc/config.h

    r1736 r2534  
    1818
    1919#define VERSION "0.7 (msvc)"
     20#define SONAME "libzzuf.dll"
    2021
    2122#define HAVE_WINDOWS_H 1
  • zzuf/trunk/src/Makefile.am

    r1866 r2534  
    99zzuf_SOURCES = zzuf.c $(COMMON) $(GETOPT) \
    1010               opts.c opts.h md5.c md5.h timer.c timer.h
    11 zzuf_CFLAGS = -DLIBDIR=\"$(libdir)/zzuf\"
     11zzuf_CFLAGS = -DLIBDIR=\"$(libdir)/zzuf\" -DSONAME=\"$$(grep dlname libzzuf.la | cut -f2 -d"'")\"
    1212zzuf_LDFLAGS = $(MATH_LIBS) $(WINSOCK2_LIBS)
     13zzuf_DEPENDENCIES = libzzuf.la
    1314
    1415pkglib_LTLIBRARIES = libzzuf.la
  • zzuf/trunk/src/zzuf.c

    r2530 r2534  
    906906    int pid, j, len = strlen(opts->oldargv[0]);
    907907#   if defined __APPLE__
    908 #       define FILENAME "libzzuf.dylib"
    909908#       define EXTRAINFO ""
    910909#       define PRELOAD "DYLD_INSERT_LIBRARIES"
    911910    setenv("DYLD_FORCE_FLAT_NAMESPACE", "1", 1);
    912911#   elif defined __osf__
    913 #       define FILENAME "libzzuf.so"
    914912#       define EXTRAINFO ":DEFAULT"
    915913#       define PRELOAD "_RLD_LIST"
    916914#   else
    917 #       define FILENAME "libzzuf.so"
    918915#       define EXTRAINFO ""
    919916#       define PRELOAD "LD_PRELOAD"
     
    978975#if defined HAVE_FORK
    979976    /* Make sure there is space for everything we might do. */
    980     libpath = malloc(len + strlen(LIBDIR "/.libs/" FILENAME EXTRAINFO) + 1);
     977    libpath = malloc(len + strlen(LIBDIR "/.libs/" SONAME EXTRAINFO) + 1);
    981978    strcpy(libpath, opts->oldargv[0]);
    982979
     
    987984    if(tmp)
    988985    {
    989         strcpy(tmp + 1, ".libs/" FILENAME);
     986        strcpy(tmp + 1, ".libs/" SONAME);
    990987        if(access(libpath, R_OK) < 0)
    991             strcpy(libpath, LIBDIR "/" FILENAME);
     988            strcpy(libpath, LIBDIR "/" SONAME);
    992989    }
    993990    else
    994         strcpy(libpath, LIBDIR "/" FILENAME);
     991        strcpy(libpath, LIBDIR "/" SONAME);
    995992
    996993    /* OSF1 only */
Note: See TracChangeset for help on using the changeset viewer.