4 AM_INIT_AUTOMAKE(ofono, 0.1)
5 AM_CONFIG_HEADER(config.h)
7 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
11 AC_PREFIX_DEFAULT(/usr/local)
20 m4_define([_LT_AC_TAGCONFIG], [])
21 m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])])
26 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
27 [enable compiling with debugging information]), [
28 if (test "${enableval}" = "yes" &&
29 test "${ac_cv_prog_cc_g}" = "yes"); then
30 CFLAGS="$CFLAGS -g -O0"
34 AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
35 [enable position independent executables flag]), [
36 if (test "${enableval}" = "yes" &&
37 test "${ac_cv_prog_cc_pie}" = "yes"); then
38 CFLAGS="$CFLAGS -fPIE"
39 LDFLAGS="$LDFLAGS -pie"
43 AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads],
44 [enable threading support]), [enable_threads=${enableval}])
46 AC_CHECK_LIB(dl, dlopen, dummy=yes,
47 AC_MSG_ERROR(dynamic linking loader is required))
49 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
50 AC_MSG_ERROR(GLib >= 2.16 is required))
54 if (test "${enable_threads}" = "yes"); then
55 AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
56 PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
57 AC_MSG_ERROR(GThread >= 2.16 is required))
58 GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
59 GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
62 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, dummy=yes,
63 AC_MSG_ERROR(D-Bus >= 1.0 is required))
64 AC_CHECK_LIB(dbus-1, dbus_watch_get_unix_fd, dummy=yes,
65 AC_DEFINE(NEED_DBUS_WATCH_GET_UNIX_FD, 1,
66 [Define to 1 if you need the dbus_watch_get_unix_fd() function.]))
69 DBUS_DATADIR="`$PKG_CONFIG --variable=sysconfdir dbus-1`"
70 if (test -z "{DBUS_DATADIR}"); then
71 DBUS_DATADIR="${sysconfdir}/dbus-1/system.d"
73 DBUS_DATADIR="$DBUS_DATADIR/dbus-1/system.d"
75 AC_SUBST(DBUS_DATADIR)
77 AC_SUBST([GDBUS_CFLAGS], ['$(DBUS_CFLAGS) -I$(top_srcdir)/gdbus'])
78 AC_SUBST([GDBUS_LIBS], ['$(top_builddir)/gdbus/libgdbus.la $(DBUS_LIBS)'])
80 AC_SUBST([GATCHAT_CFLAGS], ['-I$(top_srcdir)/gatchat'])
81 AC_SUBST([GATCHAT_LIBS], ['$(top_builddir)/gatchat/libgatchat.la'])
83 AC_SUBST([GISI_CFLAGS], ['-I$(top_srcdir)'])
84 AC_SUBST([GISI_LIBS], ['$(top_builddir)/gisi/libgisi.la'])
86 AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
87 [don't install configuration and data files]),
88 [enable_datafiles=${enableval}])
90 AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no")
94 AC_OUTPUT(Makefile gdbus/Makefile gatchat/Makefile gisi/Makefile
95 include/Makefile include/version.h src/Makefile
96 plugins/Makefile drivers/Makefile unit/Makefile