]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Updated 3.2 release notes
authorAmos Jeffries <amosjeffries@squid-cache.org>
Mon, 4 Oct 2010 05:43:22 +0000 (23:43 -0600)
committerAmos Jeffries <amosjeffries@squid-cache.org>
Mon, 4 Oct 2010 05:43:22 +0000 (23:43 -0600)
14 files changed:
compat/Makefile.am
compat/compat.cc
compat/compat_shared.h
compat/xalloc.cc [new file with mode: 0644]
compat/xalloc.h [new file with mode: 0644]
compat/xstring.cc [new file with mode: 0644]
compat/xstring.h [new file with mode: 0644]
configure.in
doc/release-notes/release-3.2.sgml
include/SquidNew.h
include/util.h
lib/util.c
src/Common.am
src/Makefile.am

index 03494f72a4b80dc84c584751d23c64157fb65410..67c1c4b486fb7a8a7d5a20629db3915e36d1ab84 100644 (file)
@@ -11,16 +11,21 @@ include $(top_srcdir)/src/Common.am
 
 noinst_LIBRARIES = libcompat-squid.a
 libcompat_squid_a_SOURCES = \
+       assert.cc \
        assert.h \
+       compat.cc \
        compat.h \
        compat_shared.h \
        cpu.h \
+       debug.cc \
        debug.h \
        drand48.h \
        eui64_aton.h \
        fdsetsize.h \
        getaddrinfo.h \
        getnameinfo.h \
+       GnuRegex.c \
+       GnuRegex.h \
        inet_ntop.h \
        inet_pton.h \
        initgroups.h \
@@ -33,6 +38,10 @@ libcompat_squid_a_SOURCES = \
        types.h \
        unsafe.h \
        valgrind.h \
+       xalloc.cc \
+       xalloc.h \
+       xstring.cc \
+       xstring.h \
        \
        os/aix.h \
        os/dragonfly.h \
@@ -49,13 +58,7 @@ libcompat_squid_a_SOURCES = \
        os/sgi.h \
        os/solaris.h \
        os/sunos.h \
-       os/windows.h \
-       \
-       assert.cc \
-       compat.cc \
-       debug.cc \
-       GnuRegex.h \
-       GnuRegex.c
+       os/windows.h
 
 libcompat_squid_a_LIBADD= $(LIBOBJS)
 
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..e36ae437941bc54986ba3576f847b41c5915eb87 100644 (file)
@@ -0,0 +1,4 @@
+#include "config.h"
+#include "compat.h"
+
+void (*failure_notify) (const char *) = NULL;
index 3730b8cd838e02874f5f3321085ffc5cec34755e..84a45152734bee82dd68eb0e8b81fd99c869592f 100644 (file)
  * of the requirements for wrapping your hack for safe portability.
  */
 
+/*
+ * Define an error display handler override.
+ * If error_notify is set by the linked program it will be used by the local
+ * portability functions. Otherwise perror() will be used.
+ */
+#ifdef __cplusplus
+extern "C"
+#else
+extern
+#endif
+void (*failure_notify) (const char *);
 
 /*
  * sys/resource.h and sys/time.h are apparently order-dependant.
@@ -194,5 +205,11 @@ extern "C" {
 #endif
 #endif
 
+/*
+ * Several function definitions which we provide for security and code safety.
+ */
+#include "compat/xalloc.h"
+#include "compat/xstring.h"
+
 
 #endif /* _SQUID_COMPAT_SHARED_H */
