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(optimization, AC_HELP_STRING([--disable-optimization],
27 [disable code optimization through compiler]), [
28 if (test "${enableval}" = "no"); then
33 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
34 [enable compiling with debugging information]), [
35 if (test "${enableval}" = "yes" &&
36 test "${ac_cv_prog_cc_g}" = "yes"); then
41 AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
42 [enable position independent executables flag]), [
43 if (test "${enableval}" = "yes" &&
44 test "${ac_cv_prog_cc_pie}" = "yes"); then
45 CFLAGS="$CFLAGS -fPIE"
46 LDFLAGS="$LDFLAGS -pie"
50 AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads],
51 [enable threading support]), [enable_threads=${enableval}])
53 AC_CHECK_LIB(dl, dlopen, dummy=yes,
54 AC_MSG_ERROR(dynamic linking loader is required))
56 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
57 AC_MSG_ERROR(GLib >= 2.16 is required))
61 if (test "${enable_threads}" = "yes"); then
62 AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
63 PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
64 AC_MSG_ERROR(GThread >= 2.16 is required))
65 GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
66 GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
69 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, dummy=yes,
70 AC_MSG_ERROR(D-Bus >= 1.0 is required))
71 AC_CHECK_LIB(dbus-1, dbus_watch_get_unix_fd, dummy=yes,
72 AC_DEFINE(NEED_DBUS_WATCH_GET_UNIX_FD, 1,
73 [Define to 1 if you need the dbus_watch_get_unix_fd() function.]))
76 DBUS_DATADIR="`$PKG_CONFIG --variable=sysconfdir dbus-1`"
77 if (test -z "{DBUS_DATADIR}"); then
78 DBUS_DATADIR="${sysconfdir}/dbus-1/system.d"
80 DBUS_DATADIR="$DBUS_DATADIR/dbus-1/system.d"
82 AC_SUBST(DBUS_DATADIR)
84 AC_SUBST([GDBUS_CFLAGS], ['$(DBUS_CFLAGS) -I$(top_srcdir)/gdbus'])
85 AC_SUBST([GDBUS_LIBS], ['$(top_builddir)/gdbus/libgdbus.la $(DBUS_LIBS)'])
87 AC_SUBST([GATCHAT_CFLAGS], ['-I$(top_srcdir)/gatchat'])
88 AC_SUBST([GATCHAT_LIBS], ['$(top_builddir)/gatchat/libgatchat.la'])
90 AC_SUBST([GISI_CFLAGS], ['-I$(top_srcdir)'])
91 AC_SUBST([GISI_LIBS], ['$(top_builddir)/gisi/libgisi.la'])
93 AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
94 [don't install configuration and data files]),
95 [enable_datafiles=${enableval}])
97 AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no")
101 AC_OUTPUT(Makefile gdbus/Makefile gatchat/Makefile gisi/Makefile
102 include/Makefile include/version.h src/Makefile
103 plugins/Makefile drivers/Makefile unit/Makefile