blob: be1b33f64e73b716ea9e9dd98c58ac002844c025 [file] [log] [blame]
Aleksander Morgadoa43cecb2013-06-13 09:48:10 +02001AC_PREREQ([2.63])
Tambet Ingocc314582008-07-31 09:43:00 +03002
Aleksander Morgadode9446e2015-02-20 10:14:58 +01003dnl-----------------------------------------------------------------------------
4dnl Package and library versioning support
5dnl
6
Aleksander Morgado5c68a362013-07-19 10:00:01 +02007m4_define([mm_major_version], [1])
Aleksander Morgado19e5d5f2021-02-23 12:20:53 +01008m4_define([mm_minor_version], [17])
Aleksander Morgado5f206622020-06-23 14:06:03 +02009m4_define([mm_micro_version], [0])
Aleksander Morgadoa43cecb2013-06-13 09:48:10 +020010m4_define([mm_version],
11 [mm_major_version.mm_minor_version.mm_micro_version])
12
Aleksander Morgado2139e392013-06-13 10:56:04 +020013dnl libtool versioning for libmm-glib (-version-info c:r:a)
14dnl If the interface is unchanged, but the implementation has changed or
15dnl been fixed, then increment r.
16dnl Otherwise, increment c and zero r.
17dnl If the interface has grown (that is, the new library is compatible
18dnl with old code), increment a.
19dnl If the interface has changed in an incompatible way (that is,
20dnl functions have changed or been removed), then zero a.
Aleksander Morgado7a5a49b2021-02-23 11:35:50 +010021m4_define([mm_glib_lt_current], [7])
Aleksander Morgado2139e392013-06-13 10:56:04 +020022m4_define([mm_glib_lt_revision], [0])
Aleksander Morgado7a5a49b2021-02-23 11:35:50 +010023m4_define([mm_glib_lt_age], [7])
Aleksander Morgado2139e392013-06-13 10:56:04 +020024
Aleksander Morgadode9446e2015-02-20 10:14:58 +010025dnl-----------------------------------------------------------------------------
26dnl autoconf, automake, libtool initialization
27dnl
Aleksander Morgado6a3b7bd2020-09-18 10:31:32 +020028AC_INIT([ModemManager],
29 [mm_version],
30 [https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues],
31 [ModemManager])
Sam Spilsburya0b95db2015-07-21 13:12:44 +080032AM_INIT_AUTOMAKE([1.11.2 subdir-objects tar-ustar no-dist-gzip dist-xz -Wno-portability])
Dan Williamsb4d3ab02010-08-05 22:10:33 -050033m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
Aleksander Morgadode9446e2015-02-20 10:14:58 +010034
Adrian Bunkf31ab092013-05-12 17:10:32 +030035AM_MAINTAINER_MODE([enable])
Aleksander Morgadode9446e2015-02-20 10:14:58 +010036
Aleksander Morgadoee41e572015-02-20 09:39:10 +010037AM_SILENT_RULES([yes])
Tambet Ingocc314582008-07-31 09:43:00 +030038
Michael Biebl22f6ab42010-01-27 15:48:10 -080039AC_CONFIG_MACRO_DIR([m4])
40
Tambet Ingocc314582008-07-31 09:43:00 +030041AC_CONFIG_HEADERS(config.h)
42
Aleksander Morgadoe68bf522011-03-28 11:30:10 +020043dnl Define system extensions for various things like strcasestr()
44AC_USE_SYSTEM_EXTENSIONS
45
Tambet Ingocc314582008-07-31 09:43:00 +030046dnl Required programs
47AC_PROG_CC
48AM_PROG_CC_C_O
49AC_PROG_INSTALL
Aleksander Morgado40e6fa42017-02-15 10:10:51 +010050AC_PROG_MKDIR_P
Aleksander Morgado641ec512011-03-28 18:09:48 +020051
52dnl Initialize libtool
53LT_PREREQ([2.2])
Aleksander Morgado9f700662015-02-20 09:40:09 +010054LT_INIT([disable-static])
Tambet Ingocc314582008-07-31 09:43:00 +030055
Aleksander Morgadode9446e2015-02-20 10:14:58 +010056dnl-----------------------------------------------------------------------------
Aleksander Morgado1c078532019-11-19 11:06:43 +010057dnl Compiler warnings
58dnl
59
60dnl Make sure autoconf-archive is available
61m4_pattern_forbid([^AX_(COMPILER_FLAGS|COMPILER_FLAGS_(CFLAGS|GIR|LDFLAGS))\b],
62 [Unexpanded AX_ macro found. Please install GNU autoconf-archive])
63
64dnl Detect git or release builds
65AX_IS_RELEASE([git-directory])
66
67dnl Function type cast disabled: used throughout the code especially to
68dnl cast GAsyncReadyCallbacks with the real object type instead of GObject
69DISABLED_WARNINGS="${DISABLED_WARNINGS} -Wno-cast-function-type"
70
71dnl All message protocol structs are packed, never complain about it
72DISABLED_WARNINGS="${DISABLED_WARNINGS} -Wno-packed"
73
74dnl Setup compiler checks
75AX_COMPILER_FLAGS()
76AX_COMPILER_FLAGS_CFLAGS(,,,[${DISABLED_WARNINGS}])
77
78dnl Specify gnu89 mode
79if test "$GCC" = "yes"; then
80 CFLAGS="$CFLAGS -std=gnu89"
81fi
82
83dnl-----------------------------------------------------------------------------
Aleksander Morgadode9446e2015-02-20 10:14:58 +010084dnl Version definitions
85dnl
86
Aleksander Morgadoa43cecb2013-06-13 09:48:10 +020087dnl Version stuff
88MM_MAJOR_VERSION=mm_major_version
89MM_MINOR_VERSION=mm_minor_version
90MM_MICRO_VERSION=mm_micro_version
91MM_VERSION=mm_version
92AC_SUBST(MM_MAJOR_VERSION)
93AC_SUBST(MM_MINOR_VERSION)
94AC_SUBST(MM_MICRO_VERSION)
95AC_SUBST(MM_VERSION)
96
Aleksander Morgado2139e392013-06-13 10:56:04 +020097dnl libtool version stuff
98MM_GLIB_LT_CURRENT=mm_glib_lt_current
99MM_GLIB_LT_REVISION=mm_glib_lt_revision
100MM_GLIB_LT_AGE=mm_glib_lt_age
101AC_SUBST(MM_GLIB_LT_CURRENT)
102AC_SUBST(MM_GLIB_LT_REVISION)
103AC_SUBST(MM_GLIB_LT_AGE)
104
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100105dnl-----------------------------------------------------------------------------
Aleksander Morgado09f40c82011-11-22 11:33:35 +0100106dnl Documentation
107dnl
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100108
Aleksander Morgado09f40c82011-11-22 11:33:35 +0100109GTK_DOC_CHECK(1.0)
110
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100111dnl-----------------------------------------------------------------------------
112dnl i18n
Aleksander Morgado09f40c82011-11-22 11:33:35 +0100113dnl
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100114
Aleksander Morgadobb7311f2011-10-12 00:15:11 +0200115AM_GNU_GETTEXT([external])
Aleksander Morgado98462512017-08-25 21:35:18 +0200116AM_GNU_GETTEXT_VERSION([0.19.8])
Aleksander Morgadobb7311f2011-10-12 00:15:11 +0200117
Dan Williams9c958c92010-02-16 11:03:16 -0800118GETTEXT_PACKAGE=ModemManager
119AC_SUBST(GETTEXT_PACKAGE)
120AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
Dan Williams9c958c92010-02-16 11:03:16 -0800121
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100122dnl-----------------------------------------------------------------------------
123dnl Build dependencies
124dnl
125
Aleksander Morgado5e4b5592020-01-21 10:58:55 +0100126# NOTE! If using glib < 2.55.1, make sure you have backported the following patch to avoid
127# the daemon leaking a lot: https://gitlab.gnome.org/GNOME/glib/commit/37d9b0c6995f97ea0f744650aaf5179081f878ba
Aleksander Morgadof7757212020-01-15 18:49:09 +0100128GLIB_MIN_VERSION=2.48.0
129GLIB_BUILD_SYMBOLS="-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_48 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_48 -DGLIB_DISABLE_DEPRECATION_WARNINGS"
Aleksander Morgado1bdb1a52016-01-24 15:26:12 +0100130
Aleksander Morgadodbb06b62011-10-10 11:58:28 +0200131PKG_CHECK_MODULES(MM,
Aleksander Morgado1bdb1a52016-01-24 15:26:12 +0100132 glib-2.0 >= $GLIB_MIN_VERSION
Aleksander Morgadodbb06b62011-10-10 11:58:28 +0200133 gmodule-2.0
134 gobject-2.0
135 gio-2.0
Aleksander Morgado4804c372012-09-05 19:51:18 +0200136 gio-unix-2.0)
Aleksander Morgadoaf905062016-10-13 12:00:26 +0200137MM_CFLAGS="$MM_CFLAGS $GLIB_BUILD_SYMBOLS"
Dan Williams4fd62642012-01-27 15:13:42 -0600138AC_SUBST(MM_CFLAGS)
139AC_SUBST(MM_LIBS)
Dan Williams924814c2009-06-18 14:25:30 -0400140
Aleksander Morgadodc8d9df2012-06-26 13:01:39 +0200141PKG_CHECK_MODULES(LIBMM_GLIB,
Aleksander Morgado1bdb1a52016-01-24 15:26:12 +0100142 glib-2.0 >= $GLIB_MIN_VERSION
Aleksander Morgadoba0e4ca2011-10-26 21:08:21 +0200143 gobject-2.0
Aleksander Morgadob6d628b2012-10-02 15:08:46 +0200144 gio-2.0
145 gio-unix-2.0)
Aleksander Morgadoaf905062016-10-13 12:00:26 +0200146LIBMM_GLIB_CFLAGS="$LIBMM_GLIB_CFLAGS $GLIB_BUILD_SYMBOLS"
Aleksander Morgadodc8d9df2012-06-26 13:01:39 +0200147AC_SUBST(LIBMM_GLIB_CFLAGS)
148AC_SUBST(LIBMM_GLIB_LIBS)
Aleksander Morgadoba0e4ca2011-10-26 21:08:21 +0200149
Aleksander Morgado8f450d82011-08-17 18:14:26 +0200150PKG_CHECK_MODULES(MMCLI,
Aleksander Morgado1bdb1a52016-01-24 15:26:12 +0100151 glib-2.0 >= $GLIB_MIN_VERSION
Aleksander Morgado8f450d82011-08-17 18:14:26 +0200152 gobject-2.0
153 gio-2.0)
Aleksander Morgadoaf905062016-10-13 12:00:26 +0200154MMCLI_CFLAGS="$MMCLI_CFLAGS $GLIB_BUILD_SYMBOLS"
Aleksander Morgado8f450d82011-08-17 18:14:26 +0200155AC_SUBST(MMCLI_CFLAGS)
Aleksander Morgado6512fde2016-03-20 17:38:38 +0100156AC_SUBST(MMCLI_LIBS)
Aleksander Morgado8f450d82011-08-17 18:14:26 +0200157
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100158dnl Some required utilities
Aleksander Morgado596c9ea2013-02-06 13:55:04 +0100159GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
160AC_SUBST(GLIB_MKENUMS)
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100161
Aleksander Morgadoff4e4572014-06-13 16:54:06 +0200162GDBUS_CODEGEN=`$PKG_CONFIG --variable=gdbus_codegen gio-2.0`
Aleksander Morgado6313f572014-06-11 17:14:18 +0200163AC_SUBST(GDBUS_CODEGEN)
Tambet Ingoa93f0842008-08-13 10:05:31 +0300164
Aleksander Morgado904adbf2020-11-08 08:10:45 +0100165dnl xsltproc required in git builds only
166AC_CHECK_PROG(XSLTPROC_CHECK,xsltproc,yes)
167if test "x$ax_is_release" != "xyes" -a "x$XSLTPROC_CHECK" != "xyes"; then
168 AC_MSG_ERROR([Please install xsltproc before configuring.])
169fi
170
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100171dnl-----------------------------------------------------------------------------
172dnl Testing support
173dnl
174
175dnl Code coverage (disabled by default)
Jakub Sitnicki75520302015-01-11 15:07:22 +0100176AX_CODE_COVERAGE
177
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100178dnl-----------------------------------------------------------------------------
179dnl Introspection and bindings
180dnl
181
182dnl GObject Introspection
Christian Perschb8838b82013-08-04 13:51:27 +0200183GOBJECT_INTROSPECTION_CHECK([0.9.6])
184
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100185dnl Vala bindings
Christian Perschbfae8632013-08-06 23:12:26 +0200186VAPIGEN_CHECK(0.18)
Christian Persch81194332013-08-14 12:32:17 +0200187if test "x$enable_vala" = "xyes" -a ! -f "$VAPIGEN_MAKEFILE"; then
188 AC_MSG_ERROR([Vala bindings enabled but Makefile.vapigen not found. Install vala-devel, or pass --disable-vala])
189fi
190
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100191dnl-----------------------------------------------------------------------------
192dnl System paths
193dnl
194
195dnl DBus system directory
Aleksander Morgado596c9ea2013-02-06 13:55:04 +0100196AC_ARG_WITH(dbus-sys-dir, AS_HELP_STRING([--with-dbus-sys-dir=DIR], [where D-BUS system.d directory is]))
Tambet Ingoa93f0842008-08-13 10:05:31 +0300197if test -n "$with_dbus_sys_dir" ; then
198 DBUS_SYS_DIR="$with_dbus_sys_dir"
199else
200 DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d"
201fi
202AC_SUBST(DBUS_SYS_DIR)
203
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100204dnl udev base directory
Dan Williams50105ae2009-07-07 10:45:44 -0400205AC_ARG_WITH(udev-base-dir, AS_HELP_STRING([--with-udev-base-dir=DIR], [where udev base directory is]))
Dan Williams50105ae2009-07-07 10:45:44 -0400206if test -n "$with_udev_base_dir" ; then
207 UDEV_BASE_DIR="$with_udev_base_dir"
208else
209 UDEV_BASE_DIR="/lib/udev"
210fi
211AC_SUBST(UDEV_BASE_DIR)
212
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100213dnl systemd system unit directory
Aleksander Morgado222825d2013-02-06 15:40:28 +0100214AC_ARG_WITH([systemdsystemunitdir], AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [where systemd service files are]),
215 [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
216if test "x$with_systemdsystemunitdir" != xno; then
217 AC_SUBST([SYSTEMD_UNIT_DIR], [$with_systemdsystemunitdir])
218fi
219AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$SYSTEMD_UNIT_DIR" -a "$SYSTEMD_UNIT_DIR" != xno ])
220
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100221dnl-----------------------------------------------------------------------------
Aleksander Morgado58c955f2016-09-28 19:46:12 +0200222dnl udev support (enabled by default)
223dnl
224
225GUDEV_VERSION=147
226
227AC_ARG_WITH(udev, AS_HELP_STRING([--without-udev], [Build without udev support]), [], [with_udev=yes])
228AM_CONDITIONAL(WITH_UDEV, test "x$with_udev" = "xyes")
229case $with_udev in
230 yes)
231 PKG_CHECK_MODULES(GUDEV, [gudev-1.0 >= $GUDEV_VERSION], [have_gudev=yes],[have_gudev=no])
232 if test "x$have_gudev" = "xno"; then
233 AC_MSG_ERROR([Couldn't find gudev >= $GUDEV_VERSION. Install it, or otherwise configure using --without-udev to disable udev support.])
234 else
235 AC_DEFINE(WITH_UDEV, 1, [Define if you want udev support])
236 AC_SUBST(GUDEV_CFLAGS)
237 AC_SUBST(GUDEV_LIBS)
238 fi
239 ;;
240 *)
241 with_udev=no
242 ;;
243esac
244
245dnl-----------------------------------------------------------------------------
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100246dnl Suspend/resume support
247dnl
248
Aleksander Morgado1f139092016-04-01 13:06:55 +0200249PKG_CHECK_MODULES(LIBSYSTEMD, [libsystemd >= 209],[have_libsystemd=yes],[have_libsystemd=no])
250PKG_CHECK_MODULES(LIBSYSTEMD_LOGIN, [libsystemd-login >= 183],[have_libsystemd_login=yes],[have_libsystemd_login=no])
Dylan Van Assche756894b2020-11-27 18:07:02 +0100251PKG_CHECK_MODULES(LIBELOGIND, [libelogind >= 209], [have_elogind=yes], [have_elogind=no])
Aleksander Morgado4d6896f2017-06-22 10:51:40 +0200252AC_ARG_WITH(systemd-suspend-resume,
253 AS_HELP_STRING([--with-systemd-suspend-resume=no|yes],
254 [Enable systemd suspend/resume support [[default=auto]]]),,
255 [with_systemd_suspend_resume=auto])
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100256
Aleksander Morgado4d6896f2017-06-22 10:51:40 +0200257if test "x$with_systemd_suspend_resume" = "xauto"; then
Dylan Van Assche756894b2020-11-27 18:07:02 +0100258 if test "x$have_libsystemd" = "xyes" || test "x$have_libsystemd_login" = "xyes" || test "x$have_elogind" = "xyes"; then
Aleksander Morgado4d6896f2017-06-22 10:51:40 +0200259 with_systemd_suspend_resume=yes
Aleksander Morgado1f139092016-04-01 13:06:55 +0200260 else
Aleksander Morgado4d6896f2017-06-22 10:51:40 +0200261 with_systemd_suspend_resume=no
Aleksander Morgado1f139092016-04-01 13:06:55 +0200262 fi
Aleksander Morgadoa92b6f22015-01-15 11:53:03 +0100263fi
264
Aleksander Morgado4d6896f2017-06-22 10:51:40 +0200265case $with_systemd_suspend_resume in
266 yes)
Dylan Van Assche756894b2020-11-27 18:07:02 +0100267 if test "x$have_libsystemd" = "xno" && test "x$have_libsystemd_login" = "xno" && test "x$have_elogind" = "xno"; then
268 AC_MSG_WARN(libsystemd, libsystemd-login or elogind must be available at runtime for suspend/resume support)
Aleksander Morgado1f139092016-04-01 13:06:55 +0200269 fi
Aleksander Morgado4d6896f2017-06-22 10:51:40 +0200270 AC_DEFINE(WITH_SYSTEMD_SUSPEND_RESUME, 1, [Define if you have systemd suspend-resume support])
Aleksander Morgadoa92b6f22015-01-15 11:53:03 +0100271 ;;
272 *)
Aleksander Morgado4d6896f2017-06-22 10:51:40 +0200273 with_systemd_suspend_resume=no
Aleksander Morgadoa92b6f22015-01-15 11:53:03 +0100274 ;;
275esac
276
Aleksander Morgado4d6896f2017-06-22 10:51:40 +0200277AM_CONDITIONAL(WITH_SYSTEMD_SUSPEND_RESUME, test "x$with_systemd_suspend_resume" = "xyes")
Aleksander Morgadoa92b6f22015-01-15 11:53:03 +0100278
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100279dnl-----------------------------------------------------------------------------
Torsten Hilbrichfd0bed12017-06-21 12:59:35 +0200280dnl systemd journal support
281dnl
282
283AC_ARG_WITH(systemd-journal,
284 AS_HELP_STRING([--with-systemd-journal=no|yes|auto],
285 [Enable systemd journal support [[default=auto]]]),,
286 [with_systemd_journal=auto])
287
288if test "x$with_systemd_journal" = "xauto"; then
289 if test "x$have_libsystemd" = "xyes"; then
290 with_systemd_journal=yes
291 else
292 with_systemd_journal=no
293 fi
294fi
295
296case $with_systemd_journal in
Torsten Hilbrichfd0bed12017-06-21 12:59:35 +0200297 yes)
298 if test "x$have_libsystemd" = "xno"; then
299 AC_MSG_ERROR(libsystemd development headers are required)
Aleksander Morgado34155552017-06-22 10:30:48 +0200300 fi
Torsten Hilbrichfd0bed12017-06-21 12:59:35 +0200301 AC_DEFINE(WITH_SYSTEMD_JOURNAL, 1, [Define if you want systemd journal support])
302 ;;
303 *)
Aleksander Morgado34155552017-06-22 10:30:48 +0200304 with_systemd_journal=no
Torsten Hilbrichfd0bed12017-06-21 12:59:35 +0200305 ;;
306esac
307
308AM_CONDITIONAL(WITH_SYSTEMD_JOURNAL, test "x$with_systemd_journal" = "xyes")
309
310dnl-----------------------------------------------------------------------------
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100311dnl PolicyKit
312dnl
313
Aleksander Morgado0c7265d2013-06-10 18:30:12 +0200314PKG_CHECK_MODULES(POLKIT, [polkit-gobject-1 >= 0.97], [have_polkit=yes],[have_polkit=no])
315AC_ARG_WITH(polkit,
Aleksander Morgado0e5fdad2016-04-01 12:58:55 +0200316 AS_HELP_STRING([--with-polkit=(strict|permissive|no)],
Aleksander Morgado0c7265d2013-06-10 18:30:12 +0200317 [Enable PolicyKit support [[default=auto]]]),,
318 [with_polkit=auto])
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100319
Aleksander Morgado0c7265d2013-06-10 18:30:12 +0200320if test "x$with_polkit" = "xauto"; then
321 if test "x$have_polkit" = "xno"; then
Aleksander Morgado0e5fdad2016-04-01 12:58:55 +0200322 with_polkit="no"
Aleksander Morgado0c7265d2013-06-10 18:30:12 +0200323 else
324 with_polkit="strict"
325 fi
Aleksander Morgado0c7265d2013-06-10 18:30:12 +0200326elif test "x$with_polkit" = "xyes"; then
327 with_polkit=strict
328fi
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100329
Aleksander Morgado55c3f7d2019-09-25 13:23:42 +0200330MM_POLKIT_SERVICE=""
Aleksander Morgadoacf36f22017-06-22 10:26:12 +0200331if test "x$with_polkit" != "xno"; then
Aleksander Morgado0c7265d2013-06-10 18:30:12 +0200332 if test "x$have_polkit" = "xno"; then
333 AC_MSG_ERROR(PolicyKit development headers are required)
334 fi
Dan Williams67d936e2010-09-01 17:20:57 -0500335
Aleksander Morgado0c7265d2013-06-10 18:30:12 +0200336 case "x$with_polkit" in
337 "xpermissive")
338 MM_DEFAULT_USER_POLICY="yes"
Aleksander Morgado55c3f7d2019-09-25 13:23:42 +0200339 MM_POLKIT_SERVICE="polkit.service"
Aleksander Morgado0c7265d2013-06-10 18:30:12 +0200340 ;;
341 "xstrict")
342 MM_DEFAULT_USER_POLICY="auth_self_keep"
Aleksander Morgado55c3f7d2019-09-25 13:23:42 +0200343 MM_POLKIT_SERVICE="polkit.service"
Aleksander Morgado0c7265d2013-06-10 18:30:12 +0200344 ;;
345 *)
346 AC_MSG_ERROR([Wrong value for --with-polkit: $with_polkit])
347 ;;
348 esac
349
350 AC_DEFINE(WITH_POLKIT, 1, [Define if you have PolicyKit support])
351 AC_SUBST(POLKIT_CFLAGS)
352 AC_SUBST(POLKIT_LIBS)
353 AC_SUBST(MM_DEFAULT_USER_POLICY)
354fi
355
Aleksander Morgado55c3f7d2019-09-25 13:23:42 +0200356AC_SUBST(MM_POLKIT_SERVICE)
Aleksander Morgado0e5fdad2016-04-01 12:58:55 +0200357AM_CONDITIONAL(WITH_POLKIT, [test "x$with_polkit" != "xno"])
Dan Williams438a0472010-02-26 18:01:55 -0800358
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100359dnl-----------------------------------------------------------------------------
Aleksander Morgadoc78ba5e2019-06-01 10:23:15 +0200360dnl AT command via DBus support (disabled by default unless running in --debug)
361dnl
362dnl It is suggested that this option is only enabled in custom built systems and
363dnl only if truly required.
364dnl
365
366AC_ARG_WITH(at_command_via_dbus,
367 AS_HELP_STRING([--with-at-command-via-dbus],
368 [Build with Modem.Command() interface enabled always]),
369 [],
370 [with_at_command_via_dbus=no])
371
372if test "x$with_at_command_via_dbus" = "xyes"; then
373 AC_DEFINE(WITH_AT_COMMAND_VIA_DBUS, 1, [Define if you want to enable AT commands via DBus])
374fi
375
376dnl-----------------------------------------------------------------------------
Aleksander Morgado5b3392e2013-07-14 17:12:55 +0200377dnl MBIM support (enabled by default)
Aleksander Morgadodd5680d2013-04-06 19:23:14 +0200378dnl
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100379
Aleksander Morgado54de4192020-06-18 10:58:14 +0200380LIBMBIM_VERSION=1.24.0
Aleksander Morgado30cbf722015-10-25 15:41:08 +0100381
Aleksander Morgado5b3392e2013-07-14 17:12:55 +0200382AC_ARG_WITH(mbim, AS_HELP_STRING([--without-mbim], [Build without MBIM support]), [], [with_mbim=yes])
383AM_CONDITIONAL(WITH_MBIM, test "x$with_mbim" = "xyes")
384case $with_mbim in
385 yes)
Aleksander Morgado30cbf722015-10-25 15:41:08 +0100386 PKG_CHECK_MODULES(MBIM, [mbim-glib >= $LIBMBIM_VERSION], [have_mbim=yes],[have_mbim=no])
Aleksander Morgado5b3392e2013-07-14 17:12:55 +0200387 if test "x$have_mbim" = "xno"; then
Aleksander Morgado30cbf722015-10-25 15:41:08 +0100388 AC_MSG_ERROR([Couldn't find libmbim-glib >= $LIBMBIM_VERSION. Install it, or otherwise configure using --without-mbim to disable MBIM support.])
Aleksander Morgado0e60d962013-04-17 15:34:23 +0200389 else
Aleksander Morgado5b3392e2013-07-14 17:12:55 +0200390 AC_DEFINE(WITH_MBIM, 1, [Define if you want MBIM support])
391 AC_SUBST(MBIM_CFLAGS)
392 AC_SUBST(MBIM_LIBS)
Aleksander Morgado0e60d962013-04-17 15:34:23 +0200393 fi
Aleksander Morgado5b3392e2013-07-14 17:12:55 +0200394 ;;
395 *)
396 with_mbim=no
397 ;;
398esac
Aleksander Morgadodd5680d2013-04-06 19:23:14 +0200399
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100400dnl-----------------------------------------------------------------------------
Aleksander Morgado4804c372012-09-05 19:51:18 +0200401dnl QMI support (enabled by default)
Aleksander Morgadodd5680d2013-04-06 19:23:14 +0200402dnl
Aleksander Morgado30cbf722015-10-25 15:41:08 +0100403
Aleksander Morgadobbd36382021-02-23 11:22:18 +0100404LIBQMI_VERSION=1.28.0
Aleksander Morgado30cbf722015-10-25 15:41:08 +0100405
Aleksander Morgado4804c372012-09-05 19:51:18 +0200406AC_ARG_WITH(qmi, AS_HELP_STRING([--without-qmi], [Build without QMI support]), [], [with_qmi=yes])
407AM_CONDITIONAL(WITH_QMI, test "x$with_qmi" = "xyes")
408case $with_qmi in
409 yes)
Aleksander Morgado30cbf722015-10-25 15:41:08 +0100410 PKG_CHECK_MODULES(QMI, [qmi-glib >= $LIBQMI_VERSION], [have_qmi=yes],[have_qmi=no])
Aleksander Morgadoac588e92013-07-14 17:04:26 +0200411 if test "x$have_qmi" = "xno"; then
Aleksander Morgado30cbf722015-10-25 15:41:08 +0100412 AC_MSG_ERROR([Couldn't find libqmi-glib >= $LIBQMI_VERSION. Install it, or otherwise configure using --without-qmi to disable QMI support.])
Aleksander Morgadoac588e92013-07-14 17:04:26 +0200413 else
414 AC_DEFINE(WITH_QMI, 1, [Define if you want QMI support])
415 AC_SUBST(QMI_CFLAGS)
416 AC_SUBST(QMI_LIBS)
417 fi
Aleksander Morgado4804c372012-09-05 19:51:18 +0200418 ;;
419 *)
420 with_qmi=no
421 ;;
422esac
423
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100424dnl-----------------------------------------------------------------------------
Dan Williamsafebde42010-05-21 09:43:47 -0700425dnl Distribution version string
426dnl
427AC_ARG_WITH(dist-version, AS_HELP_STRING([--with-dist-version=<mm-dist-version>], [Define the custom version (like distribution package name and revision)]), ac_distver=$withval, ac_distver="")
428if ! test x"$ac_distver" = x""; then
429 AC_DEFINE_UNQUOTED(MM_DIST_VERSION, "$ac_distver", [Define the distribution version string])
430fi
431
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100432dnl-----------------------------------------------------------------------------
433dnl Protocol libs
434dnl
435
Dan Williams4fd62642012-01-27 15:13:42 -0600436AM_CONDITIONAL(QCDM_STANDALONE, test "yes" = "no")
Dan Williams4fd62642012-01-27 15:13:42 -0600437
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100438dnl-----------------------------------------------------------------------------
Aleksander Morgado09080072019-11-21 18:28:51 +0100439dnl Plugins
440dnl
441dnl By default all plugins are built and installed. If the user wants to build only
442dnl some specific plugins, this can be done by disabling all first and then enabling
443dnl only the ones required, e.g.:
444dnl $ ./configure \
445dnl --disable-all-plugins \
446dnl --enable-plugin-generic \
447dnl --enable-plugin-zte ...
448dnl
449dnl If the user wants all plugins except for some specific ones, those can be
450dnl explicitly disabled, e.g.:
451dnl $ ./configure \
452dnl --disable-plugin-generic \
453dnl --disable-plugin-zte ...
454dnl
455
456MM_ENABLE_ALL_PLUGINS
457
458MM_ENABLE_PLUGIN([generic])
459MM_ENABLE_PLUGIN([altair-lte])
460MM_ENABLE_PLUGIN([anydata])
Aleksander Morgado26b589c2020-05-10 10:36:47 +0200461MM_ENABLE_PLUGIN([broadmobi])
Aleksander Morgado09080072019-11-21 18:28:51 +0100462MM_ENABLE_PLUGIN([cinterion])
463MM_ENABLE_PLUGIN([dell],
464 [with_shared_sierra,
465 with_shared_novatel,
466 with_shared_xmm,
467 with_shared_telit,
468 with_shared_foxconn])
469MM_ENABLE_PLUGIN([dlink])
470MM_ENABLE_PLUGIN([fibocom],
471 [with_shared_xmm])
472MM_ENABLE_PLUGIN([foxconn],
473 [with_shared_foxconn])
Aleksander Morgado9397ed42020-09-18 10:52:06 +0200474MM_ENABLE_PLUGIN([gosuncn])
Aleksander Morgado09080072019-11-21 18:28:51 +0100475MM_ENABLE_PLUGIN([haier])
476MM_ENABLE_PLUGIN([huawei])
477MM_ENABLE_PLUGIN([iridium])
478MM_ENABLE_PLUGIN([linktop])
479MM_ENABLE_PLUGIN([longcheer])
480MM_ENABLE_PLUGIN([mbm])
481MM_ENABLE_PLUGIN([motorola])
482MM_ENABLE_PLUGIN([mtk])
483MM_ENABLE_PLUGIN([nokia])
484MM_ENABLE_PLUGIN([nokia-icera],
485 [with_shared_icera])
486MM_ENABLE_PLUGIN([novatel],
487 [with_shared_novatel])
488MM_ENABLE_PLUGIN([novatel-lte])
489MM_ENABLE_PLUGIN([option],
490 [with_shared_option])
491MM_ENABLE_PLUGIN([option-hso],
492 [with_shared_option])
493MM_ENABLE_PLUGIN([pantech])
Aleksander Morgado65560dd2020-11-19 12:00:34 +0100494MM_ENABLE_PLUGIN_DISABLED([qcom-soc])
Aleksander Morgado09080072019-11-21 18:28:51 +0100495MM_ENABLE_PLUGIN([quectel])
496MM_ENABLE_PLUGIN([samsung],
497 [with_shared_icera])
498MM_ENABLE_PLUGIN([sierra-legacy],
499 [with_shared_icera,
500 with_shared_sierra])
Aleksander Morgado28ad9942020-08-10 19:26:56 +0200501MM_ENABLE_PLUGIN([sierra],
502 [with_shared_xmm])
Aleksander Morgado09080072019-11-21 18:28:51 +0100503MM_ENABLE_PLUGIN([simtech])
504MM_ENABLE_PLUGIN([telit],
505 [with_shared_telit])
506MM_ENABLE_PLUGIN([thuraya])
507MM_ENABLE_PLUGIN([tplink])
508MM_ENABLE_PLUGIN([ublox])
509MM_ENABLE_PLUGIN([via])
510MM_ENABLE_PLUGIN([wavecom])
511MM_ENABLE_PLUGIN([x22x])
512MM_ENABLE_PLUGIN([zte],
513 [with_shared_icera])
514
515MM_BUILD_SHARED([icera])
516MM_BUILD_SHARED([sierra])
517MM_BUILD_SHARED([option])
518MM_BUILD_SHARED([novatel])
519MM_BUILD_SHARED([xmm])
520MM_BUILD_SHARED([telit])
521MM_BUILD_SHARED([foxconn])
522
523dnl-----------------------------------------------------------------------------
524dnl Output
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100525dnl
526
Tambet Ingocc314582008-07-31 09:43:00 +0300527AC_CONFIG_FILES([
528Makefile
Aleksander Morgado8d975382011-11-22 13:36:48 +0100529data/Makefile
Aleksander Morgado6fa3f0b2012-05-24 09:59:00 +0200530data/ModemManager.pc
Aleksander Morgado6fa3f0b2012-05-24 09:59:00 +0200531data/mm-glib.pc
Aleksander Morgado46ff06f2013-11-22 10:11:36 +0100532data/tests/Makefile
533data/tests/org.freedesktop.ModemManager1.service
Aleksander Morgado365b9062011-10-18 19:57:17 +0200534include/Makefile
Aleksander Morgadoa43cecb2013-06-13 09:48:10 +0200535include/ModemManager-version.h
Aleksander Morgado365b9062011-10-18 19:57:17 +0200536build-aux/Makefile
Dan Williams704d6e92010-02-08 09:13:17 -0800537libqcdm/Makefile
538libqcdm/src/Makefile
539libqcdm/tests/Makefile
Tambet Ingocc314582008-07-31 09:43:00 +0300540src/Makefile
Dan Williams216e49f2010-01-05 14:29:19 -0600541src/tests/Makefile
Tambet Ingocc314582008-07-31 09:43:00 +0300542plugins/Makefile
Tambet Ingof0a2dc62008-07-31 14:03:37 +0300543test/Makefile
Frederic Martinsons519df252020-11-10 16:48:22 +0100544tools/Makefile
Frederic Martinsons89cd1692020-11-12 10:48:11 +0100545tools/tests/Makefile
546tools/tests/services/org.freedesktop.ModemManager1.service
Tambet Ingocc314582008-07-31 09:43:00 +0300547introspection/Makefile
Aleksander Morgado1eaa4162013-11-22 09:24:07 +0100548introspection/tests/Makefile
Dan Williams9c958c92010-02-16 11:03:16 -0800549po/Makefile.in
Aleksander Morgado09f40c82011-11-22 11:33:35 +0100550docs/Makefile
Aleksander Morgado3b976c42011-11-22 12:17:12 +0100551docs/man/Makefile
Aleksander Morgado09f40c82011-11-22 11:33:35 +0100552docs/reference/Makefile
553docs/reference/api/Makefile
554docs/reference/api/version.xml
Aleksander Morgadoca14de02012-10-01 14:08:40 +0200555docs/reference/libmm-glib/Makefile
556docs/reference/libmm-glib/version.xml
Aleksander Morgadoba0e4ca2011-10-26 21:08:21 +0200557libmm-glib/Makefile
Aleksander Morgadob6d628b2012-10-02 15:08:46 +0200558libmm-glib/generated/Makefile
Aleksander Morgado4827e792013-11-22 09:25:21 +0100559libmm-glib/generated/tests/Makefile
Aleksander Morgadob6d628b2012-10-02 15:08:46 +0200560libmm-glib/tests/Makefile
Christian Perschbfae8632013-08-06 23:12:26 +0200561vapi/Makefile
Aleksander Morgado8f450d82011-08-17 18:14:26 +0200562cli/Makefile
Aleksander Morgadoebff76c2014-04-10 19:05:13 +0200563examples/Makefile
564examples/modem-watcher-python/Makefile
Aleksander Morgadoae99c452014-04-11 09:27:51 +0200565examples/modem-watcher-javascript/Makefile
Aleksander Morgado24fd3ef2016-07-25 10:36:42 +0200566examples/sms-python/Makefile
Aleksander Morgado248cd552019-12-13 15:38:33 +0100567examples/network-scan-python/Makefile
Tambet Ingocc314582008-07-31 09:43:00 +0300568])
569AC_OUTPUT
Dan Williams71cbcb82009-12-21 11:18:38 -0800570
Aleksander Morgado7e0f0162011-10-11 15:13:04 +0200571echo "
572 ModemManager $VERSION
573 ==============================================
574
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100575 Build:
576 compiler: ${CC}
577 cflags: ${CFLAGS}
578 ldflags: ${LDFLAGS}
Aleksander Morgado1c078532019-11-19 11:06:43 +0100579 warn cflags: ${WARN_CFLAGS}
580 warn ldflags: ${WARN_LDFLAGS}
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100581 maintainer mode: ${USE_MAINTAINER_MODE}
Aleksander Morgado1c078532019-11-19 11:06:43 +0100582 release: ${ax_is_release}
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100583
584 System paths:
585 prefix: ${prefix}
586 D-Bus system directory: ${DBUS_SYS_DIR}
587 udev base directory: ${UDEV_BASE_DIR}
588 systemd unit directory: ${with_systemdsystemunitdir}
589
590 Features:
Aleksander Morgado4d6896f2017-06-22 10:51:40 +0200591 udev: ${with_udev}
592 policykit: ${with_polkit}
593 mbim: ${with_mbim}
594 qmi: ${with_qmi}
595 systemd suspend/resume: ${with_systemd_suspend_resume}
596 systemd journal: ${with_systemd_journal}
Aleksander Morgadoc78ba5e2019-06-01 10:23:15 +0200597 at command via dbus: ${with_at_command_via_dbus}
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100598
Aleksander Morgado09080072019-11-21 18:28:51 +0100599 Shared utils:
600 icera: ${with_shared_icera}
601 sierra: ${with_shared_sierra}
602 option: ${with_shared_option}
603 novatel: ${with_shared_novatel}
604 xmm: ${with_shared_xmm}
605 telit: ${with_shared_telit}
606 foxconn: ${with_shared_foxconn}
607
608 Plugins:
609 generic: ${enable_plugin_generic}
610 altair lte: ${enable_plugin_altair_lte}
611 anydata: ${enable_plugin_anydata}
Aleksander Morgado26b589c2020-05-10 10:36:47 +0200612 broadmobi: ${enable_plugin_broadmobi}
Aleksander Morgado09080072019-11-21 18:28:51 +0100613 cinterion: ${enable_plugin_cinterion}
614 dell: ${enable_plugin_dell}
615 dlink: ${enable_plugin_dlink}
616 fibocom: ${enable_plugin_fibocom}
617 foxconn: ${enable_plugin_foxconn}
Aleksander Morgado9397ed42020-09-18 10:52:06 +0200618 gosuncn: ${enable_plugin_gosuncn}
Aleksander Morgado09080072019-11-21 18:28:51 +0100619 haier: ${enable_plugin_haier}
620 huawei: ${enable_plugin_huawei}
621 iridium: ${enable_plugin_iridium}
622 linktop: ${enable_plugin_linktop}
623 longcheer: ${enable_plugin_longcheer}
624 mbm: ${enable_plugin_mbm}
625 motorola: ${enable_plugin_motorola}
626 mtk: ${enable_plugin_mtk}
627 nokia: ${enable_plugin_nokia}
628 nokia icera: ${enable_plugin_nokia_icera}
629 novatel: ${enable_plugin_novatel}
630 novatel lte: ${enable_plugin_novatel_lte}
631 option: ${enable_plugin_option}
632 option hso: ${enable_plugin_option_hso}
633 pantech: ${enable_plugin_pantech}
Aleksander Morgado8fc60752020-10-22 12:48:35 +0200634 qcom-soc: ${enable_plugin_qcom_soc}
Aleksander Morgado09080072019-11-21 18:28:51 +0100635 quectel: ${enable_plugin_quectel}
636 samsung: ${enable_plugin_samsung}
637 sierra legacy: ${enable_plugin_sierra_legacy}
638 sierra: ${enable_plugin_sierra}
639 simtech: ${enable_plugin_simtech}
640 telit: ${enable_plugin_telit}
641 thuraya: ${enable_plugin_thuraya}
642 tplink: ${enable_plugin_tplink}
643 ublox: ${enable_plugin_ublox}
644 via: ${enable_plugin_via}
645 wavecom: ${enable_plugin_wavecom}
646 x22x: ${enable_plugin_x22x}
647 zte: ${enable_plugin_zte}
648
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100649 Miscellaneous:
650 gobject introspection: ${found_introspection}
651 vala bindings: ${enable_vala}
652 documentation: ${enable_gtk_doc}
653 code coverage: ${CODE_COVERAGE_ENABLED}"
Jakub Sitnicki75520302015-01-11 15:07:22 +0100654if test "x${CODE_COVERAGE_ENABLED}" = "xyes"; then
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100655 echo " code coverage cflags: ${CODE_COVERAGE_CFLAGS}"
656 echo " code coverage ldflags: ${CODE_COVERAGE_LDFLAGS}"
Jakub Sitnicki75520302015-01-11 15:07:22 +0100657fi
Aleksander Morgadode9446e2015-02-20 10:14:58 +0100658echo ""