Commit ec90b49f authored by Dag Erling Smørgrav's avatar Dag Erling Smørgrav

Portability: use -lsocket / -lns on systems that need it (read Solaris),

use <sys/queue.h> instead of our own if present.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2032 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 35e4c150
......@@ -13,4 +13,5 @@ varnishadm_CFLAGS = -include config.h
varnishadm_LDADD = \
$(top_builddir)/lib/libvarnish/libvarnish.la \
$(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la
$(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \
${NET_LIBS}
......@@ -70,4 +70,4 @@ varnishd_LDADD = \
$(top_builddir)/lib/libvarnish/libvarnish.la \
$(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \
$(top_builddir)/lib/libvcl/libvcl.la \
${DL_LIBS} ${PTHREAD_LIBS} ${LIBM}
${DL_LIBS} ${PTHREAD_LIBS} ${NET_LIBS} ${LIBM}
......@@ -36,7 +36,12 @@
#include <pthread.h>
#include <stdint.h>
#ifdef HAVE_SYS_QUEUE_H
#include <sys/queue.h>
#else
#include "queue.h"
#endif
#include "vsb.h"
#include "libvarnish.h"
......
......@@ -32,7 +32,12 @@
*/
#include <pthread.h>
#ifdef HAVE_SYS_QUEUE_H
#include <sys/queue.h>
#else
#include "queue.h"
#endif
struct listen_sock {
TAILQ_ENTRY(listen_sock) list;
......
......@@ -30,7 +30,12 @@
*/
#include <poll.h>
#ifdef HAVE_SYS_QUEUE_H
#include <sys/queue.h>
#else
#include "queue.h"
#endif
struct ev;
struct evbase;
......
......@@ -44,7 +44,12 @@
#include "compat/asprintf.h"
#endif
#include "vsb.h"
#ifdef HAVE_SYS_QUEUE_H
#include <sys/queue.h>
#else
#include "queue.h"
#endif
#include "libvcl.h"
#include "cli.h"
......
......@@ -29,7 +29,11 @@
* $Id$
*/
#ifdef HAVE_SYS_QUEUE_H
#include <sys/queue.h>
#else
#include "queue.h"
#endif
struct stevedore;
struct sess;
......
......@@ -15,5 +15,4 @@ varnishreplay_LDADD = \
$(top_builddir)/lib/libvarnish/libvarnish.la \
$(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \
$(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
${PTHREAD_LIBS}
${PTHREAD_LIBS} ${NET_LIBS}
......@@ -38,8 +38,13 @@
#include <string.h>
#include <unistd.h>
#include "libvarnish.h"
#ifdef HAVE_SYS_QUEUE_H
#include <sys/queue.h>
#else
#include "queue.h"
#endif
#include "libvarnish.h"
#include "varnishapi.h"
#include "vss.h"
......
......@@ -43,11 +43,16 @@
#include <unistd.h>
#include <limits.h>
#ifdef HAVE_SYS_QUEUE_H
#include <sys/queue.h>
#else
#include "queue.h"
#endif
#include "vsb.h"
#include "libvarnish.h"
#include "shmlog.h"
#include "queue.h"
#include "varnishapi.h"
struct top {
......
......@@ -50,6 +50,14 @@ PTHREAD_LIBS="${LIBS}"
LIBS="${save_LIBS}"
AC_SUBST(PTHREAD_LIBS)
save_LIBS="${LIBS}"
LIBS=""
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(getaddrinfo, ns)
NET_LIBS="${LIBS}"
LIBS="${save_LIBS}"
AC_SUBST(NET_LIBS)
AC_CHECK_LIBM
AC_SUBST(LIBM)
......@@ -57,6 +65,7 @@ AC_SUBST(LIBM)
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
AC_CHECK_HEADERS([sys/queue.h])
AC_CHECK_HEADERS([sys/socket.h])
AC_CHECK_HEADERS([sys/mount.h])
AC_CHECK_HEADERS([sys/vfs.h])
......
......@@ -20,4 +20,4 @@ libvarnish_la_SOURCES = \
libvarnish_la_CFLAGS = -include config.h
libvarnish_la_LIBADD = ${RT_LIBS}
libvarnish_la_LIBADD = ${RT_LIBS} ${NET_LIBS}
......@@ -60,6 +60,8 @@
* and all the rest...
*/
#include <sys/stat.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
......@@ -69,10 +71,13 @@
#include <string.h>
#include <unistd.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_QUEUE_H
#include <sys/queue.h>
#else
#include "queue.h"
#endif
#include "vsb.h"
#include "queue.h"
#include "vcc_priv.h"
#include "vcc_compile.h"
......
......@@ -29,7 +29,12 @@
* $Id$
*/
#ifdef HAVE_SYS_QUEUE_H
#include <sys/queue.h>
#else
#include "queue.h"
#endif
#include "vcl_returns.h"
#define INDENT 2
......
......@@ -34,8 +34,13 @@
#include <stdlib.h>
#include <string.h>
#include "vsb.h"
#ifdef HAVE_SYS_QUEUE_H
#include <sys/queue.h>
#else
#include "queue.h"
#endif
#include "vsb.h"
#include "libvarnish.h"
#include "vcc_priv.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment