2 # arch-tag: Toplevel Autoconf configuration script
5 AC_CONFIG_MACRO_DIR(macros)
6 AM_CONFIG_HEADER(config.h)
7 AM_INIT_AUTOMAKE(rhythmbox, 0.9.5)
22 OLD_DBUS_MIN_REQS=0.31
24 TOTEM_PLPARSER_REQS=1.1.5
26 AC_MSG_CHECKING([for GNU extension fwrite_unlocked])
32 [[fwrite_unlocked ("foo", 1, sizeof ("foo"), stdout);]])],[have_fwrite_unlocked=yes])
33 if test x"$have_fwrite_unlocked" = xyes; then
34 AC_DEFINE(HAVE_GNU_FWRITE_UNLOCKED,1,[Define if you have GNU fwrite_unlocked])
41 AC_CHECK_FUNC(mkdtemp,
42 [AC_DEFINE([HAVE_MKDTEMP], 1, [Have GlibC function to make temp dirs])],
44 AM_CONDITIONAL(MKDTEMP_MISSING, test x$mkdtemp_missing = xtrue)
46 AC_CHECK_LIB(glib-2.0, g_utf8_collate_key_for_filename,
47 [AC_DEFINE([HAVE_COLLATE_KEY_FILENAME], 1, [Have glib function to collate filename sort keys])])
48 AC_CHECK_LIB(glib-2.0, g_mapped_file_new,
49 [AC_DEFINE([HAVE_G_MAPPED_FILE], 1, [Have glib mmap wrapper])])
53 PKG_CHECK_MODULES(RB_CLIENT, gnome-vfs-2.0 >= $GNOME_VFS_REQS)
55 PKG_CHECK_MODULES(RHYTHMBOX, \
56 gtk+-2.0 >= $GTK_REQS \
59 gnome-vfs-2.0 >= $GNOME_VFS_REQS \
62 PKG_CHECK_MODULES(TOTEM_PLPARSER, totem-plparser >= $TOTEM_PLPARSER_REQS, have_totem_plparser=yes, have_totem_plparser=no)
63 if test x$have_totem_plparser != xyes; then
64 AC_MSG_ERROR([totem playlist parsing library not found or too old])
68 AC_HELP_STRING([--without-hal],
69 [Disable HAL support]))
70 if test "x$with_hal" != "xno"; then
71 PKG_CHECK_MODULES(HAL, hal >= 0.5 hal < 0.6, enable_hal05=yes, enable_hal05=no)
72 if test x$enable_hal05 != xyes; then
73 PKG_CHECK_MODULES(HAL, hal >= 0.2.92 hal < 0.5, enable_hal02=yes, enable_hal02=no)
75 if test x$enable_hal05 = xyes || test x$enable_hal02 = xyes; then
77 AC_DEFINE(HAVE_HAL, 1, [Define if you HAL support])
78 if test x$enable_hal05 = xyes; then
79 AC_DEFINE(HAVE_HAL_0_5, 1, [Define if you have HAL 0.5 or later])
81 AC_DEFINE(HAVE_HAL_0_2, 1, [Define if you have HAL 0.2 or later])
86 if test "x$with_hal" = "xyes"; then
87 AC_MSG_ERROR([HAL support explicitly requested but HAL couldn't be found])
91 AM_CONDITIONAL(HAVE_HAL_0_5, test x"$enable_hal05" = xyes)
92 AM_CONDITIONAL(HAVE_HAL_0_2, test x"$enable_hal02" = xyes)
93 AM_CONDITIONAL(HAVE_HAL, test x"$enable_hal" = xyes)
98 AC_HELP_STRING([--with-ipod],
99 [Enable iPod support]),,
101 if test "x$with_ipod" != "xno"; then
103 PKG_CHECK_MODULES(IPOD, libgpod-1.0, have_libgpod=yes, have_libgpod=no)
104 if test "x$have_libgpod" = "xno" -a "x$with_ipod" = "xyes"; then
105 AC_MSG_ERROR([iPod explicitly requested but libgpod couldn't be found])
107 if test "x$have_libgpod" = "xyes"; then
108 if test "x$with_hal" = xyes && test "x$enable_hal" = xno; then
109 AC_MSG_ERROR([iPod explicitly requested but HAL not found or too old])
111 if test "x$enable_hal" = xyes; then
112 AC_DEFINE(WITH_IPOD_SUPPORT, 1, [Define if iPod support is enabled])
115 PKG_CHECK_MODULES(IPOD_PHONE, libgpod-1.0 >= 0.3.3, support_phone=yes, support_phone=no)
116 if test "x$support_phone" = xyes; then
117 AC_DEFINE(IPOD_PHONE_SUPPORT, 1, [iPod support for phone])
120 AC_SUBST(IPOD_CFLAGS)
124 AM_CONDITIONAL(USE_IPOD, test x"$use_ipod" = xyes)
127 AC_ARG_WITH(database,
128 AC_HELP_STRING([--with-database=tree|libgda],
129 [Select the database to use (default tree)]),,
131 AM_CONDITIONAL(USE_TREEDB, test x"$with_database" = xtree)
132 AM_CONDITIONAL(USE_GDADB, test x"$with_database" = xlibgda)
136 case "x$with_database" in
138 AC_DEFINE(WITH_RHYTHMDB_TREE, 1, [Define if you are using the RhythmDB tree database])
141 AC_DEFINE(WITH_RHYTHMDB_GDA, 1, [Define if you are using the RhythmDB sqlite/libgda database])
142 dnl FIXME: check for sqlite, too?
143 PKG_CHECK_MODULES(GDA, libgda > 1.0.3)
146 AC_MSG_ERROR([Unknown database selected])
152 dnl Database debugging
153 AC_ARG_WITH(rhythmdb-debug,
154 AC_HELP_STRING([--with-rhythmdb-debug=0|1|2],
155 [Level of RhythmDB sanity checking]),,with_rhythmdb_debug=0)
156 if test x"${with_rhythmdb_debug}" != x0; then
157 AC_DEFINE_UNQUOTED([RHYTHMDB_ENABLE_SANITY_CHECK], "${with_rhythmdb_debug}", [Define to the level of RhythmDB sanity checking])
161 dnl Now we're ready to ask for gstreamer libs and cflags
162 dnl And we can also ask for the right version of gstreamer
165 GST_0_8_MAJORMINOR=0.8
166 GST_0_8_REQUIRED_VERSION=0.8.2
167 PKG_CHECK_MODULES(GSTREAMER_0_8, \
168 gstreamer-$GST_0_8_MAJORMINOR >= $GST_0_8_REQUIRED_VERSION gstreamer-libs-$GST_0_8_MAJORMINOR >= $GST_0_8_REQUIRED_VERSION
169 gstreamer-control-$GST_0_8_MAJORMINOR >= $GST_0_8_REQUIRED_VERSION
170 gstreamer-gconf-$GST_0_8_MAJORMINOR >= $GST_0_8_REQUIRED_VERSION,
171 have_gstreamer_0_8=yes,have_gstreamer_0_8=no)
173 GST_0_10_MAJORMINOR=0.10
174 GST_0_10_REQUIRED_VERSION=0.9.7
175 PKG_CHECK_MODULES(GSTREAMER_0_10, \
176 gstreamer-$GST_0_10_MAJORMINOR >= $GST_0_10_REQUIRED_VERSION
177 gstreamer-base-$GST_0_10_MAJORMINOR >= $GST_0_10_REQUIRED_VERSION
178 gstreamer-plugins-base-$GST_0_10_MAJORMINOR >= $GST_0_10_REQUIRED_VERSION,
179 have_gstreamer_0_10=yes,have_gstreamer_0_10=no)
181 AC_ARG_WITH(playback,
182 AC_HELP_STRING([--with-playback=auto|gstreamer-0-8|gstreamer-0-10],
183 [Select the playback backend to use (default auto)]),,
186 if test x$with_playback = xauto -o x$with_playback = xgstreamer-0-10; then
187 if test x"$have_gstreamer_0_10" = xyes; then
188 with_playback=gstreamer_0_10
189 SOUNDSYSTEM_DEPS="gstreamer-$GST_0_10_MAJORMINOR"
190 AC_DEFINE(HAVE_GSTREAMER,1,[Define if you want to use the GStreamer media framework])
191 AC_DEFINE(HAVE_GSTREAMER_0_10,1,[Define if you want to use the GStreamer 0.10])
192 SOUNDSYSTEM_CFLAGS="$GSTREAMER_0_10_CFLAGS"
193 SOUNDSYSTEM_LIBS="$GSTREAMER_0_10_LIBS"
194 elif test x$with_playback = xgstreamer-0-10; then
195 AC_MSG_ERROR([GStreamer 0.10 explicity requested, and it was not found or older than version $GST_REQUIRED_VERSION, or gst-plugins-base was missing])
198 if test x$with_playback = xauto -o x$with_playback = xgstreamer-0-8; then
199 if test x"$have_gstreamer_0_8" = xyes; then
200 with_playback=gstreamer_0_8
201 SOUNDSYSTEM_DEPS="gstreamer-$GST_0_8_MAJORMINOR"
202 AC_DEFINE(HAVE_GSTREAMER,1,[Define if you want to use the GStreamer media framework])
203 AC_DEFINE(HAVE_GSTREAMER_0_8,1,[Define if you want to use the GStreamer 0.8])
204 SOUNDSYSTEM_CFLAGS="$GSTREAMER_0_8_CFLAGS"
205 SOUNDSYSTEM_LIBS="$GSTREAMER_0_8_LIBS"
206 elif test x$with_playback = xgstreamer-0-8; then
207 AC_MSG_ERROR([GStreamer 0.8 explicity requested, and it was not found or older than version $GST_REQUIRED_VERSION])
210 AM_CONDITIONAL(USE_GSTREAMER_0_10, test x"$with_playback" = xgstreamer_0_10)
211 AM_CONDITIONAL(USE_GSTREAMER_0_8, test x"$with_playback" = xgstreamer_0_8)
213 dnl Give error and exit if we don't have gstreamer
214 if test x$with_playback = xauto; then
215 AC_MSG_ERROR([GStreamer not found, or older than version $GST_0_8_REQUIRED_VERSION/$GST_0_10_REQUIRED_VERSION])
218 AC_SUBST(SOUNDSYSTEM_DEPS)
219 RHYTHMBOX_CFLAGS="$RHYTHMBOX_CFLAGS $SOUNDSYSTEM_CFLAGS"
220 RHYTHMBOX_LIBS="$RHYTHMBOX_LIBS $SOUNDSYSTEM_LIBS"
224 AC_ARG_ENABLE(tag-writing,
225 AC_HELP_STRING([--enable-tag-writing],
226 [Enable tag writing support in rhythmbox **EXPERIMENTAL**]))
227 if test x"$enable_tag_writing" = xyes; then
228 AC_MSG_WARN([Tag writing support is experimental, and may corrupt files, use at your own risk])
229 AC_DEFINE(ENABLE_TAG_WRITING, 1, [Define if tag writing should be enabled])
233 AC_ARG_ENABLE(track-transfer,
234 AC_HELP_STRING([--disable-track-transfer],
235 [Enable track transfer support in rhythmbox]))
236 if test x"$enable_track_transfer" != xno; then
237 PKG_CHECK_MODULES(GNOME_MEDIA_PROFILES,
238 gnome-media-profiles >= 2.8,
239 with_track_transfer=yes,
240 with_track_transfer=no)
242 if test "x$with_track_transfer" = xno -a "x$enable_track_transfer" = xyes; then
243 AC_MSG_ERROR([Track transfer support explicitly requested but gnome-media-profiles not found.])
246 if test "x$with_track_transfer" = xyes; then
247 AC_DEFINE(ENABLE_TRACK_TRANSFER, 1, [Define if track transfer should be enabled])
250 AM_CONDITIONAL(ENABLE_TRACK_TRANSFER, test "x$with_track_transfer" = "xyes")
253 AC_ARG_ENABLE(ipod-writing,
254 AC_HELP_STRING([--enable-ipod-writing],
255 [Enable support for writing to ipods in rhythmbox **EXPERIMENTAL**]))
256 if test x"$enable_ipod_writing" = xyes; then
257 if test "x$use_ipod" != xyes -a "x$enable_ipod_writing" = xyes; then
258 AC_MSG_ERROR([iPod write support explicitly requested but iPod support is disabled.])
260 if test "x$with_track_transfer" != xyes -a "x$enable_ipod_writing" = xyes; then
261 AC_MSG_ERROR([iPod write support explicitly requested but track transfer support is disabled.])
263 AC_MSG_WARN([iPod writing support is experimental, and may corrupt iPod databases, use at your own risk])
264 AC_DEFINE(ENABLE_IPOD_WRITING, 1, [Define if ipod writing should be enabled])
269 AC_ARG_ENABLE(audioscrobbler,
270 AC_HELP_STRING([--disable-audioscrobbler],
271 [Disable Audioscrobbler support in Rhythmbox]))
273 dnl DAAP (iTunes Music Shares)
275 AC_HELP_STRING([--disable-daap],
276 [Enable Digital Audio Access Protocol (music sharing) in rhythmbox]))
279 AC_HELP_STRING([--with-mdns=auto|howl|avahi],
280 [Select the mDNS/DNS-SD implementation to use (default auto)]),,
289 PKG_CHECK_MODULES(AVAHI,
294 if test x$have_avahi_06 != xyes; then
295 PKG_CHECK_MODULES(AVAHI,
301 if test x$have_avahi_06 = xyes || test x$have_avahi_05 = xyes; then
307 PKG_CHECK_MODULES(HOWL,
312 if test x"$with_mdns" = xauto; then
313 if test x"$have_avahi" = xyes; then
314 MDNS_CFLAGS=$AVAHI_CFLAGS
315 MDNS_LIBS=$AVAHI_LIBS
316 AC_DEFINE(WITH_AVAHI, 1, [Define if mDNS/DNS-SD implementation uses Avahi])
318 AC_MSG_NOTICE([Detected Avahi, using it for mDNS/DNS-SD])
319 if test x$have_avahi_06 = xyes; then
320 AC_DEFINE(HAVE_AVAHI_0_6, 1, [Define if mDNS/DNS-SD implementation uses Avahi 0.6])
322 AC_DEFINE(HAVE_AVAHI_0_5, 1, [Define if mDNS/DNS-SD implementation uses Avahi 0.5])
326 elif test x"$have_howl" = xyes; then
327 MDNS_CFLAGS=$HOWL_CFLAGS
329 AC_DEFINE(WITH_HOWL, 1, [Define if mDNS/DNS-SD implementation uses Howl])
331 AC_MSG_NOTICE([Detected Howl, using it for mDNS/DNS-SD])
337 if test x"$with_mdns" = xhowl; then
338 if test x"$have_howl" = xno; then
339 AC_MSG_ERROR([Howl explicitly requested but not found. Install Howl or try --with-mdns=avahi])
342 MDNS_CFLAGS=$HOWL_CFLAGS
344 AC_DEFINE(WITH_HOWL, 1, [Define if mDNS/DNS-SD implementation uses Howl])
346 AC_MSG_NOTICE([Using Howl for mDNS/DNS-SD])
350 if test x"$with_mdns" = xavahi; then
351 if test x"$have_avahi" = xno; then
352 AC_MSG_ERROR([Avahi explicitly requested but not found. Install Avahi or try --with-mdns=howl])
355 MDNS_CFLAGS=$AVAHI_CFLAGS
356 MDNS_LIBS=$AVAHI_LIBS
357 AC_DEFINE(WITH_AVAHI, 1, [Define if mDNS/DNS-SD implementation uses Avahi])
359 AC_MSG_NOTICE([Using Avahi for mDNS/DNS-SD])
361 if test x$have_avahi_06 = xyes; then
362 AC_DEFINE(HAVE_AVAHI_0_6, 1, [Define if mDNS/DNS-SD implementation uses Avahi 0.6])
364 AC_DEFINE(HAVE_AVAHI_0_5, 1, [Define if mDNS/DNS-SD implementation uses Avahi 0.5])
370 AM_CONDITIONAL(USE_HOWL, test "x$use_howl" = "xyes")
371 AM_CONDITIONAL(USE_AVAHI, test "x$use_avahi" = "xyes")
373 LIBNOTIFY_REQUIRED=0.2.2
374 AC_ARG_ENABLE(libnotify,
375 AC_HELP_STRING([--disable-libnotify],
376 [Disable libnotify support]),,
377 enable_libnotify=auto)
378 if test "x$enable_libnotify" != "xno"; then
379 PKG_CHECK_MODULES(NOTIFY, \
380 libnotify >= $LIBNOTIFY_REQUIRED,
383 if test "x$have_libnotify" = "xno" -a "x$enable_libnotify" = "xyes"; then
384 AC_MSG_ERROR([libnotify support explicitly requested, but libnotify couldn't be found])
386 if test "x$have_libnotify" = "xyes"; then
390 AM_CONDITIONAL(USE_NOTIFY, test x"$enable_libnotify" = xyes)
391 if test x$enable_libnotify = xyes ; then
392 # Find out the version of LIBNOTIFY we're using
393 libnotify_version=`pkg-config --modversion libnotify`
394 LIBNOTIFY_VERSION_MAJOR=`echo $libnotify_version | awk -F. '{print $1}'`
395 LIBNOTIFY_VERSION_MINOR=`echo $libnotify_version | awk -F. '{print $2}'`
396 LIBNOTIFY_VERSION_MICRO=`echo $libnotify_version | awk -F. '{print $3}'`
397 if test "z$LIBNOTIFY_VERSION_MAJOR" = "z"; then
398 LIBNOTIFY_VERSION_MAJOR="0"
400 if test "z$LIBNOTIFY_VERSION_MINOR" = "z"; then
401 LIBNOTIFY_VERSION_MINOR="0"
403 if test "z$LIBNOTIFY_VERSION_MICRO" = "z"; then
404 LIBNOTIFY_VERSION_MICRO="0"
406 echo "Your libnotify version is $LIBNOTIFY_VERSION_MAJOR,$LIBNOTIFY_VERSION_MINOR,$LIBNOTIFY_VERSION_MICRO."
407 NOTIFY_CFLAGS="$NOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MAJOR=$LIBNOTIFY_VERSION_MAJOR"
408 NOTIFY_CFLAGS="$NOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MINOR=$LIBNOTIFY_VERSION_MINOR"
409 NOTIFY_CFLAGS="$NOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MICRO=$LIBNOTIFY_VERSION_MICRO"
411 AC_DEFINE(HAVE_NOTIFY, 1, [Define if libnotify support is enabled])
412 AC_SUBST(NOTIFY_CFLAGS)
413 AC_SUBST(NOTIFY_LIBS)
416 dnl Check for libsoup, needed for DAAP and audioscrobbler
417 if test "x$enable_daap" = "xyes" || test "x$enable_audioscrobbler" != "xno"; then
418 PKG_CHECK_MODULES(SOUP, \
422 if test x"$have_libsoup" = "xno"; then
423 PKG_CHECK_MODULES(SOUP,
428 if test x"$have_libsoup" = "xyes"; then
429 AC_DEFINE(HAVE_LIBSOUP, 1, [Define if libsoup support is enabled])
433 AM_CONDITIONAL(USE_LIBSOUP, test x"$have_libsoup" = "xyes")
436 dnl audioscrobbler support
437 if test "x$enable_audioscrobbler" != "xno"; then
438 if test x"$have_libsoup" = "xno"; then
439 if test "x$enable_audioscrobbler" = "xyes"; then
440 AC_MSG_ERROR([AudioScrobbler support explicitly requested, but no libsoup found. Install libsoup])
442 enable_audioscrobbler=no
444 AC_DEFINE(WITH_AUDIOSCROBBLER, 1, [define if Audioscrobbler support should be enabled])
447 AM_CONDITIONAL(WITH_AUDIOSCROBBLER, test "x$enable_audioscrobbler" != "xno")
451 if test "x$enable_daap" != "xno"; then
452 if test x"$have_libsoup" = "xno"; then
453 if test "x$enable_daap" = "xyes"; then
454 AC_MSG_ERROR([DAAP support explicitly requested, but no libsoup found. Install libsoup])
457 elif test x"$have_mdns" = xno; then
458 if test "x$enable_daap" = "xyes"; then
459 AC_MSG_ERROR([DAAP support explicitly requested, but no mDNS implementation found. Install Howl or Avahi])
463 AC_DEFINE(WITH_DAAP_SUPPORT, 1, [Define if DAAP should be enabled])
465 AC_SUBST(MDNS_CFLAGS)
469 AM_CONDITIONAL(USE_DAAP, test "x$enable_daap" != "xno")
471 AC_CHECK_LIB(z, uncompress)
475 dnl check for MusicBrainz
476 AC_ARG_ENABLE(musicbrainz, AC_HELP_STRING([--disable-musicbrainz],
477 [don't build with MusicBrainz support]))
478 if test x"$enable_musicbrainz" != "xno"; then
479 PKG_CHECK_MODULES(MUSICBRAINZ, libmusicbrainz >= 2.1.0, enable_musicbrainz=yes,
480 enable_musicbrainz=no)
482 if test x"$enable_musicbrainz" = xyes; then
483 RHYTHMBOX_CFLAGS="$RHYTHMBOX_CFLAGS $MUSICBRAINZ_CFLAGS"
484 RHYTHMBOX_LIBS="$RHYTHMBOX_LIBS $MUSICBRAINZ_LIBS"
485 AC_DEFINE(HAVE_MUSICBRAINZ, 1, [define if you have Musicbrainz])
487 AM_CONDITIONAL(HAVE_MUSICBRAINZ, test "x$enable_musicbrainz" = "xyes")
493 if test x"$x_includes" != x"NONE" && test -n "$x_includes" ; then
494 CFLAGS=$CFLAGS -I`echo $x_includes | sed -e "s/:/ -I/g"`
496 if test x"$x_libraries" != x"NONE" && test -n "$x_libraries" ; then
497 LIBS=-L`echo $x_libraries | sed -e "s/:/ -L/g"`
502 #include <X11/extensions/xidle.h>
503 int main(int argc,char **argv) {
507 AC_MSG_CHECKING(for XIDLE extension)
508 AC_MSG_RESULT($have_xidle)
509 if test x"$have_xidle" = "xyes" ; then
510 AC_DEFINE(HAVE_XIDLE_EXTENSION, 1, [defined if you have X11/extensions/xidle.h])
516 #include <X11/XF86keysym.h>
517 int main(int argc,char **argv) {
521 AC_MSG_CHECKING(for XFree86 headers)
522 AC_MSG_RESULT($have_xfree)
523 if test x"$have_xfree" = "xyes" ; then
524 AC_DEFINE(HAVE_XFREE, 1, [defined if you have X11/XF86keysym.h])
527 AC_ARG_ENABLE(mmkeys, AC_HELP_STRING([--disable-mmkeys],
528 [don't build with Multimedia Keys support]))
529 if test x"$have_xfree" = xyes; then
530 if test x"$enable_mmkeys" != xno; then
532 AC_DEFINE(HAVE_MMKEYS, 1, [define if Multimedia Keys are enabled])
535 if test x"$enable_mmkeys" = xyes; then
536 AC_MSG_ERROR([Multimedia keys explicitly requested but no support found])
541 AC_DEFINE(WITH_AUDIOCD_SUPPORT, 1, [Define if audio cd support is enabled])
542 AC_CHECK_HEADER(linux/cdrom.h,[enable_linux_cdrom=yes],)
543 if test "x$enable_linux_cdrom" = "xyes"; then
544 AC_MSG_CHECKING([whether linux/cdrom.h actually works])
547 #include <sys/ioctl.h>
548 #include <linux/cdrom.h>
549 int main(int argc,char **argv) {
550 ioctl (0, CDROM_GET_CAPABILITY, 0);
551 ioctl (0, CDROM_DRIVE_STATUS, CDSL_CURRENT);
552 ioctl (0, CDROMREADTOCHDR, NULL);
554 }], [enable_linux_cdrom=yes],[enable_linux_cdrom=no])
555 if test "x$enable_linux_cdrom" = "xyes"; then
559 AC_MSG_FAILURE([linux/cdrom.h is damaged; fix your system or use --disable-audiocd])
562 AM_CONDITIONAL(HAVE_LINUX_CDROM, test "x$enable_linux_cdrom" = "xyes")
564 dnl CD burner support
565 AC_ARG_WITH(cd-burning,
566 AC_HELP_STRING([--with-cd-burning],
567 [Enable CD burning support]),,
568 with_cd_burning=auto)
569 if test "x$with_cd_burning" != "xno"; then
570 NCB_DRIVE_DOOR_VERSION=2.11.3
571 PKG_CHECK_MODULES(LIBNAUTILUS_BURN, [libnautilus-burn >= $NCB_MIN_REQS], have_cd_burner=yes, have_cd_burner=no)
572 if test "x$have_cd_burner" = xno; then
573 AC_MSG_ERROR([libnautilus-burn not found or too cold])
576 AC_CHECK_LIB(nautilus-burn, nautilus_burn_drive_door_is_open,
577 [AC_DEFINE([HAVE_BURN_DRIVE_DOOR], 1, [Have nautilus-burn function to check drive door state])],
578 ,[$LIBNAUTILUS_BURN_LIBS $LIBNAUTILUS_BURN_CFLAGS])
579 AC_CHECK_LIB(nautilus-burn, nautilus_burn_drive_unref,
580 [AC_DEFINE([HAVE_BURN_DRIVE_UNREF], 1, [Have nautilus-burn 2.13 drive unref function])],
581 ,[$LIBNAUTILUS_BURN_LIBS $LIBNAUTILUS_BURN_CFLAGS])
582 AC_CHECK_LIB(nautilus-burn, nautilus_burn_drive_new_from_path,
583 [AC_DEFINE([HAVE_BURN_DRIVE_NEW_FROM_PATH], 1, [Have nautilus-burn 2.13 drive new_from_path function])],
584 ,[$LIBNAUTILUS_BURN_LIBS $LIBNAUTILUS_BURN_CFLAGS])
585 AC_CHECK_LIB(nautilus-burn, nautilus_burn_drive_get_write_speeds,
586 [AC_DEFINE([HAVE_BURN_DRIVE_GET_WRITE_SPEEDS], 1, [Have nautilus-burn 2.13 drive get_write_speeds])],
587 ,[$LIBNAUTILUS_BURN_LIBS $LIBNAUTILUS_BURN_CFLAGS])
589 AC_DEFINE([HAVE_NAUTILUS_BURN], 1, [Have nautilus-burn])
592 AM_CONDITIONAL(USE_CD_BURNING, test "x$with_cd_burning" != "xno")
597 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
598 AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource)
599 AC_PATH_PROG(GCONFTOOL, gconftool-2)
601 AC_SUBST(RHYTHMBOX_CFLAGS)
602 AC_SUBST(RHYTHMBOX_LIBS)
603 AC_SUBST(RB_CLIENT_CFLAGS)
604 AC_SUBST(RB_CLIENT_LIBS)
606 AC_TRY_RUN([#include <time.h>
612 if (strftime(buf, 100, "%EY", &tm) == 4 &&
613 strcmp (buf, "1999")==0)
618 AC_DEFINE(HAVE_STRFTIME_EXTENSION, 1, [Define if strftime supports %E and %O modifiers.])
621 GETTEXT_PACKAGE=rhythmbox
622 AC_SUBST(GETTEXT_PACKAGE)
623 AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
624 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Define to the Gettext package name])
625 ALL_LINGUAS="`cat "$srcdir/po/LINGUAS" | grep -v '^#'`"
629 dnl Workaround for automake 1.8
630 AC_SUBST(mkdir_p) if test x"$mkdir_p" = "x"; then
631 MKINSTALLDIRS="mkinstalldirs"
633 AC_SUBST(MKINSTALLDIRS)
635 AS_AC_EXPAND(DATADIR, $datadir)
638 PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= $DBUS_MIN_REQS, enable_dbus=yes, enable_dbus=no)
639 if test "x$enable_dbus" = xno; then
640 PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= $OLD_DBUS_MIN_REQS, enable_old_dbus=yes, enable_old_dbus=no)
641 if test "x$enable_old_dbus" = xno; then
642 AC_MSG_ERROR([DBUS not found or too old])
644 AC_DEFINE(WITH_OLD_DBUS, 1, [Define if old D-BUS is enabled])
646 AC_DEFINE(WITH_DBUS, 1, [Define if D-BUS is enabled])
649 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_API_SUBJECT_TO_CHANGE"
650 DBUS_GLIB_BIN="`$PKG_CONFIG --variable=exec_prefix dbus-glib-1`/bin"
651 AC_SUBST(DBUS_GLIB_BIN)
652 AM_CONDITIONAL(WITH_DBUS, test "x$enable_dbus" = "xyes")
653 AM_CONDITIONAL(WITH_OLD_DBUS, test "x$enable_old_dbus" = "xyes")
655 dnl out-of-process metadata reader (requires dbus)
656 AC_ARG_WITH(metadata-helper,
657 AC_HELP_STRING([--with-metadata-helper],
658 [Use a separate process for metadata reading]),,
659 with_metadata_helper=auto)
660 enable_metadata_helper=no
661 if test "x$with_metadata_helper" != xno; then
662 if test "x$enable_dbus" = xyes || test "x$enable_old_dbus" = xyes; then
663 AC_DEFINE(WITH_METADATA_HELPER, 1, [Define if the metadata helper process is enabled])
664 enable_metadata_helper=yes
665 elif test "x$with_metadata_helper" = xyes; then
666 AC_MSG_ERROR([Metadata helper process explicitly requested, but D-BUS is not enabled])
669 AM_CONDITIONAL(WITH_METADATA_HELPER, test "x$enable_metadata_helper" = "xyes")
675 AC_HELP_STRING([--enable-lirc],[enable lirc support]))
677 if test x"$enable_lirc" != xno; then
678 AC_CHECK_HEADER(lirc/lirc_client.h,[with_lirc=yes],[with_lirc=no])
679 if test x"$with_lirc" = xyes; then
680 AC_CHECK_LIB(lirc_client,lirc_init,[with_lirc=yes],[with_lirc=no])
682 if test x"$with_lirc" = xno -a x"$enable_lirc" = xyes; then
683 AC_MSG_ERROR([lirc explicitly requested but no support found])
686 AM_CONDITIONAL(WITH_LIRC, test x"$with_lirc" = xyes)
689 AC_ARG_ENABLE(uninstalled-build,
690 AC_HELP_STRING([--enable-uninstalled-build],
691 [Search for files in build directory as well]),
692 enable_uninstalled=yes,)
693 if test x"$enable_uninstalled" = xyes; then
694 AC_DEFINE_UNQUOTED(SHARE_UNINSTALLED_DIR,"`pwd`/data",[path to source data dir])
695 AC_DEFINE_UNQUOTED(METADATA_UNINSTALLED_DIR,"`pwd`/metadata",[path to metadata build dir])
698 AC_ARG_WITH(internal-libsexy,
699 AC_HELP_STRING([--with-internal-libsexy],
700 [Build using internal libsexy library]),,
701 with_internal_libsexy=no)
702 if test "x$with_internal_libsexy" = "xno"; then
703 PKG_CHECK_MODULES(LIBSEXY, libsexy >= 0.1.5, with_internal_libsexy=no,
704 with_internal_libsexy=yes)
706 AC_SUBST(LIBSEXY_CFLAGS)
707 AC_SUBST(LIBSEXY_LIBS)
708 AM_CONDITIONAL(WITH_INTERNAL_LIBSEXY, test "x$with_internal_libsexy" = "xyes")
710 dnl warnings bits, copied from gnome-keyring configure.in
711 dnl Turn on the additional warnings last, so -Werror doesn't affect other tests.
713 AC_ARG_ENABLE(more-warnings,
714 [ --enable-more-warnings Maximum compiler warnings],
715 set_more_warnings="$enableval",[
716 if test -d "$srcdir/{arch}" || test -d "$srcdir/CVS" || test -d "$srcdir/_darcs"; then
717 set_more_warnings=yes
722 AC_MSG_CHECKING(for more warnings, including -Werror)
723 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
726 -Wcomment -Wformat -Wnonnull -Wimplicit-int -Wimplicit \
727 -Wmain -Wmissing-braces -Wparentheses -Wsequence-point \
728 -Wreturn-type -Wswitch -Wtrigraphs -Wunused-function \
729 -Wunused-label -Wunused-value \
730 -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
731 -Wnested-externs -Wpointer-arith \
735 if echo "$CFLAGS" | grep -e '-O[1-9]'; then
736 WARN_CFLAGS="-Wuninitialized $WARN_CFLAGS"
739 for option in $WARN_CFLAGS; do
740 SAVE_CFLAGS="$CFLAGS"
741 CFLAGS="$CFLAGS $option"
742 AC_MSG_CHECKING([whether gcc understands $option])
743 AC_TRY_COMPILE([], [],
746 if test x$has_option = xyes; then
747 RHYTHMBOX_CFLAGS="$RHYTHMBOX_CFLAGS $option"
749 AC_MSG_RESULT($has_option)
750 CFLAGS="$SAVE_CFLAGS"
756 SAVE_CFLAGS="$CFLAGS"
757 CFLAGS="$CFLAGS -Wno-error"
758 AC_TRY_COMPILE([], [],
759 WNOERROR_CFLAGS="-Wno-error",
761 AC_SUBST(WNOERROR_CFLAGS)
762 CFLAGS="$SAVE_CFLAGS"
772 dnl Enable gnome-doc-utils
776 dnl ================================================================
778 dnl ================================================================
780 PLUGIN_LIBTOOL_FLAGS="-module -avoid-version"
781 AC_SUBST(PLUGIN_LIBTOOL_FLAGS)
783 AS_AC_EXPAND(PLUGINDIR, ${libdir}/rhythmbox/plugins)
786 dnl ================================================================
788 dnl ================================================================
790 AC_MSG_CHECKING([whether Python support is requested])
791 AC_ARG_ENABLE([python],
792 AS_HELP_STRING([--enable-python],[Enable python support]),
793 [enable_python=$enableval have_python=$enableval],
794 [enable_python=autodetect have_python=yes])
795 AC_MSG_RESULT([$enable_python])
797 if test "x$have_python" != "xno"; then
798 AM_PATH_PYTHON([2.3],[],[no])
799 if test "x$PYTHON" = "x:"; then
804 if test "x$have_python" != "xno"; then
805 PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
806 PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; print sys.exec_prefix'`
807 PYTHON_LIBS="-lpython$PYTHON_VERSION"
808 PYTHON_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config"
809 PYTHON_CFLAGS="-I$PY_PREFIX/include/python$PYTHON_VERSION"
810 PYTHON_MAKEFILE="$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config/Makefile"
811 PYTHON_LOCALMODLIBS=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
812 PYTHON_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
813 PYTHON_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
814 PYTHON_EXTRA_LIBS="$PYTHON_LOCALMODLIBS $PYTHON_BASEMODLIBS $PYTHON_OTHER_LIBS"
815 AC_SUBST([PYTHON_LIBS])
816 AC_SUBST([PYTHON_LIB_LOC])
817 AC_SUBST([PYTHON_CFLAGS])
818 AC_SUBST([PYTHON_EXTRA_LIBS])
820 dnl FIXME: do we really need this test?
821 AC_MSG_CHECKING([whether we can build a shared library depending on libpython])
825 cat > testpython.c <<EOF
827 int testpython (void)
833 if /bin/sh ../libtool --mode=compile ${CC} $PYTHON_CFLAGS -c testpython.c >/dev/null 2>&1 && \
834 /bin/sh ../libtool --mode=link ${CC} -o testpython.la -rpath `pwd` -module -avoid-version $PYTHON_LIB_LOC testpython.lo $PYTHON_LIBS $PYTHON_EXTRA_LIBS >/dev/null 2>&1 && \
835 grep 'dlname.*testpython' testpython.la >/dev/null 2>&1; then
843 AC_MSG_RESULT([$result])
846 if test "x$have_python" != "xno"; then
849 PKG_CHECK_MODULES([PYGTK], [
850 pygtk-2.0 >= $PYGTK_REQUIRED],
853 AC_SUBST([PYGTK_CFLAGS])
854 AC_SUBST([PYGTK_LIBS])
857 if test "x$have_python" != "xno"; then
858 AC_MSG_CHECKING([for pygtk defs])
859 PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
860 AC_MSG_RESULT([$PYGTK_DEFSDIR])
862 AC_MSG_CHECKING([for pygtk codegen])
863 PYGTK_CODEGEN="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/codegen.py"
864 AC_MSG_RESULT([$PYGTK_CODEGEN])
866 AC_MSG_CHECKING([for pygtk h2def])
867 PYGTK_H2DEF="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/h2def.py"
868 AC_MSG_RESULT([$PYGTK_H2DEF])
870 AC_SUBST([PYGTK_DEFSDIR])
871 AC_SUBST([PYGTK_CODEGEN])
872 AC_SUBST([PYGTK_H2DEF])
874 dnl Check for -fno-strict-aliasing
875 FLAGS="-fno-strict-aliasing"
876 save_CFLAGS="$CFLAGS"
877 CFLAGS="$CFLAGS $FLAGS"
878 AC_MSG_CHECKING([whether [$]CC understands $FLAGS])
879 AC_TRY_COMPILE([], [], [compiler_has_option=yes], [compiler_has_option=no])
880 CFLAGS="$save_CFLAGS"
881 AC_MSG_RESULT($compiler_has_option)
882 if test $compiler_has_option = yes; then
883 NO_STRICT_ALIASING_CFLAGS="$FLAGS"
885 AC_SUBST([NO_STRICT_ALIASING_CFLAGS])
888 if test "x$have_python" != "xyes"; then
889 if test "x$enable_python" = "xyes"; then
890 AC_MSG_ERROR([Python support explicity requested, but not found])
891 elif test "x$enable_python" != "xno"; then
893 AC_MSG_WARN([Python not found, disabling python support])
895 elif test "x$enable_python" != "xno"; then
897 AC_DEFINE([ENABLE_PYTHON],[1],[Define to compile with python support])
900 AM_CONDITIONAL([ENABLE_PYTHON],[test "x$enable_python" = "xyes"])
903 dnl check, for unit tests
904 AM_PATH_CHECK([], have_check=yes, have_check=no)
905 AM_CONDITIONAL([HAVE_CHECK],[test "x$have_check" = "xyes"])
908 dnl ================================================================
910 dnl ================================================================
919 widgets/libsexy/Makefile
930 plugins/sample/Makefile
931 plugins/audioscrobbler/Makefile
932 plugins/cd-recorder/Makefile
933 plugins/ipod/Makefile
934 plugins/lirc/Makefile
935 plugins/lyrics/Makefile
936 plugins/sample-python/Makefile
937 plugins/pythonconsole/Makefile
938 plugins/artdisplay/Makefile
939 plugins/artdisplay/artdisplay/Makefile
940 plugins/generic-player/Makefile
943 bindings/python/Makefile
948 doc/reference/Makefile
950 backends/gstreamer/Makefile
955 AC_MSG_NOTICE([Rhythmbox was configured with the following options:])
956 if test x"$with_database" = xtree; then
957 AC_MSG_NOTICE([** Tree database is enabled])
958 elif test x"$with_database" = xlibgda; then
959 AC_MSG_NOTICE([** libgda/sqlite database is enabled])
961 AC_MSG_ERROR([Unknown database!])
963 if test x"${with_rhythmdb_debug}" != x0; then
964 AC_MSG_NOTICE([** RhythmDB sanity checking enabled (may be slow!)])
968 if test x"$enable_tag_writing" = xyes; then
969 AC_MSG_NOTICE([** Tag writing is enabled - USE AT YOUR OWN RISK])
971 AC_MSG_NOTICE([ Tag writing is disabled])
973 if test x"$with_track_transfer" = xyes; then
974 AC_MSG_NOTICE([** Track transfer is enabled])
976 AC_MSG_NOTICE([ Track transfer is disabled])
978 if test x"$enable_ipod_writing" = xyes; then
979 AC_MSG_NOTICE([** iPod write support is enabled])
981 AC_MSG_NOTICE([ iPod write support is disabled])
983 if test x"$enable_mmkeys" != "xyes"; then
984 AC_MSG_NOTICE([ Multimedia keys support is disabled])
986 AC_MSG_NOTICE([** Multimedia keys support is enabled])
988 if test x"$enable_musicbrainz" != "xyes"; then
989 AC_MSG_NOTICE([ MusicBrainz support is disabled])
991 AC_MSG_NOTICE([** MusicBrainz support is enabled])
994 if test x"$with_playback" = xgstreamer_0_8; then
995 AC_MSG_NOTICE([** GStreamer 0.8 player is enabled])
996 elif test x"$with_playback" = xgstreamer_0_10; then
997 AC_MSG_NOTICE([** GStreamer 0.10 player is enabled])
999 AC_MSG_ERROR([ Playback engine set incorrectly])
1002 if test x"$use_ipod" = xyes; then
1003 AC_MSG_NOTICE([** iPod integration enabled])
1005 AC_MSG_NOTICE([ iPod integration disabled])
1007 if test x"$with_cd_burning" != xno; then
1008 AC_MSG_NOTICE([** CD burning support enabled])
1010 AC_MSG_NOTICE([ CD burning support disabled])
1012 if test x"$enable_daap" = xyes; then
1013 AC_MSG_NOTICE([** DAAP (music sharing) support is enabled])
1015 AC_MSG_NOTICE([ DAAP (music sharing) support is disabled])
1017 if test x"$have_libnotify" = xyes; then
1018 AC_MSG_NOTICE([** libnotify support is enabled])
1020 AC_MSG_NOTICE([ libnotify support is disabled])
1022 if test x"$enable_hal" = xyes; then
1023 AC_MSG_NOTICE([** HAL support enabled])
1025 AC_MSG_NOTICE([ HAL support disabled])
1027 if test x"$enable_old_dbus" = xyes; then
1028 AC_MSG_NOTICE([** using D-BUS < 0.35 control/activation])
1030 if test x"$enable_python" != xno; then
1031 AC_MSG_NOTICE([** Python support enabled])
1033 AC_MSG_NOTICE([ Python support disabled])
1036 if test x"$enable_audioscrobbler" != xno; then
1037 AC_MSG_NOTICE([** Audioscrobbler support enabled])
1039 AC_MSG_NOTICE([ Audioscrobbler support disabled])
1041 if test x"$enable_metadata_helper" = xyes; then
1042 AC_MSG_NOTICE([** Separate metadata helper process enabled])
1044 AC_MSG_NOTICE([ Separate metadata helper process disabled])
1046 if test x"$with_internal_libsexy" = xyes; then
1047 AC_MSG_NOTICE([ using internal libsexy])
1049 AC_MSG_NOTICE([** using system-wide libsexy])
1052 AC_MSG_NOTICE([End options])