4 AM_INIT_AUTOMAKE([foreign subdir-objects color-tests])
5 AC_CONFIG_HEADERS(config.h)
7 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
11 AC_PREFIX_DEFAULT(/usr/local)
13 if (test "${libdir}" = '${exec_prefix}/lib'); then
14 libdir="${prefix}/lib"
17 plugindir="${libdir}/near/plugins"
29 m4_define([_LT_AC_TAGCONFIG], [])
30 m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])])
35 AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],
36 [disable code optimization through compiler]), [
37 if (test "${enableval}" = "no"); then
42 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
43 [enable compiling with debugging information]), [
44 if (test "${enableval}" = "yes" &&
45 test "${ac_cv_prog_cc_g}" = "yes"); then
50 AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
51 [enable position independent executables flag]), [
52 if (test "${enableval}" = "yes" &&
53 test "${ac_cv_prog_cc_pie}" = "yes"); then
54 CFLAGS="$CFLAGS -fPIE"
55 LDFLAGS="$LDFLAGS -pie"
59 AC_CHECK_LIB(dl, dlopen, dummy=yes,
60 AC_MSG_ERROR(dynamic linking loader is required))
62 GLIB_DEPS="glib-2.0 >= 2.28"
63 PKG_CHECK_MODULES(GLIB, [${GLIB_DEPS}], dummy=yes,
64 AC_MSG_ERROR(GLib >= 2.28 is required))
69 DBUS_DEPS="dbus-1 >= 1.2"
70 PKG_CHECK_MODULES(DBUS, [${DBUS_DEPS}], dummy=yes,
71 AC_MSG_ERROR(D-Bus >= 1.2 is required))
76 LIBNL3_DEPS="libnl-3.0 libnl-genl-3.0"
77 PKG_CHECK_MODULES(LIBNL3, [${LIBNL3_DEPS}], [
78 NETLINK_CFLAGS=${LIBNL3_CFLAGS}
79 NETLINK_LIBS=${LIBNL3_LIBS}
80 NETLINK_DEPS=${LIBNL3_DEPS}
82 LIBNL2_DEPS="libnl-2.0"
83 PKG_CHECK_MODULES(LIBNL2, [${LIBNL2_DEPS}], [
84 NETLINK_CFLAGS=${LIBNL2_CFLAGS}
85 NETLINK_LIBS=${LIBNL2_LIBS}
86 NETLINK_DEPS=${LIBNL2_DEPS}
89 PKG_CHECK_MODULES(LIBNL1, [${LIBNL1_DEPS}], dummy=yes,
90 AC_MSG_ERROR(Netlink library is required))
91 AC_DEFINE(NEED_LIBNL_COMPAT, 1,
92 [Define to 1 if you need libnl-1 compat functions.])
93 NETLINK_CFLAGS=${LIBNL1_CFLAGS}
94 NETLINK_LIBS=${LIBNL1_LIBS}
95 NETLINK_DEPS=${LIBNL1_DEPS}
98 AC_SUBST(NETLINK_CFLAGS)
99 AC_SUBST(NETLINK_LIBS)
100 AC_SUBST(NETLINK_DEPS)
102 AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test],
103 [enable test/example scripts]),
104 [enable_test=${enableval}])
105 AM_CONDITIONAL(TEST, test "${enable_test}" = "yes")
107 AC_ARG_ENABLE(tools, AC_HELP_STRING([--enable-tools],
108 [enable testing tools]),
109 [enable_tools=${enableval}])
110 AM_CONDITIONAL(TOOLS, test "${enable_tools}" = "yes")
112 AC_ARG_ENABLE(nfctype1, AC_HELP_STRING([--disable-nfctype1],
113 [disable NFC forum type 1 tags support]),
114 [enable_nfctype1=${enableval}])
115 AM_CONDITIONAL(NFCTYPE1, test "${enable_nfctype1}" != "no")
117 AC_ARG_ENABLE(nfctype2, AC_HELP_STRING([--disable-nfctype2],
118 [disable NFC forum type 2 tags support]),
119 [enable_nfctype2=${enableval}])
120 AM_CONDITIONAL(NFCTYPE2, test "${enable_nfctype2}" != "no")
122 AC_ARG_ENABLE(nfctype3, AC_HELP_STRING([--disable-nfctype3],
123 [disable NFC forum type 3 tags support]),
124 [enable_nfctype3=${enableval}])
125 AM_CONDITIONAL(NFCTYPE3, test "${enable_nfctype3}" != "no")
127 AC_ARG_ENABLE(nfctype4, AC_HELP_STRING([--disable-nfctype4],
128 [disable NFC forum type 4 tags support]),
129 [enable_nfctype4=${enableval}])
130 AM_CONDITIONAL(NFCTYPE4, test "${enable_nfctype4}" != "no")
132 AC_ARG_ENABLE(p2p, AC_HELP_STRING([--disable-p2p],
133 [disable NFC peer to peer support]),
134 [enable_p2p=${enableval}])
135 AM_CONDITIONAL(P2P, test "${enable_p2p}" != "no")
137 AC_OUTPUT(Makefile include/version.h neard.pc)