2014-04-26 02:57:48 +02:00
|
|
|
AC_PREREQ(2.60)
|
2018-07-25 06:18:45 +02:00
|
|
|
AC_INIT(iwd, 0.4)
|
2014-04-26 02:57:48 +02:00
|
|
|
|
2014-04-28 01:12:54 +02:00
|
|
|
AC_CONFIG_HEADERS(config.h)
|
|
|
|
AC_CONFIG_AUX_DIR(build-aux)
|
|
|
|
AC_CONFIG_MACRO_DIR(build-aux)
|
|
|
|
|
2014-04-26 02:57:48 +02:00
|
|
|
AM_INIT_AUTOMAKE([foreign subdir-objects color-tests silent-rules
|
|
|
|
tar-pax no-dist-gzip dist-xz])
|
|
|
|
|
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
|
|
|
|
|
|
|
AM_MAINTAINER_MODE
|
|
|
|
|
|
|
|
AC_PREFIX_DEFAULT(/usr/local)
|
|
|
|
|
2017-08-30 23:09:42 +02:00
|
|
|
PKG_PROG_PKG_CONFIG
|
|
|
|
|
2014-07-15 22:18:59 +02:00
|
|
|
COMPILER_FLAGS
|
|
|
|
|
|
|
|
AC_LANG_C
|
|
|
|
|
2014-04-26 02:57:48 +02:00
|
|
|
AC_PROG_CC
|
2014-07-15 22:18:59 +02:00
|
|
|
AC_PROG_CC_PIE
|
2014-04-26 02:57:48 +02:00
|
|
|
AC_PROG_INSTALL
|
2014-04-28 01:12:54 +02:00
|
|
|
AC_PROG_MKDIR_P
|
|
|
|
AC_PROG_LN_S
|
|
|
|
|
|
|
|
LT_PREREQ(2.2)
|
|
|
|
LT_INIT([disable-static])
|
|
|
|
|
2014-07-16 02:10:15 +02:00
|
|
|
AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],
|
|
|
|
[disable code optimization through compiler]), [
|
|
|
|
if (test "${enableval}" = "no"); then
|
2016-08-10 00:32:56 +02:00
|
|
|
CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -O0"
|
2014-07-16 02:10:15 +02:00
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
|
|
|
|
[enable compiling with debugging information]), [
|
|
|
|
if (test "${enableval}" = "yes" &&
|
|
|
|
test "${ac_cv_prog_cc_g}" = "yes"); then
|
|
|
|
CFLAGS="$CFLAGS -g"
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
|
|
|
|
[enable position independent executables flag]), [
|
|
|
|
if (test "${enableval}" = "yes" &&
|
|
|
|
test "${ac_cv_prog_cc_pie}" = "yes"); then
|
|
|
|
CFLAGS="$CFLAGS -fPIE"
|
|
|
|
LDFLAGS="$LDFLAGS -pie"
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
2017-12-13 00:49:10 +01:00
|
|
|
|
2017-12-06 20:19:30 +01:00
|
|
|
AC_ARG_ENABLE(sim_hardcoded, AC_HELP_STRING([--disable-sim-hardcoded],
|
|
|
|
[disable hard coded SIM keys]),
|
|
|
|
[enable_sim_hardcoded=${enableval}])
|
|
|
|
AM_CONDITIONAL(SIM_HARDCODED, test "${enable_sim_hardcoded}" != "no")
|
|
|
|
|
2017-12-13 00:49:10 +01:00
|
|
|
AC_ARG_ENABLE(ofono, AC_HELP_STRING([--disable-ofono],
|
|
|
|
[disable ofono support]),
|
|
|
|
[echo "CHECKING"
|
|
|
|
enable_ofono=${enableval}])
|
|
|
|
AM_CONDITIONAL(OFONO, test "${enable_ofono}" != "no")
|
|
|
|
|
2015-04-26 18:14:08 +02:00
|
|
|
if (test "${prefix}" = "NONE"); then
|
|
|
|
dnl no prefix and no localstatedir, so default to /var
|
|
|
|
if (test "$localstatedir" = '${prefix}/var'); then
|
|
|
|
AC_SUBST([localstatedir], ['/var'])
|
|
|
|
fi
|
|
|
|
|
|
|
|
prefix="${ac_default_prefix}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if (test "$localstatedir" = '${prefix}/var'); then
|
|
|
|
storagedir="${prefix}/var/lib/iwd"
|
|
|
|
else
|
|
|
|
storagedir="${localstatedir}/lib/iwd"
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_DEFINE_UNQUOTED(STORAGEDIR, "${storagedir}",
|
|
|
|
[Directory for the storage files])
|
2016-11-02 21:25:09 +01:00
|
|
|
AC_DEFINE_UNQUOTED(CONFIGDIR, "/etc/iwd", [Configuration directory])
|
|
|
|
|
2015-02-27 21:04:34 +01:00
|
|
|
AC_CHECK_HEADERS(linux/types.h linux/if_alg.h)
|
|
|
|
|
2018-05-18 00:41:11 +02:00
|
|
|
AC_CHECK_HEADERS_ONCE(execinfo.h)
|
|
|
|
AC_CHECK_LIB(execinfo, backtrace)
|
|
|
|
|
2018-02-10 11:10:26 +01:00
|
|
|
if (test "${enable_client}" != "no"); then
|
|
|
|
AC_CHECK_HEADERS(readline/readline.h, enable_readline=yes,
|
2017-03-23 17:48:58 +01:00
|
|
|
AC_MSG_ERROR(readline header files are required))
|
2018-02-10 11:10:26 +01:00
|
|
|
fi
|
2017-03-23 17:48:58 +01:00
|
|
|
|
2018-02-09 17:14:31 +01:00
|
|
|
AC_ARG_ENABLE([client], AC_HELP_STRING([--disable-client],
|
|
|
|
[don't install iwctl client utility]),
|
|
|
|
[enable_client=${enableval}])
|
|
|
|
AM_CONDITIONAL(CLIENT, test "${enable_client}" != "no")
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([monitor], AC_HELP_STRING([--disable-monitor],
|
|
|
|
[don't install iwmon monitor utility]),
|
|
|
|
[enable_monitor=${enableval}])
|
|
|
|
AM_CONDITIONAL(MONITOR, test "${enable_monitor}" != "no")
|
|
|
|
|
2018-02-09 16:36:12 +01:00
|
|
|
AC_ARG_ENABLE([dbus-policy], AC_HELP_STRING([--disable-dbus-policy],
|
2018-01-29 11:55:54 +01:00
|
|
|
[don't install D-Bus system policy file]),
|
2018-02-09 16:36:12 +01:00
|
|
|
[enable_dbus_policy=${enableval}])
|
|
|
|
AM_CONDITIONAL(DBUS_POLICY, test "${enable_dbus_policy}" != "no")
|
|
|
|
|
|
|
|
AC_ARG_WITH([dbus-datadir], AC_HELP_STRING([--with-dbus-datadir=DIR],
|
|
|
|
[path to D-Bus data directory]),
|
|
|
|
[path_dbus_datadir=${withval}])
|
|
|
|
if (test "${enable_dbus_policy}" != "no" && test -z "${path_dbus_datadir}"); then
|
|
|
|
AC_MSG_CHECKING([D-Bus data directory])
|
|
|
|
path_dbus_datadir="`$PKG_CONFIG --variable=datadir dbus-1`"
|
|
|
|
if (test -z "${path_dbus_datadir}"); then
|
2018-02-10 11:05:58 +01:00
|
|
|
path_dbus_datadir="`$PKG_CONFIG --variable=sysconfdir dbus-1`"
|
|
|
|
if (test -z "${path_dbus_datadir}"); then
|
|
|
|
AC_MSG_ERROR([D-Bus data directory is required])
|
|
|
|
fi
|
2017-05-05 00:47:40 +02:00
|
|
|
fi
|
2018-02-09 16:36:12 +01:00
|
|
|
AC_MSG_RESULT([${path_dbus_datadir}])
|
2017-05-05 00:47:40 +02:00
|
|
|
fi
|
2018-02-09 16:36:12 +01:00
|
|
|
AC_SUBST(DBUS_DATADIR, [${path_dbus_datadir}])
|
2017-05-05 00:47:40 +02:00
|
|
|
|
2018-02-10 18:42:43 +01:00
|
|
|
AC_ARG_ENABLE([systemd-service], AC_HELP_STRING([--disable-systemd-service],
|
|
|
|
[don't install systemd service file]),
|
|
|
|
[enable_systemd_service=${enableval}])
|
|
|
|
AM_CONDITIONAL(SYSTEMD_SERVICE, test "${enable_systemd_service}" != "no")
|
|
|
|
|
|
|
|
AC_ARG_WITH([systemd-unitdir], AC_HELP_STRING([--with-systemd-unitdir=DIR],
|
|
|
|
[path to systemd unit directory]),
|
|
|
|
[path_systemd_unitdir=${withval}])
|
|
|
|
if (test "${enable_systemd_service}" != "no" && test -z "${path_systemd_unitdir}"); then
|
|
|
|
AC_MSG_CHECKING([systemd unit directory])
|
|
|
|
path_systemd_unitdir="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`"
|
|
|
|
if (test -z "${path_systemd_unitdir}"); then
|
|
|
|
AC_MSG_ERROR([systemd unit directory is required])
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT([${path_systemd_unitdir}])
|
|
|
|
fi
|
|
|
|
AC_SUBST(SYSTEMD_UNITDIR, [${path_systemd_unitdir}])
|
|
|
|
|
2018-01-29 12:04:17 +01:00
|
|
|
AC_ARG_ENABLE([docs], AC_HELP_STRING([--enable-docs],
|
|
|
|
[build documentation and manual pages]),
|
|
|
|
[enable_docs=${enableval}])
|
|
|
|
if (test "${enable_docs}" = "yes"); then
|
|
|
|
AC_PATH_PROG(A2X, [a2x], [], $PATH:/sbin:/usr/sbin)
|
|
|
|
fi
|
2017-03-07 22:06:50 +01:00
|
|
|
AM_CONDITIONAL(BUILD_DOCS, test "$A2X" != "")
|
2014-08-15 21:10:58 +02:00
|
|
|
|
2014-04-28 01:12:54 +02:00
|
|
|
AC_CONFIG_FILES(Makefile)
|
|
|
|
|
|
|
|
AC_OUTPUT
|
2014-04-26 02:57:48 +02:00
|
|
|
|
2014-04-28 01:12:54 +02:00
|
|
|
AC_MSG_RESULT([
|
|
|
|
$PACKAGE_NAME $VERSION
|
|
|
|
])
|