diff --git a/compat/xalloc.cc b/compat/xalloc.cc
new file mode 100644 (file)
index 0000000..37de8e8
--- /dev/null
@@ -0,0 +1,105 @@
+#include "config.h"
+#include "compat/xalloc.h"
+
+void *
+xcalloc(size_t n, size_t sz)
+{
+    void *p;
+
+    if (n < 1)
+        n = 1;
+
+    if (sz < 1)
+        sz = 1;
+
+    p = calloc(n, sz);
+
+    if (p == NULL) {
+        if (failure_notify) {
+            static char msg[128];
+            snprintf(msg, 128, "xcalloc: Unable to allocate %u blocks of %u bytes!\n",
+                     (unsigned int) n, (unsigned int) sz);
+            msg[127] = '\0';
+            (*failure_notify) (msg);
+        } else {
+            perror("xcalloc");
+        }
+        exit(1);
+    }
+
+#if XMALLOC_DEBUG
+    check_malloc(p, sz * n);
+#endif
+#if XMALLOC_STATISTICS
+    malloc_stat(sz * n);
+#endif
+#if XMALLOC_TRACE
+    xmalloc_show_trace(p, 1);
+#endif
+#if MEM_GEN_TRACE
+    if (tracefp)
+        fprintf(tracefp, "c:%u:%u:%p\n", (unsigned int) n, (unsigned int) sz, p);
+#endif
+
+    return p;
+}
+
+void *
+xmalloc(size_t sz)
+{
+    void *p;
+
+    if (sz < 1)
+        sz = 1;
+
+    p = malloc(sz);
+
+    if (p == NULL) {
+        if (failure_notify) {
+            static char msg[128];
+            snprintf(msg, 128, "xmalloc: Unable to allocate %d bytes!\n",
+                     (int) sz);
+            msg[127] = '\0';
+            (*failure_notify) (msg);
+        } else {
+            perror("malloc");
+        }
+        exit(1);
+    }
+
+#if XMALLOC_DEBUG
+    check_malloc(p, sz);
+#endif
+#if XMALLOC_STATISTICS
+    malloc_stat(sz);
+#endif
+#if XMALLOC_TRACE
+    xmalloc_show_trace(p, 1);
+#endif
+#if MEM_GEN_TRACE
+    if (tracefp)
+        fprintf(tracefp, "m:%d:%p\n", sz, p);
+#endif
+
+    return (p);
+}
+
+void
+xfree(void *s)
+{
+#if XMALLOC_TRACE
+    xmalloc_show_trace(s, -1);
+#endif
+
+    if (s != NULL) {
+#if XMALLOC_DEBUG
+        check_free(s);
+#endif
+        free(s);
+    }
+
+#if MEM_GEN_TRACE
+    if (tracefp && s)
+        fprintf(tracefp, "f:%p\n", s);
+#endif
+}
diff --git a/compat/xalloc.h b/compat/xalloc.h
new file mode 100644 (file)
index 0000000..23d0a5c
--- /dev/null
@@ -0,0 +1,39 @@
+#ifndef _SQUID_COMPAT_XALLOC_H
+#define _SQUID_COMPAT_XALLOC_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ *  xcalloc() - same as calloc(3).  Used for portability.
+ *  Never returns NULL; fatal on error.
+ *
+ * Define failure_notify to receive error message.
+ * otherwise perror() is used to display it.
+ */
+void *xcalloc(size_t n, size_t sz);
+
+/**
+ *  xmalloc() - same as malloc(3).  Used for portability.
+ *  Never returns NULL; fatal on error.
+ *
+ * Define failure_notify to receive error message.
+ * otherwise perror() is used to display it.
+ */
+void *xmalloc(size_t sz);
+
+/**
+ *  xfree() - same as free(3).  Used for portability.
+ *   Will not call free(3) if s == NULL.
+ *
+ * Define failure_notify to receive error message.
+ * otherwise perror() is used to display it.
+ */
+void xfree(void *s);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SQUID_COMPAT_XALLOC_H */
diff --git a/compat/xstring.cc b/compat/xstring.cc
new file mode 100644 (file)
index 0000000..1e8376c
--- /dev/null
@@ -0,0 +1,80 @@
+#include "config.h"
+#include "compat/xalloc.h"
+#include "compat/xstring.h"
+
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
+char *
+xstrdup(const char *s)
+{
+    size_t sz;
+    char *p;
+
+    if (s == NULL) {
+        if (failure_notify) {
+            (*failure_notify) ("xstrdup: tried to dup a NULL pointer!\n");
+        } else {
+            errno = EINVAL;
+            perror("xstrdup: tried to dup a NULL pointer!");
+        }
+        exit(1);
+    }
+
+    /* copy string, including terminating character */
+    sz = strlen(s) + 1;
+    p = (char *)xmalloc(sz);
+    memcpy(p, s, sz);
+
+    return p;
+}
+
+char *
+xstrncpy(char *dst, const char *src, size_t n)
+{
+    char *r = dst;
+
+    if (!n || !dst)
+        return dst;
+
+    if (src)
+        while (--n != 0 && *src != '\0')
+            *dst++ = *src++;
+
+    *dst = '\0';
+    return r;
+}
+
+char *
+xstrndup(const char *s, size_t n)
+{
+    size_t sz;
+    char *p;
+
+    if (s == NULL) {
+        errno = EINVAL;
+        if (failure_notify) {
+            (*failure_notify) ("xstrndup: tried to dup a NULL pointer!\n");
+        } else {
+            perror("xstrndup: tried to dup a NULL pointer!");
+        }
+        exit(1);
+    }
+    if (n < 0) {
+        errno = EINVAL;
+        if (failure_notify) {
+            (*failure_notify) ("xstrndup: tried to dup a negative length string!\n");
+        } else {
+            perror("xstrndup: tried to dup a negative length string!");
+        }
+        exit(1);
+    }
+
+    sz = strlen(s) + 1;
+    if (sz > n)
+        sz = n;
+
+    p = xstrncpy((char *)xmalloc(sz), s, sz);
+    return p;
+}
diff --git a/compat/xstring.h b/compat/xstring.h
new file mode 100644 (file)
index 0000000..4c8d71a
--- /dev/null
@@ -0,0 +1,57 @@
+#ifndef _SQUID_COMPAT_XSTRING_H
+#define _SQUID_COMPAT_XSTRING_H
+
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * xstrdup() - same as strdup(3).  Used for portability.
+ * Never returns NULL; fatal on error.
+ *
+ * Sets errno to EINVAL if a NULL pointer is passed.
+ * 
+ * Define failure_notify to receive error message.
+ * otherwise perror() is used to display it.
+ */
+char *xstrdup(const char *s);
+
+#ifdef strdup
+#undef strdup
+#endif
+#define strdup(X) xstrdup((X))
+
+/*
+ *  xstrncpy() - similar to strncpy(3) but terminates string
+ *  always with '\0' if (n != 0 and dst != NULL),
+ *  and doesn't do padding
+ */
+char *xstrncpy(char *dst, const char *src, size_t n);
+
+/**
+ * xstrndup() - same as strndup(3).  Used for portability.
+ * Never returns NULL; fatal on error.
+ *
+ * Sets errno to EINVAL if a NULL pointer or negative
+ * length is passed.
+ * 
+ * Define failure_notify to receive error message.
+ * otherwise perror() is used to display it.
+ */
+char *xstrndup(const char *s, size_t n);
+
+#ifdef strndup
+#undef strndup
+#endif
+#define strndup(X) xstrndup((X))
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SQUID_COMPAT_XSTRING_H */
index 98c8be27ba2b0b9a25c3a48b3ee5bbd9164019c6..28aedc6adeb5aa154725356e8dbbd400318219be 100644 (file)
@@ -2112,6 +2112,7 @@ AC_CHECK_HEADERS( \
   bstring.h \
   cassert \
   crypt.h \
+  cstdlib \
   cstring \
   ctype.h \
   errno.h \
index 85f5f2ed34792285dde56d76f77817547b746073..2082977749fd0ee8aa98b6859469b9818740bada 100644 (file)
@@ -301,19 +301,22 @@ This section gives a thorough account of those changes in three categories:
 <sect1>New tags<label id="newtags">
 <p>
 <descrip>
-       <tag>adapted_http_access</tag>
-       <p>Access control based on altered HTTP request following adaptation alterations (ICAP, eCAP, URL rewriter).
-       An upgraded drop-in replacement for <em>http_access2</em> found in Squid-2.
+       <tag>cpu_affinity_map</tag>
+       <p>New setting for SMP support to map Squid processes onto specific CPU cores.
 
        <tag>else</tag>
-       <p>Part of conditional SMP support syyntax. see <em>if</em>
+       <p>Part of conditional SMP support syntax. see <em>if</em>
 
        <tag>endif</tag>
-       <p>Part of conditional SMP support syyntax. see <em>if</em>
+       <p>Part of conditional SMP support syntax. see <em>if</em>
 
        <tag>eui_lookup</tag>
        <p>Whether to lookup the EUI or MAC address of a connected client.
 
+       <tag>icap_206_enable</tag>
+       <p>New option to toggle whether the ICAP 206 (Partial Content) responses extension.
+          Default is on.
+
        <tag>if</tag>
        <p>New conditional syntax for SMP multiple-worker. 
        If-statements can be used to make configuration directives depend on conditions.
@@ -349,6 +352,10 @@ This section gives a thorough account of those changes in three categories:
        1: "no SMP" mode, start one main Squid process daemon (default)
        N: start N main Squid process daemons (i.e., SMP mode)
        </verb>
+
+       <tag>write_timeout</tag>
+       <p>New setting to limit time spent waiting for data writes to be confirmed.
+
 </descrip>
 
 <sect1>Changes to existing tags<label id="modifiedtags">
@@ -423,6 +430,9 @@ This section gives a thorough account of those changes in three categories:
        <tag>ftp_list_width</tag>
        <p>Obsolete.
 
+       <tag>ignore_expect_100</tag>
+       <p>Obsolete.
+
        <tag>url_rewrite_concurrency</tag>
        <p>Replaced by url_rewrite_children ... concurrency=N option.
 
index e30f7b46c12ed9b0ded05d8e634ad270f965af20..74c92135c0d29f3c5783f4bd8dda75927ed0fffe 100644 (file)
@@ -33,7 +33,7 @@
 #ifndef SQUID_NEW_H
 #define SQUID_NEW_H
 
-#include "util.h"
+#include "config.h"
 
 #ifndef __SUNPRO_CC
 /* Any code using libstdc++ must have externally resolvable overloads
@@ -50,7 +50,7 @@ _SQUID_EXTERNNEW_ void *operator new(size_t size) throw (std::bad_alloc)
 }
 _SQUID_EXTERNNEW_ void operator delete (void *address) throw()
 {
-    xfree (address);
+    xfree(address);
 }
 _SQUID_EXTERNNEW_ void *operator new[] (size_t size) throw (std::bad_alloc)
 {
@@ -58,7 +58,7 @@ _SQUID_EXTERNNEW_ void *operator new[] (size_t size) throw (std::bad_alloc)
 }
 _SQUID_EXTERNNEW_ void operator delete[] (void *address) throw()
 {
-    xfree (address);
+    xfree(address);
 }
 
 
index cae47dea16b226abb9a9a887106d178b967d5ace..6abde0ed6ec4517447947258b2ee1247573eb195 100644 (file)
 SQUIDCEXTERN const char *mkhttpdlogtime(const time_t *);
 SQUIDCEXTERN const char *mkrfc1123(time_t);
 SQUIDCEXTERN char *uudecode(const char *);
-SQUIDCEXTERN char *xstrdup(const char *);
-SQUIDCEXTERN char *xstrndup(const char *, size_t);
 SQUIDCEXTERN const char *xstrerr(int xerrno);
 SQUIDCEXTERN const char *xstrerror(void);
 SQUIDCEXTERN int tvSubMsec(struct timeval, struct timeval);
 SQUIDCEXTERN int tvSubUsec(struct timeval, struct timeval);
 SQUIDCEXTERN double tvSubDsec(struct timeval, struct timeval);
-SQUIDCEXTERN char *xstrncpy(char *, const char *, size_t);
 SQUIDCEXTERN size_t xcountws(const char *str);
 SQUIDCEXTERN time_t parse_rfc1123(const char *str);
-SQUIDCEXTERN void *xcalloc(size_t, size_t);
-SQUIDCEXTERN void *xmalloc(size_t);
 SQUIDCEXTERN void *xrealloc(void *, size_t);
 SQUIDCEXTERN void Tolower(char *);
-SQUIDCEXTERN void xfree(void *);
 SQUIDCEXTERN void xxfree(const void *);
 #ifdef __cplusplus
 /*
index 0e017f5ae95f5e5af29a33a15a0e0355d19e948e..30bb6fbadc7299224fcbe2a0a5a8b0da80d2041f 100644 (file)
@@ -485,96 +485,6 @@ xmalloc_find_leaks(void)
 
 #endif /* XMALLOC_TRACE */
 
-/*
- *  xmalloc() - same as malloc(3).  Used for portability.
- *  Never returns NULL; fatal on error.
- */
-void *
-xmalloc(size_t sz)
-{
-    void *p;
-
-    PROF_start(xmalloc);
-
-    if (sz < 1)
-        sz = 1;
-
-    PROF_start(malloc);
-
-    p = malloc(sz);
-
-    PROF_stop(malloc);
-
-    if (p == NULL) {
-        if (failure_notify) {
-            snprintf(msg, 128, "xmalloc: Unable to allocate %d bytes!\n",
-                     (int) sz);
-            (*failure_notify) (msg);
-        } else {
-            perror("malloc");
-        }
-
-        exit(1);
-    }
-
-#if XMALLOC_DEBUG
-    check_malloc(p, sz);
-
-#endif
-#if XMALLOC_STATISTICS
-
-    malloc_stat(sz);
-
-#endif
-#if XMALLOC_TRACE
-
-    xmalloc_show_trace(p, 1);
-
-#endif
-#if MEM_GEN_TRACE
-
-    if (tracefp)
-        fprintf(tracefp, "m:%d:%p\n", sz, p);
-
-#endif
-
-    PROF_stop(xmalloc);
-
-    return (p);
-}
-
-/*
- *  xfree() - same as free(3).  Will not call free(3) if s == NULL.
- */
-void
-xfree(void *s)
-{
-    PROF_start(xfree);
-#if XMALLOC_TRACE
-
-    xmalloc_show_trace(s, -1);
-#endif
-
-#if XMALLOC_DEBUG
-
-    if (s != NULL)
-        check_free(s);
-
-#endif
-
-    if (s != NULL)
-        free(s);
-
-#if MEM_GEN_TRACE
-
-    if (tracefp && s)
-        fprintf(tracefp, "f:%p\n", s);
-
-#endif
-
-    PROF_stop(xfree);
-}
-
 /* xxfree() - like xfree(), but we already know s != NULL */
 void
 xxfree(const void *s_const)
@@ -664,122 +574,6 @@ xrealloc(void *s, size_t sz)
     return (p);
 }
 
