4 AM_INIT_AUTOMAKE([foreign subdir-objects color-tests])
5 AM_CONFIG_HEADER(config.h)
7 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
11 AC_PREFIX_DEFAULT(/usr/local)
13 if (test "${libdir}" = '${exec_prefix}/lib'); then
14 libdir="${prefix}/lib"
17 plugindir="${libdir}/obex/plugins"
19 if (test "$sysconfdir" = '${prefix}/etc'); then
20 configdir="${prefix}/etc/obex"
22 configdir="${sysconfdir}/obex"
25 AC_DEFINE_UNQUOTED(CONFIGDIR, "${configdir}",
26 [Directory for the configuration files])
40 m4_define([_LT_AC_TAGCONFIG], [])
41 m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])])
46 AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
52 ], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no))
54 if (test "$ac_cv_struct_tm_gmtoff" = "yes"); then
55 AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if struct tm has a tm_gmtoff member])
58 AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
63 ], ac_cv_var_timezone=yes, ac_cv_var_timezone=no))
65 if (test "$ac_cv_var_timezone" = "yes"); then
66 AC_DEFINE(HAVE_TIMEZONE, 1, [Define if libc defines a timezone variable])
69 AC_CHECK_LIB(dl, dlopen, dummy=yes,
70 AC_MSG_ERROR(dynamic linking loader is required))
72 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28, dummy=yes,
73 AC_MSG_ERROR(GLib >= 2.28 is required))
77 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.4, dummy=yes,
78 AC_MSG_ERROR(D-Bus >= 1.4 is required))
82 PKG_CHECK_MODULES(BLUEZ, bluez >= 4.99, dummy=yes,
83 AC_MSG_ERROR(BlueZ >= 4.99 is required))
84 AC_SUBST(BLUEZ_CFLAGS)
87 AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],
88 [disable code optimization through compiler]), [
89 if (test "${enableval}" = "no"); then
94 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
95 [enable compiling with debugging information]), [
96 if (test "${enableval}" = "yes" && test "${ac_cv_prog_cc_g}" = "yes"); then
101 messages_driver=dummy
102 AC_ARG_WITH(messages, AC_HELP_STRING([--with-messages=DRIVER], [select messages driver]), [
103 if (test "${withval}" = "no"); then
104 messages_driver=dummy;
106 messages_driver=${withval};
110 AC_SUBST([MESSAGES_DRIVER], [messages-${messages_driver}.c])
112 phonebook_driver=dummy
113 AC_ARG_WITH(phonebook, AC_HELP_STRING([--with-phonebook=DRIVER], [select phonebook driver]), [
114 if (test "${withval}" = "no"); then
115 phonebook_driver=dummy;
117 phonebook_driver=${withval};
121 if (test "${phonebook_driver}" = "dummy"); then
122 PKG_CHECK_MODULES(LIBICAL, libical, dummy=yes,
123 AC_MSG_ERROR(libical is required))
124 AC_SUBST(LIBICAL_CFLAGS)
125 AC_SUBST(LIBICAL_LIBS)
128 if (test "${phonebook_driver}" = "ebook"); then
129 AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
131 PKG_CHECK_MODULES(EBOOK, libebook-1.2, dummy=yes,
132 AC_MSG_ERROR(libebook is required))
133 AC_SUBST(EBOOK_CFLAGS)
136 PKG_CHECK_MODULES(GTHREAD, gthread-2.0, dummy=yes,
137 AC_MSG_ERROR(libgthread is required))
138 AC_SUBST(GTHREAD_CFLAGS)
139 AC_SUBST(GTHREAD_LIBS)
142 if (test "${phonebook_driver}" = "tracker"); then
143 PKG_CHECK_MODULES(TRACKER_09, tracker-sparql-0.9, [
144 TRACKER_CFLAGS=${TRACKER_09_CFLAGS}
145 TRACKER_LIBS=${TRACKER_09_LIBS}
147 PKG_CHECK_MODULES(TRACKER_10, tracker-sparql-0.10, [
148 TRACKER_CFLAGS=${TRACKER_10_CFLAGS}
149 TRACKER_LIBS=${TRACKER_10_LIBS}
150 ], AC_MSG_ERROR(libtracker-sparql is required))])
151 AC_SUBST(TRACKER_CFLAGS)
152 AC_SUBST(TRACKER_LIBS)
155 AC_SUBST([PHONEBOOK_DRIVER], [phonebook-${phonebook_driver}.c])
157 AC_ARG_ENABLE(usb, AC_HELP_STRING([--enable-usb],
158 [enable USB plugin]), [
159 enable_usb=${enableval}
161 AM_CONDITIONAL(USB, test "${enable_usb}" = "yes")
163 AC_ARG_ENABLE(pcsuite, AC_HELP_STRING([--enable-pcsuite],
164 [enable Nokia PcSuite plugin]), [
165 enable_pcsuite=${enableval}
167 AM_CONDITIONAL(NOKIA_PCSUITE, test "${enable_pcsuite}" = "yes")
169 AC_ARG_ENABLE(server, AC_HELP_STRING([--disable-server],
170 [disable compilation of OBEX server]), [
171 enable_server=${enableval}
173 AM_CONDITIONAL(SERVER, test "${enable_server}" != "no")
175 AC_ARG_ENABLE(client, AC_HELP_STRING([--disable-client],
176 [disable compilation of OBEX client]), [
177 enable_client=${enableval}
179 AM_CONDITIONAL(CLIENT, test "${enable_client}" != "no")
181 AM_CONDITIONAL(READLINE, test "${readline_found}" = "yes")