1
0

configure.ac 65 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075
  1. dnl $Id$
  2. AC_PREREQ([2.69])
  3. dnl Set version info here!
  4. AC_INIT([tcpreplay],[4.5.2],[https://github.com/appneta/tcpreplay/issues],[tcpreplay],[http://tcpreplay.sourceforge.net/])
  5. AC_CONFIG_SRCDIR([src/tcpreplay.c])
  6. AC_CONFIG_HEADERS([src/config.h])
  7. AC_CONFIG_AUX_DIR(config)
  8. AM_MAINTAINER_MODE([enable])
  9. AM_WITH_DMALLOC
  10. dnl People building from GitHub need the same version of Autogen as I'm using
  11. dnl or specify --disable-local-libopts to force using the locally-installed
  12. dnl copy of libopts rather than the source in the `./libopts/` directory.
  13. MAINTAINER_AUTOGEN_VERSION=5.18.16
  14. AC_CONFIG_MACRO_DIR([m4])
  15. TCPREPLAY_VERSION=$PACKAGE_VERSION
  16. dnl Release is only used for the RPM spec file
  17. TCPREPLAY_RELEASE=1
  18. AC_SUBST(TCPREPLAY_VERSION)
  19. AC_SUBST(TCPREPLAY_RELEASE)
  20. dnl Determine OS
  21. AC_CANONICAL_BUILD
  22. AC_CANONICAL_HOST
  23. AC_CANONICAL_TARGET
  24. AC_SUBST(host)
  25. AC_SUBST(build)
  26. AC_SUBST(target)
  27. CROSS_ARCH=
  28. CROSS_LD=
  29. build_arch=$(echo $MACHTYPE | cut -d'-' -f1)
  30. if test "$cross_compiling" = "yes" ; then
  31. CROSS_ARCH="ARCH=$host_cpu"
  32. CROSS_LD="LD=$LD"
  33. fi
  34. AC_SUBST(CROSS_ARCH)
  35. AC_SUBST(CROSS_LD)
  36. dnl ===========================
  37. dnl Check OS X SDK and compiler
  38. dnl ===========================
  39. AC_ARG_WITH([macos-sdk],
  40. [AS_HELP_STRING([--with-macos-sdk=VER],
  41. [Specify the macOS SDK version to use.])]
  42. )
  43. case "$host_os" in
  44. darwin*) # Mac OS X or iOS
  45. # If no --with-macos-sdk option is given, look for the latestq SDK
  46. # The intent is that for "most" Mac-based developers, a suitable
  47. # SDK will be found automatically without any configure options.
  48. # For developers with a current Xcode, the lowest-numbered SDK
  49. # higher than or equal to the minimum required should be found.
  50. # To find a list of available version run `xcodebuild -showsdks`
  51. MULTIARCH=${host_cpu}-${host_os}
  52. unset MACOSX_SDK_PATH
  53. AC_MSG_CHECKING([what macOS compiler to use])
  54. if test -n "$with_macos_sdk"; then
  55. MACOSX_SDK_PATH=$(xcrun --sdk macosx${with_macos_sdk} --show-sdk-path 2> /dev/null)
  56. if test -z "$MACOSX_SDK_PATH" ; then
  57. AC_MSG_ERROR([could not find SDK ${with_macos_sdk} for macos-${MULTIARCH}])
  58. fi
  59. else
  60. MACOSX_SDK_PATH=$(xcrun --show-sdk-path 2> /dev/null)
  61. if test -z "$MACOSX_SDK_PATH" ; then
  62. dnl could not find a default SDK - search likely SDK versions
  63. for _macos_sdk_major in $(seq 15 -1 10); do
  64. for _macos_sdk_minor in $(seq 20 -1 0); do
  65. _macos_sdk_version=$_macos_sdk_major.$_macos_sdk_minor
  66. MACOSX_SDK_PATH=$(xcrun --sdk macosx${_macos_sdk_version} --show-sdk-path 2> /dev/null)
  67. if test -d "$_macos_sdk_path" ; then
  68. break 2
  69. fi
  70. done
  71. done
  72. dnl could not find a default SDK - search disk for the latest SDK
  73. if test -z "$MACOSX_SDK_PATH"; then
  74. for _macos_sdk_major in $(seq 15 -1 10); do
  75. for _macos_sdk_minor in $(seq 20 -1 0); do
  76. _macos_sdk_version=$_macos_sdk_major.$_macos_sdk_minor
  77. MACOSX_SDK_PATH=$(xcode-select -print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${_macos_sdk_version}.sdk
  78. if test -d "$MACOSX_SDK_PATH"; then
  79. break 2
  80. fi
  81. MACOSX_SDK_PATH=$(xcode-select -print-path)/SDKs/MacOSX${_macos_sdk_version}.sdk
  82. if test -d "$MACOSX_SDK_PATH"; then
  83. break 2
  84. fi
  85. done
  86. done
  87. fi
  88. fi
  89. fi
  90. if test -d "$MACOSX_SDK_PATH"; then
  91. CC="$(xcrun -find clang) -m64 -isysroot $MACOSX_SDK_PATH"
  92. INSTALL_NAME_TOOL=$(xcrun -find install_name_tool)
  93. AR=$(xcrun -find ar)
  94. NM=$(xcrun -find nm)
  95. STRIP=$(xcrun -find strip)
  96. LIBTOOL=$(xcrun -find libtool)
  97. RANLIB=$(xcrun -find ranlib)
  98. AC_MSG_RESULT([${MACOSX_SDK_PATH}])
  99. else
  100. AC_MSG_RESULT([legacy])
  101. fi
  102. ;;
  103. Linux*)
  104. dnl ============================================
  105. dnl Some libraries are in /usr/lib/i386-linux-gnu
  106. dnl but host is i686-linux-gnu
  107. dnl ============================================
  108. MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH) 2> /dev/null || ${host_cpu}-${host_os}
  109. ;;
  110. *)
  111. MULTIARCH=${host_cpu}-${host_os}
  112. ;;
  113. esac
  114. AC_SUBST(MACOSX_SDK_PATH)
  115. AC_SUBST(LIBTOOL) # Note that the OS X libtool command is unrelated to GNU libtool
  116. dnl ============================================
  117. dnl PF_RING library option
  118. dnl ============================================
  119. AC_ARG_WITH(pfring-lib,
  120. AS_HELP_STRING([--with-pfring-lib],
  121. [Use a specific PF_RING static library when using PF_RING libpcap.])
  122. [
  123. Usage: --with-pfring-lib=<library>
  124. e. g.: --with-pfring-lib=/usr/lib/libpfring_zc_x86_64.a
  125. ],
  126. ,)
  127. have_cygwin=no
  128. AC_MSG_CHECKING([for cygwin development environment])
  129. if test $(echo $target | grep -c cygwin) -gt 0 ; then
  130. AC_DEFINE([HAVE_WIN32], [1], [Windows/Cygwin])
  131. AC_MSG_RESULT(yes)
  132. have_cygwin=yes
  133. else
  134. AC_MSG_RESULT(no)
  135. fi
  136. AM_INIT_AUTOMAKE([1.15 foreign subdir-objects -Wall -Wno-override])
  137. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  138. dnl Checks for programs.
  139. AM_PROG_AR
  140. AC_PROG_INSTALL
  141. LT_INIT
  142. AC_PROG_CC
  143. AC_PROG_CXX
  144. AC_PROG_CPP
  145. AC_PROG_LN_S
  146. LT_INIT
  147. AC_PROG_AWK
  148. AC_PROG_SED
  149. AC_PROG_MAKE_SET
  150. AC_EXEEXT
  151. AC_PATH_PROG(PRINTF, printf)
  152. AC_PATH_PROG(ECHO, echo)
  153. AC_PATH_PROG(CUT, cut)
  154. AC_PATH_PROG(AUTOGEN, autogen)
  155. AC_PATH_PROG(GROFF, groff)
  156. AC_PATH_PROG(depmod, depmod, /sbin/depmod, $PATH:/sbin)
  157. AC_PATH_PROG(insmod, insmod, /sbin/insmod, $PATH:/sbin)
  158. AC_PATH_PROG(rmmod, rmmod, /sbin/rmmod, $PATH:/sbin)
  159. dnl tcpreplay has (so far) been relying on leading-edge autogen.
  160. dnl Therefore, by default:
  161. dnl - use the version we ship with
  162. dnl - do not install it
  163. dnl - build a static copy (AC_DISABLE_SHARED - implicitly done earlier)
  164. case "${enable_local_libopts+set}" in
  165. set) ;;
  166. *) enable_local_libopts=yes ;;
  167. esac
  168. case "${enable_libopts_install+set}" in
  169. set) ;;
  170. *) enable_libopts_install=no ;;
  171. esac
  172. dnl check autogen version
  173. AUTOGEN_VERSION="unknown - man pages will not be built"
  174. if test -n "${AUTOGEN}" ; then
  175. AC_MSG_CHECKING(for autogen version >= ${MAINTAINER_AUTOGEN_VERSION})
  176. AUTOGEN_VERSION=$(${AUTOGEN} -v | ${CUT} -d' ' -f 4)
  177. AUTOGEN_MAJOR=$(echo ${AUTOGEN_VERSION} | ${CUT} -d '.' -f 1)
  178. AUTOGEN_MINOR=$(echo ${AUTOGEN_VERSION} | ${CUT} -d '.' -f 2)
  179. AUTOGEN_BUILD=$(echo ${AUTOGEN_VERSION} | ${CUT} -d '.' -f 3)
  180. if test -z "$AUTOGEN_BUILD"; then
  181. AUTOGEN_BUILD=0
  182. fi
  183. if (test ${AUTOGEN_MAJOR} -eq 5 && test ${AUTOGEN_MINOR} -eq 18 && test ${AUTOGEN_BUILD} -lt 4) ||
  184. (test ${AUTOGEN_MAJOR} -eq 5 && test ${AUTOGEN_MINOR} -lt 18) ||
  185. test ${AUTOGEN_MAJOR} -lt 5 ; then
  186. AC_MSG_RESULT(no)
  187. if test ! "x$enable_local_libopts" = "xyes"; then
  188. AC_MSG_ERROR([${AUTOGEN} is too old (${AUTOGEN_VERSION}) for building from source code. Upgrade to 5.18.4 or higher])
  189. fi
  190. AUTOGEN_VERSION="${AUTOGEN_VERSION} - downlevel"
  191. else
  192. AC_MSG_RESULT(yes)
  193. fi
  194. dnl Compare the installed version with the maintainer version if building from GitHub and not using system libopts
  195. if test ! -f src/tcpreplay_opts.c && test "x$enable_local_libopts" = "xyes" ; then
  196. if test $MAINTAINER_AUTOGEN_VERSION != $AUTOGEN_VERSION ; then
  197. AC_MSG_ERROR([Your version of autogen ($AUTOGEN_VERSION) != libopts tear off ($MAINTAINER_AUTOGEN_VERSION) Either install the correct version or specify --disable-local-libopts])
  198. fi
  199. fi
  200. else
  201. if test ! -f src/tcpreplay_opts.c ; then
  202. AC_MSG_ERROR([Please install GNU autogen $MAINTAINER_AUTOGEN_VERSION or higher if you are building from GitHub. To avoid this message download source from https://github.com/appneta/tcpreplay/releases/latest])
  203. fi
  204. fi
  205. AC_DEFINE([AUTOGEN_VERSION], [${AUTOGEN_VERSION}], [What version of autogen is installed on this system])
  206. if test "x$enable_local_libopts" = "xyes" ; then
  207. AC_MSG_NOTICE([Using included libopts tearoff])
  208. else
  209. AC_MSG_NOTICE([Using system libopts])
  210. fi
  211. AC_PROG_EGREP
  212. AC_HEADER_MAJOR
  213. dnl Checks for typedefs, structures, and compiler characteristics.
  214. AC_CHECK_HEADER_STDBOOL
  215. AC_C_INLINE
  216. AC_TYPE_INT16_T
  217. AC_TYPE_INT32_T
  218. AC_TYPE_INT64_T
  219. AC_TYPE_INT8_T
  220. AC_TYPE_OFF_T
  221. AC_TYPE_PID_T
  222. AC_TYPE_SIZE_T
  223. AC_TYPE_SSIZE_T
  224. AC_TYPE_UINT16_T
  225. AC_TYPE_UINT32_T
  226. AC_TYPE_UINT64_T
  227. AC_TYPE_UINT8_T
  228. AC_CHECK_HEADERS_ONCE([sys/time.h])
  229. AC_C_CONST
  230. AC_C_INLINE
  231. AC_SYS_LARGEFILE
  232. dnl Check for functions
  233. AC_FUNC_FSEEKO
  234. dnl Check for types.
  235. AC_CHECK_TYPE(u_int8_t, uint8_t)
  236. AC_CHECK_TYPE(u_char, uint8_t)
  237. AC_CHECK_TYPE(u_int16_t, uint16_t)
  238. AC_CHECK_TYPE(u_short, uint16_t)
  239. AC_CHECK_TYPE(u_int, uint32_t)
  240. AC_CHECK_TYPE(u_int32_t, uint32_t)
  241. AC_CHECK_TYPE(u_int64_t, uint64_t)
  242. # required by C23 standard
  243. CFLAGS="-D_DEFAULT_SOURCE $CFLAGS"
  244. dnl OS X SDK 10.11 throws lots of unnecessary macro warnings
  245. wno_format=""
  246. wno_macro_redefined=""
  247. case $host in
  248. *-apple-darwin*)
  249. AC_MSG_CHECKING(for $CC -Wno-macro-redefined)
  250. OLD_CFLAGS=$CFLAGS
  251. CFLAGS="$CFLAGS -Wno-macro-redefined -Werror"
  252. AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
  253. int main(int argc, char *argv[]) { return(0); }]])],
  254. [ AC_MSG_RESULT(yes)
  255. wno_macro_redefined="-Wno-macro-redefined" ],
  256. [ AC_MSG_RESULT(no) ])
  257. AC_MSG_CHECKING(for $CC -Wno-format)
  258. CFLAGS="$OLD_CFLAGS $wno_macro_redefined"
  259. CFLAGS="$CFLAGS -Wno-format -Werror"
  260. AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
  261. int main(int argc, char *argv[]) { return(0); }]])],
  262. [ AC_MSG_RESULT(yes)
  263. wno_format="-Wno-format" ],
  264. [ AC_MSG_RESULT(no) ])
  265. CFLAGS="$OLD_CFLAGS $wno_format"
  266. ;;
  267. esac
  268. dnl Older versions of GCC don't support these options
  269. AC_MSG_CHECKING(for $CC -Wextra support)
  270. OLD_CFLAGS=$CFLAGS
  271. CFLAGS="$CFLAGS -Wextra -Werror"
  272. wextra=""
  273. AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
  274. int main(int argc, char *argv[]) { return(0); }]])],
  275. [ AC_MSG_RESULT(yes)
  276. wextra="-Wextra" ],
  277. [ AC_MSG_RESULT(no) ])
  278. CFLAGS="$OLD_CFLAGS $wextra"
  279. AC_MSG_CHECKING(for $CC -Wno-variadic-macros support)
  280. OLD_CFLAGS=$CFLAGS
  281. CFLAGS="$CFLAGS -Wno-variadic-macros -Werror"
  282. wno_variadic_macros=""
  283. AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
  284. int main(int argc, char *argv[]) { return(0); }]])],
  285. [ AC_MSG_RESULT(yes)
  286. wno_variadic_macros="-Wno-variadic-macros" ],
  287. [ AC_MSG_RESULT(no) ])
  288. CFLAGS="$OLD_CFLAGS $wno_variadic_macros"
  289. AC_MSG_CHECKING(for $CC -Wfatal-errors support)
  290. OLD_CFLAGS=$CFLAGS
  291. CFLAGS="$CFLAGS -Wfatal-errors -Werror"
  292. wfatal_errors=""
  293. AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
  294. int main(int argc, char *argv[]) { return(0); }]])],
  295. [ AC_MSG_RESULT(yes)
  296. wfatal_errors="-Wfatal-errors" ],
  297. [ AC_MSG_RESULT(no) ])
  298. CFLAGS="$OLD_CFLAGS $wfatal_errors"
  299. AC_MSG_CHECKING(for $CC -Wno-format-contains-nul support)
  300. OLD_CFLAGS=$CFLAGS
  301. CFLAGS="$CFLAGS -Wno-format-contains-nul -Werror"
  302. wno_format_contains_nul=""
  303. AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
  304. int main(int argc, char *argv[]) { return(0); }]])],
  305. [ AC_MSG_RESULT(yes)
  306. wno_format_contains_nul="-Wno-format-contains-nul" ],
  307. [ AC_MSG_RESULT(no) ])
  308. CFLAGS="$OLD_CFLAGS $wno_format_contains_nul"
  309. dnl Check for other header files
  310. AC_CHECK_HEADERS([fcntl.h stddef.h sys/socket.h arpa/inet.h sys/time.h])
  311. AC_CHECK_HEADERS([signal.h string.h strings.h sys/types.h stdint.h sys/select.h])
  312. AC_CHECK_HEADERS([netinet/in.h netinet/in_systm.h poll.h sys/poll.h unistd.h sys/param.h])
  313. AC_CHECK_HEADERS([inttypes.h libintl.h sys/file.h sys/ioctl.h sys/systeminfo.h])
  314. AC_CHECK_HEADERS([sys/io.h architecture/i386/pio.h sched.h fts.h])
  315. AC_HEADER_STDBOOL
  316. dnl OpenBSD has special requirements
  317. AC_CHECK_HEADERS([sys/sysctl.h net/route.h], [], [], [
  318. [#if HAVE_SYS_PARAM_H
  319. #include <sys/param.h>
  320. #endif
  321. #if HAVE_SYS_TYPES_H
  322. #include <sys/types.h>
  323. #endif
  324. #if HAVE_SYS_SOCKET_H
  325. #include <sys/socket.h>
  326. #endif
  327. ]])
  328. dnl Checks for libraries.
  329. AC_CHECK_LIB(socket, socket)
  330. AC_CHECK_LIB(nsl, gethostbyname)
  331. AC_CHECK_LIB(rt, nanosleep)
  332. AC_CHECK_LIB(resolv, resolv)
  333. dnl Checks for library functions.
  334. AC_FUNC_FORK
  335. AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
  336. AC_FUNC_MEMCMP
  337. AC_FUNC_VPRINTF
  338. AC_FUNC_MKTIME
  339. AC_FUNC_MMAP
  340. AC_CHECK_MEMBERS([struct timeval.tv_sec])
  341. AC_CHECK_FUNCS([alarm atexit bzero dup2 gethostbyname getpagesize gettimeofday])
  342. AC_CHECK_FUNCS([ctime inet_ntoa memmove memset munmap pow putenv realpath])
  343. AC_CHECK_FUNCS([regcomp strdup select socket strcasecmp strchr strcspn strdup])
  344. AC_CHECK_FUNCS([strerror strtol strncpy strtoull poll ntohll mmap snprintf])
  345. AC_CHECK_FUNCS([vsnprintf strsignal strpbrk strrchr strspn strstr strtoul])
  346. AC_CHECK_FUNCS([ioperm])
  347. dnl Look for strlcpy since some BSD's have it
  348. AC_CHECK_FUNCS([strlcpy],have_strlcpy=true,have_strlcpy=false)
  349. AM_CONDITIONAL(SYSTEM_STRLCPY, [test x$have_strlcpy = xtrue])
  350. AC_C_BIGENDIAN
  351. AM_CONDITIONAL([WORDS_BIGENDIAN], [ test x$ac_cv_c_bigendian = xyes ])
  352. AC_ARG_ENABLE([asan],
  353. AS_HELP_STRING([--enable-asan],[Enable Address Sanitizer support]))
  354. if test "x$enable_asan" = "xyes"; then
  355. build_asan=yes
  356. AC_CHECK_LIB([asan], [__asan_report_error], ,
  357. [AC_MSG_ERROR([libasan.so not found, this is required for --enable-asan])])
  358. CFLAGS="${CFLAGS} -O1 -g -fsanitize=address -fno-omit-frame-pointer"
  359. dnl -lasan always need to be the first library
  360. LDFLAGS="-fsanitize=address ${LDFLAGS}"
  361. else
  362. build_asan=no
  363. fi
  364. AC_SUBST(build_asan)
  365. AC_ARG_ENABLE([tsan],
  366. AS_HELP_STRING([--enable-tsan],[Enable Thread Sanitizer support]))
  367. if test "x$enable_tsan" = "xyes"; then
  368. build_tsan=yes
  369. CFLAGS="${CFLAGS} -O1 -g -fsanitize=thread -fno-omit-frame-pointer"
  370. dnl -ltsan always need to be the first library
  371. LDFLAGS="-fsanitize=thread ${LDFLAGS}"
  372. else
  373. build_tsan=no
  374. fi
  375. AC_SUBST(build_tsan)
  376. if test "$build_asan" = "yes" -a "$build_tsan" = "yes" ; then
  377. AC_MSG_ERROR([--enable-asan and --eanble-tsan are mutually exclusive])
  378. fi
  379. dnl Enable debugging in code/compiler options
  380. debug=no
  381. debug_flag=NDEBUG
  382. debug_run_time_flag=
  383. AC_ARG_ENABLE(debug,
  384. AS_HELP_STRING([--enable-debug],[Enable debugging code and support for the -d option]),
  385. [ if test x$enableval = xyes; then
  386. debug=yes
  387. dnl replace '-0X' and add '-g' flags
  388. changequote({,})
  389. CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9s]*//g'`
  390. changequote([,])
  391. CFLAGS="${CFLAGS} -g -O0 -Wall $wextra $wfatal_errors $wno_variadic_macros $wno_format_contains_nul $wno_format"
  392. # We may also want to add:
  393. # -Wformat-security -Wswitch-default -Wunused-paramter -Wpadded"
  394. debug_flag=DEBUG
  395. debug_run_time_flag=--dbug=1
  396. AC_DEFINE([DEBUG], [1], [Enable debugging code and support for the -d option])
  397. fi])
  398. AC_SUBST(debug_flag)
  399. AC_SUBST(debug_run_time_flag)
  400. dnl Enable extra debugging in code/compiler options - may slow down performance
  401. extra_debug=no
  402. extra_debug_flag=NEXTRA_DBUG
  403. AC_ARG_ENABLE(extra-debug,
  404. AS_HELP_STRING([--enable-extra-debug],[Enable additional debugging code (may affect performance)]),
  405. [ if test x$enableval = xyes; then
  406. extra_debug=yes
  407. extra_debug_flag=EXTRA_DEBUG
  408. AC_DEFINE([EXTRA_DEBUG], [1], [Enable additional debugging code (may affect performance)])
  409. fi])
  410. AC_SUBST(extra_debug_flag)
  411. dnl Enable timestamp_trace in code/compiler options
  412. timestamp_trace=no
  413. AC_ARG_ENABLE(timestamp-trace,
  414. AS_HELP_STRING([--timestamp-trace],[Enable dumping of trace timestamps at the end of a test]),
  415. [ if test x$enableval = xyes; then
  416. timestamp_trace=yes
  417. CFLAGS="${CFLAGS} -DTIMESTAMP_TRACE"
  418. AC_DEFINE([TIMESTAMP_TRACE], [1], [Enable dumping of trace timestamps at the end of a test])
  419. fi])
  420. AC_SUBST(timestamp_trace_flag)
  421. AC_ARG_ENABLE(dmalloc,
  422. AS_HELP_STRING([--enable-dmalloc],[Enable linking to dmalloc for better memory debugging]),
  423. [ if test x$enableval = xyes ; then
  424. dmalloc=yes
  425. AC_DEFINE([ENABLE_DMALLOC], [1], [Enable dmalloc])
  426. AC_DEFINE([DMALLOC_FUNC_CHECK], [1], [Enable dmalloc function arg checking])
  427. CFLAGS="${CFLAGS} -I/opt/local/include"
  428. DMALLOC_LIB="/opt/local/lib/libdmalloc.a"
  429. AC_SUBST(DMALLOC_LIB)
  430. fi])
  431. AC_ARG_ENABLE(pedantic,
  432. AS_HELP_STRING([--enable-pedantic],[Enable gcc's -pedantic option]),
  433. [ if test x$enableval = xyes; then
  434. CFLAGS="$CFLAGS -pedantic"
  435. fi ])
  436. dnl Enable Efense
  437. AC_ARG_ENABLE(efence,
  438. AS_HELP_STRING([--enable-efence],[Enable Electric Fence memory debugger]),
  439. [ if test x$enableval = xyes; then
  440. CFLAGS="$CFLAGS -lefence"
  441. AC_DEFINE([EFENCE], [1], [Enable Electric Fence memory debugger])
  442. fi])
  443. dnl Enable Gprof
  444. AC_ARG_ENABLE(gprof,
  445. AS_HELP_STRING([--enable-gprof],[Enable GNU Profiler]),
  446. [ if test x$enableval = xyes; then
  447. if test $debug = yes; then
  448. CFLAGS="$CFLAGS -pg"
  449. else
  450. # GPROF requires gdb
  451. CFLAGS="$CFLAGS -ggdb -pg -fprofile-arcs"
  452. fi
  453. AC_DEFINE([GPROF], [1], [Enable GNU Profiler])
  454. fi])
  455. dnl Enable libpcap auto discovery via pcap-config
  456. enable_pcap_config=no
  457. AC_ARG_ENABLE(pcapconfig,
  458. AS_HELP_STRING([--enable-pcapconfig],[Enable automatic libpcap config, reverting to system scanning]),
  459. [
  460. if test $enableval = yes; then
  461. enable_pcap_config=yes
  462. AC_MSG_NOTICE([Enabling libpcap discovery via pcap_config])
  463. else
  464. enable_pcap_config=no
  465. AC_MSG_NOTICE([Disabling libpcap discovery via pcap_config])
  466. fi
  467. ],
  468. [
  469. AC_MSG_NOTICE([Bypassing libpcap discovery via pcap_config])
  470. ])
  471. dnl Use 64bits for packet counters
  472. use64bit_counters=yes
  473. AC_ARG_ENABLE(64bits,
  474. AS_HELP_STRING([--disable-64bits],[Do not use 64bit packet counters]),
  475. [
  476. AC_MSG_NOTICE([Using u_int32_t for packet counters])
  477. ],
  478. [
  479. AC_DEFINE([ENABLE_64BITS], [1], [Use 64bit packet counters])
  480. AC_MSG_NOTICE([Using u_int64_t for packet counters])
  481. ])
  482. # If we're running gcc add '-D_U_="__attribute__((unused))"' to CFLAGS as well,
  483. # so we can use _U_ to flag unused function arguments and not get warnings
  484. # about them. Otherwise, add '-D_U_=""', so that _U_ used to flag an unused
  485. # function argument will compile with non-GCC compilers.
  486. #
  487. if test "x$GCC" = "xyes" ; then
  488. CFLAGS="-D_U_=\"__attribute__((unused))\" $CFLAGS"
  489. else
  490. CFLAGS="-D_U_=\"\" $CFLAGS"
  491. fi
  492. AC_ARG_ENABLE(force-bpf,
  493. AS_HELP_STRING([--enable-force-bpf],[Force using BPF for sending packets]),
  494. [ AC_DEFINE([FORCE_INJECT_BPF], [1], [Force using BPF for sending packet])])
  495. AC_ARG_ENABLE(force-pf,
  496. AS_HELP_STRING([--enable-force-pf],[Force using Linux's PF_PACKET for sending packets]),
  497. [ AC_DEFINE([FORCE_INJECT_PF], [1], [Force using Linux's PF_PACKET for sending packets])])
  498. AC_ARG_ENABLE(force-libdnet,
  499. AS_HELP_STRING([--enable-force-libdnet],[Force using libdnet for sending packets]),
  500. [ AC_DEFINE([FORCE_INJECT_LIBDNET], [1], [Force using libdnet for sending packets])])
  501. AC_ARG_ENABLE(force-libxdp,
  502. AS_HELP_STRING([--enable-force-libxdp],[Force using libxdp for sending packets]),
  503. [ AC_DEFINE([FORCE_INJECT_LIBXDP], [1], [Force using libxdp for sending packets])])
  504. AC_ARG_ENABLE(force-inject,
  505. AS_HELP_STRING([--enable-force-inject],[Force using libpcap's pcap_inject() for sending packets]),
  506. [ AC_DEFINE([FORCE_INJECT_PCAP_INJECT],[1], [Force using libpcap's pcap_inject() for sending packets])])
  507. AC_ARG_ENABLE(force-sendpacket,
  508. AS_HELP_STRING([--enable-force-sendpacket],[Force using libpcap's pcap_sendpacket() for sending packets]),
  509. [ AC_DEFINE([FORCE_INJECT_PCAP_SENDPACKET], [1], [Force using libpcap's pcap_sendpacket() for sending packets])])
  510. dnl Static link libraries
  511. static_link=no
  512. dynamic_link=yes
  513. AC_ARG_ENABLE(static-link,
  514. AS_HELP_STRING([--enable-static-link],[Use static libraries ( .a or .A.tbd ) - default no]),
  515. [
  516. if test $enableval = yes; then
  517. static_link=yes
  518. dynamic_link=no
  519. fi
  520. ])
  521. dnl Dynamic link libraries
  522. AC_ARG_ENABLE(dynamic-link,
  523. AS_HELP_STRING([--enable-dynamic-link],[Use shared libraries ( .so .dylib or .tbd ) - default yes]),
  524. [
  525. if test $enableval = no; then
  526. dynamic_link=no
  527. static_link=yes
  528. elif test $static_link = yes; then
  529. AC_MSG_ERROR([Cannot specify both --enable-dynamic-link and --enable-static-link])
  530. fi
  531. ])
  532. if test $static_link = yes; then
  533. AC_DEFINE([ENABLE_STATIC_LINK], [1], [Use static libraries ( .a or .A.tbd )])
  534. else
  535. AC_DEFINE([ENABLE_DYNAMIC_LINK], [1], [Use shared libraries ( .so .dylib or .tbd )])
  536. fi
  537. dnl Check for inet_aton and inet_pton
  538. dnl On Haiku these functions are in libnetwork.
  539. AC_CHECK_FUNC(inet_aton,
  540. AC_DEFINE([HAVE_INET_ATON], [1], [Do we have inet_aton?])
  541. inet_aton=yes,
  542. [
  543. AC_CHECK_LIB(network, inet_aton,
  544. AC_DEFINE([HAVE_INET_ATON], [1], [Do we have inet_aton?])
  545. use_libnetwork=yes,
  546. [inet_aton=no]
  547. )
  548. ]
  549. )
  550. AC_CHECK_FUNC(inet_pton,
  551. AC_DEFINE([HAVE_INET_PTON], [1], [Do we have inet_pton?])
  552. inet_pton=yes,
  553. [
  554. AC_CHECK_LIB(network, inet_pton,
  555. AC_DEFINE([HAVE_INET_PTON], [1], [Do we have inet_pton?])
  556. use_libnetwork=yes,
  557. [inet_pton=no]
  558. )
  559. ]
  560. )
  561. AC_CHECK_FUNC(inet_ntop,
  562. AC_DEFINE([HAVE_INET_NTOP], [1], [Do we have inet_ntop?])
  563. inet_ntop=yes,
  564. [
  565. AC_CHECK_LIB(network, inet_ntop,
  566. AC_DEFINE([HAVE_INET_NTOP], [1], [Do we have inet_ntop?])
  567. use_libnetwork=yes,
  568. [inet_ntop=no]
  569. )
  570. ]
  571. )
  572. if test "$inet_ntop" = "no" -a "$inet_pton" = "no" ; then
  573. AC_MSG_ERROR([We need either inet_ntop or inet_pton])
  574. fi
  575. if test "$use_libnetwork" = "yes" ; then
  576. LIBS="-lnetwork $LIBS"
  577. fi
  578. AC_CHECK_FUNC(inet_addr,
  579. AC_DEFINE([HAVE_INET_ADDR], [1], [Do we have inet_addr?])
  580. inet_addr=yes,
  581. inet_addr=no)
  582. if test x$inet_addr = xno ; then
  583. AC_MSG_ERROR([We need inet_addr. See bug 26])
  584. fi
  585. dnl On Haiku fts_*() functions are in libbsd.
  586. AC_CHECK_FUNC(fts_read,,[AC_CHECK_LIB(bsd, fts_read)])
  587. dnl #####################################################
  588. dnl Checks for tuntap device support
  589. dnl #####################################################
  590. have_tuntap=no
  591. AC_ARG_ENABLE([tuntap],
  592. AS_HELP_STRING([--disable-tuntap], [Disable tuntap support]), [:],
  593. [case "$build_os" in
  594. linux*)
  595. AC_CHECK_HEADER([linux/if_tun.h], [have_tuntap=yes])
  596. ;;
  597. *)
  598. AC_CHECK_HEADER([net/if_tun.h], [have_tuntap=yes])
  599. ;;
  600. esac])
  601. if test $have_tuntap = yes ; then
  602. AC_DEFINE([HAVE_TUNTAP], [1],
  603. [Do we have TUNTAP device support?])
  604. fi
  605. dnl #####################################################
  606. dnl Checks for libpcap
  607. dnl #####################################################
  608. foundpcap=no
  609. pf_ring_found=no
  610. pf_ring_lib=${with_pfring_lib}
  611. using_pcap_config=no
  612. AC_MSG_CHECKING(for libpcap)
  613. AC_ARG_WITH(libpcap,
  614. AS_HELP_STRING([--with-libpcap=DIR],[Use libpcap in DIR]),
  615. [
  616. testdir=$withval
  617. for incl in ${testdir}/include/pcap.h ${testdir}/pcap.h ${testdir}/pcap/pcap.h; do
  618. if ! test -f "${incl}"; then
  619. continue
  620. fi
  621. LPCAPINC=${incl}
  622. LPCAPINCDIR=${testdir}
  623. if test $dynamic_link = yes; then
  624. for ext in .dylib .so .tbd ; do
  625. for dir in . lib lib64 lib32 lib/${host_cpu}-${host_os} ${host_cpu}-${host_os} lib/${MULTIARCH} ${MULTIARCH}; do
  626. sharefile=$(ls ${testdir}/$dir/libpcap${ext}* 2> /dev/null | sort | head -n1)
  627. if test -n "${sharefile}"; then
  628. LPCAP_LD_LIBRARY_PATH="$(dirname ${sharefile})"
  629. LPCAPLIB="-L$LPCAP_LD_LIBRARY_PATH -lpcap"
  630. foundpcap=$testdir
  631. break 2
  632. fi
  633. done
  634. done
  635. else
  636. dnl
  637. dnl If dynamic library not found, try static
  638. dnl
  639. for ext in ${libext} .a .A.tbd ; do
  640. for dir in . lib lib64 lib32 lib/${host_cpu}-${host_os} ${host_cpu}-${host_os} lib/${MULTIARCH} ${MULTIARCH}; do
  641. staticfile=$(ls ${testdir}/$dir/libpcap${ext} 2> /dev/null | sort | head -n1)
  642. if test -n "${staticfile}"; then
  643. LPCAPLIB="${staticfile}"
  644. foundpcap=${testdir}
  645. break 2
  646. fi
  647. done
  648. done
  649. fi
  650. if test $foundpcap = no; then
  651. AC_MSG_ERROR("Unable to find matching library for header file in ${testdir}")
  652. fi
  653. break
  654. done
  655. ],[
  656. #
  657. # Look for pcap-config.
  658. #
  659. # I wish this option could be the default, but it is only enabled with --enable-pcapconfig
  660. #
  661. # The issue is that libpcap is one of those libraries that is nearly impossible to set up
  662. # properly across all platforms. The 'pcap-config' script is shipped with new versions of libpcap,
  663. # and was created to address portability issues. Unfortunately, the script is not updated properly
  664. # outside of the base distribution. Examples: PF_RING requires 'pthreads', 'numa' and 'rt', but
  665. # this is not reflect that in the script. OS X Xcode 10.11 SDK creates its own very broken
  666. # 'pcap-config' script that only occasionally works for dynamic definitions, and definitely
  667. # does not work for static.
  668. #
  669. # The ability to enable this script exists for corner cases where libpcap distributions starts
  670. # using even more libraries than I am currently not aware of. Originally, you only had to worry
  671. # about 'nl', but now we have to be prepared to add 'nl-3', 'nl-genl-3' and 'dbus-1' to make
  672. # libpcap functional. In the future, there may be more.
  673. #
  674. # (sigh)
  675. #
  676. # So, in the future if libpcap changes and stops working, try setting --enable-pcapconfig. It
  677. # it may work for you.
  678. if test $enable_pcap_config = yes; then
  679. AC_PATH_TOOL(PCAP_CONFIG, pcap-config)
  680. if test -n "$PCAP_CONFIG"; then
  681. #
  682. # Found - use it to get the include flags for
  683. # libpcap and the flags to link with libpcap.
  684. #
  685. # Please read section 11.6 "Shell Substitutions"
  686. # in the autoconf manual before doing anything
  687. # to this that involves quoting. Especially note
  688. # the statement "There is just no portable way to use
  689. # double-quoted strings inside double-quoted back-quoted
  690. # expressions (pfew!)."
  691. #
  692. if test $dynamic_link = yes; then
  693. LPCAPLIB=$($PCAP_CONFIG --libs)
  694. else
  695. LPCAPLIB=$($PCAP_CONFIG --libs --static)
  696. fi
  697. CFLAGS="$CFLAGS $($PCAP_CONFIG --cflags)"
  698. if test -n "$LPCAPLIB"; then
  699. foundpcap=yes
  700. using_pcap_config=yes
  701. else
  702. AC_MSG_WARN(Unable to find libpcap using pcap-config)
  703. fi
  704. fi
  705. fi
  706. if test ! $foundpcap = yes; then
  707. #
  708. # Not found; look for pcap.
  709. #
  710. for testdir in /usr/local /opt/local /usr /wpdpack $MACOSX_SDK_PATH/usr /usr/local/opt/libpcap ; do
  711. if test -f "${testdir}/include/pcap.h"; then
  712. LPCAPINC="${testdir}/include/pcap.h"
  713. LPCAPINCDIR="${testdir}/include"
  714. if test $dynamic_link = yes; then
  715. for ext in .dylib .so .tbd; do
  716. for dir in . lib lib64 lib32 lib/${host_cpu}-${host_os} ${host_cpu}-${host_os} lib/${MULTIARCH} ${MULTIARCH}; do
  717. sharefile=$(ls "${testdir}/$dir/libpcap${ext}" 2> /dev/null | sort | head -n1)
  718. if test -n "${sharefile}"; then
  719. LPCAPLIB="-L$(dirname ${sharefile}) -lpcap"
  720. foundpcap=$testdir
  721. break
  722. fi
  723. done
  724. if ! test $foundpcap = no; then
  725. break
  726. fi
  727. done
  728. fi
  729. if test $foundpcap = no ; then
  730. dnl
  731. dnl If dynamic library not found, try static
  732. dnl
  733. for ext in ${libext} .a .A.tbd ; do
  734. for dir in . lib lib64 lib32 lib/${host_cpu}-${host_os} ${host_cpu}-${host_os} lib/${MULTIARCH} ${MULTIARCH}; do
  735. staticfile=$(ls "${testdir}/$dir/libpcap${ext}" 2> /dev/null | sort | head -n1)
  736. if test -n "${staticfile}"; then
  737. LPCAPLIB="${staticfile}"
  738. foundpcap=$testdir
  739. break
  740. fi
  741. done
  742. if ! test $foundpcap = no; then
  743. break
  744. fi
  745. done
  746. fi
  747. if test $foundpcap = no -a -f "${testdir}/lib/libwpcap.${libext}" ; then
  748. LPCAPLIB="${testdir}/lib/libwpcap.${libext}"
  749. AC_DEFINE([HAVE_WINPCAP], [1], [Do we have WinPcap?])
  750. foundpcap=$testdir
  751. fi
  752. fi
  753. if ! test $foundpcap = no; then
  754. break
  755. fi
  756. done
  757. fi
  758. ])
  759. if test $foundpcap = no ; then
  760. AC_MSG_RESULT(no)
  761. AC_MSG_ERROR(libpcap not found)
  762. else
  763. AC_MSG_RESULT($foundpcap)
  764. fi
  765. ## could be PF_RING
  766. #
  767. # library is static and in PF_RING build tree
  768. #
  769. # Need access to libpfring library
  770. # and must find an associated libpfring.a
  771. if test -n "${with_pfring_lib}"; then
  772. if test -f ${with_pfring_lib}; then
  773. pf_ring_lib=${with_pfring_lib}
  774. pf_ring_found=yes
  775. else
  776. AC_MSG_ERROR(["Unable to find PF_RING library ${with_pfring_lib}"])
  777. fi
  778. fi
  779. # libpcap can require libnl
  780. AC_SEARCH_LIBS([nl_handle_alloc], [nl],
  781. [AC_MSG_NOTICE([Unable to find nl library - may be needed by libpcap])])
  782. AC_CHECK_LIB(bpf, bpf_object__open_file,,
  783. [AC_MSG_NOTICE([Unable to find libbpf library ])])
  784. AC_CHECK_LIB(xdp, xsk_umem__delete,,
  785. [AC_MSG_NOTICE([Unable to find libxdp library ])])
  786. ##
  787. ## If not automatically configured,
  788. ## check for newer and full-featured libpcap's
  789. ##
  790. if ! test $using_pcap_config = yes; then
  791. ## newer libpcap requires dbus and latest nl (e.g. -lnl-genl-3 -lnl-3 -ldbus-1)
  792. AC_CHECK_LIB(nl, nl_cache_alloc, [nl_found=yes])
  793. AC_CHECK_LIB(nl-genl-3, genl_connect, [nl_genl_3_found=yes])
  794. AC_CHECK_LIB(nl-3, nl_cache_alloc, [nl_3_found=yes])
  795. AC_CHECK_LIB(dbus-1, dbus_malloc, [dbus_1_found=yes])
  796. if test "$nl_found" = "yes"; then
  797. LPCAPLIB="$LPCAPLIB -lnl"
  798. fi
  799. if test "$nl_genl_3_found" = "yes"; then
  800. LPCAPLIB="$LPCAPLIB -lnl-genl-3"
  801. fi
  802. if test "$nl_3_found" = "yes"; then
  803. LPCAPLIB="$LPCAPLIB -lnl-3"
  804. fi
  805. if test "$dbus_1_found" = "yes"; then
  806. LPCAPLIB="$LPCAPLIB -ldbus-1"
  807. fi
  808. ## See if prereqs for PF_RING exist
  809. AC_CHECK_LIB(numa, numa_available, [numa_found=yes])
  810. AC_CHECK_LIB(pthread, pthread_create, [pthread_found=yes])
  811. if test $pf_ring_found = yes; then
  812. if ! test "${numa_found}" = "yes"; then
  813. AC_MSG_ERROR([PF_RING requires libnuma and/or libnuma-dev])
  814. fi
  815. if ! test "${pthread_found}" = "yes"; then
  816. AC_MSG_ERROR([PF_RING requires libpthread])
  817. fi
  818. LPCAPLIB="$LPCAPLIB ${pf_ring_lib} -lnuma -lpthread -lrt"
  819. fi
  820. fi
  821. OLDLIBS="$LIBS"
  822. if test -n "$LPCAPINCDIR"; then
  823. OLDCFLAGS="$CFLAGS -I$LPCAPINCDIR"
  824. CFLAGS="$CFLAGS -I$LPCAPINCDIR"
  825. else
  826. OLDCFLAGS="$CFLAGS"
  827. LPCAPINCDIR=$(echo $CFLAGS | sed -e 's/^\-I//')
  828. if test -d "$LPCAPINCDIR/pcap"; then
  829. LPCAPINC="$LPCAPINCDIR/pcap/pcap.h"
  830. else
  831. LPCAPINC="$LPCAPINCDIR/pcap.h"
  832. fi
  833. fi
  834. LIBS="$LPCAPLIB"
  835. AC_SEARCH_LIBS([pcap_get_pfring_id],
  836. [pcap],
  837. AC_DEFINE([HAVE_PF_RING_PCAP],
  838. ,
  839. [${with_pfring_lib} numa pthread rt]))
  840. ## Does libpcap work with selected libraries?
  841. AC_SEARCH_LIBS([pcap_close], [pcap],
  842. , AC_MSG_ERROR(Unable to link libpcap in ${foundpcap}),)
  843. AC_SUBST(LPCAPINC)
  844. AC_SUBST(LPCAPLIB)
  845. dnl Check to see what version of libpcap
  846. AC_MSG_CHECKING(libpcap version)
  847. libpcap_version=unknown
  848. libpcap_version_096=no
  849. cat >conftest.c <<EOF
  850. #include <string.h>
  851. #include <stdio.h>
  852. #include "$LPCAPINC"
  853. /*
  854. * simple proggy to get the version of libpcap
  855. */
  856. int main() {
  857. printf("%s\n", pcap_lib_version());
  858. return 0;
  859. }
  860. EOF
  861. ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LPCAPLIB \
  862. conftest.c $LIBS >/dev/null 2>&1
  863. if test -x conftest -a "$cross_compiling" != "yes"; then
  864. full_libpcap_version=$(LD_LIBRARY_PATH="$LPCAP_LD_LIBRARY_PATH" ./conftest)
  865. libpcap_version=$(echo "$full_libpcap_version" | ${CUT} -d' ' -f3)
  866. pcap_version_ok=yes
  867. fi
  868. AC_MSG_RESULT([$libpcap_version])
  869. rm -rf conftest.* core core.conftest 2>&1 > /dev/null
  870. AC_MSG_CHECKING(for valid libpcap version)
  871. if test x$libpcap_version != xunknown; then
  872. libpcap_major=$(echo ${libpcap_version} | ${CUT} -d '.' -f1)
  873. libpcap_minor=$(echo ${libpcap_version} | ${CUT} -d '.' -f2)
  874. libpcap_build=$(echo ${libpcap_version} | ${CUT} -d '.' -f3)
  875. if test $libpcap_major -eq 0 && \
  876. (test $libpcap_minor -lt 7 || \
  877. (test $libpcap_minor -eq 7 && test $libpcap_build -lt 2))
  878. then
  879. AC_MSG_ERROR([Libpcap versions < 0.7.2 are not supported
  880. Please upgrade to version 0.7.2 or better. Your version is $libpcap_version])
  881. fi
  882. dnl 0.9.6 (which is still thinks it is 0.9.5 due to a bug) introduces an important
  883. dnl fix for OSX. See: http://tcpreplay.synfin.net/trac/ticket/167
  884. if test $libpcap_major -gt 0 || \
  885. (test $libpcap_minor -eq 9 && test $libpcap_build -ge 6)
  886. then
  887. libpcap_version_096=yes
  888. fi
  889. AC_MSG_RESULT([yes])
  890. else
  891. AC_MSG_RESULT([unknown])
  892. fi
  893. dnl Check for pcap_setnonblock()
  894. AC_MSG_CHECKING(for pcap_setnonblock)
  895. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  896. #include <stdio.h>
  897. #include <stdlib.h>
  898. #include <string.h>
  899. #include "$LPCAPINC"
  900. ]],[[
  901. pcap_t *p;
  902. char *errbuf;
  903. pcap_setnonblock(p, 1, errbuf);
  904. exit(0);
  905. ]])], [
  906. have_pcap_setnonblock=yes
  907. AC_MSG_RESULT(yes)
  908. ], [
  909. have_pcap_setnonblock=no
  910. AC_MSG_RESULT(no)
  911. ])
  912. if test $have_pcap_setnonblock = yes ; then
  913. AC_DEFINE([HAVE_PCAP_SETNONBLOCK], [1],
  914. [Does libpcap have pcap_setnonblock?])
  915. fi
  916. dnl Check to see if we've got pcap_datalink_val_to_name()
  917. AC_MSG_CHECKING(for pcap_datalink_val_to_description)
  918. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  919. #include <stdio.h>
  920. #include <stdlib.h>
  921. #include <string.h>
  922. #include "$LPCAPINC"
  923. ]],[[
  924. if (strcmp(pcap_datalink_val_to_description(1), "Ethernet (10Mb)") == 0)
  925. exit(0);
  926. exit(1);
  927. ]])],[
  928. have_dlt_to_desc=yes
  929. AC_MSG_RESULT(yes)
  930. ], [
  931. have_dlt_to_desc=no
  932. AC_MSG_RESULT(no)
  933. ])
  934. if test $have_dlt_to_desc = yes ; then
  935. AC_DEFINE([HAVE_DLT_VAL_TO_DESC], [1],
  936. [Does libpcap have pcap_datalink_val_to_description?])
  937. fi
  938. dnl Check for pcap_get_selectable_fd()
  939. AC_MSG_CHECKING(for pcap_get_selectable_fd)
  940. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  941. #include <stdio.h>
  942. #include <stdlib.h>
  943. #include <string.h>
  944. #include "$LPCAPINC"
  945. ]], [[
  946. int f;
  947. pcap_t *p;
  948. f = pcap_get_selectable_fd(p);
  949. exit(0);
  950. ]])], [
  951. have_pcap_get_selectable_fd=yes
  952. AC_MSG_RESULT(yes)
  953. ], [
  954. have_pcap_get_selectable_fd=no
  955. AC_MSG_RESULT(no)
  956. ])
  957. if test x$have_pcap_get_selectable_fd = xyes ; then
  958. AC_DEFINE([HAVE_PCAP_GET_SELECTABLE_FD], [1],
  959. [Does libpcap have pcap_get_selectable_fd?])
  960. fi
  961. dnl Important: winpcap apparently defines functions in it's header files
  962. dnl which aren't actually in the library. Totally fucked up. Hence, we
  963. dnl must actually LINK the code, not just compile it.
  964. dnl Check to see if we've got pcap_dump_fopen()
  965. AC_MSG_CHECKING(for pcap_dump_fopen)
  966. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  967. #include <stdio.h>
  968. #include <stdlib.h>
  969. #include <string.h>
  970. #include "$LPCAPINC"
  971. ]],[[
  972. pcap_dumper_t *dump;
  973. pcap_t *pcap;
  974. FILE *foo;
  975. dump = pcap_dump_fopen(pcap, foo);
  976. ]])],[
  977. have_pcap_dump_fopen=yes
  978. AC_MSG_RESULT(yes)
  979. ], [
  980. have_pcap_dump_fopen=no
  981. AC_MSG_RESULT(no)
  982. ])
  983. if test $have_pcap_dump_fopen = yes ; then
  984. AC_DEFINE([HAVE_PCAP_DUMP_FOPEN], [1],
  985. [Does libpcap have pcap_dump_fopen?])
  986. else
  987. AC_MSG_NOTICE([--verbose mode requires libpcap >= 0.9.0])
  988. fi
  989. have_pcap_inject=no
  990. dnl Check to see if we've got pcap_inject()
  991. AC_MSG_CHECKING(for pcap_inject sending support)
  992. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  993. #include <stdio.h>
  994. #include <stdlib.h>
  995. #include <string.h>
  996. #include "$LPCAPINC"
  997. ]],[[
  998. pcap_t *pcap;
  999. char *buf;
  1000. pcap_inject(pcap, (void *)buf, 0);
  1001. ]])],[
  1002. have_pcap_inject=yes
  1003. AC_MSG_RESULT(yes)
  1004. ], [
  1005. have_pcap_inject=no
  1006. AC_MSG_RESULT(no)
  1007. ])
  1008. if test $have_pcap_inject = yes ; then
  1009. AC_DEFINE([HAVE_PCAP_INJECT], [1], [Does libpcap have pcap_inject?])
  1010. fi
  1011. have_pcap_sendpacket=no
  1012. dnl Check to see if we've got pcap_sendpacket()
  1013. AC_MSG_CHECKING(for pcap_sendpacket sending support)
  1014. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  1015. #include <stdio.h>
  1016. #include <stdlib.h>
  1017. #include <string.h>
  1018. #include "$LPCAPINC"
  1019. ]],[[
  1020. pcap_t *pcap;
  1021. u_char *buf;
  1022. pcap_sendpacket(pcap, buf, 0);
  1023. ]])],[
  1024. have_pcap_sendpacket=yes
  1025. AC_MSG_RESULT(yes)
  1026. ], [
  1027. have_pcap_sendpacket=no
  1028. AC_MSG_RESULT(no)
  1029. ])
  1030. if test $have_pcap_sendpacket = yes ; then
  1031. AC_DEFINE([HAVE_PCAP_SENDPACKET], [1], [Does libpcap have pcap_sendpacket?])
  1032. fi
  1033. have_pcap_breakloop=no
  1034. AC_MSG_CHECKING(for pcap_breakloop)
  1035. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  1036. #include <stdio.h>
  1037. #include <stdlib.h>
  1038. #include <string.h>
  1039. #include "$LPCAPINC"
  1040. ]],[[
  1041. pcap_t *pcap;
  1042. pcap_sendpacket(pcap);
  1043. ]])],[
  1044. have_pcap_breakloop=yes
  1045. AC_MSG_RESULT(yes)
  1046. ], [
  1047. have_pcap_breakloop=no
  1048. AC_MSG_RESULT(no)
  1049. ])
  1050. if test $have_pcap_breakloop = yes ; then
  1051. AC_DEFINE([HAVE_PCAP_BREAKLOOP], [1], [Does libpcap have pcap_breakloop?])
  1052. fi
  1053. have_pcap_version=no
  1054. dnl Check to see if we have pcap_version[]
  1055. AC_MSG_CHECKING(for pcap_version[])
  1056. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  1057. #include <stdio.h>
  1058. #include <stdlib.h>
  1059. #include <string.h>
  1060. #include "$LPCAPINC"
  1061. extern char pcap_version[];
  1062. ]], [[
  1063. printf("%s", pcap_version);
  1064. ]])],[
  1065. AC_DEFINE([HAVE_PCAP_VERSION],[1], [Does libpcap have pcap_version[]])
  1066. AC_MSG_RESULT(yes)
  1067. ],[
  1068. AC_MSG_RESULT(no)
  1069. ])
  1070. have_pcap_snapshot=no
  1071. dnl Check for pcap_snapshot()
  1072. AC_MSG_CHECKING(for pcap_snapshot)
  1073. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  1074. #include <stdio.h>
  1075. #include <stdlib.h>
  1076. #include <string.h>
  1077. #include "$LPCAPINC"
  1078. ]],[[
  1079. pcap_t *p;
  1080. int len;
  1081. len = pcap_snapshot(p);
  1082. exit(0);
  1083. ]])], [
  1084. have_pcap_snapshot=yes
  1085. AC_MSG_RESULT(yes)
  1086. ], [
  1087. have_pcap_snapshot=no
  1088. AC_MSG_RESULT(no)
  1089. ])
  1090. if test $have_pcap_snapshot = yes ; then
  1091. AC_DEFINE([HAVE_PCAP_SNAPSHOT], [1],
  1092. [Does libpcap have pcap_snapshot?])
  1093. fi
  1094. have_pcap_open_offline_with_tstamp_precision=no
  1095. dnl Check to see if we've got pcap_open_offline_with_tstamp_precision()
  1096. AC_MSG_CHECKING(for pcap_open_offline_with_tstamp_precision support)
  1097. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  1098. #include <stdio.h>
  1099. #include <stdlib.h>
  1100. #include <string.h>
  1101. #include "$LPCAPINC"
  1102. ]],[[
  1103. pcap_t *pcap;
  1104. char ebuf[PCAP_ERRBUF_SIZE];
  1105. pcap = pcap_open_offline_with_tstamp_precision("fake.pcap", PCAP_TSTAMP_PRECISION_NANO, &ebuf[0]);
  1106. ]])],[
  1107. have_pcap_open_offline_with_tstamp_precision=yes
  1108. AC_MSG_RESULT(yes)
  1109. ], [
  1110. have_pcap_open_offline_with_tstamp_precision=no
  1111. AC_MSG_RESULT(no)
  1112. ])
  1113. if test $have_pcap_open_offline_with_tstamp_precision = yes ; then
  1114. AC_DEFINE([HAVE_PCAP_OPEN_OFFLINE_WITH_TSTAMP_PRECISION], [1], [Does libpcap have pcap_open_offline_with_tstamp_precision?])
  1115. AC_DEFINE([PCAP_TSTAMP_US_TO_NS_MULTIPLIER], [1], [Multiplier for conversion from PCAP usec to nsec])
  1116. AC_DEFINE([PCAP_TSTAMP_US_TO_US_DIVISOR], [1000], [Divisor for conversion from PCAP usec to usec])
  1117. else
  1118. AC_DEFINE([PCAP_TSTAMP_US_TO_NS_MULTIPLIER], [1000], [Multiplier for conversion from PCAP usec to nsec])
  1119. AC_DEFINE([PCAP_TSTAMP_US_TO_US_DIVISOR], [1], [Divisor for conversion from PCAP usec to usec])
  1120. fi
  1121. # Tcpbridge requires libpcap and pcap_sendpacket()
  1122. enable_tcpbridge=no
  1123. if test x$foundpcap != xno -a x$have_pcap_sendpacket = xyes ; then
  1124. # if we have pcap_sendpacket() then we can build tcpbridge on non-BPF systems
  1125. if test x$have_bpf = xno; then
  1126. AC_DEFINE(ENABLE_TCPBRIDGE, [1], [Compile tcpbridge])
  1127. enable_tcpbridge=yes
  1128. AC_MSG_NOTICE([Building tcpbridge])
  1129. # BPF systems need to also have pcap_setnonblock()
  1130. elif test x$have_pcap_setnonblock = xyes ; then
  1131. AC_DEFINE(ENABLE_TCPBRIDGE, [1], [Compile tcpbridge])
  1132. enable_tcpbridge=yes
  1133. AC_MSG_NOTICE([Building tcpbridge])
  1134. else
  1135. AC_MSG_WARN([Unable to build tcpbridge. Try installing latest libpcap!])
  1136. fi
  1137. fi
  1138. AM_CONDITIONAL(COMPILE_TCPBRIDGE, [test x$enable_tcpbridge = xyes ])
  1139. # tcpliveplay requires linux OS to function properly
  1140. enable_tcpliveplay=no
  1141. case $host in
  1142. *-*-linux*)
  1143. AC_DEFINE(ENABLE_TCPLIVEPLAY, [1], [Compile tcpliveplay])
  1144. enable_tcpliveplay=yes
  1145. AC_MSG_NOTICE([Building tcpliveplay])
  1146. ;;
  1147. *)
  1148. AC_MSG_WARN([Unable to build tcpliveplay. This tool is only enabled on linux environments.])
  1149. ;;
  1150. esac
  1151. AM_CONDITIONAL(COMPILE_TCPLIVEPLAY, [test x$enable_tcpliveplay = xyes ])
  1152. dnl #####################################################
  1153. dnl Check for netmap support
  1154. dnl #####################################################
  1155. have_netmap=no
  1156. enable_netmap=no
  1157. trynetmapdir=
  1158. AC_MSG_CHECKING(for netmap socket sending support)
  1159. AC_ARG_WITH(netmap,
  1160. AS_HELP_STRING([--with-netmap=DIR],[Use netmap in DIR]),
  1161. [trynetmapdir=$withval])
  1162. NETMAP_SEARCH_DIRS=
  1163. if test "$cross_compiling" = yes; then
  1164. if test "x$trynetmapdir" != "x"; then
  1165. NETMAP_SEARCH_DIRS=$trynetmapdir
  1166. fi
  1167. else
  1168. NETMAP_SEARCH_DIRS="$trynetmapdir /opt/netmap /usr/src/netmap-release /usr/src/netmap /usr/local/src/netmap-release /usr/local/src/netmap /usr/include /usr/local/include"
  1169. fi
  1170. for testdir in $NETMAP_SEARCH_DIRS; do
  1171. if test -f "${testdir}/sys/net/netmap.h" ; then
  1172. NETMAPINC="${testdir}/sys/net/netmap.h"
  1173. NETMAPUSERINC="${testdir}/sys/net/netmap_user.h"
  1174. NETMAPINCDIR="${testdir}/sys"
  1175. have_netmap="yes $testdir"
  1176. enable_netmap=yes
  1177. else
  1178. if test -f "${testdir}/net/netmap.h" ; then
  1179. NETMAPINC="${testdir}/net/netmap.h"
  1180. NETMAPUSERINC="${testdir}/net/netmap_user.h"
  1181. NETMAPINCDIR="${testdir}"
  1182. have_netmap="yes $testdir"
  1183. enable_netmap=yes
  1184. fi
  1185. fi
  1186. if test "$have_netmap" != no ; then
  1187. NETMAPFLAGS="-DHAVE_NETMAP"
  1188. OLDCFLAGS="$CFLAGS -I$NETMAPINCDIR"
  1189. CFLAGS="$CFLAGS -DNETMAP_WITH_LIBS -DND -I$NETMAPINCDIR"
  1190. AC_SUBST(NETMAPINC)
  1191. AC_SUBST(NETMAPUSERINC)
  1192. AC_SUBST(NETMAPINCDIR)
  1193. AC_SUBST(NETMAPFLAGS)
  1194. AC_DEFINE([HAVE_NETMAP], [1],
  1195. [Do we have netmap support?])
  1196. have_netmap="yes $testdir"
  1197. enable_netmap=yes
  1198. break;
  1199. fi
  1200. done
  1201. AC_MSG_RESULT($have_netmap)
  1202. AM_CONDITIONAL(COMPILE_NETMAP, [test x$enable_netmap = xyes ])
  1203. dnl ###########################################################
  1204. dnl Check for nm_open() function available in netmap version 5
  1205. dnl Also check for other version-specific netmap definitions and structures
  1206. dnl ###########################################################
  1207. if test "x$NETMAPINCDIR" != "x"; then
  1208. OLDCPPFLAGS="$CPPFLAGS"
  1209. CPPFLAGS="$CPPFLAGS -DNETMAP_WITH_LIBS -DND -I$NETMAPINCDIR"
  1210. have_nm_open=no
  1211. have_nm_nr_reg_mask=no
  1212. have_nm_nr_flags=no
  1213. have_nmring_head_tail=no
  1214. if test "$have_netmap" != no ; then
  1215. dnl check for nm_open()
  1216. AC_CHECK_DECL([nm_open],[have_nm_open=yes], , [[
  1217. #include <stdio.h>
  1218. #include "${NETMAPUSERINC}"
  1219. ]])
  1220. dnl check for #define NR_REG_MASK
  1221. AC_MSG_CHECKING(for netmap NR_REG_MASK definition)
  1222. AC_COMPILE_IFELSE(
  1223. [AC_LANG_PROGRAM([[
  1224. #include <stdint.h>
  1225. #include <sys/socket.h>
  1226. #include <net/if.h>
  1227. #include <net/netmap.h>
  1228. ]],
  1229. [[
  1230. #ifdef NR_REG_MASK
  1231. /* OK */
  1232. #else
  1233. # error NR_REG_MASK not found
  1234. #endif
  1235. ]])
  1236. ],
  1237. [have_nm_nr_reg_mask=yes],
  1238. [])
  1239. AC_MSG_RESULT($have_nm_nr_reg_mask)
  1240. dnl check for nr_flags in struct nmreq
  1241. AC_MSG_CHECKING(for netmap nr_flags definition)
  1242. AC_COMPILE_IFELSE(
  1243. [AC_LANG_PROGRAM([[
  1244. #include <stdint.h>
  1245. #include <sys/socket.h>
  1246. #include <net/if.h>
  1247. #include <net/netmap.h>
  1248. ]],
  1249. [[
  1250. struct nmreq nmr;
  1251. nmr.nr_flags = 0;
  1252. ]])
  1253. ],
  1254. [have_nm_nr_flags=yes],
  1255. [])
  1256. AC_MSG_RESULT($have_nm_nr_flags)
  1257. dnl check for head/tail in struct netmap_ring
  1258. AC_MSG_CHECKING(for netmap ring head/tail definitions)
  1259. AC_COMPILE_IFELSE(
  1260. [AC_LANG_PROGRAM([[
  1261. #include <stdint.h>
  1262. #include <sys/socket.h>
  1263. #include <net/if.h>
  1264. #include <net/netmap.h>
  1265. ]],
  1266. [[
  1267. struct netmap_ring r;
  1268. r.head = r.tail = 0;
  1269. ]])
  1270. ],
  1271. [have_nmring_head_tail=yes],
  1272. [])
  1273. AC_MSG_RESULT($have_nmring_head_tail)
  1274. fi
  1275. if test "$have_nm_open" = yes ; then
  1276. AC_DEFINE([HAVE_NETMAP_NM_OPEN], [1], [Does netmap have nm_open function?])
  1277. fi
  1278. if test "$have_nm_nr_reg_mask" = yes ; then
  1279. AC_DEFINE([HAVE_NETMAP_NR_REG], [1], [Does netmap have NR_REG_MASK defined?])
  1280. fi
  1281. if test "$have_nm_nr_flags" = yes ; then
  1282. AC_DEFINE([HAVE_NETMAP_NR_FLAGS], [1], [Does netmap struct nmreq have nr_flags defined?])
  1283. fi
  1284. if test "$have_nmring_head_tail" = yes ; then
  1285. AC_DEFINE([HAVE_NETMAP_RING_HEAD_TAIL], [1], [Does structure netmap_ring have head/tail defined?])
  1286. fi
  1287. CPPFLAGS="$OLDCPPFLAGS"
  1288. fi
  1289. have_pf=no
  1290. dnl Check for linux PF_PACKET support
  1291. AC_MSG_CHECKING(for PF_PACKET socket sending support)
  1292. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  1293. #include <sys/socket.h>
  1294. #include <netpacket/packet.h>
  1295. #include <net/ethernet.h> /* the L2 protocols */
  1296. #include <netinet/in.h> /* htons */
  1297. ]], [[
  1298. int pf_socket;
  1299. pf_socket = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
  1300. ]])],[
  1301. AC_DEFINE([HAVE_PF_PACKET], [1],
  1302. [Do we have Linux PF_PACKET socket support?])
  1303. AC_MSG_RESULT(yes)
  1304. have_pf=yes
  1305. ],[
  1306. AC_MSG_RESULT(no)
  1307. ])
  1308. have_libxdp=no
  1309. dnl Check for LIBXDP AF_XDP socket support
  1310. AC_MSG_CHECKING(for LIBXDP XDP packet sending support)
  1311. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  1312. #include <stdlib.h>
  1313. #include <xdp/xsk.h>
  1314. #include <sys/socket.h>
  1315. ]], [[
  1316. struct xsk_socket {
  1317. struct xsk_ring_cons *rx;
  1318. struct xsk_ring_prod *tx;
  1319. struct xsk_ctx *ctx;
  1320. struct xsk_socket_config config;
  1321. int fd;
  1322. };
  1323. struct xsk_socket xsk;
  1324. struct xsk_ring_cons *rxr = NULL;
  1325. struct xsk_ring_prod *txr = NULL;
  1326. int queue_id = 0;
  1327. xsk_socket__create(&xsk, "lo", queue_id, NULL, rxr, txr, NULL);
  1328. socket(AF_XDP, SOCK_RAW, 0);
  1329. ]])],[
  1330. AC_DEFINE([HAVE_LIBXDP], [1],
  1331. [Do we have LIBXDP AF_XDP socket support?])
  1332. AC_MSG_RESULT(yes)
  1333. have_libxdp=yes
  1334. ],[
  1335. AC_MSG_RESULT(no)
  1336. ])
  1337. have_tx_ring=no
  1338. dnl Check for older Linux TX_RING support
  1339. AC_MSG_CHECKING(for TX_RING socket sending support)
  1340. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  1341. #include <sys/socket.h>
  1342. #include <netpacket/packet.h>
  1343. #include <net/ethernet.h> /* the L2 protocols */
  1344. #include <netinet/in.h> /* htons */
  1345. #include <linux/if_packet.h>
  1346. ]], [[
  1347. int test;
  1348. test = TP_STATUS_WRONG_FORMAT
  1349. ]])],[
  1350. AC_DEFINE([HAVE_TX_RING], [1],
  1351. [Do we have Linux TX_RING socket support?])
  1352. AC_MSG_RESULT(yes)
  1353. have_tx_ring=yes
  1354. ],[
  1355. AC_MSG_RESULT(no)
  1356. ])
  1357. AC_CHECK_HEADERS([bpf/libbpf.h])
  1358. AC_CHECK_HEADERS([bpf/bpf.h])
  1359. AC_CHECK_HEADERS([xdp/libxdp.h])
  1360. AC_CHECK_HEADERS([net/bpf.h], [have_bpf=yes], [have_bpf=no])
  1361. if test $have_bpf = yes ; then
  1362. AC_DEFINE([HAVE_BPF], [1],
  1363. [Do we have BPF device support?])
  1364. fi
  1365. dnl ##################################################
  1366. dnl # Check for libdnet, but only if not Cygwin!
  1367. dnl #
  1368. dnl # if your version of libdnet doesn't compile, try
  1369. dnl # getting it from ...
  1370. dnl # http://libdnet.sourceforge.net/
  1371. dnl # ... or ...
  1372. dnl # https://github.com/jncornett/libdnet
  1373. dnl # ... or ...
  1374. dnl # on Linux try 'apt-get install libdumbnet-dev'
  1375. dnl ##################################################
  1376. founddnet=no
  1377. have_libdnet=no
  1378. libdnet_version=
  1379. enable_fragroute=no
  1380. trydnetdir=/usr/local
  1381. if test $have_cygwin = no ; then
  1382. AC_MSG_CHECKING(for libdnet)
  1383. AC_ARG_WITH(libdnet,
  1384. AS_HELP_STRING([--with-libdnet=DIR],[Use libdnet in DIR]),
  1385. [trydnetdir=$withval])
  1386. if test $trydnetdir != no; then
  1387. case "$build_os" in
  1388. linux*)
  1389. dnl # Debian/Ubuntu already have a package called libdnet
  1390. dnl # so you the package you want to install libdumbnet-dev
  1391. for testdir in $trydnetdir /usr/local /opt/local /usr ; do
  1392. if test -x ${testdir}/bin/dumbnet-config -a $founddnet = no ; then
  1393. LDNETINC="$($testdir/bin/dumbnet-config --cflags)"
  1394. LDNETLIB="$($testdir/bin/dumbnet-config --libs)"
  1395. libdnet_version="$($testdir/bin/dumbnet-config --version) (libdumbnet)"
  1396. founddnet=$testdir
  1397. fi
  1398. done
  1399. ;;
  1400. esac
  1401. if test $founddnet = no ; then
  1402. for testdir in $trydnetdir /usr/local /opt/local $MACOSX_SDK_PATH/usr /usr ; do
  1403. if test -x ${testdir}/bin/dnet-config -a $founddnet = no ; then
  1404. LDNETINC="$($testdir/bin/dnet-config --cflags)"
  1405. LDNETLIB="$($testdir/bin/dnet-config --libs)"
  1406. libdnet_version="$($testdir/bin/dnet-config --version)"
  1407. founddnet=$testdir
  1408. fi
  1409. done
  1410. fi
  1411. fi
  1412. if test $founddnet = no ; then
  1413. AC_MSG_RESULT(no)
  1414. AC_MSG_WARN([libdnet not found, disabling fragroute feature])
  1415. else
  1416. AC_MSG_RESULT($founddnet)
  1417. enable_fragroute=yes
  1418. have_libdnet=yes
  1419. AC_DEFINE([HAVE_LIBDNET], [1], [Do we have libdnet?])
  1420. dnl Debian uses dumbnet.h instead of dnet.h due to naming conflict
  1421. old_cflags=$CFLAGS
  1422. CFLAGS=$LDNETINC
  1423. AC_CHECK_HEADERS([dumbnet.h dnet.h])
  1424. CFLAGS=$old_cflags
  1425. fi
  1426. else
  1427. AC_MSG_NOTICE([Skipping libdnet check under Cygwin for compatibility reasons])
  1428. fi
  1429. AC_SUBST(LDNETINC)
  1430. AC_SUBST(LDNETLIB)
  1431. AC_DEFINE_UNQUOTED([LIBDNET_VERSION], "$libdnet_version", [Version of libdnet])
  1432. AM_CONDITIONAL(COMPILE_FRAGROUTE, [test x$founddnet != xno])
  1433. if test x$founddnet != xno ; then
  1434. AC_DEFINE(ENABLE_FRAGROUTE, [1], [Enable fragroute module])
  1435. fi
  1436. dnl Make sure we have a valid packet injection mechanisim
  1437. if test $have_bpf = no -a $have_pcap_inject = no -a $have_pcap_sendpacket = no \
  1438. -a $have_libdnet = no -a $have_pf = no ; then
  1439. AC_MSG_ERROR([Unable to find a supported method to send packets. Please upgrade your libpcap or enable libdnet])
  1440. fi
  1441. dnl Older versions of libpcap are missing some DLT types
  1442. dnl If doesn't exist, we'll define them in src/common/fakepcap.h
  1443. AC_MSG_CHECKING(for DLT_LINUX_SLL in libpcap)
  1444. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "$LPCAPINC"]], [[ int foo;
  1445. foo = DLT_LINUX_SLL
  1446. ]])],[ AC_DEFINE([HAVE_DLT_LINUX_SLL], [1],
  1447. [Does pcap.h include a header with DLT_LINUX_SLL?])
  1448. AC_MSG_RESULT(yes)
  1449. ],[AC_MSG_RESULT(no)
  1450. ])
  1451. AC_MSG_CHECKING(for DLT_LINUX_SLL2 in libpcap)
  1452. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "$LPCAPINC"]], [[ int foo;
  1453. foo = DLT_LINUX_SLL2
  1454. ]])],[ AC_DEFINE([HAVE_DLT_LINUX_SLL2], [1],
  1455. [Does pcap.h include a header with DLT_LINUX_SLL2?])
  1456. AC_MSG_RESULT(yes)
  1457. ],[AC_MSG_RESULT(no)
  1458. ])
  1459. AC_MSG_CHECKING(for DLT_C_HDLC in libpcap)
  1460. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "$LPCAPINC"]], [[ int foo;
  1461. foo = DLT_C_HDLC ]])],[ AC_DEFINE([HAVE_DLT_C_HDLC], [1],
  1462. [Does pcap.h include a header with DLT_C_HDLC?])
  1463. AC_MSG_RESULT(yes)
  1464. ],[AC_MSG_RESULT(no)
  1465. ])
  1466. PCAP_BPF_H_FILE="$LPCAPINCDIR/pcap-bpf.h"
  1467. AC_MSG_CHECKING(for $PCAP_BPF_H_FILE)
  1468. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
  1469. #include <sys/time.h>
  1470. #include <stdint.h>
  1471. #include "$PCAP_BPF_H_FILE"]], [[ int foo;
  1472. foo = BPF_MAJOR_VERSION; ]])],[ AC_DEFINE([INCLUDE_PCAP_BPF_HEADER], [1],
  1473. [What is the path (if any) to the pcap-bpf.h
  1474. header?])
  1475. AC_MSG_RESULT(yes)
  1476. AC_SUBST(PCAP_BPF_H_FILE)
  1477. ],[AC_MSG_RESULT(no)
  1478. ])
  1479. foundbpfheader=no
  1480. AC_MSG_CHECKING(for libpcap bpf header)
  1481. for testfile in $LPCAPINCDIR/pcap/bpf.h $LPCAPINCDIR/pcap-bpf.h ; do
  1482. if test -f "${testfile}" -a $foundbpfheader = no ; then
  1483. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  1484. #include <sys/types.h>
  1485. #include <sys/time.h>
  1486. #include <stdint.h>
  1487. #include "$testfile"]], [[
  1488. int foo;
  1489. foo = BPF_MAJOR_VERSION;
  1490. ]])],[
  1491. foundbpfheader=yes
  1492. PCAP_BPF_H_FILE=$testfile
  1493. AC_SUBST(PCAP_BPF_H_FILE)
  1494. AC_DEFINE([INCLUDE_PCAP_BPF_HEADER], [1],
  1495. [What is the path (if any) to the libpcap bpf header file?])
  1496. ],[])
  1497. fi
  1498. done
  1499. if test $foundbpfheader != no; then
  1500. AC_MSG_RESULT($testfile)
  1501. else
  1502. AC_MSG_RESULT(no)
  1503. fi
  1504. dnl ## Test for netmap-libpcap
  1505. have_pcap_netmap=no
  1506. if test $foundpcap != no ; then
  1507. AC_MSG_CHECKING(for netmap libpcap)
  1508. PCAP_NETMAP_C_FILE="$LPCAPINCDIR/pcap-netmap.c"
  1509. if test -f "${PCAP_NETMAP_C_FILE}" ; then
  1510. AC_DEFINE([HAVE_LIBPCAP_NETMAP], [1],
  1511. [Does this version of libpcap support netmap?])
  1512. have_pcap_netmap=yes
  1513. AC_MSG_RESULT(yes)
  1514. else
  1515. AC_MSG_RESULT(no)
  1516. fi
  1517. fi
  1518. dnl restore LIBS & CFLAGS
  1519. LIBS="$OLDLIBS"
  1520. CFLAGS="$OLDCFLAGS"
  1521. dnl ##################################################
  1522. dnl # Check for pcapnav
  1523. dnl ##################################################
  1524. pcapnav_ver=no
  1525. pcncfg=no
  1526. AC_ARG_WITH(pcapnav-config,
  1527. AS_HELP_STRING([--with-pcapnav-config=FILE],[Use given pcapnav-config]),
  1528. [ AC_MSG_CHECKING(for pcapnav-config)
  1529. if test -x $withval ; then
  1530. pcncfg=$withval
  1531. AC_MSG_RESULT($pcncfg)
  1532. elif test x$withval = xno ; then
  1533. AC_MSG_RESULT(no)
  1534. else
  1535. AC_MSG_RESULT([Can't find pcapnav-config: disabling offset jump feature])
  1536. fi ],
  1537. [ AC_PATH_PROG(pcncfg,[pcapnav-config], [no] ) ]
  1538. )
  1539. if test $pcncfg != no ; then
  1540. LNAVLIB=$($pcncfg --libs)
  1541. LNAV_CFLAGS=$($pcncfg --cflags)
  1542. PCAPNAV_VERSION=$($pcncfg --version)
  1543. AC_SUBST(LNAVLIB)
  1544. AC_SUBST(LNAV_CFLAGS)
  1545. AC_DEFINE_UNQUOTED(PCAPNAV_VERSION, "$PCAPNAV_VERSION",
  1546. [libpcapnav's version?])
  1547. dnl Check to see what version of libpcapnav
  1548. dnl this code has been reduced a lot, but probably still could be
  1549. dnl reduced quite a bit more if we chose too
  1550. AC_MSG_CHECKING(for libpcapnav version)
  1551. AC_RUN_IFELSE([AC_LANG_SOURCE([[
  1552. #include <string.h>
  1553. #define PCAPNAV_TEST "0.4"
  1554. /*
  1555. * simple proggy to test the version of libpcapnav
  1556. * returns zero if version >= 0.4
  1557. * or one otherwise
  1558. */
  1559. int
  1560. main (int argc, char *argv[])
  1561. {
  1562. if (strncmp(PCAPNAV_VERSION, PCAPNAV_TEST, 3) >= 0)
  1563. return 0;
  1564. return 1;
  1565. } ]])],[libpcapnav_ver=yes
  1566. AC_MSG_RESULT(>= 0.4)],[libpcapnav_ver=no
  1567. AC_MSG_RESULT(< 0.4)],[libpcapnav_ver=no
  1568. ])
  1569. if test x$libpcapnav_ver = xno ; then
  1570. AC_MSG_WARN([Libpcapnav versions < 0.4 are not supported.
  1571. Please upgrade to version 0.4 or better.
  1572. Disabling offset jump feature.])
  1573. else
  1574. AC_DEFINE([HAVE_PCAPNAV], [1], [Do we have libpcapnav?])
  1575. fi
  1576. fi # checking pcapnav version
  1577. dnl (shamelessly ripped off from libpcap)
  1578. dnl Checks to see if unaligned memory accesses fail
  1579. dnl
  1580. dnl FORCE_ALIGN (DEFINED)
  1581. dnl
  1582. AC_MSG_CHECKING(for requires strict byte alignment)
  1583. AC_CACHE_VAL(unaligned_cv_fail,
  1584. [
  1585. case "$host_os" in
  1586. darwin*)
  1587. # macOS M1 test fails due to lack of fork() so just hard code it
  1588. unaligned_cv_fail=no
  1589. ;;
  1590. *)
  1591. case "$host_cpu" in
  1592. # XXX: should also check that they don't do weird things
  1593. alpha*|arm*|hp*|mips*|sparc*|ia64)
  1594. unaligned_cv_fail=yes
  1595. ;;
  1596. *)
  1597. cat >conftest.c <<EOF
  1598. #include <sys/types.h>
  1599. #include <sys/wait.h>
  1600. #include <stdio.h>
  1601. #include <unistd.h>
  1602. unsigned char a[[5]] = { 1, 2, 3, 4, 5 };
  1603. int main() {
  1604. unsigned int i;
  1605. pid_t pid;
  1606. int status;
  1607. /* avoid "core dumped" message */
  1608. pid = fork();
  1609. if (pid < 0)
  1610. return 2;
  1611. if (pid > 0) {
  1612. /* parent */
  1613. pid = waitpid(pid, &status, 0);
  1614. if (pid < 0)
  1615. return 3;
  1616. return !WIFEXITED(status);
  1617. }
  1618. /* child */
  1619. i = *(unsigned int *)&a[[1]];
  1620. printf("%d\n", i);
  1621. return 0;
  1622. }
  1623. EOF
  1624. ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS \
  1625. conftest.c $LIBS >/dev/null 2>&1
  1626. if test ! -x conftest -o "$cross_compiling" = "yes" ; then
  1627. dnl failed to compile for some reason
  1628. unaligned_cv_fail=yes
  1629. else
  1630. ./conftest >conftest.out
  1631. if test ! -s conftest.out ; then
  1632. unaligned_cv_fail=yes
  1633. else
  1634. unaligned_cv_fail=no
  1635. fi
  1636. fi
  1637. rm -f conftest* core core.conftest
  1638. ;;
  1639. esac
  1640. ;;
  1641. esac
  1642. ])
  1643. AC_MSG_RESULT($unaligned_cv_fail)
  1644. if test $unaligned_cv_fail = yes ; then
  1645. AC_DEFINE([FORCE_ALIGN], [1], [Are we strictly aligned?])
  1646. fi
  1647. dnl ##################################################
  1648. dnl # Check for tcpdump.
  1649. dnl ##################################################
  1650. tcpdump_path=no
  1651. AC_ARG_WITH(tcpdump,
  1652. AS_HELP_STRING([--with-tcpdump=FILE],[Path to tcpdump binary]),
  1653. [ if test -x $withval ; then
  1654. tcpdump_path=$withval
  1655. AC_MSG_RESULT([Using tcpdump in $tcpdump_path])
  1656. else
  1657. AC_MSG_RESULT([Error: $withval does not exist or is not executable])
  1658. fi ],
  1659. [ AC_PATH_PROG(tcpdump_path, tcpdump, "no", [$PATH:/usr/sbin:/sbin:/usr/local/sbin]) ])
  1660. if test "$tcpdump_path" = "no"; then
  1661. AC_MSG_WARN([Unable to find tcpdump. Please specify --with-tcpdump.
  1662. Disabling --verbose])
  1663. else
  1664. AC_DEFINE([HAVE_TCPDUMP], [1], [Do we have tcpdump?])
  1665. AC_DEFINE_UNQUOTED(TCPDUMP_BINARY, "$tcpdump_path", [The tcpdump binary initially used])
  1666. fi
  1667. AM_CONDITIONAL([ENABLE_TCPDUMP], test "$tcpdump_path" != "no" -a x$have_pcap_dump_fopen = xyes)
  1668. if test x$tcpdump_path != xno -a x$have_pcap_dump_fopen = xyes ; then
  1669. AC_DEFINE([ENABLE_VERBOSE], [1], [Do we have tcpdump and pcap_dump_fopen()?])
  1670. else
  1671. AC_MSG_WARN([Your version of libpcap does not support --verbose])
  1672. fi
  1673. dnl No 'make test' when cross compile
  1674. AC_MSG_CHECKING(for 'make test' profile)
  1675. if test "$host" = "$build" ; then
  1676. AC_MSG_RESULT([yes])
  1677. else
  1678. AC_MSG_WARN(Unable to do tests when cross-compiling)
  1679. AC_MSG_RESULT([Unable to do tests when cross-compiling])
  1680. fi
  1681. dnl Allows user to choose which nic to use for testing purposes
  1682. AC_ARG_WITH(testnic,
  1683. AS_HELP_STRING([--with-testnic=NIC],[Select which network card to use for testing]),
  1684. [ nic1=$withval
  1685. nic2=$withval
  1686. AC_MSG_RESULT([Using --with-testnic=$withval])],
  1687. [
  1688. case $host in
  1689. *-*-linux*)
  1690. nic1=eth0
  1691. nic2=eth0
  1692. ;;
  1693. *-*-solaris*)
  1694. nic1=hme0
  1695. nic2=hme0
  1696. ;;
  1697. *-*-sunos*)
  1698. nic1=hme0
  1699. nic2=hme0
  1700. ;;
  1701. *-apple-darwin*)
  1702. nic1=en0
  1703. nic2=en0
  1704. ;;
  1705. *-*-openbsd*)
  1706. nic1=xl0
  1707. nic2=xl0
  1708. ;;
  1709. *-*-freebsd*)
  1710. nic1=em0
  1711. nic2=em0
  1712. ;;
  1713. *-*-cygwin)
  1714. nic1=%0
  1715. nic2=%0
  1716. ;;
  1717. *)
  1718. AC_MSG_RESULT([$host is unknown! Using first non-loopback interface])
  1719. nic1=%0
  1720. nic2=%0
  1721. ;;
  1722. esac])
  1723. AC_ARG_ENABLE([test_hexdump],
  1724. AS_HELP_STRING([--enable-test-hexdump],[Enable hexdump pcap on test failure]))
  1725. if test "x$enable_test_hexdump" = "xyes"; then
  1726. test_hexdump=yes
  1727. else
  1728. test_hexdump=no
  1729. fi
  1730. AC_SUBST(test_hexdump)
  1731. dnl There's a bug in OS X which causes pcap_findalldevs() to make the wifi NIC to disassociate
  1732. dnl so under OSX we disable the interface list feature
  1733. disable_pcap_findalldevs=no
  1734. osx_frameworks=no
  1735. AC_MSG_CHECKING([for OS version])
  1736. dnl these need to be dynamic based on OS
  1737. case $host in
  1738. *-*-linux*)
  1739. AC_DEFINE([HAVE_LINUX], [1], [Building Linux])
  1740. AC_MSG_RESULT(Linux)
  1741. ;;
  1742. *-*-solaris*)
  1743. AC_DEFINE([HAVE_SOLARIS], [1], [Building Solaris])
  1744. AC_MSG_RESULT(Solaris)
  1745. ;;
  1746. *-*-sunos*)
  1747. AC_DEFINE([HAVE_SUNOS], [1], [Building SunOS])
  1748. AC_MSG_RESULT(SunOS)
  1749. ;;
  1750. *-apple-darwin*)
  1751. if test x$libpcap_version_096 = xno ; then
  1752. disable_pcap_findalldevs=yes
  1753. fi
  1754. osx_frameworks=yes
  1755. AC_DEFINE([HAVE_DARWIN], [1], [Building Apple/Darwin])
  1756. AC_MSG_RESULT(Apple macOS)
  1757. ;;
  1758. *-*-openbsd*)
  1759. AC_DEFINE([HAVE_OPENBSD], [1], [Building Open BSD])
  1760. AC_MSG_RESULT(OpenBSD)
  1761. ;;
  1762. *-*-freebsd*)
  1763. AC_DEFINE([HAVE_FREEBSD], [1], [Building Free BSD])
  1764. AC_MSG_RESULT(FreeBSD)
  1765. ;;
  1766. *-*-cygwin)
  1767. AC_MSG_RESULT(Win32/Cygwin)
  1768. AC_DEFINE([HAVE_CYGWIN], [1], [Building Cygwin])
  1769. ;;
  1770. *)
  1771. AC_MSG_RESULT([$host is unknown!])
  1772. ;;
  1773. esac
  1774. AM_CONDITIONAL([ENABLE_OSX_FRAMEWORKS], test "$osx_frameworks" = "yes")
  1775. AC_ARG_WITH(testnic2,
  1776. AS_HELP_STRING([--with-testnic2=NIC2],[Select an optional 2nd network card to use for testing]),
  1777. [ nic2=$withval ])
  1778. AC_MSG_NOTICE([Using $nic1 for 1st test network interface card])
  1779. AC_MSG_NOTICE([Using $nic2 for 2nd test network interface card])
  1780. AC_SUBST(nic1)
  1781. AC_SUBST(nic2)
  1782. AC_MSG_CHECKING([if it's ok to use pcap_findalldevs()])
  1783. if test x$disable_pcap_findalldevs = xno ; then
  1784. AC_DEFINE([ENABLE_PCAP_FINDALLDEVS], [1], [Enable use of pcap_findalldevs()])
  1785. AC_MSG_RESULT(yes)
  1786. else
  1787. AC_MSG_RESULT(no)
  1788. fi
  1789. LIBOPTS_CHECK(libopts)
  1790. AC_CONFIG_FILES([Makefile
  1791. doxygen.cfg
  1792. lib/Makefile
  1793. docs/Makefile
  1794. src/Makefile
  1795. src/tcpedit/Makefile
  1796. src/fragroute/Makefile
  1797. src/common/Makefile
  1798. src/defines.h
  1799. test/Makefile
  1800. test/config
  1801. scripts/Makefile])
  1802. AC_OUTPUT
  1803. # Configuration results
  1804. AC_MSG_RESULT([
  1805. ##########################################################################
  1806. TCPREPLAY Suite Configuration Results (${TCPREPLAY_VERSION})
  1807. ##########################################################################
  1808. libpcap: ${foundpcap} (${libpcap_version})
  1809. PF_RING libpcap ${pf_ring_found} ${pf_ring_lib}
  1810. libdnet: ${founddnet} ${libdnet_version}
  1811. autogen: ${AUTOGEN} (${AUTOGEN_VERSION})
  1812. Use libopts tearoff: ${enable_local_libopts}
  1813. 64bit counter support: ${use64bit_counters}
  1814. tcpdump binary path: ${tcpdump_path}
  1815. fragroute support: ${enable_fragroute}
  1816. tcpbridge support: ${enable_tcpbridge}
  1817. tcpliveplay support: ${enable_tcpliveplay}
  1818. Supported Packet Injection Methods (*):
  1819. Linux TX_RING: ${have_tx_ring}
  1820. Linux PF_PACKET: ${have_pf}
  1821. BSD BPF: ${have_bpf}
  1822. libdnet: ${have_libdnet}
  1823. pcap_inject: ${have_pcap_inject}
  1824. pcap_sendpacket: ${have_pcap_sendpacket} **
  1825. pcap_netmap ${have_pcap_netmap}
  1826. Linux/BSD netmap: ${have_netmap}
  1827. Tuntap device support: ${have_tuntap}
  1828. LIBXDP for AF_XDP socket: ${have_libxdp}
  1829. * In order of preference; see configure --help to override
  1830. ** Required for tcpbridge
  1831. ])
  1832. case $host in
  1833. *-*-cygwin)
  1834. AC_MSG_WARN([Windows/Cygwin support is still somewhat experimental.
  1835. Please report any bugs! https://github.com/appneta/tcpreplay/issues])
  1836. ;;
  1837. esac