-/*
- *  xcalloc() - same as calloc(3).  Used for portability.
- *  Never returns NULL; fatal on error.
- */
-void *
-xcalloc(size_t n, size_t sz)
-{
-    void *p;
-
-    PROF_start(xcalloc);
-
-    if (n < 1)
-        n = 1;
-
-    if (sz < 1)
-        sz = 1;
-
-    PROF_start(calloc);
-
-    p = calloc(n, sz);
-
-    PROF_stop(calloc);
-
-    if (p == NULL) {
-        if (failure_notify) {
-            snprintf(msg, 128, "xcalloc: Unable to allocate %u blocks of %u bytes!\n",
-                     (unsigned int) n, (unsigned int) sz);
-            (*failure_notify) (msg);
-        } else {
-            perror("xcalloc");
-        }
-
-        exit(1);
-    }
-
-#if XMALLOC_DEBUG
-    check_malloc(p, sz * n);
-
-#endif
-#if XMALLOC_STATISTICS
-
-    malloc_stat(sz * n);
-
-#endif
-#if XMALLOC_TRACE
-
-    xmalloc_show_trace(p, 1);
-
-#endif
-#if MEM_GEN_TRACE
-
-    if (tracefp)
-        fprintf(tracefp, "c:%u:%u:%p\n", (unsigned int) n, (unsigned int) sz, p);
-
-#endif
-
-    PROF_stop(xcalloc);
-
-    return (p);
-}
-
-/*
- *  xstrdup() - same as strdup(3).  Used for portability.
- *  Never returns NULL; fatal on error.
- */
-char *
-xstrdup(const char *s)
-{
-    size_t sz;
-    char *p;
-    PROF_start(xstrdup);
-
-    if (s == NULL) {
-        if (failure_notify) {
-            (*failure_notify) ("xstrdup: tried to dup a NULL pointer!\n");
-        } else {
-            fprintf(stderr, "xstrdup: tried to dup a NULL pointer!\n");
-        }
-
-        exit(1);
-    }
-
-    /* copy string, including terminating character */
-    sz = strlen(s) + 1;
-
-    p = (char *)xmalloc(sz);
-    memcpy(p, s, sz);
-
-    PROF_stop(xstrdup);
-
-    return p;
-}
-
-/*
- *  xstrndup() - string dup with length limit.
- */
-char *
-xstrndup(const char *s, size_t n)
-{
-    size_t sz;
-    char *p;
-    PROF_start(xstrndup);
-    assert(s != NULL);
-    assert(n);
-    sz = strlen(s) + 1;
-
-    if (sz > n)
-        sz = n;
-
-    p = xstrncpy((char *)xmalloc(sz), s, sz);
-
-    PROF_stop(xstrndup);
-
-    return p;
-}
-
 /*
  * xstrerror() - strerror() wrapper
  */
