From 35b1c25093a478d20e01f0ff391c9cdc9c41c2b8 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Thu, 31 Dec 2009 13:19:13 +0100 Subject: [PATCH] Move source from lib/ to src/. The utility functions in the lib/ directory do not really form a library. Also, now that we build two binaries, tincctl does not need everything that was in libvpn.a, so it is wasteful to link to it. --- lib/Makefile.am | 13 ------------- src/Makefile.am | 22 +++++++++++----------- {lib => src}/alloca.c | 0 {lib => src}/dropin.c | 0 {lib => src}/dropin.h | 0 {lib => src}/ethernet.h | 0 {lib => src}/fake-gai-errnos.h | 0 {lib => src}/fake-getaddrinfo.c | 0 {lib => src}/fake-getaddrinfo.h | 0 {lib => src}/fake-getnameinfo.c | 0 {lib => src}/fake-getnameinfo.h | 0 {lib => src}/getopt.c | 0 {lib => src}/getopt.h | 0 {lib => src}/getopt1.c | 0 {lib => src}/ipv4.h | 0 {lib => src}/ipv6.h | 0 {lib => src}/list.c | 0 {lib => src}/list.h | 0 {lib => src}/malloc.c | 0 {lib => src}/memcmp.c | 0 {lib => src}/realloc.c | 0 {lib => src}/splay_tree.c | 0 {lib => src}/splay_tree.h | 0 {lib => src}/utils.c | 0 {lib => src}/utils.h | 0 {lib => src}/xalloc.h | 0 {lib => src}/xmalloc.c | 0 system.h | 2 +- 28 files changed, 12 insertions(+), 25 deletions(-) rename {lib => src}/alloca.c (100%) rename {lib => src}/dropin.c (100%) rename {lib => src}/dropin.h (100%) rename {lib => src}/ethernet.h (100%) rename {lib => src}/fake-gai-errnos.h (100%) rename {lib => src}/fake-getaddrinfo.c (100%) rename {lib => src}/fake-getaddrinfo.h (100%) rename {lib => src}/fake-getnameinfo.c (100%) rename {lib => src}/fake-getnameinfo.h (100%) rename {lib => src}/getopt.c (100%) rename {lib => src}/getopt.h (100%) rename {lib => src}/getopt1.c (100%) rename {lib => src}/ipv4.h (100%) rename {lib => src}/ipv6.h (100%) rename {lib => src}/list.c (100%) rename {lib => src}/list.h (100%) rename {lib => src}/malloc.c (100%) rename {lib => src}/memcmp.c (100%) rename {lib => src}/realloc.c (100%) rename {lib => src}/splay_tree.c (100%) rename {lib => src}/splay_tree.h (100%) rename {lib => src}/utils.c (100%) rename {lib => src}/utils.h (100%) rename {lib => src}/xalloc.h (100%) rename {lib => src}/xmalloc.c (100%) diff --git a/lib/Makefile.am b/lib/Makefile.am index c96e176..96d7a6a 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,14 +1 @@ ## Process this file with automake to produce Makefile.in - -noinst_LIBRARIES = libvpn.a - -INCLUDES = @INCLUDES@ -I. -I$(top_builddir) - -libvpn_a_SOURCES = xmalloc.c utils.c getopt.c getopt1.c list.c splay_tree.c dropin.c fake-getaddrinfo.c fake-getnameinfo.c - -libvpn_a_LIBADD = @LIBOBJS@ @ALLOCA@ -libvpn_a_DEPENDENCIES = $(libvpn_a_LIBADD) - -noinst_HEADERS = xalloc.h utils.h getopt.h list.h splay_tree.h dropin.h fake-getaddrinfo.h fake-getnameinfo.h fake-gai-errnos.h ipv6.h ipv4.h ethernet.h - -EXTRA_DIST = diff --git a/src/Makefile.am b/src/Makefile.am index 7be9f5c..20e438f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -4,11 +4,15 @@ sbin_PROGRAMS = tincd tincctl EXTRA_DIST = linux bsd solaris cygwin mingw raw_socket uml_socket openssl gcrypt -tincd_SOURCES = cipher.c conf.c connection.c control.c crypto.c digest.c edge.c graph.c logger.c meta.c net.c net_packet.c net_setup.c \ - net_socket.c netutl.c node.c process.c protocol.c protocol_auth.c protocol_edge.c protocol_misc.c \ +tincd_SOURCES = \ + xmalloc.c utils.c getopt.c getopt1.c list.c splay_tree.c dropin.c fake-getaddrinfo.c fake-getnameinfo.c \ + cipher.c conf.c connection.c control.c crypto.c digest.c edge.c graph.c logger.c meta.c net.c net_packet.c net_setup.c \ + net_socket.c netutl.c node.c process.c protocol.c protocol_auth.c protocol_edge.c protocol_misc.c \ protocol_key.c protocol_subnet.c route.c rsa.c subnet.c tincd.c -tincctl_SOURCES = tincctl.c rsagen.c +tincctl_SOURCES = \ + xmalloc.c utils.c getopt.c getopt1.c \ + tincctl.c rsagen.c if TUNEMU tincd_SOURCES += bsd/tunemu.c @@ -18,9 +22,11 @@ nodist_tincd_SOURCES = device.c DEFAULT_INCLUDES = -INCLUDES = @INCLUDES@ -I$(top_builddir) -I$(top_srcdir)/lib +INCLUDES = @INCLUDES@ -I$(top_builddir) -noinst_HEADERS = cipher.h conf.h connection.h control.h control_common.h crypto.h device.h digest.h edge.h graph.h logger.h meta.h net.h netutl.h node.h process.h \ +noinst_HEADERS = \ + xalloc.h utils.h getopt.h list.h splay_tree.h dropin.h fake-getaddrinfo.h fake-getnameinfo.h fake-gai-errnos.h ipv6.h ipv4.h ethernet.h \ + cipher.h conf.h connection.h control.h control_common.h crypto.h device.h digest.h edge.h graph.h logger.h meta.h net.h netutl.h node.h process.h \ protocol.h route.h rsa.h rsagen.h subnet.h bsd/tunemu.h LIBS = @LIBS@ @LIBGCRYPT_LIBS@ @@ -29,12 +35,6 @@ if TUNEMU LIBS += -lpcap endif -tincd_LDADD = \ - $(top_builddir)/lib/libvpn.a - -tincctl_LDADD = \ - $(top_builddir)/lib/libvpn.a - AM_CFLAGS = @CFLAGS@ -DCONFDIR=\"$(sysconfdir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" -DSBINDIR=\"$(sbindir)\" dist-hook: diff --git a/lib/alloca.c b/src/alloca.c similarity index 100% rename from lib/alloca.c rename to src/alloca.c diff --git a/lib/dropin.c b/src/dropin.c similarity index 100% rename from lib/dropin.c rename to src/dropin.c diff --git a/lib/dropin.h b/src/dropin.h similarity index 100% rename from lib/dropin.h rename to src/dropin.h diff --git a/lib/ethernet.h b/src/ethernet.h similarity index 100% rename from lib/ethernet.h rename to src/ethernet.h diff --git a/lib/fake-gai-errnos.h b/src/fake-gai-errnos.h similarity index 100% rename from lib/fake-gai-errnos.h rename to src/fake-gai-errnos.h diff --git a/lib/fake-getaddrinfo.c b/src/fake-getaddrinfo.c similarity index 100% rename from lib/fake-getaddrinfo.c rename to src/fake-getaddrinfo.c diff --git a/lib/fake-getaddrinfo.h b/src/fake-getaddrinfo.h similarity index 100% rename from lib/fake-getaddrinfo.h rename to src/fake-getaddrinfo.h diff --git a/lib/fake-getnameinfo.c b/src/fake-getnameinfo.c similarity index 100% rename from lib/fake-getnameinfo.c rename to src/fake-getnameinfo.c diff --git a/lib/fake-getnameinfo.h b/src/fake-getnameinfo.h similarity index 100% rename from lib/fake-getnameinfo.h rename to src/fake-getnameinfo.h diff --git a/lib/getopt.c b/src/getopt.c similarity index 100% rename from lib/getopt.c rename to src/getopt.c diff --git a/lib/getopt.h b/src/getopt.h similarity index 100% rename from lib/getopt.h rename to src/getopt.h diff --git a/lib/getopt1.c b/src/getopt1.c similarity index 100% rename from lib/getopt1.c rename to src/getopt1.c diff --git a/lib/ipv4.h b/src/ipv4.h similarity index 100% rename from lib/ipv4.h rename to src/ipv4.h diff --git a/lib/ipv6.h b/src/ipv6.h similarity index 100% rename from lib/ipv6.h rename to src/ipv6.h diff --git a/lib/list.c b/src/list.c similarity index 100% rename from lib/list.c rename to src/list.c diff --git a/lib/list.h b/src/list.h similarity index 100% rename from lib/list.h rename to src/list.h diff --git a/lib/malloc.c b/src/malloc.c similarity index 100% rename from lib/malloc.c rename to src/malloc.c diff --git a/lib/memcmp.c b/src/memcmp.c similarity index 100% rename from lib/memcmp.c rename to src/memcmp.c diff --git a/lib/realloc.c b/src/realloc.c similarity index 100% rename from lib/realloc.c rename to src/realloc.c diff --git a/lib/splay_tree.c b/src/splay_tree.c similarity index 100% rename from lib/splay_tree.c rename to src/splay_tree.c diff --git a/lib/splay_tree.h b/src/splay_tree.h similarity index 100% rename from lib/splay_tree.h rename to src/splay_tree.h diff --git a/lib/utils.c b/src/utils.c similarity index 100% rename from lib/utils.c rename to src/utils.c diff --git a/lib/utils.h b/src/utils.h similarity index 100% rename from lib/utils.h rename to src/utils.h diff --git a/lib/xalloc.h b/src/xalloc.h similarity index 100% rename from lib/xalloc.h rename to src/xalloc.h diff --git a/lib/xmalloc.c b/src/xmalloc.c similarity index 100% rename from lib/xmalloc.c rename to src/xmalloc.c diff --git a/system.h b/system.h index dfb4c6d..5dc1daf 100644 --- a/system.h +++ b/system.h @@ -37,7 +37,7 @@ typedef int bool; /* Other functions */ -#include "dropin.h" +#include "src/dropin.h" #ifndef HAVE_SOCKLEN_T typedef int socklen_t; -- 2.25.1