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)
27 m4_define([_LT_AC_TAGCONFIG], [])
28 m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])])
33 AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],
34 [disable code optimization through compiler]), [
35 if (test "${enableval}" = "no"); then
40 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
41 [enable compiling with debugging information]), [
42 if (test "${enableval}" = "yes" &&
43 test "${ac_cv_prog_cc_g}" = "yes"); then
48 AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
49 [enable position independent executables flag]), [
50 if (test "${enableval}" = "yes" &&
51 test "${ac_cv_prog_cc_pie}" = "yes"); then
52 CFLAGS="$CFLAGS -fPIE"
53 LDFLAGS="$LDFLAGS -pie"
57 AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads],
58 [enable threading support]), [enable_threads=${enableval}])
60 AC_CHECK_FUNC(signalfd, dummy=yes,
61 AC_MSG_ERROR(signalfd support is required))
63 AC_CHECK_LIB(dl, dlopen, dummy=yes,
64 AC_MSG_ERROR(dynamic linking loader is required))
66 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28, dummy=yes,
67 AC_MSG_ERROR(GLib >= 2.28 is required))
71 if (test "${enable_threads}" = "yes"); then
72 AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
73 PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
74 AC_MSG_ERROR(GThread >= 2.16 is required))
75 GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
76 GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
79 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.4, dummy=yes,
80 AC_MSG_ERROR(D-Bus >= 1.4 is required))
84 AC_ARG_WITH(dbusconfdir, AC_HELP_STRING([--with-dbusconfdir=PATH],
85 [path to D-Bus config directory]), [path_dbusconf=${withval}],
86 [path_dbusconf="`$PKG_CONFIG --variable=sysconfdir dbus-1`"])
87 if (test -z "${path_dbusconf}"); then
88 DBUS_CONFDIR="${sysconfdir}/dbus-1/system.d"
90 DBUS_CONFDIR="${path_dbusconf}/dbus-1/system.d"
92 AC_SUBST(DBUS_CONFDIR)
94 AC_ARG_WITH(dbusdatadir, AC_HELP_STRING([--with-dbusdatadir=PATH],
95 [path to D-Bus data directory]), [path_dbusdata=${withval}],
96 [path_dbusdata="`$PKG_CONFIG --variable=datadir dbus-1`"])
97 if (test -z "${path_dbusdata}"); then
98 DBUS_DATADIR="${datadir}/dbus-1/system-services"
100 DBUS_DATADIR="${path_dbusdata}/dbus-1/system-services"
102 AC_SUBST(DBUS_DATADIR)
104 AC_ARG_WITH([systemdunitdir], AC_HELP_STRING([--with-systemdunitdir=DIR],
105 [path to systemd service directory]), [path_systemdunit=${withval}],
106 [path_systemdunit="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`"])
107 if (test -n "${path_systemdunit}"); then
108 SYSTEMD_UNITDIR="${path_systemdunit}"
109 AC_SUBST(SYSTEMD_UNITDIR)
111 AM_CONDITIONAL(SYSTEMD, test -n "${path_systemdunit}")
113 AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test],
114 [enable test/example scripts]), [enable_test=${enableval}])
115 AM_CONDITIONAL(TEST, test "${enable_test}" = "yes")
117 AC_ARG_ENABLE(tools, AC_HELP_STRING([--enable-tools],
118 [enable testing tools]), [enable_tools=${enableval}])
119 AM_CONDITIONAL(TOOLS, test "${enable_tools}" = "yes")
121 AC_ARG_ENABLE(dundee, AC_HELP_STRING([--enable-dundee],
122 [enable dialup deamon support]), [enable_dundee=${enableval}])
123 AM_CONDITIONAL(DUNDEE, test "${enable_dundee}" = "yes")
125 AC_ARG_ENABLE(udev, AC_HELP_STRING([--disable-udev],
126 [disable udev modem detection support]),
127 [enable_udev=${enableval}])
128 if (test "${enable_udev}" != "no"); then
129 PKG_CHECK_MODULES(UDEV, libudev >= 143, [enable_udev="yes"],
130 AC_MSG_ERROR(libudev >= 143 is required))
131 UDEV_DATADIR="`$PKG_CONFIG --variable=udevdir udev`"
132 if (test -z "${UDEV_DATADIR}"); then
133 UDEV_DATADIR="${sysconfdir}/udev/rules.d"
135 UDEV_DATADIR="${UDEV_DATADIR}/rules.d"
137 AC_SUBST(UDEV_DATADIR)
139 AC_SUBST(UDEV_CFLAGS)
141 AM_CONDITIONAL(UDEV, test "${enable_udev}" = "yes")
143 AC_ARG_ENABLE(atmodem, AC_HELP_STRING([--disable-atmodem],
144 [disable ETSI AT modem support]),
145 [enable_atmodem=${enableval}])
146 AM_CONDITIONAL(ATMODEM, test "${enable_atmodem}" != "no")
148 AC_ARG_ENABLE(cdmamodem, AC_HELP_STRING([--disable-cdmamodem],
149 [disable CDMA AT modem support]),
150 [enable_cdmamodem=${enableval}])
151 AM_CONDITIONAL(CDMAMODEM, test "${enable_cdmamodem}" != "no")
153 AC_ARG_ENABLE(phonesim, AC_HELP_STRING([--disable-phonesim],
154 [disable Phone simulator support]),
155 [enable_phonesim=${enableval}])
156 AM_CONDITIONAL(PHONESIM, test "${enable_phonesim}" != "no" &&
157 test "${enable_atmodem}" != "no")
159 AC_ARG_ENABLE(isimodem, AC_HELP_STRING([--disable-isimodem],
160 [disable PhoNet/ISI modem support]),
161 [enable_isimodem=${enableval}])
162 AM_CONDITIONAL(ISIMODEM, test "${enable_isimodem}" != "no")
164 AC_ARG_ENABLE(qmimodem, AC_HELP_STRING([--disable-qmimodem],
165 [disable Qualcomm QMI modem support]),
166 [enable_qmimodem=${enableval}])
167 AM_CONDITIONAL(QMIMODEM, test "${enable_qmimodem}" != "no")
169 AC_ARG_ENABLE(bluetooth, AC_HELP_STRING([--disable-bluetooth],
170 [disable BlueZ 4 and BlueZ 5 plugins support]),
171 [enable_bluetooth=${enableval}])
173 AC_ARG_ENABLE(bluez4, AC_HELP_STRING([--enable-bluez4],
174 [enable BlueZ 4 plugins support prior to BlueZ 5]),
175 [enable_bluez4=${enableval}])
177 if (test "${enable_bluez4}" = "yes"); then
178 PKG_CHECK_MODULES(BLUEZ, bluez >= 4.99 bluez < 5, dummy=yes,
179 AC_MSG_ERROR(Bluetooth library >= 4.99 and < 5 is required))
180 AC_SUBST(BLUEZ_CFLAGS)
184 AM_CONDITIONAL(BLUEZ4, test "${enable_bluetooth}" != "no" && test "${enable_bluez4}" = "yes")
185 AM_CONDITIONAL(BLUETOOTH, test "${enable_bluetooth}" != "no")
187 AC_ARG_WITH([provisiondb], AC_HELP_STRING([--with-provisiondb=FILE],
188 [location of provision database]), [path_provisiondb=${withval}])
190 AC_ARG_ENABLE(provision, AC_HELP_STRING([--disable-provision],
191 [disable provisioning support]),
192 [enable_provision=${enableval}])
193 if (test "${enable_provision}" != "no"); then
194 if (test -n "${path_provisiondb}"); then
195 AC_DEFINE_UNQUOTED(PROVIDER_DATABASE, "${path_provisiondb}",
196 [Mobile provider database])
198 AC_MSG_CHECKING([for mobile-broadband-provider-info])
199 PKG_CHECK_EXISTS(mobile-broadband-provider-info,
200 _PKG_CONFIG(PROVIDER_DATABASE, [variable=database],
201 [mobile-broadband-provider-info])
202 AC_DEFINE_UNQUOTED(PROVIDER_DATABASE,
203 "$pkg_cv_PROVIDER_DATABASE",
204 [Mobile provider database])
205 AC_MSG_RESULT([yes]),
206 AC_MSG_ERROR(Mobile broadband provider database is required))
209 AM_CONDITIONAL(PROVISION, test "${enable_provision}" != "no")
211 AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
212 [do not install configuration and data files]),
213 [enable_datafiles=${enableval}])
214 AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no")
216 if (test "${prefix}" = "NONE"); then
217 dnl no prefix and no localstatedir, so default to /var
218 if (test "$localstatedir" = '${prefix}/var'); then
219 AC_SUBST([localstatedir], ['/var'])
222 prefix="${ac_default_prefix}"
225 if (test "$localstatedir" = '${prefix}/var'); then
226 storagedir="${prefix}/var/lib/ofono"
228 storagedir="${localstatedir}/lib/ofono"
230 AC_DEFINE_UNQUOTED(STORAGEDIR, "${storagedir}",
231 [Directory for the storage files])
233 if (test "$sysconfdir" = '${prefix}/etc'); then
234 configdir="${prefix}/etc/ofono"
236 configdir="${sysconfdir}/ofono"
238 AC_DEFINE_UNQUOTED(CONFIGDIR, "${configdir}",
239 [Directory for the configuration files])
241 AC_OUTPUT(Makefile include/version.h src/ofono.service ofono.pc \
242 dundee/dundee.service)