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.16, dummy=yes,
73 AC_MSG_ERROR(libglib 2.16 or later is required))
74 AC_CHECK_LIB(glib-2.0, g_slist_free_full, dummy=yes,
75 AC_DEFINE(NEED_G_SLIST_FREE_FULL, 1,
76 [Define to 1 if you need g_slist_free_full()
81 PKG_CHECK_MODULES(DBUS, dbus-1, dummy=yes,
82 AC_MSG_ERROR(libdbus-1 is required))
83 AC_CHECK_LIB(dbus-1, dbus_watch_get_unix_fd, dummy=yes,
84 AC_DEFINE(NEED_DBUS_WATCH_GET_UNIX_FD, 1,
85 [Define to 1 if you need the dbus_watch_get_unix_fd() function.]))
86 AC_CHECK_LIB(dbus-1, dbus_connection_can_send_type, dummy=yes,
87 AC_DEFINE(NEED_DBUS_CONNECTION_CAN_SEND_TYPE, 1,
88 [Define to 1 if you need the dbus_connection_can_send_type() funnction.]))
92 PKG_CHECK_MODULES(BLUEZ, bluez, dummy=yes,
93 AC_MSG_ERROR(libbluetooth is required))
94 AC_SUBST(BLUEZ_CFLAGS)
97 AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],
98 [disable code optimization through compiler]), [
99 if (test "${enableval}" = "no"); then
104 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
105 [enable compiling with debugging information]), [
106 if (test "${enableval}" = "yes" && test "${ac_cv_prog_cc_g}" = "yes"); then
111 messages_driver=dummy
112 AC_ARG_WITH(messages, AC_HELP_STRING([--with-messages=DRIVER], [select messages driver]), [
113 if (test "${withval}" = "no"); then
114 messages_driver=dummy;
116 messages_driver=${withval};
120 AC_SUBST([MESSAGES_DRIVER], [messages-${messages_driver}.c])
122 phonebook_driver=dummy
123 AC_ARG_WITH(phonebook, AC_HELP_STRING([--with-phonebook=DRIVER], [select phonebook driver]), [
124 if (test "${withval}" = "no"); then
125 phonebook_driver=dummy;
127 phonebook_driver=${withval};
131 if (test "${phonebook_driver}" = "dummy"); then
132 PKG_CHECK_MODULES(LIBICAL, libical, dummy=yes,
133 AC_MSG_ERROR(libical is required))
134 AC_SUBST(LIBICAL_CFLAGS)
135 AC_SUBST(LIBICAL_LIBS)
138 if (test "${phonebook_driver}" = "ebook"); then
139 AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
141 PKG_CHECK_MODULES(EBOOK, libebook-1.2, dummy=yes,
142 AC_MSG_ERROR(libebook is required))
143 AC_SUBST(EBOOK_CFLAGS)
146 PKG_CHECK_MODULES(GTHREAD, gthread-2.0, dummy=yes,
147 AC_MSG_ERROR(libgthread is required))
148 AC_SUBST(GTHREAD_CFLAGS)
149 AC_SUBST(GTHREAD_LIBS)
152 if (test "${phonebook_driver}" = "tracker"); then
153 PKG_CHECK_MODULES(TRACKER_09, tracker-sparql-0.9, [
154 TRACKER_CFLAGS=${TRACKER_09_CFLAGS}
155 TRACKER_LIBS=${TRACKER_09_LIBS}
157 PKG_CHECK_MODULES(TRACKER_10, tracker-sparql-0.10, [
158 TRACKER_CFLAGS=${TRACKER_10_CFLAGS}
159 TRACKER_LIBS=${TRACKER_10_LIBS}
160 ], AC_MSG_ERROR(libtracker-sparql is required))])
161 AC_SUBST(TRACKER_CFLAGS)
162 AC_SUBST(TRACKER_LIBS)
165 AC_SUBST([PHONEBOOK_DRIVER], [phonebook-${phonebook_driver}.c])
167 AC_ARG_ENABLE(usb, AC_HELP_STRING([--enable-usb],
168 [enable USB plugin]), [
169 enable_usb=${enableval}
171 AM_CONDITIONAL(USB, test "${enable_usb}" = "yes")
173 AC_ARG_ENABLE(pcsuite, AC_HELP_STRING([--enable-pcsuite],
174 [enable Nokia PcSuite plugin]), [
175 enable_pcsuite=${enableval}
177 AM_CONDITIONAL(NOKIA_PCSUITE, test "${enable_pcsuite}" = "yes")
179 AC_ARG_ENABLE(server, AC_HELP_STRING([--disable-server],
180 [disable compilation of OBEX server]), [
181 enable_server=${enableval}
183 AM_CONDITIONAL(SERVER, test "${enable_server}" != "no")
185 AC_ARG_ENABLE(client, AC_HELP_STRING([--disable-client],
186 [disable compilation of OBEX client]), [
187 enable_client=${enableval}
189 AM_CONDITIONAL(CLIENT, test "${enable_client}" != "no")
191 AM_CONDITIONAL(READLINE, test "${readline_found}" = "yes")