@@ -840,31 +634,6 @@ tvSubDsec(struct timeval t1, struct timeval t2)
            (double) (t2.tv_usec - t1.tv_usec) / 1000000.0;
 }
 
-/*
- *  xstrncpy() - similar to strncpy(3) but terminates string
- *  always with '\0' if (n != 0 and dst != NULL),
- *  and doesn't do padding
- */
-char *
-xstrncpy(char *dst, const char *src, size_t n)
-{
-    char *r = dst;
-    PROF_start(xstrncpy);
-
-    if (!n || !dst)
-        return dst;
-
-    if (src)
-        while (--n != 0 && *src != '\0')
-            *dst++ = *src++;
-
-    *dst = '\0';
-
-    PROF_stop(xstrncpy);
-
-    return r;
-}
-
 /* returns the number of leading white spaces in str; handy in skipping ws */
 size_t
 xcountws(const char *str)
index 9e71907d9adef0de5472f665012e7710adf37a5e..e6a1827c4990a109143ad42343d1db3fc578fe55 100644 (file)
@@ -35,10 +35,7 @@ endif
 $(OBJS): $(top_srcdir)/include/version.h $(top_builddir)/include/autoconf.h
 
 ## Because compatibility is almost universal. And the link order is important.
-## NP: libmisc util.cc depends on rint from math library
-COMPAT_LIB = \
-       -L$(top_builddir)/lib -lmiscutil \
-       -L$(top_builddir)/compat -lcompat-squid
+COMPAT_LIB = -L$(top_builddir)/compat -lcompat-squid
 
 ## Some helpers are written in Perl and need the local shell defined properly
 subst_perlshell = sed -e 's,[@]PERL[@],$(PERL),g' <$(srcdir)/$@.pl.in >$@ || ($(RM) -f $@ ; exit 1)
