1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
|
--- a/configure.ac
+++ b/configure.ac
@@ -268,7 +268,8 @@
AC_CHECK_LIB([dl], [dlopen], [LIBDL="-ldl"])
-AM_CONDITIONAL([BUILD_SHARED_MODULES], [ test "$enable_shared" = yes ])
+AM_CONDITIONAL([BUILD_STATIC_LIBRARIES], [ test "$enable_shared" = no ])
+AM_CONDITIONAL([BUILD_STATIC_MODULES], [ test "$enable_shared" = no ])
# Checks for header files.
AC_CHECK_HEADERS([inttypes.h memory.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h unistd.h])
--- a/api/Makefile.am
+++ b/api/Makefile.am
@@ -4,12 +4,15 @@
include_HEADERS = daq.h daq_api.h daq_common.h
-lib_LTLIBRARIES = libdaq.la libdaq_static.la
+lib_LTLIBRARIES = libdaq.la
+
+if BUILD_STATIC_LIBRARIES
+ lib_LTLIBRARIES += libdaq_static.la
+ libdaq_static_la_SOURCES = daq_base.c daq_mod_ops.c daq.h daq_api.h daq_common.h
+ libdaq_static_la_CFLAGS = -DSTATIC_MODULE_LIST
+ libdaq_static_la_LDFLAGS = -static
+endif
libdaq_la_SOURCES = daq_base.c daq_mod_ops.c daq.h daq_api.h daq_common.h
libdaq_la_LDFLAGS = -version-info 2:4:0 @XCCFLAGS@
libdaq_la_LIBADD = @LIBDL@
-
-libdaq_static_la_SOURCES = daq_base.c daq_mod_ops.c daq.h daq_api.h daq_common.h
-libdaq_static_la_CFLAGS = -DSTATIC_MODULE_LIST
-libdaq_static_la_LDFLAGS = -static
--- a/os-daq-modules/Makefile.am
+++ b/os-daq-modules/Makefile.am
@@ -6,7 +6,9 @@
pkglib_LTLIBRARIES =
-lib_LTLIBRARIES = libdaq_static_modules.la
+if BUILD_STATIC_MODULES
+ pkglib_LTLIBRARIES += libdaq_static_modules.la
+endif
libdaq_static_modules_la_SOURCES = \
daq_static_modules.c \
daq_static_modules.h
@@ -15,88 +17,88 @@
libdaq_static_modules_la_LIBADD =
if BUILD_AFPACKET_MODULE
-if BUILD_SHARED_MODULES
pkglib_LTLIBRARIES += daq_afpacket.la
daq_afpacket_la_SOURCES = daq_afpacket.c
daq_afpacket_la_CFLAGS = -DBUILDING_SO
daq_afpacket_la_LDFLAGS = -module -export-dynamic -avoid-version -shared @XCCFLAGS@
daq_afpacket_la_LIBADD = $(top_builddir)/sfbpf/libsfbpf.la
-endif
+if BUILD_STATIC_MODULES
libdaq_static_modules_la_SOURCES += daq_afpacket.c
libdaq_static_modules_la_CFLAGS += -DBUILD_AFPACKET_MODULE
endif
+endif
if BUILD_PCAP_MODULE
-if BUILD_SHARED_MODULES
pkglib_LTLIBRARIES += daq_pcap.la
daq_pcap_la_SOURCES = daq_pcap.c
daq_pcap_la_CFLAGS = -DBUILDING_SO
daq_pcap_la_LDFLAGS = -module -export-dynamic -avoid-version -shared @XCCFLAGS@
daq_pcap_la_LIBADD = -lpcap
-endif
+if BUILD_STATIC_MODULES
libdaq_static_modules_la_SOURCES += daq_pcap.c
libdaq_static_modules_la_CFLAGS += -DBUILD_PCAP_MODULE
endif
+endif
if BUILD_DUMP_MODULE
-if BUILD_SHARED_MODULES
pkglib_LTLIBRARIES += daq_dump.la
daq_dump_la_SOURCES = daq_dump.c
daq_dump_la_CFLAGS = -DBUILDING_SO
daq_dump_la_LDFLAGS = -module -export-dynamic -avoid-version -shared @XCCFLAGS@
daq_dump_la_LIBADD = -lpcap
-endif
+if BUILD_STATIC_MODULES
libdaq_static_modules_la_SOURCES += daq_dump.c
libdaq_static_modules_la_CFLAGS += -DBUILD_DUMP_MODULE
endif
+endif
if BUILD_IPFW_MODULE
-if BUILD_SHARED_MODULES
pkglib_LTLIBRARIES += daq_ipfw.la
daq_ipfw_la_SOURCES = daq_ipfw.c
daq_ipfw_la_CFLAGS = -DBUILDING_SO
daq_ipfw_la_LDFLAGS = -module -export-dynamic -avoid-version -shared @XCCFLAGS@
daq_ipfw_la_LIBADD = $(top_builddir)/sfbpf/libsfbpf.la
-endif
+if BUILD_STATIC_MODULES
libdaq_static_modules_la_SOURCES += daq_ipfw.c
libdaq_static_modules_la_CFLAGS += -DBUILD_IPFW_MODULE
endif
+endif
if BUILD_IPQ_MODULE
-if BUILD_SHARED_MODULES
pkglib_LTLIBRARIES += daq_ipq.la
daq_ipq_la_SOURCES = daq_ipq.c
daq_ipq_la_CFLAGS = -DBUILDING_SO
daq_ipq_la_LDFLAGS = -module -export-dynamic -avoid-version -shared @DNET_LDFLAGS@ @XCCFLAGS@
daq_ipq_la_LIBADD = -lipq @DNET_LDFLAGS@ $(top_builddir)/sfbpf/libsfbpf.la
-endif
+if BUILD_STATIC_MODULES
libdaq_static_modules_la_SOURCES += daq_ipq.c
libdaq_static_modules_la_CFLAGS += -DBUILD_IPQ_MODULE
endif
+endif
if BUILD_NFQ_MODULE
-if BUILD_SHARED_MODULES
pkglib_LTLIBRARIES += daq_nfq.la
daq_nfq_la_SOURCES = daq_nfq.c
daq_nfq_la_CFLAGS = -DBUILDING_SO
daq_nfq_la_LDFLAGS = -module -export-dynamic -avoid-version -shared @DNET_LDFLAGS@ @XCCFLAGS@
daq_nfq_la_LIBADD = -lnfnetlink -lnetfilter_queue @DNET_LDFLAGS@ $(top_builddir)/sfbpf/libsfbpf.la
-endif
+if BUILD_STATIC_MODULES
libdaq_static_modules_la_SOURCES += daq_nfq.c
libdaq_static_modules_la_CFLAGS += -DBUILD_NFQ_MODULE
endif
+endif
if BUILD_NETMAP_MODULE
-if BUILD_SHARED_MODULES
pkglib_LTLIBRARIES += daq_netmap.la
daq_netmap_la_SOURCES = daq_netmap.c
daq_netmap_la_CFLAGS = -DBUILDING_SO
daq_netmap_la_LDFLAGS = -module -export-dynamic -avoid-version -shared @XCCFLAGS@
daq_netmap_la_LIBADD = $(top_builddir)/sfbpf/libsfbpf.la
-endif
+if BUILD_STATIC_MODULES
libdaq_static_modules_la_SOURCES += daq_netmap.c
libdaq_static_modules_la_CFLAGS += -DBUILD_NETMAP_MODULE
endif
+endif
AM_CPPFLAGS = -I$(top_srcdir)/api -I$(top_srcdir)/sfbpf -I$(top_builddir)/sfbpf
|