1# -*- Autoconf -*-
2# configure.ac -- Autoconf script for qcacld-tools
3#
4
5AC_PREREQ(2.61)
6AC_INIT([wpa_supplicant_8_lib], 1.0.0)
7AM_INIT_AUTOMAKE([foreign])
8AM_MAINTAINER_MODE
9AC_CONFIG_HEADERS([config.h])
10AC_CONFIG_MACRO_DIR([m4])
11LT_INIT
12
13# Checks for programs.
14AC_PROG_CC
15AM_PROG_CC_C_O
16AC_PROG_LIBTOOL
17AC_PROG_AWK
18AC_PROG_CPP
19AC_PROG_INSTALL
20AC_PROG_LN_S
21AC_PROG_MAKE_SET
22PKG_PROG_PKG_CONFIG
23
24AC_ARG_ENABLE([debug],
25        [  --enable-debug    Turn on debugging],
26        [case "${enableval}" in
27            yes) debug=true ;;
28            no)  debug=false ;;
29            *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
30        esac],[debug=false])
31AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
32
33has_libnl_ver=0
34# libnl-2 provides only libnl-2.0.pc file, so we check for separate libnl-genl-3.0.pc
35# pkg-config file just for libnl-3.0 case.
36#
37PKG_CHECK_MODULES([LIBNL], [libnl-3.0 >= 3.0 libnl-genl-3.0 >= 3.0], [has_libnl_ver=3], [
38   PKG_CHECK_MODULES([LIBNL], [libnl-2.0 >= 2.0], [has_libnl_ver=2], [
39           PKG_CHECK_MODULES([LIBNL], [libnl-1], [has_libnl_ver=1], [has_libnl_ver=0])])])
40
41if (test "$has_libnl_ver" -eq 0); then
42        AC_MSG_ERROR(libnl and libnl-genl are required but were not found)
43fi
44
45
46AC_ARG_VAR(WPA_SUPPLICANT_DIR,[Path to Wpa-supplicant-dir ])
47AS_IF([test "${WPA_SUPPLICANT_DIR}" = ""],[AC_MSG_ERROR("Provide WPA_SUPPLICANT_DIR=path to wpa_supplicant dir")])
48
49AC_SUBST([LIBNL_CFLAGS])
50AC_SUBST([LIBNL_LIBS])
51
52# Checks for typedefs, structures, and compiler characteristics.
53AC_HEADER_STDBOOL
54AC_HEADER_STDC
55AC_C_INLINE
56AC_TYPE_INT64_T
57AC_TYPE_PID_T
58AC_TYPE_SIZE_T
59AC_TYPE_SSIZE_T
60AC_TYPE_UINT16_T
61AC_TYPE_UINT32_T
62AC_TYPE_UINT8_T
63
64# Checks for library functions.
65AC_FUNC_ERROR_AT_LINE
66AC_FUNC_FORK
67AC_FUNC_MALLOC
68
69AC_CONFIG_FILES([ \
70    Makefile
71])
72AC_OUTPUT
73