]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/snort/0003-configure.in-convert-AC_RUN_IFELSE-to-AC_CHECK_MEMBE.patch
lrzsz: install symlinks for XMODEM and YMODEM
[coffee/buildroot.git] / package / snort / 0003-configure.in-convert-AC_RUN_IFELSE-to-AC_CHECK_MEMBE.patch
1 From 1ef6bdaeb0463a208a14e5d90646ce337df738fc Mon Sep 17 00:00:00 2001
2 From: Romain Naour <romain.naour@smile.fr>
3 Date: Sun, 1 Apr 2018 15:38:55 +0200
4 Subject: [PATCH] configure.in: convert AC_RUN_IFELSE to AC_CHECK_MEMBERS
5
6 With AC_CHECK_MEMBERS, we don't need to compile and run a test program
7 to check if a daq structure element is defined.
8
9 Also check DAQ_Data_Channel_Params_t with params.flags
10
11 typedef struct _DAQ_Data_Channel_Params_t
12 {
13     unsigned flags;     /* DAQ_DATA_CHANNEL_* flags*/
14     unsigned timeout_ms;/* timeout of the data channel in milliseconds */
15     unsigned length;    /* [Future] length of the data associated with the data channel */
16     uint8_t* data;      /* [Future] opaque data blob to return with the data channel */
17 } DAQ_Data_Channel_Params_t;
18
19 https://github.com/Xiche/libdaq/blob/master/api/daq_common.h
20
21 Signed-off-by: Romain Naour <romain.naour@smile.fr>
22 Cc: Sergio Prado <sergio.prado@e-labworks.com>
23 ---
24  configure.in | 143 +++++++++++++++++------------------------------------------
25  1 file changed, 41 insertions(+), 102 deletions(-)
26
27 diff --git a/configure.in b/configure.in
28 index 938409f..571322b 100644
29 --- a/configure.in
30 +++ b/configure.in
31 @@ -718,17 +718,11 @@ fi
32  AC_CHECK_FUNCS([daq_hup_apply] [daq_acquire_with_meta] [daq_dp_add_dc])
33  
34  AC_MSG_CHECKING([for daq real addresses])
35 -AC_RUN_IFELSE(
36 -[AC_LANG_PROGRAM(
37 -[[
38 -#include <daq.h>
39 -]],
40 -[[
41 -   DAQ_PktHdr_t hdr;
42 -   hdr.n_real_dPort = 0;
43 -]])],
44 -[have_daq_real_addresses="yes"],
45 -[have_daq_real_addresses="no"])
46 +
47 +AC_CHECK_MEMBERS([DAQ_PktHdr_t hdr.n_real_dPort],
48 +    [have_daq_real_addresses="yes"],
49 +    [have_daq_real_addresses="no"],
50 +    [[#include <daq.h>]])
51  AC_MSG_RESULT($have_daq_real_addresses)
52  if test "x$have_daq_real_addresses" = "xyes"; then
53      AC_DEFINE([HAVE_DAQ_REAL_ADDRESSES],[1],
54 @@ -756,17 +750,11 @@ if test "x$ac_cv_func_daq_dp_add_dc" = "xyes"; then
55  fi
56  
57  AC_MSG_CHECKING([for daq address space ID])
58 -AC_RUN_IFELSE(
59 -[AC_LANG_PROGRAM(
60 -[[
61 -#include <daq.h>
62 -]],
63 -[[
64 -   DAQ_PktHdr_t hdr;
65 -   hdr.address_space_id = 0;
66 -]])],
67 -[have_daq_address_space_id="yes"],
68 -[have_daq_address_space_id="no"])
69 +
70 +AC_CHECK_MEMBERS([DAQ_PktHdr_t hdr.address_space_id],
71 +    [have_daq_address_space_id="yes"],
72 +    [have_daq_address_space_id="no"],
73 +    [[#include <daq.h>]])
74  AC_MSG_RESULT($have_daq_address_space_id)
75  if test "x$have_daq_address_space_id" = "xyes"; then
76      AC_DEFINE([HAVE_DAQ_ADDRESS_SPACE_ID],[1],
77 @@ -774,17 +762,10 @@ if test "x$have_daq_address_space_id" = "xyes"; then
78  fi
79  
80  AC_MSG_CHECKING([for daq flow ID])
81 -AC_RUN_IFELSE(
82 -[AC_LANG_PROGRAM(
83 -[[
84 -#include <daq.h>
85 -]],
86 -[[
87 -   DAQ_PktHdr_t hdr;
88 -   hdr.flow_id = 0;
89 -]])],
90 -[have_daq_flow_id="yes"],
91 -[have_daq_flow_id="no"])
92 +AC_CHECK_MEMBERS([DAQ_PktHdr_t hdr.flow_id],
93 +    [have_daq_flow_id="yes"],
94 +    [have_daq_flow_id="no"],
95 +    [[#include <daq.h>]])
96  AC_MSG_RESULT($have_daq_flow_id)
97  if test "x$have_daq_flow_id" = "xyes"; then
98      AC_DEFINE([HAVE_DAQ_FLOW_ID],[1],
99 @@ -792,19 +773,10 @@ if test "x$have_daq_flow_id" = "xyes"; then
100  fi
101  
102  AC_MSG_CHECKING([for daq extended flow modifiers])
103 -AC_RUN_IFELSE(
104 -[AC_LANG_PROGRAM(
105 -[[
106 -#include <daq.h>
107 -]],
108 -[[
109 -   DAQ_ModFlow_t mod;
110 -   mod.type = 0;
111 -   mod.length = 0;
112 -   mod.value = NULL;
113 -]])],
114 -[have_daq_ext_modflow="yes"],
115 -[have_daq_ext_modflow="no"])
116 +AC_CHECK_MEMBERS([DAQ_ModFlow_t mod.type, DAQ_ModFlow_t mod.length, DAQ_ModFlow_t mod.value],
117 +    [have_daq_ext_modflow="yes"],
118 +    [have_daq_ext_modflow="no"],
119 +    [[#include <daq.h>]])
120  AC_MSG_RESULT($have_daq_ext_modflow)
121  if test "x$have_daq_ext_modflow" = "xyes"; then
122      CCONFIGFLAGS="${CCONFIGFLAGS} -DHAVE_DAQ_EXT_MODFLOW"
123 @@ -813,19 +785,11 @@ if test "x$have_daq_ext_modflow" = "xyes"; then
124  fi
125  
126  AC_MSG_CHECKING([for daq query flow])
127 -AC_RUN_IFELSE(
128 -[AC_LANG_PROGRAM(
129 -[[
130 -#include <daq.h>
131 -]],
132 -[[
133 -   DAQ_QueryFlow_t mod;
134 -   mod.type = 0;
135 -   mod.length = 0;
136 -   mod.value = NULL;
137 -]])],
138 -[have_daq_queryflow="yes"],
139 -[have_daq_queryflow="no"])
140 +
141 +AC_CHECK_MEMBERS([DAQ_QueryFlow_t mod.type, DAQ_QueryFlow_t mod.length, DAQ_QueryFlow_t mod.value],
142 +    [have_daq_queryflow="yes"],
143 +    [have_daq_queryflow="no"],
144 +    [[#include <daq.h>]])
145  AC_MSG_RESULT($have_daq_queryflow)
146  if test "x$have_daq_queryflow" = "xyes"; then
147      CCONFIGFLAGS="${CCONFIGFLAGS} -DHAVE_DAQ_QUERYFLOW"
148 @@ -834,16 +798,11 @@ if test "x$have_daq_queryflow" = "xyes"; then
149  fi
150  
151  AC_MSG_CHECKING([for daq data channel flags])
152 -AC_RUN_IFELSE(
153 -[AC_LANG_PROGRAM(
154 -[[
155 -#include <daq.h>
156 -]],
157 -[[
158 -   DAQ_Data_Channel_Params_t params;
159 -]])],
160 -[have_daq_data_channel_flags="yes"],
161 -[have_daq_data_channel_flags="no"])
162 +
163 +AC_CHECK_MEMBERS([DAQ_Data_Channel_Params_t params.flags],
164 +    [have_daq_data_channel_flags="yes"],
165 +    [have_daq_data_channel_flags="no"],
166 +    [[#include <daq.h>]])
167  AC_MSG_RESULT($have_daq_data_channel_flags)
168  if test "x$have_daq_data_channel_flags" = "xyes"; then
169      CCONFIGFLAGS="${CCONFIGFLAGS} -DHAVE_DAQ_DATA_CHANNEL_PARAMS"
170 @@ -852,17 +811,10 @@ if test "x$have_daq_data_channel_flags" = "xyes"; then
171  fi
172  
173  AC_MSG_CHECKING([for separate IP versions on pinhole endpoints])
174 -AC_RUN_IFELSE(
175 -[AC_LANG_PROGRAM(
176 -[[
177 -#include <daq.h>
178 -]],
179 -[[
180 -   DAQ_DP_key_t dpKey;
181 -   dpKey.src_af = 0;
182 -]])],
183 -[have_daq_data_channel_separate_ip_versions="yes"],
184 -[have_daq_data_channel_separate_ip_versions="no"])
185 +AC_CHECK_MEMBERS([DAQ_DP_key_t dpKey.src_af],
186 +    [have_daq_data_channel_separate_ip_versions="yes"],
187 +    [have_daq_data_channel_separate_ip_versions="no"],
188 +    [[#include <daq.h>]])
189  AC_MSG_RESULT($have_daq_data_channel_separate_ip_versions)
190  if test "x$have_daq_data_channel_separate_ip_versions" = "xyes"; then
191      CCONFIGFLAGS="${CCONFIGFLAGS} -DHAVE_DAQ_DATA_CHANNEL_SEPARATE_IP_VERSIONS"
192 @@ -889,17 +841,10 @@ if test "x$have_daq_verdict_retry" = "xyes"; then
193  fi
194  
195  AC_MSG_CHECKING([for daq packet trace])
196 -AC_RUN_IFELSE(
197 -[AC_LANG_PROGRAM(
198 -[[
199 -#include <daq.h>
200 -]],
201 -[[
202 -   DAQ_PktHdr_t hdr;
203 -   hdr.flags = DAQ_PKT_FLAG_TRACE_ENABLED;
204 -]])],
205 -[have_daq_packet_trace="yes"],
206 -[have_daq_packet_trace="no"])
207 +AC_CHECK_MEMBERS([DAQ_PktHdr_t hdr.flags],
208 +    [have_daq_packet_trace="yes"],
209 +    [have_daq_packet_trace="no"],
210 +    [[#include <daq.h>]])
211  AC_MSG_RESULT($have_daq_packet_trace)
212  if test "x$have_daq_packet_trace" = "xyes"; then
213      AC_DEFINE([HAVE_DAQ_PKT_TRACE],[1],
214 @@ -909,17 +854,11 @@ else
215  fi
216  
217  AC_MSG_CHECKING([for daq verdict reason])
218 -AC_RUN_IFELSE(
219 -[AC_LANG_PROGRAM(
220 -[[
221 -#include <daq.h>
222 -]],
223 -[[
224 -   DAQ_ModFlow_t fl;
225 -   fl.type = DAQ_MODFLOW_TYPE_VER_REASON;
226 -]])],
227 -[have_daq_verdict_reason="yes"],
228 -[have_daq_verdict_reason="no"])
229 +
230 +AC_CHECK_MEMBERS([DAQ_ModFlow_t fl.type],
231 +    [have_daq_verdict_reason="yes"],
232 +    [have_daq_verdict_reason="no"],
233 +    [[#include <daq.h>]])
234  AC_MSG_RESULT($have_daq_verdict_reason)
235  if test "x$have_daq_verdict_reason" = "xyes"; then
236      AC_DEFINE([HAVE_DAQ_VERDICT_REASON],[1],
237 -- 
238 2.14.3
239