mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Move the libpcap version number check into acinclude.m4, call it
PCAP_IS_SUITABLE.
This commit is contained in:
parent
49e6ad8560
commit
701fe380f8
3 changed files with 31 additions and 22 deletions
23
acinclude.m4
23
acinclude.m4
|
|
@ -26,3 +26,26 @@ recvfrom (0, NULL, 0, 0, NULL, &arg);],[
|
|||
[Type of 6th argument to recvfrom()])
|
||||
AC_LANG_POP(C++)
|
||||
])
|
||||
|
||||
AC_DEFUN([PCAP_IS_SUITABLE],
|
||||
[
|
||||
AC_MSG_CHECKING(if libpcap version is suitable)
|
||||
AC_TRY_RUN([
|
||||
#include <stdio.h>
|
||||
extern char pcap_version[];
|
||||
int main() {
|
||||
int major, minor1, minor2;
|
||||
sscanf(pcap_version,"%d.%d.%d", &major, &minor1, &minor2);
|
||||
if (major > 0)
|
||||
exit(0);
|
||||
if (minor1 < 9)
|
||||
exit(1);
|
||||
if (minor2 < 4)
|
||||
exit(1);
|
||||
exit(0);
|
||||
}
|
||||
],
|
||||
[AC_MSG_RESULT(yes); $1],
|
||||
[AC_MSG_RESULT(no); $2],
|
||||
[AC_MSG_RESULT(cross-compiling -- assuming yes); $3])
|
||||
])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue