4 AM_INIT_AUTOMAKE([foreign subdir-objects color-tests])
5 AM_CONFIG_HEADER(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 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28, dummy=yes,
63 AC_MSG_ERROR(GLib >= 2.28 is required))
67 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.2, dummy=yes,
68 AC_MSG_ERROR(D-Bus >= 1.2 is required))
72 PKG_CHECK_MODULES(LIBNL2, libnl-2.0, [
73 NETLINK_CFLAGS=${IBNL2_CFLAGS}
74 NETLINK_LIBS=${LIBNL2_LIBS}
76 PKG_CHECK_MODULES(LIBNL1, libnl-1, dummy=yes,
77 AC_MSG_ERROR(Netlink library is required))
78 AC_DEFINE(NEED_LIBNL_COMPAT, 1,
79 [Define to 1 if you need libnl-1 compat functions.])
80 NETLINK_CFLAGS=${LIBNL1_CFLAGS}
81 NETLINK_LIBS=${LIBNL1_LIBS}
83 AC_SUBST(NETLINK_CFLAGS)
84 AC_SUBST(NETLINK_LIBS)
86 AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test],
87 [enable test/example scripts]), [enable_test=${enableval}])
88 AM_CONDITIONAL(TEST, test "${enable_test}" = "yes")
90 AC_ARG_ENABLE(tools, AC_HELP_STRING([--enable-tools],
91 [enable testing tools]), [enable_tools=${enableval}])
92 AM_CONDITIONAL(TOOLS, test "${enable_tools}" = "yes")
94 AC_ARG_ENABLE(nfctype1,
95 AC_HELP_STRING([--enable-nfctype1], [enable NFC forum type 1 tags support]),
96 [enable_nfctype1=${enableval}], [enable_nfctype1="no"])
97 AM_CONDITIONAL(NFCTYPE1, test "${enable_nfctype1}" != "no")
98 AM_CONDITIONAL(NFCTYPE1_BUILTIN, test "${enable_nfctype1}" = "builtin")
100 AC_ARG_ENABLE(nfctype2,
101 AC_HELP_STRING([--enable-nfctype2], [enable NFC forum type 2 tags support]),
102 [enable_nfctype2=${enableval}], [enable_nfctype2="no"])
103 AM_CONDITIONAL(NFCTYPE2, test "${enable_nfctype2}" != "no")
104 AM_CONDITIONAL(NFCTYPE2_BUILTIN, test "${enable_nfctype2}" = "builtin")
106 AC_ARG_ENABLE(nfctype3,
107 AC_HELP_STRING([--enable-nfctype3], [enable NFC forum type 3 tags support]),
108 [enable_nfctype3=${enableval}], [enable_nfctype3="no"])
109 AM_CONDITIONAL(NFCTYPE3, test "${enable_nfctype3}" != "no")
110 AM_CONDITIONAL(NFCTYPE3_BUILTIN, test "${enable_nfctype3}" = "builtin")
112 AC_ARG_ENABLE(nfctype4,
113 AC_HELP_STRING([--enable-nfctype4], [enable NFC forum type 4 tags support]),
114 [enable_nfctype4=${enableval}], [enable_nfctype4="no"])
115 AM_CONDITIONAL(NFCTYPE4, test "${enable_nfctype4}" != "no")
116 AM_CONDITIONAL(NFCTYPE4_BUILTIN, test "${enable_nfctype4}" = "builtin")
119 AC_HELP_STRING([--enable-p2p], [enable NFC peer to peer support]),
120 [enable_p2p=${enableval}], [enable_p2p="no"])
121 AM_CONDITIONAL(P2P, test "${enable_p2p}" != "no")
122 AM_CONDITIONAL(P2P_BUILTIN, test "${enable_p2p}" = "builtin")
124 AC_OUTPUT(Makefile include/version.h neard.pc)