index f80b7c169589725982c1943b1a4d0b5f7a2b7d94..dcaee72f0bac9c5a18ae77e507c93a7a86deddbf 100644 (file)
@@ -554,6 +554,7 @@ squid_LDADD = \
        $(SNMPLIB) \
        ${ADAPTATION_LIBS} \
        $(ESI_LIBS) \
+       -L$(top_srcdir)/lib -lmiscutil \
        $(COMPAT_LIB) \
        $(SSLLIB) \
        $(EPOLL_LIBS) \
@@ -671,8 +672,7 @@ data_DATA = \
        mib.txt
 
 LDADD = $(COMMON_LIBS) \
-       -L../lib \
-       -lmiscutil \
+       -L../lib -lmiscutil \
        $(EPOLL_LIBS) \
        $(MINGW_LIBS) \
        $(XTRA_LIBS)
@@ -730,7 +730,10 @@ libDiskThreads_a_SOURCES = \
 
 DiskIO_DiskDaemon_diskd_SOURCES = DiskIO/DiskDaemon/diskd.cc
 nodist_DiskIO_DiskDaemon_diskd_SOURCES = time.cc
-DiskIO_DiskDaemon_diskd_LDADD = $(COMPAT_LIB) $(XTRA_LIBS)
+DiskIO_DiskDaemon_diskd_LDADD = \
+       -L$(top_builddir)/lib -lmiscutil \
+       $(COMPAT_LIB) \
+       $(XTRA_LIBS)
 
 
 DEFAULT_HTTP_PORT      = 3128
