• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# -*- Autoconf -*-
2# configure.ac -- Autoconf script for qcacld-tools
3#
4
5AC_PREREQ(2.61)
6AC_INIT([cld80211-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
45if (test "$has_libnl_ver" -gt 1); then
46        AC_DEFINE([HAVE_LIBNL20], [1], [Define if you have libnl-2.0 or higher])
47fi
48
49if (test "$has_libnl_ver" -gt 2); then
50        AC_DEFINE([HAVE_LIBNL30], [1], [Define if you have libnl-3.0 or higher])
51fi
52
53AC_SUBST([LIBNL_CFLAGS])
54AC_SUBST([LIBNL_LIBS])
55
56# Checks for typedefs, structures, and compiler characteristics.
57AC_HEADER_STDBOOL
58AC_HEADER_STDC
59AC_C_INLINE
60AC_TYPE_INT64_T
61AC_TYPE_PID_T
62AC_TYPE_SIZE_T
63AC_TYPE_SSIZE_T
64AC_TYPE_UINT16_T
65AC_TYPE_UINT32_T
66AC_TYPE_UINT8_T
67
68# Checks for library functions.
69AC_FUNC_ERROR_AT_LINE
70AC_FUNC_FORK
71AC_FUNC_MALLOC
72
73AC_CONFIG_FILES([ \
74    Makefile \
75    cld80211-lib.pc
76])
77AC_OUTPUT
78