blob: 296be30b2ba9b188a070f54d2425ebb07c0bb9f3 [file] [log] [blame]
Aleksander Morgadoa43cecb2013-06-13 09:48:10 +02001AC_PREREQ([2.63])
Tambet Ingocc314582008-07-31 09:43:00 +03002
Aleksander Morgadoa43cecb2013-06-13 09:48:10 +02003dnl The MM version number
Aleksander Morgado5c68a362013-07-19 10:00:01 +02004m4_define([mm_major_version], [1])
Aleksander Morgadod81dd742014-01-30 17:57:00 +01005m4_define([mm_minor_version], [3])
Aleksander Morgado2c53c662014-01-30 17:17:45 +01006m4_define([mm_micro_version], [0])
Aleksander Morgadoa43cecb2013-06-13 09:48:10 +02007m4_define([mm_version],
8 [mm_major_version.mm_minor_version.mm_micro_version])
9
Aleksander Morgado2139e392013-06-13 10:56:04 +020010dnl libtool versioning for libmm-glib (-version-info c:r:a)
11dnl If the interface is unchanged, but the implementation has changed or
12dnl been fixed, then increment r.
13dnl Otherwise, increment c and zero r.
14dnl If the interface has grown (that is, the new library is compatible
15dnl with old code), increment a.
16dnl If the interface has changed in an incompatible way (that is,
17dnl functions have changed or been removed), then zero a.
Aleksander Morgado5b078ed2013-12-10 14:27:35 +010018m4_define([mm_glib_lt_current], [1])
Aleksander Morgado2139e392013-06-13 10:56:04 +020019m4_define([mm_glib_lt_revision], [0])
Aleksander Morgado5b078ed2013-12-10 14:27:35 +010020m4_define([mm_glib_lt_age], [1])
Aleksander Morgado2139e392013-06-13 10:56:04 +020021
22
Aleksander Morgado56cce852013-06-13 11:35:57 +020023AC_INIT([ModemManager],[mm_version],[modemmanager-devel@lists.freedesktop.org],[ModemManager])
Aleksander Morgado97657902013-06-10 16:58:43 +020024AM_INIT_AUTOMAKE([1.9 subdir-objects tar-ustar no-dist-gzip dist-xz -Wno-portability])
Dan Williamsb4d3ab02010-08-05 22:10:33 -050025m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
Adrian Bunkf31ab092013-05-12 17:10:32 +030026AM_MAINTAINER_MODE([enable])
Tambet Ingocc314582008-07-31 09:43:00 +030027
Michael Biebl22f6ab42010-01-27 15:48:10 -080028AC_CONFIG_MACRO_DIR([m4])
29
Tambet Ingocc314582008-07-31 09:43:00 +030030AC_CONFIG_HEADERS(config.h)
31
Aleksander Morgadoe68bf522011-03-28 11:30:10 +020032dnl Define system extensions for various things like strcasestr()
33AC_USE_SYSTEM_EXTENSIONS
34
Tambet Ingocc314582008-07-31 09:43:00 +030035dnl Required programs
36AC_PROG_CC
37AM_PROG_CC_C_O
38AC_PROG_INSTALL
Aleksander Morgado641ec512011-03-28 18:09:48 +020039
40dnl Initialize libtool
41LT_PREREQ([2.2])
42LT_INIT
Tambet Ingocc314582008-07-31 09:43:00 +030043
Aleksander Morgadoa43cecb2013-06-13 09:48:10 +020044dnl Version stuff
45MM_MAJOR_VERSION=mm_major_version
46MM_MINOR_VERSION=mm_minor_version
47MM_MICRO_VERSION=mm_micro_version
48MM_VERSION=mm_version
49AC_SUBST(MM_MAJOR_VERSION)
50AC_SUBST(MM_MINOR_VERSION)
51AC_SUBST(MM_MICRO_VERSION)
52AC_SUBST(MM_VERSION)
53
Aleksander Morgado2139e392013-06-13 10:56:04 +020054dnl libtool version stuff
55MM_GLIB_LT_CURRENT=mm_glib_lt_current
56MM_GLIB_LT_REVISION=mm_glib_lt_revision
57MM_GLIB_LT_AGE=mm_glib_lt_age
58AC_SUBST(MM_GLIB_LT_CURRENT)
59AC_SUBST(MM_GLIB_LT_REVISION)
60AC_SUBST(MM_GLIB_LT_AGE)
61
Dan Williamsc96db0c2011-04-27 14:47:00 -050062dnl
Aleksander Morgado09f40c82011-11-22 11:33:35 +010063dnl Documentation
64dnl
Aleksander Morgado09f40c82011-11-22 11:33:35 +010065GTK_DOC_CHECK(1.0)
66
67dnl
Dan Williamsc96db0c2011-04-27 14:47:00 -050068dnl translation support
69dnl
Aleksander Morgadobb7311f2011-10-12 00:15:11 +020070IT_PROG_INTLTOOL([0.40.0])
71
72AM_GNU_GETTEXT([external])
73AM_GNU_GETTEXT_VERSION([0.17])
74
Dan Williams9c958c92010-02-16 11:03:16 -080075GETTEXT_PACKAGE=ModemManager
76AC_SUBST(GETTEXT_PACKAGE)
77AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
Dan Williams9c958c92010-02-16 11:03:16 -080078
Aleksander Morgadodbb06b62011-10-10 11:58:28 +020079PKG_CHECK_MODULES(MM,
Aleksander Morgado678f5962013-04-02 13:31:31 +020080 glib-2.0 >= 2.32
Aleksander Morgadodbb06b62011-10-10 11:58:28 +020081 gmodule-2.0
82 gobject-2.0
83 gio-2.0
Aleksander Morgado4804c372012-09-05 19:51:18 +020084 gio-unix-2.0)
Dan Williams4fd62642012-01-27 15:13:42 -060085AC_SUBST(MM_CFLAGS)
86AC_SUBST(MM_LIBS)
Dan Williams924814c2009-06-18 14:25:30 -040087
Aleksander Morgadodc8d9df2012-06-26 13:01:39 +020088PKG_CHECK_MODULES(LIBMM_GLIB,
Aleksander Morgado678f5962013-04-02 13:31:31 +020089 glib-2.0 >= 2.32
Aleksander Morgadoba0e4ca2011-10-26 21:08:21 +020090 gobject-2.0
Aleksander Morgadob6d628b2012-10-02 15:08:46 +020091 gio-2.0
92 gio-unix-2.0)
Aleksander Morgadodc8d9df2012-06-26 13:01:39 +020093AC_SUBST(LIBMM_GLIB_CFLAGS)
94AC_SUBST(LIBMM_GLIB_LIBS)
Aleksander Morgadoba0e4ca2011-10-26 21:08:21 +020095
Aleksander Morgado8f450d82011-08-17 18:14:26 +020096PKG_CHECK_MODULES(MMCLI,
Aleksander Morgado678f5962013-04-02 13:31:31 +020097 glib-2.0 >= 2.32
Aleksander Morgado8f450d82011-08-17 18:14:26 +020098 gobject-2.0
99 gio-2.0)
100AC_SUBST(MMCLI_CFLAGS)
101AC_SUBST(LIBMM_LIBS)
102
Aleksander Morgadoc52762e2012-03-13 16:42:49 +0100103PKG_CHECK_MODULES(GUDEV, gudev-1.0 >= 147)
Dan Williams924814c2009-06-18 14:25:30 -0400104AC_SUBST(GUDEV_CFLAGS)
105AC_SUBST(GUDEV_LIBS)
Tambet Ingocc314582008-07-31 09:43:00 +0300106
Aleksander Morgado596c9ea2013-02-06 13:55:04 +0100107# Some required utilities
108GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
109AC_SUBST(GLIB_GENMARSHAL)
110GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
111AC_SUBST(GLIB_MKENUMS)
Tambet Ingoa93f0842008-08-13 10:05:31 +0300112
Christian Perschb8838b82013-08-04 13:51:27 +0200113# GObject Introspection
114GOBJECT_INTROSPECTION_CHECK([0.9.6])
115
Christian Perschbfae8632013-08-06 23:12:26 +0200116# Vala bindings
117VAPIGEN_CHECK(0.18)
118
Christian Persch81194332013-08-14 12:32:17 +0200119# Sanity check
120if test "x$enable_vala" = "xyes" -a ! -f "$VAPIGEN_MAKEFILE"; then
121 AC_MSG_ERROR([Vala bindings enabled but Makefile.vapigen not found. Install vala-devel, or pass --disable-vala])
122fi
123
Aleksander Morgado596c9ea2013-02-06 13:55:04 +0100124# DBus system directory
125AC_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 +0300126if test -n "$with_dbus_sys_dir" ; then
127 DBUS_SYS_DIR="$with_dbus_sys_dir"
128else
129 DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d"
130fi
131AC_SUBST(DBUS_SYS_DIR)
132
Aleksander Morgado596c9ea2013-02-06 13:55:04 +0100133# udev base directory
Dan Williams50105ae2009-07-07 10:45:44 -0400134AC_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 -0400135if test -n "$with_udev_base_dir" ; then
136 UDEV_BASE_DIR="$with_udev_base_dir"
137else
138 UDEV_BASE_DIR="/lib/udev"
139fi
140AC_SUBST(UDEV_BASE_DIR)
141
Aleksander Morgado222825d2013-02-06 15:40:28 +0100142# systemd system unit directory
143AC_ARG_WITH([systemdsystemunitdir], AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [where systemd service files are]),
144 [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
145if test "x$with_systemdsystemunitdir" != xno; then
146 AC_SUBST([SYSTEMD_UNIT_DIR], [$with_systemdsystemunitdir])
147fi
148AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$SYSTEMD_UNIT_DIR" -a "$SYSTEMD_UNIT_DIR" != xno ])
149
Dan Williams438a0472010-02-26 18:01:55 -0800150# PolicyKit
Aleksander Morgado0c7265d2013-06-10 18:30:12 +0200151PKG_CHECK_MODULES(POLKIT, [polkit-gobject-1 >= 0.97], [have_polkit=yes],[have_polkit=no])
152AC_ARG_WITH(polkit,
153 AS_HELP_STRING([--with-polkit=(strict|permissive|none)],
154 [Enable PolicyKit support [[default=auto]]]),,
155 [with_polkit=auto])
156# Handle 'auto' ('strict' if polkit found, 'none' otherwise),
157# 'yes' ('strict') and 'no' ('none')
158if test "x$with_polkit" = "xauto"; then
159 if test "x$have_polkit" = "xno"; then
160 with_polkit="none"
161 else
162 with_polkit="strict"
163 fi
164elif test "x$with_polkit" = "xno"; then
165 with_polkit=none
166elif test "x$with_polkit" = "xyes"; then
167 with_polkit=strict
168fi
169# Build policies context
170if test "x$with_polkit" = "xnone"; then
171 AC_DEFINE(WITH_POLKIT, 0, [Define if you have PolicyKit support])
172else
173 if test "x$have_polkit" = "xno"; then
174 AC_MSG_ERROR(PolicyKit development headers are required)
175 fi
Dan Williams67d936e2010-09-01 17:20:57 -0500176
Aleksander Morgado0c7265d2013-06-10 18:30:12 +0200177 case "x$with_polkit" in
178 "xpermissive")
179 MM_DEFAULT_USER_POLICY="yes"
180 ;;
181 "xstrict")
182 MM_DEFAULT_USER_POLICY="auth_self_keep"
183 ;;
184 *)
185 AC_MSG_ERROR([Wrong value for --with-polkit: $with_polkit])
186 ;;
187 esac
188
189 AC_DEFINE(WITH_POLKIT, 1, [Define if you have PolicyKit support])
190 AC_SUBST(POLKIT_CFLAGS)
191 AC_SUBST(POLKIT_LIBS)
192 AC_SUBST(MM_DEFAULT_USER_POLICY)
193fi
194
195AM_CONDITIONAL(WITH_POLKIT, [test "x$with_polkit" != "xnone" ])
Dan Williams438a0472010-02-26 18:01:55 -0800196
Dan Williams216e49f2010-01-05 14:29:19 -0600197dnl
Aleksander Morgado5b3392e2013-07-14 17:12:55 +0200198dnl MBIM support (enabled by default)
Aleksander Morgadodd5680d2013-04-06 19:23:14 +0200199dnl
Aleksander Morgado5b3392e2013-07-14 17:12:55 +0200200AC_ARG_WITH(mbim, AS_HELP_STRING([--without-mbim], [Build without MBIM support]), [], [with_mbim=yes])
201AM_CONDITIONAL(WITH_MBIM, test "x$with_mbim" = "xyes")
202case $with_mbim in
203 yes)
Aleksander Morgadoa2ef1672014-03-06 14:30:56 +0100204 PKG_CHECK_MODULES(MBIM, [mbim-glib >= 1.8], [have_mbim=yes],[have_mbim=no])
Aleksander Morgado5b3392e2013-07-14 17:12:55 +0200205 if test "x$have_mbim" = "xno"; then
Dan Williamsacc7b4b2014-02-19 18:59:24 -0600206 AC_MSG_ERROR([Couldn't find libmbim-glib. Install it, or otherwise configure using --without-mbim to disable MBIM support.])
Aleksander Morgado0e60d962013-04-17 15:34:23 +0200207 else
Aleksander Morgado5b3392e2013-07-14 17:12:55 +0200208 AC_DEFINE(WITH_MBIM, 1, [Define if you want MBIM support])
209 AC_SUBST(MBIM_CFLAGS)
210 AC_SUBST(MBIM_LIBS)
Aleksander Morgado0e60d962013-04-17 15:34:23 +0200211 fi
Aleksander Morgado5b3392e2013-07-14 17:12:55 +0200212 ;;
213 *)
214 with_mbim=no
215 ;;
216esac
Aleksander Morgadodd5680d2013-04-06 19:23:14 +0200217
218dnl
Aleksander Morgado4804c372012-09-05 19:51:18 +0200219dnl QMI support (enabled by default)
Aleksander Morgadodd5680d2013-04-06 19:23:14 +0200220dnl
Aleksander Morgado4804c372012-09-05 19:51:18 +0200221AC_ARG_WITH(qmi, AS_HELP_STRING([--without-qmi], [Build without QMI support]), [], [with_qmi=yes])
222AM_CONDITIONAL(WITH_QMI, test "x$with_qmi" = "xyes")
223case $with_qmi in
224 yes)
Aleksander Morgado0c618272013-09-05 15:31:46 +0200225 PKG_CHECK_MODULES(QMI, [qmi-glib >= 1.6], [have_qmi=yes],[have_qmi=no])
Aleksander Morgadoac588e92013-07-14 17:04:26 +0200226 if test "x$have_qmi" = "xno"; then
227 AC_MSG_ERROR([Couldn't find libqmi-glib. Install it, or otherwise configure using --without-qmi to disable QMI support.])
228 else
229 AC_DEFINE(WITH_QMI, 1, [Define if you want QMI support])
230 AC_SUBST(QMI_CFLAGS)
231 AC_SUBST(QMI_LIBS)
232 fi
Aleksander Morgado4804c372012-09-05 19:51:18 +0200233 ;;
234 *)
235 with_qmi=no
236 ;;
237esac
238
Aleksander Morgado12246a82012-08-09 16:58:34 +0200239dnl
240dnl Newest QMI commands
241dnl
242AC_ARG_WITH(newest_qmi_commands, AS_HELP_STRING([--with-newest-qmi-commands], [Try to avoid deprecated QMI commands]))
243AM_CONDITIONAL(WITH_NEWEST_QMI_COMMANDS, test "x$with_newest_qmi_commands" = "xyes")
244case $with_newest_qmi_commands in
245 yes)
Aleksander Morgadoe6a5ad22013-03-14 14:41:50 +0100246 if test "x$with_qmi" = "xno" ; then
247 AC_ERROR([Cannot enable newest QMI commands if QMI support is disabled])
Aleksander Morgado4804c372012-09-05 19:51:18 +0200248 fi
249
Aleksander Morgado12246a82012-08-09 16:58:34 +0200250 AC_DEFINE(WITH_NEWEST_QMI_COMMANDS, 1, [Define if we enable new QMI commands support])
251 with_newest_qmi_commands=yes
252 ;;
253 *)
254 with_newest_qmi_commands=no
255 ;;
256esac
257
Michael Biebl22e68782010-01-27 15:48:55 -0800258NM_COMPILER_WARNINGS
259
Dan Williams2f1fbfb2010-04-04 09:17:08 -0700260
261dnl
Dan Williamsafebde42010-05-21 09:43:47 -0700262dnl Distribution version string
263dnl
264AC_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="")
265if ! test x"$ac_distver" = x""; then
266 AC_DEFINE_UNQUOTED(MM_DIST_VERSION, "$ac_distver", [Define the distribution version string])
267fi
268
Dan Williams4fd62642012-01-27 15:13:42 -0600269# Not building protocol libs standalone
270AM_CONDITIONAL(QCDM_STANDALONE, test "yes" = "no")
271AM_CONDITIONAL(WMC_STANDALONE, test "yes" = "no")
272
Tambet Ingocc314582008-07-31 09:43:00 +0300273AC_CONFIG_FILES([
274Makefile
Aleksander Morgado8d975382011-11-22 13:36:48 +0100275data/Makefile
Aleksander Morgado6fa3f0b2012-05-24 09:59:00 +0200276data/ModemManager.pc
Aleksander Morgado6fa3f0b2012-05-24 09:59:00 +0200277data/mm-glib.pc
Aleksander Morgado0c7265d2013-06-10 18:30:12 +0200278data/org.freedesktop.ModemManager1.policy.in
Aleksander Morgado46ff06f2013-11-22 10:11:36 +0100279data/tests/Makefile
280data/tests/org.freedesktop.ModemManager1.service
Aleksander Morgado365b9062011-10-18 19:57:17 +0200281include/Makefile
Aleksander Morgadoa43cecb2013-06-13 09:48:10 +0200282include/ModemManager-version.h
Aleksander Morgado365b9062011-10-18 19:57:17 +0200283build-aux/Makefile
Dan Williams704d6e92010-02-08 09:13:17 -0800284libqcdm/Makefile
285libqcdm/src/Makefile
286libqcdm/tests/Makefile
Dan Williams3dd4cda2011-09-17 13:27:54 -0500287libwmc/Makefile
288libwmc/src/Makefile
289libwmc/tests/Makefile
Tambet Ingocc314582008-07-31 09:43:00 +0300290src/Makefile
Dan Williams216e49f2010-01-05 14:29:19 -0600291src/tests/Makefile
Tambet Ingocc314582008-07-31 09:43:00 +0300292plugins/Makefile
Dan Williamse7b1c482012-05-30 11:47:10 -0500293uml290/Makefile
Tambet Ingof0a2dc62008-07-31 14:03:37 +0300294test/Makefile
Tambet Ingocc314582008-07-31 09:43:00 +0300295introspection/Makefile
Aleksander Morgado1eaa4162013-11-22 09:24:07 +0100296introspection/tests/Makefile
Dan Williams9c958c92010-02-16 11:03:16 -0800297po/Makefile.in
Aleksander Morgado09f40c82011-11-22 11:33:35 +0100298docs/Makefile
Aleksander Morgado3b976c42011-11-22 12:17:12 +0100299docs/man/Makefile
Aleksander Morgado09f40c82011-11-22 11:33:35 +0100300docs/reference/Makefile
301docs/reference/api/Makefile
302docs/reference/api/version.xml
Aleksander Morgadoca14de02012-10-01 14:08:40 +0200303docs/reference/libmm-glib/Makefile
304docs/reference/libmm-glib/version.xml
Aleksander Morgadoba0e4ca2011-10-26 21:08:21 +0200305libmm-glib/Makefile
Aleksander Morgadob6d628b2012-10-02 15:08:46 +0200306libmm-glib/generated/Makefile
Aleksander Morgado4827e792013-11-22 09:25:21 +0100307libmm-glib/generated/tests/Makefile
Aleksander Morgadob6d628b2012-10-02 15:08:46 +0200308libmm-glib/tests/Makefile
Christian Perschbfae8632013-08-06 23:12:26 +0200309vapi/Makefile
Aleksander Morgado8f450d82011-08-17 18:14:26 +0200310cli/Makefile
Aleksander Morgadoebff76c2014-04-10 19:05:13 +0200311examples/Makefile
312examples/modem-watcher-python/Makefile
Tambet Ingocc314582008-07-31 09:43:00 +0300313])
314AC_OUTPUT
Dan Williams71cbcb82009-12-21 11:18:38 -0800315
Aleksander Morgado7e0f0162011-10-11 15:13:04 +0200316echo "
317 ModemManager $VERSION
318 ==============================================
319
320 compiler: ${CC}
321 cflags: ${CFLAGS}
322 Maintainer mode: ${USE_MAINTAINER_MODE}
323
324 D-Bus system directory: ${DBUS_SYS_DIR}
325 udev base directory: ${UDEV_BASE_DIR}
Aleksander Morgado222825d2013-02-06 15:40:28 +0100326 systemd unit directory: ${with_systemdsystemunitdir}
Aleksander Morgado7e0f0162011-10-11 15:13:04 +0200327
Aleksander Morgado7e0f0162011-10-11 15:13:04 +0200328 PolicyKit support: ${with_polkit}
Christian Perschb8838b82013-08-04 13:51:27 +0200329 GObject Introspection: ${found_introspection}
Christian Perschbfae8632013-08-06 23:12:26 +0200330 Vala Bindings: ${enable_vala}
Aleksander Morgadoe134a812013-05-23 13:16:54 +0200331 Documentation: ${enable_gtk_doc}
Aleksander Morgadodd5680d2013-04-06 19:23:14 +0200332 MBIM support: ${with_mbim}
Aleksander Morgado4804c372012-09-05 19:51:18 +0200333 QMI support: ${with_qmi}
Aleksander Morgado12246a82012-08-09 16:58:34 +0200334 Newest QMI commands: ${with_newest_qmi_commands}
Aleksander Morgado7e0f0162011-10-11 15:13:04 +0200335"