@@ -920,7 +923,8 @@ TESTS += $(check_PROGRAMS)
 #tests_testX_LDADD=\
 #      $(SQUID_CPPUNIT_LIBS) \
 #      $(SQUID_CPPUNIT_LA) \
-#      -L../lib -lmiscutil
+#      $(COMPAT_LIB) \
+#      $(XTRA_LIBS)
 #tests_testX_DEPENDENCIES= $(SQUID_CPPUNIT_LA) \
 #      $(top_builddir)/lib/libmiscutil.a
 
@@ -1258,7 +1262,7 @@ tests_testCacheManager_LDADD = \
        $(ESI_LIBS) \
        $(REGEXLIB) \
        $(SNMPLIB) \
-       -L../lib -lmiscutil \
+       $(COMPAT_LIB) \
        $(SQUID_CPPUNIT_LIBS) \
        $(SQUID_CPPUNIT_LA) \
        $(SSLLIB) \
@@ -1445,7 +1449,7 @@ tests_testEvent_LDADD = \
        $(ESI_LIBS) \
        $(REGEXLIB) \
        $(SNMPLIB) \
-       -L../lib -lmiscutil \
+       $(COMPAT_LIB) \
        $(SQUID_CPPUNIT_LIBS) \
        $(SQUID_CPPUNIT_LA) \
        $(SSLLIB) \
