Debian Codegraph @

build/m4/aircrack_ng_libnl.m4

raw
1 dnl Aircrack-ng
2 dnl
3 dnl Copyright (C) 2017 Joseph Benden <[email protected]>
4 dnl
5 dnl Autotool support was written by: Joseph Benden <[email protected]>
6 dnl
7 dnl This program is free software; you can redistribute it and/or modify
8 dnl it under the terms of the GNU General Public License as published by
9 dnl the Free Software Foundation; either version 2 of the License, or
10 dnl (at your option) any later version.
11 dnl
12 dnl This program is distributed in the hope that it will be useful,
13 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 dnl GNU General Public License for more details.
16 dnl
17 dnl You should have received a copy of the GNU General Public License
18 dnl along with this program; if not, write to the Free Software
19 dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 dnl
21 dnl In addition, as a special exception, the copyright holders give
22 dnl permission to link the code of portions of this program with the
23 dnl OpenSSL library under certain conditions as described in each
24 dnl individual source file, and distribute linked combinations
25 dnl including the two.
26 dnl
27 dnl You must obey the GNU General Public License in all respects
28 dnl for all of the code used other than OpenSSL.
29 dnl
30 dnl If you modify file(s) with this exception, you may extend this
31 dnl exception to your dnl version of the file(s), but you are not obligated
32 dnl to do so.
33 dnl
34 dnl If you dnl do not wish to do so, delete this exception statement from your
35 dnl version.
36 dnl
37 dnl If you delete this exception statement from all source files in the
38 dnl program, then also delete it here.
39
40 AC_DEFUN([AIRCRACK_NG_LIBNL], [
41 AC_ARG_ENABLE([libnl],[AS_HELP_STRING([--enable-libnl], [include netlink library, [default=yes on Linux]])])
42 _aircrack_ng_enable_libnl=no
43
44 case "$host_os" in
45 LINUX* | linux*)
46 _aircrack_ng_enable_libnl=yes
47 ;;
48 esac
49
50 case "$_aircrack_ng_enable_libnl" in
51 yes)
52 case "$enable_libnl" in
53 yes | "" | auto)
54 PKG_CHECK_MODULES([LIBNL3X], [libnl-3.0 >= 3.2], [
55 # CPPFLAGS="$CPPFLAGS $LIBNL3X_CFLAGS -DCONFIG_LIBNL30 -DCONFIG_LIBNL"
56 # LIBS="$LIBS $LIBNL3X_LIBS -lnl-genl-3"
57 AC_DEFINE([CONFIG_LIBNL30], [1], [Define this if libnl-3.0 is present on your system])
58 LIBNL_CFLAGS="$LIBNL3X_CFLAGS"
59 LIBNL_LIBS="$LIBNL3X_LIBS -lnl-genl-3"
60 NLLIBNAME="libnl-3.0"
61 ], [
62 PKG_CHECK_MODULES([LIBNL31], [libnl-3.1 = 3.1], [
63 AC_DEFINE([CONFIG_LIBNL30], [1], [Define this if libnl-3.0 is present on your system])
64 LIBNL_CFLAGS="$LIBNL31_CFLAGS"
65 LIBNL_LIBS="$LIBNL31_LIBS -lnl-genl"
66 NLLIBNAME="libnl-3.1"
67 ], [
68 PKG_CHECK_MODULES([LIBNL30], [libnl-3.0 >= 3], [
69 AC_DEFINE([CONFIG_LIBNL30], [1], [Define this if libnl-3.0 is present on your system])
70 LIBNL_CFLAGS="$LIBNL30_CFLAGS"
71 LIBNL_LIBS="$LIBNL30_LIBS -lnl-genl"
72 NLLIBNAME="libnl-3.0"
73 ], [
74 PKG_CHECK_MODULES([LIBNL1], [libnl-1 >= 1], [
75 LIBNL_CFLAGS="$LIBNL1_CFLAGS"
76 LIBNL_LIBS="$LIBNL1_LIBS"
77 NLLIBNAME="libnl-1"
78 ], [
79 PKG_CHECK_MODULES([LIBNLT], [libnl-tiny >= 1], [
80 AC_DEFINE([CONFIG_LIBNL20], [1], [Define this if libnl-tiny is present on your system])
81 LIBNL_CFLAGS="$LIBNLT_CFLAGS"
82 LIBNL_LIBS="$LIBNLT_LIBS"
83 NLLIBNAME="libnl-tiny"
84 ], [
85 AC_MSG_RESULT([could not find development files for any supported version of libnl. install either libnl1 or libnl3.])
86 NLLIBNAME=""
87 ])
88 ])
89 ])
90 ])
91 ])
92
93 AC_SUBST([LIBNL_CFLAGS])
94 AC_SUBST([LIBNL_LIBS])
95 AC_SUBST([NLLIBNAME])
96
97 if test "x$NLLIBNAME" = x; then
98 NLLIBNAME_FOUND="no"
99 else
100 NLLIBNAME_FOUND="yes, found $NLLIBNAME"
101 AC_DEFINE([CONFIG_LIBNL], [1], [Define this if you have any supported netlink library required])
102 fi
103 ;;
104 *)
105 NLLIBNAME_FOUND="not enabled"
106 ;;
107 esac
108 ;;
109 *)
110 NLLIBNAME_FOUND="not required"
111 ;;
112 esac
113 ])