From 6127ab7215cd92c8186cfd0ec9ad63d7593a90b0 Mon Sep 17 00:00:00 2001 From: garden Date: Tue, 26 Feb 2008 21:57:37 +0000 Subject: [PATCH] - fixed poll emulation management - moved LIBOBJ-related sources to compat/ - created libvde{compat,utils}.la as internal libraries - fixed distclean problem (but need to investigate on possible automake bug) - removed bogus "script" file git-svn-id: https://vde.svn.sourceforge.net/svnroot/vde/trunk@235 d37a7db1-d92d-0410-89df-f68f52f87b57 --- vde-2/Makefile.am | 6 +++--- vde-2/bochs/eth_vde.cc | 1 - vde-2/compat/Makefile.am | 6 ++++++ vde-2/{utils => compat}/malloc.c | 0 vde-2/{utils => compat}/memcmp.c | 0 vde-2/{utils => compat}/open_memstream.c | 0 vde-2/{utils => compat}/open_memstream.h | 3 ++- vde-2/{utils => compat}/poll.c | 2 +- vde-2/compat/poll.h | 25 +++++++++++++++++++++++++ vde-2/{utils => compat}/realloc.c | 0 vde-2/{utils => compat}/strndup.c | 0 vde-2/{utils => compat}/strndup.h | 0 vde-2/configure.ac | 27 ++++++++++++++++----------- vde-2/kvde_switch/Makefile.am | 2 +- vde-2/kvde_switch/consmgmt.c | 5 +---- vde-2/kvde_switch/kvde_switch.c | 5 +---- vde-2/libvdemgmt/Makefile.am | 4 ++-- vde-2/libvdemgmt/libvdemgmt.c | 1 - vde-2/libvdesnmp/Makefile.am | 2 +- vde-2/libvdesnmp/libvdesnmp.c | 2 +- vde-2/plugin/Makefile.am | 4 ++-- vde-2/plugin/dump.c | 7 +++---- vde-2/qemu/Makefile.am | 3 ++- vde-2/qemu/vdeq.c | 5 +---- vde-2/script | 3 --- vde-2/slirpvde/Makefile.am | 3 ++- vde-2/slirpvde/slirp.h | 2 ++ vde-2/slirpvde/slirpvde.c | 1 - vde-2/unixcmd/Makefile.am | 5 +++-- vde-2/unixcmd/unixcmd.c | 1 - vde-2/unixterm/Makefile.am | 3 ++- vde-2/unixterm/unixterm.c | 5 +---- vde-2/utils/Makefile.am | 7 +++++++ vde-2/utils/cmdparse.c | 6 ++---- vde-2/utils/poll.h | 5 ----- vde-2/vde_autolink/Makefile.am | 3 ++- vde-2/vde_autolink/vde_autolink.c | 6 ++---- vde-2/vde_cryptcab/Makefile.am | 3 ++- vde-2/vde_cryptcab/blowfish.c | 5 +---- vde-2/vde_cryptcab/blowfish.h | 1 - vde-2/vde_l3/Makefile.am | 9 +++++---- vde-2/vde_l3/vde_l3.c | 5 +---- vde-2/vde_over_ns/Makefile.am | 3 ++- vde-2/vde_over_ns/vde_io.c | 5 +---- vde-2/vde_plug/Makefile.am | 3 ++- vde-2/vde_plug/vde_plug.c | 5 +---- vde-2/vde_plug2tap/Makefile.am | 3 ++- vde-2/vde_plug2tap/vde_plug2tap.c | 5 +---- vde-2/vde_switch/Makefile.am | 3 ++- vde-2/vde_switch/consmgmt.c | 7 +++---- vde-2/vde_switch/fstp.c | 1 - vde-2/vde_switch/port.c | 1 - vde-2/vde_switch/vde_switch.c | 5 +---- vde-2/vdetaplib/Makefile.am | 3 ++- vde-2/vdetaplib/vdetap.c | 5 +---- vde-2/wirefilter/Makefile.am | 3 ++- vde-2/wirefilter/wirefilter.c | 5 +---- 57 files changed, 121 insertions(+), 119 deletions(-) create mode 100644 vde-2/compat/Makefile.am rename vde-2/{utils => compat}/malloc.c (100%) rename vde-2/{utils => compat}/memcmp.c (100%) rename vde-2/{utils => compat}/open_memstream.c (100%) rename vde-2/{utils => compat}/open_memstream.h (77%) rename vde-2/{utils => compat}/poll.c (99%) create mode 100644 vde-2/compat/poll.h rename vde-2/{utils => compat}/realloc.c (100%) rename vde-2/{utils => compat}/strndup.c (100%) rename vde-2/{utils => compat}/strndup.h (100%) delete mode 100644 vde-2/script create mode 100644 vde-2/utils/Makefile.am delete mode 100644 vde-2/utils/poll.h diff --git a/vde-2/Makefile.am b/vde-2/Makefile.am index 63babeb..bd7e332 100644 --- a/vde-2/Makefile.am +++ b/vde-2/Makefile.am @@ -1,9 +1,9 @@ -SUBDIRS = libvdeplug qemu slirpvde bochs uml doc dpipe wirefilter unixterm vde_switch vde_plug vde_plug2tap vde_over_ns vde_l3 plugin libvdemgmt unixcmd tunctl vde_autolink libvdesnmp +SUBDIRS = compat utils libvdeplug qemu slirpvde bochs uml doc dpipe wirefilter unixterm vde_switch vde_plug vde_plug2tap vde_over_ns vde_l3 plugin libvdemgmt unixcmd vde_autolink libvdesnmp # kvde_switch if CAN_MAKE_LIBVDETAP - SUBDIRS += vdetaplib + SUBDIRS += vdetaplib tunctl endif if ENABLE_CRYPTCAB @@ -12,7 +12,7 @@ endif AUTOMAKE_OPTIONS = foreign -EXTRA_DIST = LICENSE Changelog utils/open_memstream.h utils/poll.h utils/strndup.h utils/cmdparse.h +EXTRA_DIST = LICENSE Changelog extraclean: distclean rm -rf aclocal.m4 autom4te.cache autoscan.log configure.scan config.h.in* configure depcomp install-sh Makefile.in config.guess config.sub ltmain.sh missing `find . -name Makefile.in` vde-*.tar.gz diff --git a/vde-2/bochs/eth_vde.cc b/vde-2/bochs/eth_vde.cc index 685a24f..7755605 100644 --- a/vde-2/bochs/eth_vde.cc +++ b/vde-2/bochs/eth_vde.cc @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include diff --git a/vde-2/compat/Makefile.am b/vde-2/compat/Makefile.am new file mode 100644 index 0000000..adf2b2d --- /dev/null +++ b/vde-2/compat/Makefile.am @@ -0,0 +1,6 @@ +noinst_LTLIBRARIES = libvdecompat.la + +EXTRA_DIST = open_memstream.h poll.h strndup.h + +libvdecompat_la_SOURCES = +libvdecompat_la_LIBADD = $(LTLIBOBJS) $(LTALLOCA) diff --git a/vde-2/utils/malloc.c b/vde-2/compat/malloc.c similarity index 100% rename from vde-2/utils/malloc.c rename to vde-2/compat/malloc.c diff --git a/vde-2/utils/memcmp.c b/vde-2/compat/memcmp.c similarity index 100% rename from vde-2/utils/memcmp.c rename to vde-2/compat/memcmp.c diff --git a/vde-2/utils/open_memstream.c b/vde-2/compat/open_memstream.c similarity index 100% rename from vde-2/utils/open_memstream.c rename to vde-2/compat/open_memstream.c diff --git a/vde-2/utils/open_memstream.h b/vde-2/compat/open_memstream.h similarity index 77% rename from vde-2/utils/open_memstream.h rename to vde-2/compat/open_memstream.h index ec9ba79..241cad8 100644 --- a/vde-2/utils/open_memstream.h +++ b/vde-2/compat/open_memstream.h @@ -1,7 +1,8 @@ - +#ifndef HAVE_OPEN_MEMSTREAM #ifndef __OPEN_MEMSTREAM_H__ #define __OPEN_MEMSTREAM_H__ FILE *open_memstream(char **ptr, size_t *sizeloc); #endif +#endif diff --git a/vde-2/utils/poll.c b/vde-2/compat/poll.c similarity index 99% rename from vde-2/utils/poll.c rename to vde-2/compat/poll.c index 33d0c5d..1349cc4 100644 --- a/vde-2/utils/poll.c +++ b/vde-2/compat/poll.c @@ -13,7 +13,7 @@ #include /* Just for structs and defines */ -#include +#include "poll.h" #ifndef MAX #define MAX(x,y) ((x)>(y)?(x):(y)) diff --git a/vde-2/compat/poll.h b/vde-2/compat/poll.h new file mode 100644 index 0000000..a139462 --- /dev/null +++ b/vde-2/compat/poll.h @@ -0,0 +1,25 @@ +#include "config.h" + +#ifdef HAVE_POLL +#include +#else +#ifndef __POLL_H__ +#define __POLL_H__ + +typedef unsigned long int nfds_t; + +#define POLLIN 0x001 +#define POLLPRI 0x002 +#define POLLOUT 0x004 + +struct pollfd +{ + int fd; + short int events; + short int revents; +}; + +int rpl_poll(struct pollfd *ufds, nfds_t nfds, int timeout); + +#endif +#endif diff --git a/vde-2/utils/realloc.c b/vde-2/compat/realloc.c similarity index 100% rename from vde-2/utils/realloc.c rename to vde-2/compat/realloc.c diff --git a/vde-2/utils/strndup.c b/vde-2/compat/strndup.c similarity index 100% rename from vde-2/utils/strndup.c rename to vde-2/compat/strndup.c diff --git a/vde-2/utils/strndup.h b/vde-2/compat/strndup.h similarity index 100% rename from vde-2/utils/strndup.h rename to vde-2/compat/strndup.h diff --git a/vde-2/configure.ac b/vde-2/configure.ac index 1fcff95..50a02e3 100644 --- a/vde-2/configure.ac +++ b/vde-2/configure.ac @@ -6,7 +6,7 @@ AC_INIT([vde2], [2.2.0-pre2], [info@v2.cs.unibo.it]) AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects]) AC_CONFIG_SRCDIR([vde.h]) AC_CONFIG_HEADER([config.h]) -AC_CONFIG_LIBOBJ_DIR(utils) +AC_CONFIG_LIBOBJ_DIR(compat) # Checks for programs. AC_PROG_CXX @@ -57,16 +57,19 @@ AC_TYPE_SIGNAL AC_FUNC_VPRINTF AC_CHECK_FUNCS([atexit dup2 gethostbyname gethostname gettimeofday inet_ntoa memmove memset putenv select setenv socket strchr strdup strerror strstr uname inet_aton sprintf readv random srandom index bcmp drand48 memmove gethostid revoke fchmod getopt_long_only funopen]) AC_REPLACE_FUNCS([open_memstream strndup]) -AC_MSG_CHECKING([for broken poll()]) - if expr "$build_os" : "darwin8\..*" > /dev/null; then - AC_MSG_RESULT([yes, emulating with select()]) - AC_DEFINE([HAVE_POLL], 0, [Define to 1 if your system has a working poll() function.]) - AC_LIBOBJ([poll]) - AC_DEFINE([poll], [rpl_poll], [Define to rpl_poll if the replacement function should be used.]) - else - AC_DEFINE([HAVE_POLL], 1, [Define to 1 if your system has a working poll() function.]) - AC_MSG_RESULT([no]) - fi +AC_CHECK_FUNC([poll], + [ + AC_MSG_CHECKING([for poll sanity]) + if expr "$build_os" : "darwin8\..*" > /dev/null; then + AC_MSG_RESULT([present but broken, emulating with select]) + AC_LIBOBJ([poll]) + AC_DEFINE([poll], [rpl_poll], [Define to rpl_poll if the replacement function should be used.]) + else + AC_DEFINE([HAVE_POLL], 1, [Define to 1 if your system has a working poll() function.]) + AC_MSG_RESULT([yes]) + fi + ], + []) # All other nice checks I have to make for recostructing missing parts of # slirp's config.h file @@ -166,6 +169,8 @@ CFLAGS="-Wall -O2 $CFLAGS" AC_SUBST(CFLAGS) AC_CONFIG_FILES([Makefile] + [compat/Makefile] + [utils/Makefile] [doc/Makefile] [qemu/Makefile] [slirpvde/Makefile] diff --git a/vde-2/kvde_switch/Makefile.am b/vde-2/kvde_switch/Makefile.am index 5efe9d4..6531543 100644 --- a/vde-2/kvde_switch/Makefile.am +++ b/vde-2/kvde_switch/Makefile.am @@ -1,3 +1,3 @@ bin_PROGRAMS = kvde_switch kvde_switch_SOURCES = kvde_switch.c consmgmt.c datasock.c sockutils.c - +kvde_switch_LIBADD = ../compat/libvdecompat.la ../utils/libvdeutils.la diff --git a/vde-2/kvde_switch/consmgmt.c b/vde-2/kvde_switch/consmgmt.c index 70b8f3d..574631a 100644 --- a/vde-2/kvde_switch/consmgmt.c +++ b/vde-2/kvde_switch/consmgmt.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -33,9 +32,7 @@ #define MAXCMD 128 -#ifndef HAVE_OPEN_MEMSTREAM -#include -#endif +#include "compat/open_memstream.h" static struct swmodule swmi; extern time_t starting_time; diff --git a/vde-2/kvde_switch/kvde_switch.c b/vde-2/kvde_switch/kvde_switch.c index 8f58c58..4695c13 100644 --- a/vde-2/kvde_switch/kvde_switch.c +++ b/vde-2/kvde_switch/kvde_switch.c @@ -14,10 +14,7 @@ #include #include #include -#include -#ifndef HAVE_POLL -#include -#endif +#include "compat/poll.h" #include #include #include diff --git a/vde-2/libvdemgmt/Makefile.am b/vde-2/libvdemgmt/Makefile.am index eb67ed6..c3dd751 100644 --- a/vde-2/libvdemgmt/Makefile.am +++ b/vde-2/libvdemgmt/Makefile.am @@ -1,9 +1,9 @@ lib_LTLIBRARIES = libvdemgmt.la -libvdemgmt_la_SOURCES = libvdemgmt.c ../utils/cmdparse.c +libvdemgmt_la_SOURCES = libvdemgmt.c libvdemgmt_la_LDFLAGS = -version-number 0:0:1 -export-dynamic -libvdemgmt_la_LIBADD = $(LTLIBOBJS) +libvdemgmt_la_LIBADD = ../compat/libvdecompat.la ../utils/libvdeutils.la include_HEADERS = libvdemgmt.h diff --git a/vde-2/libvdemgmt/libvdemgmt.c b/vde-2/libvdemgmt/libvdemgmt.c index 5b33488..d631fb8 100644 --- a/vde-2/libvdemgmt/libvdemgmt.c +++ b/vde-2/libvdemgmt/libvdemgmt.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include diff --git a/vde-2/libvdesnmp/Makefile.am b/vde-2/libvdesnmp/Makefile.am index 12f0948..fdb9f8e 100644 --- a/vde-2/libvdesnmp/Makefile.am +++ b/vde-2/libvdesnmp/Makefile.am @@ -5,6 +5,6 @@ libvdesnmp_la_LDFLAGS = -version-number 0:0:1 -export-dynamic libvdesnmp_la_CFLAGS = -I../libvdemgmt/ -I../plugin/ -libvdesnmp_la_LIBADD = $(LTLIBOBJS) +libvdesnmp_la_LIBADD = ../compat/libvdecompat.la include_HEADERS = libvdesnmp.h diff --git a/vde-2/libvdesnmp/libvdesnmp.c b/vde-2/libvdesnmp/libvdesnmp.c index baad8d1..eeda45e 100644 --- a/vde-2/libvdesnmp/libvdesnmp.c +++ b/vde-2/libvdesnmp/libvdesnmp.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include "compat/poll.h" #include #include diff --git a/vde-2/plugin/Makefile.am b/vde-2/plugin/Makefile.am index 349d114..1c296fb 100644 --- a/vde-2/plugin/Makefile.am +++ b/vde-2/plugin/Makefile.am @@ -10,10 +10,10 @@ AM_LIBTOOLFLAGS = --tag=disable-static mod_LTLIBRARIES = dump.la dump_la_SOURCES = dump.c vdeplugin.h -dump_la_LIBADD = $(LTLIBOBJS) +dump_la_LIBADD = ../compat/libvdecompat.la ../utils/libvdeutils.la if ENABLE_PCAP mod_LTLIBRARIES += pdump.la pdump_la_SOURCES = pdump.c vdeplugin.h -pdump_la_LIBADD = $(LTLIBOBJS) -lpcap +pdump_la_LIBADD = ../compat/libvdecompat.la ../utils/libvdeutils.la -lpcap endif diff --git a/vde-2/plugin/dump.c b/vde-2/plugin/dump.c index 2033b45..efe96a7 100644 --- a/vde-2/plugin/dump.c +++ b/vde-2/plugin/dump.c @@ -1,11 +1,10 @@ #define _GNU_SOURCE -#include "vdeplugin.h" + #include #include +#include "vdeplugin.h" +#include "compat/open_memstream.h" -#ifndef HAVE_OPEN_MEMSTREAM -#include -#endif int testevent(struct dbgcl *tag,va_list v); struct plugin vde_plugin_data={ diff --git a/vde-2/qemu/Makefile.am b/vde-2/qemu/Makefile.am index dcd9ab7..76e40ad 100644 --- a/vde-2/qemu/Makefile.am +++ b/vde-2/qemu/Makefile.am @@ -1,6 +1,7 @@ bin_PROGRAMS = vdeq vdeq_SOURCES = vdeq.c -vdeq_LDADD = $(LIBOBJS) ../libvdeplug/libvdeplug.la +vdeq_LDADD = ../compat/libvdecompat.la ../libvdeplug/libvdeplug.la +vdeq_LDFLAGS = -Wl,-ldl INCLUDES = -I$(top_srcdir) diff --git a/vde-2/qemu/vdeq.c b/vde-2/qemu/vdeq.c index 276e0e7..933fede 100644 --- a/vde-2/qemu/vdeq.c +++ b/vde-2/qemu/vdeq.c @@ -16,10 +16,7 @@ #include #include #include -#include -#ifndef HAVE_POLL -#include -#endif +#include "compat/poll.h" #include #include #include diff --git a/vde-2/script b/vde-2/script deleted file mode 100644 index f051775..0000000 --- a/vde-2/script +++ /dev/null @@ -1,3 +0,0 @@ -vlan/create 2 -vlan/create 3 -vlan/create 4 diff --git a/vde-2/slirpvde/Makefile.am b/vde-2/slirpvde/Makefile.am index 4b89566..f7e4e23 100644 --- a/vde-2/slirpvde/Makefile.am +++ b/vde-2/slirpvde/Makefile.am @@ -42,7 +42,8 @@ slirpvde_SOURCES = \ tcp2unix.h \ slirpvde.c -slirpvde_LDADD = $(LIBOBJS) ../libvdeplug/libvdeplug.la +slirpvde_LDADD = ../compat/libvdecompat.la ../libvdeplug/libvdeplug.la +slirpvde_LDFLAGS = -Wl,-ldl INCLUDES = -DVDE diff --git a/vde-2/slirpvde/slirp.h b/vde-2/slirpvde/slirp.h index d7a5757..b20692b 100644 --- a/vde-2/slirpvde/slirp.h +++ b/vde-2/slirpvde/slirp.h @@ -247,6 +247,8 @@ extern int do_echo; #define DEFAULT_BAUD 115200 +void client_eth_register(const unsigned char *eth_addr, const unsigned char *ip_addr); + /* cksum.c */ int cksum(struct mbuf *m, int len); diff --git a/vde-2/slirpvde/slirpvde.c b/vde-2/slirpvde/slirpvde.c index 3b8356b..2b1ae46 100644 --- a/vde-2/slirpvde/slirpvde.c +++ b/vde-2/slirpvde/slirpvde.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include diff --git a/vde-2/unixcmd/Makefile.am b/vde-2/unixcmd/Makefile.am index 48ec79a..172d660 100644 --- a/vde-2/unixcmd/Makefile.am +++ b/vde-2/unixcmd/Makefile.am @@ -1,6 +1,7 @@ bin_PROGRAMS = unixcmd -unixcmd_SOURCES = unixcmd.c ../utils/cmdparse.c -unixcmd_LDADD = $(LIBOBJS) +unixcmd_SOURCES = unixcmd.c +unixcmd_LDADD = ../compat/libvdecompat.la ../utils/libvdeutils.la +unixcmd_LDFLAGS = -Wl,-ldl install-exec-hook: rm -f $(DESTDIR)$(bindir)/vdecmd diff --git a/vde-2/unixcmd/unixcmd.c b/vde-2/unixcmd/unixcmd.c index 324d263..96031d8 100644 --- a/vde-2/unixcmd/unixcmd.c +++ b/vde-2/unixcmd/unixcmd.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include diff --git a/vde-2/unixterm/Makefile.am b/vde-2/unixterm/Makefile.am index f0cd040..8855d42 100644 --- a/vde-2/unixterm/Makefile.am +++ b/vde-2/unixterm/Makefile.am @@ -1,3 +1,4 @@ bin_PROGRAMS = unixterm unixterm_SOURCES = unixterm.c -unixterm_LDADD = $(LIBOBJS) +unixterm_LDADD = ../compat/libvdecompat.la +unixterm_LDFLAGS = -Wl,-ldl diff --git a/vde-2/unixterm/unixterm.c b/vde-2/unixterm/unixterm.c index 8986916..fba29c7 100644 --- a/vde-2/unixterm/unixterm.c +++ b/vde-2/unixterm/unixterm.c @@ -8,10 +8,7 @@ #include #include #include -#include -#ifndef HAVE_POLL -#include -#endif +#include "compat/poll.h" #include #include diff --git a/vde-2/utils/Makefile.am b/vde-2/utils/Makefile.am new file mode 100644 index 0000000..1a92b7f --- /dev/null +++ b/vde-2/utils/Makefile.am @@ -0,0 +1,7 @@ +noinst_LTLIBRARIES = libvdeutils.la + +libvdeutils_la_SOURCES = cmdparse.c cmdparse.h +libvdeutils_la_LIBADD = ../compat/libvdecompat.la +libvdeutils_la_LDFLAGS = -Wl,-ldl + + diff --git a/vde-2/utils/cmdparse.c b/vde-2/utils/cmdparse.c index 62a9541..9cc84a7 100644 --- a/vde-2/utils/cmdparse.c +++ b/vde-2/utils/cmdparse.c @@ -20,12 +20,10 @@ #include #include #include -#include +#include "compat/poll.h" #include -#ifndef HAVE_OPEN_MEMSTREAM -#include -#endif +#include "compat/open_memstream.h" #include diff --git a/vde-2/utils/poll.h b/vde-2/utils/poll.h deleted file mode 100644 index dfa6529..0000000 --- a/vde-2/utils/poll.h +++ /dev/null @@ -1,5 +0,0 @@ - -#ifndef __POLL_H__ -#define __POLL_H__ -int rpl_poll(struct pollfd *ufds, nfds_t nfds, int timeout); -#endif diff --git a/vde-2/vde_autolink/Makefile.am b/vde-2/vde_autolink/Makefile.am index 4c387f2..aebd0f5 100644 --- a/vde-2/vde_autolink/Makefile.am +++ b/vde-2/vde_autolink/Makefile.am @@ -1,4 +1,5 @@ bin_PROGRAMS = vde_autolink vde_autolink_SOURCES = vde_autolink.c -vde_autolink_LDADD = $(LIBOBJS) ../libvdemgmt/libvdemgmt.la +vde_autolink_LDADD = ../compat/libvdecompat.la ../libvdemgmt/libvdemgmt.la +vde_autolink_LDFLAGS = -Wl,-ldl diff --git a/vde-2/vde_autolink/vde_autolink.c b/vde-2/vde_autolink/vde_autolink.c index eb09c12..d7c50ee 100644 --- a/vde-2/vde_autolink/vde_autolink.c +++ b/vde-2/vde_autolink/vde_autolink.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include @@ -36,9 +35,8 @@ #include #include -#ifndef HAVE_POLL -#include -#endif +#include "compat/poll.h" + #ifndef HAVE_STRNDUP #include #endif diff --git a/vde-2/vde_cryptcab/Makefile.am b/vde-2/vde_cryptcab/Makefile.am index a8cb60a..2969c5e 100644 --- a/vde-2/vde_cryptcab/Makefile.am +++ b/vde-2/vde_cryptcab/Makefile.am @@ -1,3 +1,4 @@ bin_PROGRAMS = vde_cryptcab vde_cryptcab_SOURCES = vde_cryptcab.c crc32.c blowfish.c blowfish.h crc32.h -vde_cryptcab_LDADD = $(LIBOBJS) -lcrypto ../libvdeplug/libvdeplug.la +vde_cryptcab_LDADD = ../compat/libvdecompat.la -lcrypto ../libvdeplug/libvdeplug.la +vde_cryptcab_LDFLAGS = -Wl,-ldl diff --git a/vde-2/vde_cryptcab/blowfish.c b/vde-2/vde_cryptcab/blowfish.c index d24cb85..a6a22a1 100644 --- a/vde-2/vde_cryptcab/blowfish.c +++ b/vde-2/vde_cryptcab/blowfish.c @@ -11,10 +11,7 @@ #include #include #include -#include -#ifndef HAVE_POLL -#include -#endif +#include "compat/poll.h" #include #include #include diff --git a/vde-2/vde_cryptcab/blowfish.h b/vde-2/vde_cryptcab/blowfish.h index df05a73..e72a1e6 100644 --- a/vde-2/vde_cryptcab/blowfish.h +++ b/vde-2/vde_cryptcab/blowfish.h @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include diff --git a/vde-2/vde_l3/Makefile.am b/vde-2/vde_l3/Makefile.am index 96d639b..9bafdc9 100644 --- a/vde-2/vde_l3/Makefile.am +++ b/vde-2/vde_l3/Makefile.am @@ -12,11 +12,12 @@ pfifo_la_SOURCES = pfifo.c vde_buff.h tbf_la_SOURCES = tbf.c vde_buff.h bfifo_la_SOURCES = bfifo.c vde_buff.h -pfifo_la_LIBADD = $(LTLIBOBJS) -bfifo_la_LIBADD = $(LTLIBOBJS) -tbf_la_LIBADD = $(LTLIBOBJS) +pfifo_la_LIBADD = ../compat/libvdecompat.la +bfifo_la_LIBADD = ../compat/libvdecompat.la +tbf_la_LIBADD = ../compat/libvdecompat.la bin_PROGRAMS = vde_l3 vde_l3_SOURCES = vde_l3.c vde_buff.h vde_l3.h -vde_l3_LDADD = $(LIBOBJS) ../libvdeplug/libvdeplug.la -ldl +vde_l3_LDADD = ../compat/libvdecompat.la ../libvdeplug/libvdeplug.la -ldl +vde_l3_LDFLAGS = -Wl,-ldl diff --git a/vde-2/vde_l3/vde_l3.c b/vde-2/vde_l3/vde_l3.c index 681edf6..d8a8dea 100644 --- a/vde-2/vde_l3/vde_l3.c +++ b/vde-2/vde_l3/vde_l3.c @@ -20,10 +20,7 @@ #include #include #include -#include -#ifndef HAVE_POLL -#include -#endif +#include "compat/poll.h" #include #include #include diff --git a/vde-2/vde_over_ns/Makefile.am b/vde-2/vde_over_ns/Makefile.am index b21e1f8..4430b35 100644 --- a/vde-2/vde_over_ns/Makefile.am +++ b/vde-2/vde_over_ns/Makefile.am @@ -12,4 +12,5 @@ vde_over_ns_SOURCES = \ fun.h \ pstack.h -vde_over_ns_LDADD = $(LIBOBJS) ../libvdeplug/libvdeplug.la +vde_over_ns_LDADD = ../compat/libvdecompat.la ../libvdeplug/libvdeplug.la +vde_over_ns_LDFLAGS = -Wl,-ldl diff --git a/vde-2/vde_over_ns/vde_io.c b/vde-2/vde_over_ns/vde_io.c index 7999d31..7f6b61b 100644 --- a/vde-2/vde_over_ns/vde_io.c +++ b/vde-2/vde_over_ns/vde_io.c @@ -25,10 +25,7 @@ #include #include #include -#include -#ifndef HAVE_POLL -#include -#endif +#include "compat/poll.h" #include #include #include diff --git a/vde-2/vde_plug/Makefile.am b/vde-2/vde_plug/Makefile.am index ad3f2ac..d3c43ee 100644 --- a/vde-2/vde_plug/Makefile.am +++ b/vde-2/vde_plug/Makefile.am @@ -1,4 +1,5 @@ bin_PROGRAMS = vde_plug vde_plug_SOURCES = vde_plug.c -vde_plug_LDADD = $(LIBOBJS) ../libvdeplug/libvdeplug.la +vde_plug_LDADD = ../compat/libvdecompat.la ../libvdeplug/libvdeplug.la +vde_plug_LDFLAGS = -Wl,-ldl diff --git a/vde-2/vde_plug/vde_plug.c b/vde-2/vde_plug/vde_plug.c index 0a954f2..72d593d 100644 --- a/vde-2/vde_plug/vde_plug.c +++ b/vde-2/vde_plug/vde_plug.c @@ -15,10 +15,7 @@ #include #include #include -#include -#ifndef HAVE_POLL -#include -#endif +#include "compat/poll.h" #include #include #include diff --git a/vde-2/vde_plug2tap/Makefile.am b/vde-2/vde_plug2tap/Makefile.am index 565dfd1..dd9eeee 100644 --- a/vde-2/vde_plug2tap/Makefile.am +++ b/vde-2/vde_plug2tap/Makefile.am @@ -1,4 +1,5 @@ bin_PROGRAMS = vde_plug2tap vde_plug2tap_SOURCES = vde_plug2tap.c -vde_plug2tap_LDADD = $(LIBOBJS) ../libvdeplug/libvdeplug.la +vde_plug2tap_LDADD = ../compat/libvdecompat.la ../libvdeplug/libvdeplug.la +vde_plug2tap_LDFLAGS = -Wl,-ldl diff --git a/vde-2/vde_plug2tap/vde_plug2tap.c b/vde-2/vde_plug2tap/vde_plug2tap.c index 8bb3a50..f01de77 100644 --- a/vde-2/vde_plug2tap/vde_plug2tap.c +++ b/vde-2/vde_plug2tap/vde_plug2tap.c @@ -7,10 +7,7 @@ #include #include #include -#include -#ifndef HAVE_POLL -#include -#endif +#include "compat/poll.h" #include #include #include diff --git a/vde-2/vde_switch/Makefile.am b/vde-2/vde_switch/Makefile.am index 37e051d..84d0a71 100644 --- a/vde-2/vde_switch/Makefile.am +++ b/vde-2/vde_switch/Makefile.am @@ -23,7 +23,8 @@ vde_switch_SOURCES = \ tuntap.c \ tuntap.h -vde_switch_LDADD = $(LIBOBJS) +vde_switch_LDADD = ../compat/libvdecompat.la ../utils/libvdeutils.la +vde_switch_LDFLAGS = -Wl,-ldl AM_CFLAGS = -Wall diff --git a/vde-2/vde_switch/consmgmt.c b/vde-2/vde_switch/consmgmt.c index 3d5ade7..3c1d004 100644 --- a/vde-2/vde_switch/consmgmt.c +++ b/vde-2/vde_switch/consmgmt.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -34,11 +33,11 @@ #include #include +#include "compat/poll.h" + #define MAXCMD 128 -#ifndef HAVE_OPEN_MEMSTREAM -#include -#endif +#include "compat/open_memstream.h" static struct swmodule swmi; diff --git a/vde-2/vde_switch/fstp.c b/vde-2/vde_switch/fstp.c index 1e9f582..dc9bcdb 100644 --- a/vde-2/vde_switch/fstp.c +++ b/vde-2/vde_switch/fstp.c @@ -11,7 +11,6 @@ #include #include #include -#include #include /*ntoh conversion*/ #include diff --git a/vde-2/vde_switch/port.c b/vde-2/vde_switch/port.c index 78a3b0a..edc53b4 100644 --- a/vde-2/vde_switch/port.c +++ b/vde-2/vde_switch/port.c @@ -12,7 +12,6 @@ #include #include #include -#include #include /*ntoh conversion*/ #include diff --git a/vde-2/vde_switch/vde_switch.c b/vde-2/vde_switch/vde_switch.c index 08bd43c..1497e4d 100644 --- a/vde-2/vde_switch/vde_switch.c +++ b/vde-2/vde_switch/vde_switch.c @@ -14,10 +14,7 @@ #include #include #include -#include -#ifndef HAVE_POLL -#include -#endif +#include "compat/poll.h" #include #include #include diff --git a/vde-2/vdetaplib/Makefile.am b/vde-2/vdetaplib/Makefile.am index 8fc263c..450569a 100644 --- a/vde-2/vdetaplib/Makefile.am +++ b/vde-2/vdetaplib/Makefile.am @@ -9,4 +9,5 @@ libvdetap_la_CFLAGS = -fno-strict-aliasing AM_CPPFLAGS=-DLIBEXECDIR=\"$(libexecdir)\" vdetap_SOURCES = vdetap.c -vdetap_LDADD = ../libvdeplug/libvdeplug.la +vdetap_LDADD = ../compat/libvdecompat.la ../libvdeplug/libvdeplug.la +vdetap_LDFLAGS = -Wl,-ldl diff --git a/vde-2/vdetaplib/vdetap.c b/vde-2/vdetaplib/vdetap.c index f2959d7..07209e7 100644 --- a/vde-2/vdetaplib/vdetap.c +++ b/vde-2/vdetaplib/vdetap.c @@ -6,10 +6,7 @@ #include #include #include -#include -#ifndef HAVE_POLL -#include -#endif +#include "compat/poll.h" #include #include #include diff --git a/vde-2/wirefilter/Makefile.am b/vde-2/wirefilter/Makefile.am index cd053f4..1e814ae 100644 --- a/vde-2/wirefilter/Makefile.am +++ b/vde-2/wirefilter/Makefile.am @@ -1,3 +1,4 @@ bin_PROGRAMS = wirefilter wirefilter_SOURCES = wirefilter.c -wirefilter_LDADD = $(LIBOBJS) ../libvdeplug/libvdeplug.la +wirefilter_LDADD = ../compat/libvdecompat.la ../libvdeplug/libvdeplug.la +wirefilter_LDFLAGS = -Wl,-ldl diff --git a/vde-2/wirefilter/wirefilter.c b/vde-2/wirefilter/wirefilter.c index 6ba8034..28c31d4 100644 --- a/vde-2/wirefilter/wirefilter.c +++ b/vde-2/wirefilter/wirefilter.c @@ -22,10 +22,7 @@ #include #include #include -#include -#ifndef HAVE_POLL -#include -#endif +#include "compat/poll.h" #include #include #include -- 2.11.4.GIT