@@ -1605,7 +1609,7 @@ tests_testEventLoop_LDADD = \
        $(ESI_LIBS) \
        $(REGEXLIB) \
        $(SNMPLIB) \
-       -L../lib -lmiscutil \
+       $(COMPAT_LIB) \
        $(SQUID_CPPUNIT_LIBS) \
        $(SQUID_CPPUNIT_LA) \
        $(SSLLIB) \
@@ -1920,7 +1924,7 @@ tests_testHttpRequest_LDADD = \
        $(ESI_LIBS) \
        $(REGEXLIB) \
        $(SNMPLIB) \
-       -L../lib -lmiscutil \
+       $(COMPAT_LIB) \
        $(SQUID_CPPUNIT_LIBS) \
        $(SQUID_CPPUNIT_LA) \
        $(SSLLIB) \
@@ -2002,7 +2006,7 @@ nodist_tests_testStore_SOURCES= \
 
 tests_testStore_LDADD= \
        $(COMMON_LIBS) \
-       -L../lib -lmiscutil \
+       $(COMPAT_LIB) \
        $(REGEXLIB) \
        $(SQUID_CPPUNIT_LIBS) \
        $(SSLLIB) \
@@ -2028,7 +2032,7 @@ nodist_tests_testString_SOURCES = \
        $(TESTSOURCES)
 tests_testString_LDADD = \
        $(COMMON_LIBS) \
-       -L../lib -lmiscutil \
+       $(COMPAT_LIB) \
        $(REGEXLIB) \
        $(SQUID_CPPUNIT_LIBS) \
        $(SSLLIB) \
@@ -2078,8 +2082,8 @@ SWAP_TEST_LDADD = \
        $(REPL_OBJS) \
        $(DISK_LIBS) \
        $(DISK_OS_LIBS) \
-       -L../lib -lmiscutil \
        acl/libapi.la \
+       $(COMPAT_LIB) \
        $(SQUID_CPPUNIT_LIBS) \
        $(XTRA_LIBS)
 SWAP_TEST_DS =\
@@ -2297,7 +2301,7 @@ tests_testURL_LDADD = \
        ${ADAPTATION_LIBS} \
        $(ESI_LIBS) \
        $(SNMPLIB) \
-       -L../lib -lmiscutil \
+       $(COMPAT_LIB) \
        $(SQUID_CPPUNIT_LIBS) \
        $(SQUID_CPPUNIT_LA) \
        $(SSLLIB) \