5 AM_CONFIG_HEADER(config.h)
7 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
18 m4_define([_LT_AC_TAGCONFIG], [])
19 m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])])
24 AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],
25 [disable code optimization through compiler]), [
26 if (test "${enableval}" = "no"); then
31 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
32 [enable compiling with debugging information]), [
33 if (test "${enableval}" = "yes" &&
34 test "${ac_cv_prog_cc_g}" = "yes"); then
39 AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
40 [enable position independent executables flag]), [
41 if (test "${enableval}" = "yes" &&
42 test "${ac_cv_prog_cc_pie}" = "yes"); then
43 CFLAGS="$CFLAGS -fPIE"
44 LDFLAGS="$LDFLAGS -pie"
48 AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads],
49 [enable threading support]), [enable_threads=${enableval}])
51 AC_CHECK_LIB(dl, dlopen, dummy=yes,
52 AC_MSG_ERROR(dynamic linking loader is required))
54 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
55 AC_MSG_ERROR(GLib >= 2.16 is required))
59 if (test "${enable_threads}" = "yes"); then
60 AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
61 PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
62 AC_MSG_ERROR(GThread >= 2.16 is required))
63 GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
64 GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
67 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, dummy=yes,
68 AC_MSG_ERROR(D-Bus >= 1.0 is required))
69 AC_CHECK_LIB(dbus-1, dbus_watch_get_unix_fd, dummy=yes,
70 AC_DEFINE(NEED_DBUS_WATCH_GET_UNIX_FD, 1,
71 [Define to 1 if you need the dbus_watch_get_unix_fd() function.]))
74 DBUS_DATADIR="`$PKG_CONFIG --variable=sysconfdir dbus-1`"
75 if (test -z "{DBUS_DATADIR}"); then
76 DBUS_DATADIR="${sysconfdir}/dbus-1/system.d"
78 DBUS_DATADIR="$DBUS_DATADIR/dbus-1/system.d"
80 AC_SUBST(DBUS_DATADIR)
82 AC_SUBST([GDBUS_CFLAGS], ['$(DBUS_CFLAGS) -I$(top_srcdir)/gdbus'])
83 AC_SUBST([GDBUS_LIBS], ['$(top_builddir)/gdbus/libgdbus.la $(DBUS_LIBS)'])
85 AC_SUBST([GATCHAT_CFLAGS], ['-I$(top_srcdir)/gatchat'])
86 AC_SUBST([GATCHAT_LIBS], ['$(top_builddir)/gatchat/libgatchat.la'])
88 AC_SUBST([GISI_CFLAGS], ['-I$(top_srcdir)'])
89 AC_SUBST([GISI_LIBS], ['$(top_builddir)/gisi/libgisi.la'])
91 AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
92 [don't install configuration and data files]),
93 [enable_datafiles=${enableval}])
95 AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no")
97 AC_PREFIX_DEFAULT(/usr/local)
99 if (test "${prefix}" = "NONE"); then
100 dnl no prefix and no localstatedir, so default to /var
101 if (test "$localstatedir" = '${prefix}/var'); then
102 AC_SUBST([localstatedir], ['/var'])
105 prefix="${ac_default_prefix}"
108 if (test "$localstatedir" = '${prefix}/var'); then
109 storagedir="${prefix}/var/lib/ofono"
111 storagedir="${localstatedir}/lib/ofono"
114 AC_DEFINE_UNQUOTED(STORAGEDIR, "${storagedir}",
115 [Directory for the storage files])
119 AC_OUTPUT(Makefile gdbus/Makefile gatchat/Makefile gisi/Makefile
120 include/Makefile include/version.h src/Makefile
121 plugins/Makefile drivers/Makefile unit/Makefile