Merge lp:~stewart/pandora-build/pandora-for-playback into lp:pandora-build
- pandora-for-playback
- Merge into devel
Proposed by
Stewart Smith
Status: | Needs review |
---|---|
Proposed branch: | lp:~stewart/pandora-build/pandora-for-playback |
Merge into: | lp:pandora-build |
Diff against target: |
441 lines (+417/-4) 2 files modified
m4/pandora_have_libmysqlclient.m4 (+18/-4) m4/pandora_have_libpcap.m4 (+399/-0) |
To merge this branch: | bzr merge lp:~stewart/pandora-build/pandora-for-playback |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Monty Taylor | Pending | ||
Review via email: mp+113329@code.launchpad.net |
Commit message
Description of the change
some fixups and additons we've needed.
To post a comment you must log in.
Unmerged revisions
- 275. By Stewart Smith
-
fix have_libmysqlcient for when mysql_config isn't a full path.
- 274. By Vlad Lesin
-
Add macros for libpcap.
- 273. By Vlad Lesin
-
Store paths to mysql client library headers, binaries and mysqlconfig in MYSQL_INCLUDES, MYSQL_LIBS, MYSQL_CONFIG variables respectively
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'm4/pandora_have_libmysqlclient.m4' | |||
2 | --- m4/pandora_have_libmysqlclient.m4 2011-10-10 15:48:44 +0000 | |||
3 | +++ m4/pandora_have_libmysqlclient.m4 2012-07-04 04:52:18 +0000 | |||
4 | @@ -30,15 +30,29 @@ | |||
5 | 30 | AC_CACHE_CHECK([for MySQL Base Location],[pandora_cv_mysql_base],[ | 30 | AC_CACHE_CHECK([for MySQL Base Location],[pandora_cv_mysql_base],[ |
6 | 31 | 31 | ||
7 | 32 | dnl option 2: something in MYSQL_CONFIG now, use that to get a base dir | 32 | dnl option 2: something in MYSQL_CONFIG now, use that to get a base dir |
10 | 33 | AS_IF([test -f "${MYSQL_CONFIG}" -a -x "${MYSQL_CONFIG}"],[ | 33 | AS_IF([test -f "`which ${MYSQL_CONFIG}`" -a -x "`which ${MYSQL_CONFIG}`"],[ |
11 | 34 | pandora_cv_mysql_base=$(dirname $(MYSQL_CONFIG --include | sed 's/-I//')) | 34 | pandora_cv_mysql_base=$(dirname $(${MYSQL_CONFIG} --include | sed 's/-I//')) |
12 | 35 | MYSQL_INCLUDES=$(${MYSQL_CONFIG} --include) | ||
13 | 36 | MYSQL_INCLUDES="$MYSQL_INCLUDES $(echo $MYSQL_INCLUDES|sed -e 's/-I/-isystem /')" | ||
14 | 37 | MYSQL_LIBS=$(${MYSQL_CONFIG} --libs_r) | ||
15 | 35 | ],[ | 38 | ],[ |
16 | 36 | dnl option 1: a directory | 39 | dnl option 1: a directory |
19 | 37 | AS_IF([test -d $with_mysql],[pandora_cv_mysql_base=$with_mysql],[ | 40 | AS_IF([test -d $with_mysql], |
20 | 38 | pandora_cv_mysql_base="not found" | 41 | [ |
21 | 42 | pandora_cv_mysql_base=$with_mysql | ||
22 | 43 | IBASE="-I${with_mysql}" | ||
23 | 44 | MYSQL_CONFIG="${with_mysql}/bin/mysql_config" | ||
24 | 45 | MYSQL_INCLUDES="$IBASE/include/mysql -isystem $IBASE/include/mysql" | ||
25 | 46 | MYSQL_LIBS="-L${with_mysql}/lib -L${with_mysql}/lib/mysql -lmysqlclient_r" | ||
26 | 47 | ], | ||
27 | 48 | [ | ||
28 | 49 | pandora_cv_mysql_base="" | ||
29 | 39 | ]) | 50 | ]) |
30 | 40 | ]) | 51 | ]) |
31 | 41 | ]) | 52 | ]) |
32 | 53 | AC_SUBST(MYSQL_CONFIG) | ||
33 | 54 | AC_SUBST(MYSQL_INCLUDES) | ||
34 | 55 | AC_SUBST(MYSQL_LIBS) | ||
35 | 42 | ]) | 56 | ]) |
36 | 43 | 57 | ||
37 | 44 | AC_DEFUN([_PANDORA_SEARCH_LIBMYSQLCLIENT],[ | 58 | AC_DEFUN([_PANDORA_SEARCH_LIBMYSQLCLIENT],[ |
38 | 45 | 59 | ||
39 | === added file 'm4/pandora_have_libpcap.m4' | |||
40 | --- m4/pandora_have_libpcap.m4 1970-01-01 00:00:00 +0000 | |||
41 | +++ m4/pandora_have_libpcap.m4 2012-07-04 04:52:18 +0000 | |||
42 | @@ -0,0 +1,399 @@ | |||
43 | 1 | dnl Macros that test for specific features. | ||
44 | 2 | dnl This file is part of the Autoconf packaging for Wireshark. | ||
45 | 3 | dnl Copyright (C) 1998-2000 by Gerald Combs. | ||
46 | 4 | dnl | ||
47 | 5 | dnl $Id$ | ||
48 | 6 | dnl | ||
49 | 7 | dnl This program is free software; you can redistribute it and/or modify | ||
50 | 8 | dnl it under the terms of the GNU General Public License as published by | ||
51 | 9 | dnl the Free Software Foundation; either version 2, or (at your option) | ||
52 | 10 | dnl any later version. | ||
53 | 11 | dnl | ||
54 | 12 | dnl This program is distributed in the hope that it will be useful, | ||
55 | 13 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
56 | 14 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
57 | 15 | dnl GNU General Public License for more details. | ||
58 | 16 | dnl | ||
59 | 17 | dnl You should have received a copy of the GNU General Public License | ||
60 | 18 | dnl along with this program; if not, write to the Free Software | ||
61 | 19 | dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | ||
62 | 20 | dnl 02111-1307, USA. | ||
63 | 21 | dnl | ||
64 | 22 | dnl As a special exception, the Free Software Foundation gives unlimited | ||
65 | 23 | dnl permission to copy, distribute and modify the configure scripts that | ||
66 | 24 | dnl are the output of Autoconf. You need not follow the terms of the GNU | ||
67 | 25 | dnl General Public License when using or distributing such scripts, even | ||
68 | 26 | dnl though portions of the text of Autoconf appear in them. The GNU | ||
69 | 27 | dnl General Public License (GPL) does govern all other use of the material | ||
70 | 28 | dnl that constitutes the Autoconf program. | ||
71 | 29 | dnl | ||
72 | 30 | dnl Certain portions of the Autoconf source text are designed to be copied | ||
73 | 31 | dnl (in certain cases, depending on the input) into the output of | ||
74 | 32 | dnl Autoconf. We call these the "data" portions. The rest of the Autoconf | ||
75 | 33 | dnl source text consists of comments plus executable code that decides which | ||
76 | 34 | dnl of the data portions to output in any given case. We call these | ||
77 | 35 | dnl comments and executable code the "non-data" portions. Autoconf never | ||
78 | 36 | dnl copies any of the non-data portions into its output. | ||
79 | 37 | dnl | ||
80 | 38 | dnl This special exception to the GPL applies to versions of Autoconf | ||
81 | 39 | dnl released by the Free Software Foundation. When you make and | ||
82 | 40 | dnl distribute a modified version of Autoconf, you may extend this special | ||
83 | 41 | dnl exception to the GPL to apply to your modified version as well, *unless* | ||
84 | 42 | dnl your modified version has the potential to copy into its output some | ||
85 | 43 | dnl of the text that was the non-data portion of the version that you started | ||
86 | 44 | dnl with. (In other words, unless your change moves or copies text from | ||
87 | 45 | dnl the non-data portions to the data portions.) If your modification has | ||
88 | 46 | dnl such potential, you must delete any notice of this special exception | ||
89 | 47 | dnl to the GPL from your modified version. | ||
90 | 48 | dnl | ||
91 | 49 | dnl Written by David MacKenzie, with help from | ||
92 | 50 | dnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, | ||
93 | 51 | dnl Roland McGrath, Noah Friedman, david d zuhn, and many others. | ||
94 | 52 | |||
95 | 53 | # | ||
96 | 54 | # PANDORA_BREAKLOOP_TRY_LINK | ||
97 | 55 | # | ||
98 | 56 | AC_DEFUN([PANDORA_PCAP_BREAKLOOP_TRY_LINK], | ||
99 | 57 | [ | ||
100 | 58 | AC_LINK_IFELSE( | ||
101 | 59 | [ | ||
102 | 60 | AC_LANG_SOURCE( | ||
103 | 61 | [[ | ||
104 | 62 | # include <pcap.h> | ||
105 | 63 | int main(void) | ||
106 | 64 | { | ||
107 | 65 | pcap_t *pct = NULL; | ||
108 | 66 | pcap_breakloop(pct); | ||
109 | 67 | return 0; | ||
110 | 68 | } | ||
111 | 69 | ]]) | ||
112 | 70 | ], | ||
113 | 71 | [ | ||
114 | 72 | ws_breakloop_compiled=yes | ||
115 | 73 | ], | ||
116 | 74 | [ | ||
117 | 75 | ws_breakloop_compiled=no | ||
118 | 76 | ]) | ||
119 | 77 | ]) | ||
120 | 78 | # | ||
121 | 79 | # PANDORA_ADD_DASH_L | ||
122 | 80 | # | ||
123 | 81 | # Add to the variable specified as the first argument a "-L" flag for the | ||
124 | 82 | # directory specified as the second argument, and, on Solaris, add a | ||
125 | 83 | # "-R" flag for it as well. | ||
126 | 84 | # | ||
127 | 85 | # XXX - IRIX, and other OSes, may require some flag equivalent to | ||
128 | 86 | # "-R" here. | ||
129 | 87 | # | ||
130 | 88 | AC_DEFUN([PANDORA_ADD_DASH_L], | ||
131 | 89 | [$1="$$1 -L$2" | ||
132 | 90 | case "$host_os" in | ||
133 | 91 | solaris*) | ||
134 | 92 | $1="$$1 -R$2" | ||
135 | 93 | ;; | ||
136 | 94 | esac | ||
137 | 95 | ]) | ||
138 | 96 | |||
139 | 97 | |||
140 | 98 | # | ||
141 | 99 | # PANDORA_PCAP_CHECK | ||
142 | 100 | # | ||
143 | 101 | AC_DEFUN([PANDORA_HAVE_LIBPCAP], | ||
144 | 102 | [ | ||
145 | 103 | AC_MSG_CHECKING(libpcap) | ||
146 | 104 | |||
147 | 105 | AC_ARG_WITH([libpcap], | ||
148 | 106 | [AS_HELP_STRING([--with-libpcap=PATH], | ||
149 | 107 | [path to libpcap prefix dir])], | ||
150 | 108 | [pcap_dir=$withval], | ||
151 | 109 | ) | ||
152 | 110 | |||
153 | 111 | if test -z "$pcap_dir" | ||
154 | 112 | then | ||
155 | 113 | # Pcap header checks | ||
156 | 114 | # XXX need to set a var AC_CHECK_HEADER(pcap.h,,) | ||
157 | 115 | |||
158 | 116 | # | ||
159 | 117 | # The user didn't specify a directory in which libpcap resides. | ||
160 | 118 | # First, look for a pcap-config script. | ||
161 | 119 | # | ||
162 | 120 | AC_PATH_PROG(PCAP_CONFIG, pcap-config) | ||
163 | 121 | else | ||
164 | 122 | if test -f $pcap_dir/bin/pcap-config -a -x $pcap_dir/bin/pcap-config | ||
165 | 123 | then | ||
166 | 124 | PCAP_CONFIG=$pcap_dir/bin/pcap-config | ||
167 | 125 | fi | ||
168 | 126 | fi | ||
169 | 127 | |||
170 | 128 | if test -n "$PCAP_CONFIG" ; then | ||
171 | 129 | # | ||
172 | 130 | # Found it. | ||
173 | 131 | # | ||
174 | 132 | # Now check whether it's the libpcap 1.0 version, which | ||
175 | 133 | # put a space after "-L" - on some platforms, that doesn't | ||
176 | 134 | # work. | ||
177 | 135 | # | ||
178 | 136 | AC_MSG_CHECKING(for broken pcap-config) | ||
179 | 137 | case `"$PCAP_CONFIG" --libs` in | ||
180 | 138 | |||
181 | 139 | "-L "*) | ||
182 | 140 | # | ||
183 | 141 | # Space after -L. Pretend pcap-config doesn't exist. | ||
184 | 142 | # | ||
185 | 143 | AC_MSG_RESULT(yes) | ||
186 | 144 | PCAP_CONFIG="" | ||
187 | 145 | ;; | ||
188 | 146 | |||
189 | 147 | *) | ||
190 | 148 | # | ||
191 | 149 | # No space after -L. | ||
192 | 150 | # | ||
193 | 151 | AC_MSG_RESULT(no) | ||
194 | 152 | ;; | ||
195 | 153 | esac | ||
196 | 154 | fi | ||
197 | 155 | if test -n "$PCAP_CONFIG" ; then | ||
198 | 156 | # | ||
199 | 157 | # Found it, and it's usable; use it to get the include flags | ||
200 | 158 | # for libpcap. | ||
201 | 159 | # | ||
202 | 160 | PCAP_INCLUDES=`"$PCAP_CONFIG" --cflags` | ||
203 | 161 | else | ||
204 | 162 | if test -d "$pcap_dir" | ||
205 | 163 | then | ||
206 | 164 | PCAP_INCLUDES="-I$pcap_dir/include" | ||
207 | 165 | PANDORA_ADD_DASH_L(PCAP_LIBS, $pcap_dir/lib) | ||
208 | 166 | else | ||
209 | 167 | # | ||
210 | 168 | # Didn't find it; we have to look for libpcap ourselves. | ||
211 | 169 | # We assume that the current library search path will work, | ||
212 | 170 | # but we may have to look for the header in a "pcap" | ||
213 | 171 | # subdirectory of "/usr/include" or "/usr/local/include", | ||
214 | 172 | # as some systems apparently put "pcap.h" in a "pcap" | ||
215 | 173 | # subdirectory, and we also check "$prefix/include" - and | ||
216 | 174 | # "$prefix/include/pcap", in case $prefix is set to | ||
217 | 175 | # "/usr/include" or "/usr/local/include". | ||
218 | 176 | # | ||
219 | 177 | # XXX - should we just add "$prefix/include" to the include | ||
220 | 178 | # search path and "$prefix/lib" to the library search path? | ||
221 | 179 | # | ||
222 | 180 | AC_MSG_CHECKING(for extraneous pcap header directories) | ||
223 | 181 | found_pcap_dir="" | ||
224 | 182 | pcap_dir_list="/usr/include/pcap $prefix/include/pcap $prefix/include" | ||
225 | 183 | if test "x$ac_cv_enable_usr_local" = "xyes" ; then | ||
226 | 184 | pcap_dir_list="$pcap_dir_list /usr/local/include/pcap" | ||
227 | 185 | fi | ||
228 | 186 | for pcap_dir in $pcap_dir_list | ||
229 | 187 | do | ||
230 | 188 | if test -d $pcap_dir ; then | ||
231 | 189 | if test x$pcap_dir != x/usr/include -a x$pcap_dir != x/usr/local/include ; then | ||
232 | 190 | PCAP_INCLUDES="-I$pcap_dir" | ||
233 | 191 | fi | ||
234 | 192 | found_pcap_dir=" $found_pcap_dir -I$pcap_dir" | ||
235 | 193 | break | ||
236 | 194 | fi | ||
237 | 195 | done | ||
238 | 196 | |||
239 | 197 | if test "$found_pcap_dir" != "" ; then | ||
240 | 198 | AC_MSG_RESULT(found --$found_pcap_dir added to CFLAGS) | ||
241 | 199 | else | ||
242 | 200 | AC_MSG_RESULT(not found) | ||
243 | 201 | fi | ||
244 | 202 | fi | ||
245 | 203 | fi | ||
246 | 204 | |||
247 | 205 | ac_CFLAGS_saved=$CFLAGS | ||
248 | 206 | CFLAGS="$PCAP_INCLUDES $CFLAGS" | ||
249 | 207 | ac_CPPFLAGS_saved=$CPPFLAGS | ||
250 | 208 | CPPFLAGS="$PCAP_INCLUDES $CPPFLAGS" | ||
251 | 209 | |||
252 | 210 | # Pcap header check | ||
253 | 211 | AC_CHECK_HEADER(pcap.h,, | ||
254 | 212 | AC_MSG_ERROR([[Header file pcap.h not found; if you installed libpcap | ||
255 | 213 | from source, did you also do \"make install-incl\", and if you installed a | ||
256 | 214 | binary package of libpcap, is there also a developer's package of libpcap, | ||
257 | 215 | and did you also install that package?]])) | ||
258 | 216 | |||
259 | 217 | |||
260 | 218 | if test -n "$PCAP_CONFIG" ; then | ||
261 | 219 | # | ||
262 | 220 | # We have pcap-config; we assume that means we have libpcap | ||
263 | 221 | # installed and that pcap-config will tell us whatever | ||
264 | 222 | # libraries libpcap needs. | ||
265 | 223 | # | ||
266 | 224 | if test x$enable_static = xyes; then | ||
267 | 225 | PCAP_LIBS=`"$PCAP_CONFIG" --libs --static` | ||
268 | 226 | else | ||
269 | 227 | PCAP_LIBS=`"$PCAP_CONFIG" --libs` | ||
270 | 228 | fi | ||
271 | 229 | AC_DEFINE(HAVE_LIBPCAP, 1, [Define to use libpcap library]) | ||
272 | 230 | else | ||
273 | 231 | # | ||
274 | 232 | # Check to see if we find "pcap_open_live" in "-lpcap". | ||
275 | 233 | # Also check for various additional libraries that libpcap might | ||
276 | 234 | # require. | ||
277 | 235 | # | ||
278 | 236 | ac_LDFLAGS_saved=$LDFLAGS | ||
279 | 237 | LDFLAGS="-L${pcap_dir}/lib" | ||
280 | 238 | AC_CHECK_LIB(pcap, pcap_open_live, | ||
281 | 239 | [ | ||
282 | 240 | PCAP_LIBS="-L${pcap_dir}/lib -lpcap" | ||
283 | 241 | AC_DEFINE(HAVE_LIBPCAP, 1, [Define to use libpcap library]) | ||
284 | 242 | ], [ | ||
285 | 243 | ac_wireshark_extras_found=no | ||
286 | 244 | ac_save_LIBS="$LIBS" | ||
287 | 245 | for extras in "-lcfg -lodm" "-lpfring" | ||
288 | 246 | do | ||
289 | 247 | AC_MSG_CHECKING([for pcap_open_live in -lpcap with $extras]) | ||
290 | 248 | LIBS="-lpcap $extras" | ||
291 | 249 | # | ||
292 | 250 | # XXX - can't we use AC_CHECK_LIB here? | ||
293 | 251 | # | ||
294 | 252 | AC_TRY_LINK( | ||
295 | 253 | [ | ||
296 | 254 | # include <pcap.h> | ||
297 | 255 | ], | ||
298 | 256 | [ | ||
299 | 257 | pcap_open_live(NULL, 0, 0, 0, NULL); | ||
300 | 258 | ], | ||
301 | 259 | [ | ||
302 | 260 | ac_wireshark_extras_found=yes | ||
303 | 261 | AC_MSG_RESULT([yes]) | ||
304 | 262 | PCAP_LIBS="-lpcap $extras" | ||
305 | 263 | AC_DEFINE(HAVE_LIBPCAP, 1, [Define to use libpcap library]) | ||
306 | 264 | ], | ||
307 | 265 | [ | ||
308 | 266 | AC_MSG_RESULT([no]) | ||
309 | 267 | ]) | ||
310 | 268 | if test x$ac_wireshark_extras_found = xyes | ||
311 | 269 | then | ||
312 | 270 | break | ||
313 | 271 | fi | ||
314 | 272 | done | ||
315 | 273 | if test x$ac_wireshark_extras_found = xno | ||
316 | 274 | then | ||
317 | 275 | AC_MSG_ERROR([Can't link with library libpcap.]) | ||
318 | 276 | fi | ||
319 | 277 | LIBS=$ac_save_LIBS | ||
320 | 278 | ]) | ||
321 | 279 | LDFLAGS=$ac_LDFLAGS_saved | ||
322 | 280 | fi | ||
323 | 281 | |||
324 | 282 | # | ||
325 | 283 | # Check whether various variables and functions are defined by | ||
326 | 284 | # libpcap. | ||
327 | 285 | # | ||
328 | 286 | ac_save_LIBS="$LIBS" | ||
329 | 287 | LIBS="$PCAP_LIBS $LIBS" | ||
330 | 288 | AC_CHECK_FUNCS(pcap_open_dead pcap_freecode) | ||
331 | 289 | # | ||
332 | 290 | # pcap_breakloop may be present in the library but not declared | ||
333 | 291 | # in the pcap.h header file. If it's not declared in the header | ||
334 | 292 | # file, attempts to use it will get warnings, and, if we're | ||
335 | 293 | # building with warnings treated as errors, that warning will | ||
336 | 294 | # cause compilation to fail. | ||
337 | 295 | # | ||
338 | 296 | # We are therefore first testing whether the function is present | ||
339 | 297 | # and then, if we're compiling with warnings as errors, testing | ||
340 | 298 | # whether it is usable. It is usable if it compiles without | ||
341 | 299 | # a -Wimplicit warning (the "compile with warnings as errors" | ||
342 | 300 | # option requires GCC). If it is not usable, we fail and tell | ||
343 | 301 | # the user that the pcap.h header needs to be updated. | ||
344 | 302 | # | ||
345 | 303 | # Ceteris paribus, this should only happen with Mac OS X 10.3[.x] which | ||
346 | 304 | # can have an up-to-date pcap library without the corresponding pcap | ||
347 | 305 | # header. | ||
348 | 306 | # | ||
349 | 307 | # However, it might also happen on some others OSes with some erroneous | ||
350 | 308 | # system manipulations where multiple versions of libcap might co-exist | ||
351 | 309 | # e.g. hand made symbolic link from libpcap.so -> libpcap.so.0.8 but | ||
352 | 310 | # having the pcap header version 0.7. | ||
353 | 311 | # | ||
354 | 312 | AC_MSG_CHECKING([whether pcap_breakloop is present]) | ||
355 | 313 | CFLAGS="$PCAP_INCLUDES $CFLAGS" | ||
356 | 314 | PANDORA_PCAP_BREAKLOOP_TRY_LINK | ||
357 | 315 | if test "x$ws_breakloop_compiled" = "xyes"; then | ||
358 | 316 | AC_MSG_RESULT(yes) | ||
359 | 317 | AC_DEFINE(HAVE_PCAP_BREAKLOOP, 1, [Define if pcap_breakloop is known]) | ||
360 | 318 | if test "x$with_warnings_as_errors" = "xyes"; then | ||
361 | 319 | AC_MSG_CHECKING([whether pcap_breakloop is usable]) | ||
362 | 320 | CFLAGS="$CFLAGS -Werror -Wimplicit" | ||
363 | 321 | PANDORA_PCAP_BREAKLOOP_TRY_LINK | ||
364 | 322 | if test "x$ws_breakloop_compiled" = "xyes"; then | ||
365 | 323 | AC_MSG_RESULT(yes) | ||
366 | 324 | else | ||
367 | 325 | AC_MSG_RESULT(no) | ||
368 | 326 | AC_MSG_ERROR( | ||
369 | 327 | [Your pcap library is more recent than your pcap header. | ||
370 | 328 | As you are building with compiler warnings treated as errors, Wireshark | ||
371 | 329 | won't be able to use functions not declared in that header. | ||
372 | 330 | If you wish to build with compiler warnings treated as errors, You should | ||
373 | 331 | install a newer version of the header file.]) | ||
374 | 332 | fi | ||
375 | 333 | fi | ||
376 | 334 | else | ||
377 | 335 | AC_MSG_RESULT(no) | ||
378 | 336 | fi | ||
379 | 337 | |||
380 | 338 | # | ||
381 | 339 | # Later versions of Mac OS X 10.3[.x] ship a pcap.h that | ||
382 | 340 | # doesn't define pcap_if_t but ship an 0.8[.x] libpcap, | ||
383 | 341 | # so the library has "pcap_findalldevs()", but pcap.h | ||
384 | 342 | # doesn't define "pcap_if_t" so you can't actually *use* | ||
385 | 343 | # "pcap_findalldevs()". | ||
386 | 344 | # | ||
387 | 345 | # That even appears to be true of systems shipped with | ||
388 | 346 | # 10.3.4, so it doesn't appear only to be a case of | ||
389 | 347 | # Software Update not updating header files. | ||
390 | 348 | # | ||
391 | 349 | # (You can work around this by installing the 0.8 header | ||
392 | 350 | # files.) | ||
393 | 351 | # | ||
394 | 352 | AC_CACHE_CHECK([whether pcap_findalldevs is present and usable], | ||
395 | 353 | [ac_cv_func_pcap_findalldevs], | ||
396 | 354 | [ | ||
397 | 355 | AC_LINK_IFELSE( | ||
398 | 356 | [ | ||
399 | 357 | AC_LANG_SOURCE( | ||
400 | 358 | [[ | ||
401 | 359 | #include <pcap.h> | ||
402 | 360 | main() | ||
403 | 361 | { | ||
404 | 362 | pcap_if_t *devpointer; | ||
405 | 363 | char errbuf[1]; | ||
406 | 364 | |||
407 | 365 | pcap_findalldevs(&devpointer, errbuf); | ||
408 | 366 | } | ||
409 | 367 | ]]) | ||
410 | 368 | ], | ||
411 | 369 | [ | ||
412 | 370 | ac_cv_func_pcap_findalldevs=yes | ||
413 | 371 | ], | ||
414 | 372 | [ | ||
415 | 373 | ac_cv_func_pcap_findalldevs=no | ||
416 | 374 | ]) | ||
417 | 375 | ]) | ||
418 | 376 | # | ||
419 | 377 | # Don't check for other new routines that showed up after | ||
420 | 378 | # "pcap_findalldevs()" if we don't have a usable | ||
421 | 379 | # "pcap_findalldevs()", so we don't end up using them if the | ||
422 | 380 | # "pcap.h" is crufty and old and doesn't declare them. | ||
423 | 381 | # | ||
424 | 382 | if test $ac_cv_func_pcap_findalldevs = "yes" ; then | ||
425 | 383 | AC_DEFINE(HAVE_PCAP_FINDALLDEVS, 1, | ||
426 | 384 | [Define to 1 if you have the `pcap_findalldevs' function and a pcap.h that declares pcap_if_t.]) | ||
427 | 385 | AC_CHECK_FUNCS(pcap_datalink_val_to_name pcap_datalink_name_to_val) | ||
428 | 386 | AC_CHECK_FUNCS(pcap_datalink_val_to_description) | ||
429 | 387 | AC_CHECK_FUNCS(pcap_list_datalinks pcap_set_datalink pcap_lib_version) | ||
430 | 388 | AC_CHECK_FUNCS(pcap_get_selectable_fd pcap_free_datalinks) | ||
431 | 389 | AC_CHECK_FUNCS(pcap_create bpf_image) | ||
432 | 390 | fi | ||
433 | 391 | LIBS="$ac_save_LIBS" | ||
434 | 392 | |||
435 | 393 | CFLAGS=$ac_CFLAGS_saved | ||
436 | 394 | CPPFLAGS=$ac_CPPFLAGS_saved | ||
437 | 395 | |||
438 | 396 | AC_SUBST(PCAP_LIBS) | ||
439 | 397 | AC_SUBST(PCAP_INCLUDES) | ||
440 | 398 | ]) | ||
441 | 399 |