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.4)
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])])
51 PKG_CHECK_MODULES(RHYTHMBOX, \
52 gtk+-2.0 >= $GTK_REQS \
55 gnome-vfs-2.0 >= $GNOME_VFS_REQS \
58 PKG_CHECK_MODULES(TOTEM_PLPARSER, totem-plparser >= $TOTEM_PLPARSER_REQS, have_totem_plparser=yes, have_totem_plparser=no)
59 if test x$have_totem_plparser != xyes; then
60 AC_MSG_ERROR([totem playlist parsing library not found or too old])
64 AC_HELP_STRING([--without-hal],
65 [Disable HAL support]))
66 if test "x$with_hal" != "xno"; then
67 PKG_CHECK_MODULES(HAL, hal >= 0.5 hal < 0.6, enable_hal05=yes, enable_hal05=no)
68 if test x$enable_hal05 != xyes; then
69 PKG_CHECK_MODULES(HAL, hal >= 0.2.92 hal < 0.5, enable_hal02=yes, enable_hal02=no)
71 if test x$enable_hal05 = xyes || test x$enable_hal02 = xyes; then
73 AC_DEFINE(HAVE_HAL, 1, [Define if you HAL support])
74 if test x$enable_hal05 = xyes; then
75 AC_DEFINE(HAVE_HAL_0_5, 1, [Define if you have HAL 0.5 or later])
77 AC_DEFINE(HAVE_HAL_0_2, 1, [Define if you have HAL 0.2 or later])
82 if test "x$with_hal" = "xyes"; then
83 AC_MSG_ERROR([HAL support explicitly requested but HAL couldn't be found])
87 AM_CONDITIONAL(HAVE_HAL_0_5, test x"$enable_hal05" = xyes)
88 AM_CONDITIONAL(HAVE_HAL_0_2, test x"$enable_hal02" = xyes)
89 AM_CONDITIONAL(HAVE_HAL, test x"$enable_hal" = xyes)
94 AC_HELP_STRING([--with-ipod],
95 [Enable iPod support]),,
97 if test "x$with_ipod" != "xno"; then
99 PKG_CHECK_MODULES(IPOD, libgpod-1.0, have_libgpod=yes, have_libgpod=no)
100 if test "x$have_libgpod" = "xno" -a "x$with_ipod" = "xyes"; then
101 AC_MSG_ERROR([iPod explicitly requested but libgpod couldn't be found])
103 if test "x$have_libgpod" = "xyes"; then
104 if test "x$with_hal" = xyes && test "x$enable_hal" = xno; then
105 AC_MSG_ERROR([iPod explicitly requested but HAL not found or too old])
107 if test "x$enable_hal" = xyes; then
108 AC_DEFINE(WITH_IPOD_SUPPORT, 1, [Define if iPod support is enabled])
111 PKG_CHECK_MODULES(IPOD_PHONE, libgpod-1.0 >= 0.3.3, support_phone=yes, support_phone=no)
112 if test "x$support_phone" = xyes; then
113 AC_DEFINE(IPOD_PHONE_SUPPORT, 1, [iPod support for phone])
116 AC_SUBST(IPOD_CFLAGS)
120 AM_CONDITIONAL(USE_IPOD, test x"$use_ipod" = xyes)
123 AC_ARG_WITH(database,
124 AC_HELP_STRING([--with-database=tree|libgda],
125 [Select the database to use (default tree)]),,
127 AM_CONDITIONAL(USE_TREEDB, test x"$with_database" = xtree)
128 AM_CONDITIONAL(USE_GDADB, test x"$with_database" = xlibgda)
132 case "x$with_database" in
134 AC_DEFINE(WITH_RHYTHMDB_TREE, 1, [Define if you are using the RhythmDB tree database])
137 AC_DEFINE(WITH_RHYTHMDB_GDA, 1, [Define if you are using the RhythmDB sqlite/libgda database])
138 dnl FIXME: check for sqlite, too?
139 PKG_CHECK_MODULES(GDA, libgda > 1.0.3)
142 AC_MSG_ERROR([Unknown database selected])
148 dnl Database debugging
149 AC_ARG_WITH(rhythmdb-debug,
150 AC_HELP_STRING([--with-rhythmdb-debug=0|1|2],
151 [Level of RhythmDB sanity checking]),,with_rhythmdb_debug=0)
152 if test x"${with_rhythmdb_debug}" != x0; then
153 AC_DEFINE_UNQUOTED([RHYTHMDB_ENABLE_SANITY_CHECK], "${with_rhythmdb_debug}", [Define to the level of RhythmDB sanity checking])
157 dnl Now we're ready to ask for gstreamer libs and cflags
158 dnl And we can also ask for the right version of gstreamer
161 GST_0_8_MAJORMINOR=0.8
162 GST_0_8_REQUIRED_VERSION=0.8.2
163 PKG_CHECK_MODULES(GSTREAMER_0_8, \
164 gstreamer-$GST_0_8_MAJORMINOR >= $GST_0_8_REQUIRED_VERSION gstreamer-libs-$GST_0_8_MAJORMINOR >= $GST_0_8_REQUIRED_VERSION
165 gstreamer-control-$GST_0_8_MAJORMINOR >= $GST_0_8_REQUIRED_VERSION
166 gstreamer-gconf-$GST_0_8_MAJORMINOR >= $GST_0_8_REQUIRED_VERSION,
167 have_gstreamer_0_8=yes,have_gstreamer_0_8=no)
169 GST_0_10_MAJORMINOR=0.10
170 GST_0_10_REQUIRED_VERSION=0.9.7
171 PKG_CHECK_MODULES(GSTREAMER_0_10, \
172 gstreamer-$GST_0_10_MAJORMINOR >= $GST_0_10_REQUIRED_VERSION
173 gstreamer-base-$GST_0_10_MAJORMINOR >= $GST_0_10_REQUIRED_VERSION
174 gstreamer-plugins-base-$GST_0_10_MAJORMINOR >= $GST_0_10_REQUIRED_VERSION,
175 have_gstreamer_0_10=yes,have_gstreamer_0_10=no)
177 AC_ARG_WITH(playback,
178 AC_HELP_STRING([--with-playback=auto|gstreamer-0-8|gstreamer-0-10],
179 [Select the playback backend to use (default auto)]),,
182 if test x$with_playback = xauto -o x$with_playback = xgstreamer-0-10; then
183 if test x"$have_gstreamer_0_10" = xyes; then
184 with_playback=gstreamer_0_10
185 SOUNDSYSTEM_DEPS="gstreamer-$GST_0_10_MAJORMINOR"
186 AC_DEFINE(HAVE_GSTREAMER,1,[Define if you want to use the GStreamer media framework])
187 AC_DEFINE(HAVE_GSTREAMER_0_10,1,[Define if you want to use the GStreamer 0.10])
188 SOUNDSYSTEM_CFLAGS="$GSTREAMER_0_10_CFLAGS"
189 SOUNDSYSTEM_LIBS="$GSTREAMER_0_10_LIBS"
190 elif test x$with_playback = xgstreamer-0-10; then
191 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])
194 if test x$with_playback = xauto -o x$with_playback = xgstreamer-0-8; then
195 if test x"$have_gstreamer_0_8" = xyes; then
196 with_playback=gstreamer_0_8
197 SOUNDSYSTEM_DEPS="gstreamer-$GST_0_8_MAJORMINOR"
198 AC_DEFINE(HAVE_GSTREAMER,1,[Define if you want to use the GStreamer media framework])
199 AC_DEFINE(HAVE_GSTREAMER_0_8,1,[Define if you want to use the GStreamer 0.8])
200 SOUNDSYSTEM_CFLAGS="$GSTREAMER_0_8_CFLAGS"
201 SOUNDSYSTEM_LIBS="$GSTREAMER_0_8_LIBS"
202 elif test x$with_playback = xgstreamer-0-8; then
203 AC_MSG_ERROR([GStreamer 0.8 explicity requested, and it was not found or older than version $GST_REQUIRED_VERSION])
206 AM_CONDITIONAL(USE_GSTREAMER_0_10, test x"$with_playback" = xgstreamer_0_10)
207 AM_CONDITIONAL(USE_GSTREAMER_0_8, test x"$with_playback" = xgstreamer_0_8)
209 dnl Give error and exit if we don't have gstreamer
210 if test x$with_playback = xauto; then
211 AC_MSG_ERROR([GStreamer not found, or older than version $GST_0_8_REQUIRED_VERSION/$GST_0_10_REQUIRED_VERSION])
214 AC_SUBST(SOUNDSYSTEM_DEPS)
215 RHYTHMBOX_CFLAGS="$RHYTHMBOX_CFLAGS $SOUNDSYSTEM_CFLAGS"
216 RHYTHMBOX_LIBS="$RHYTHMBOX_LIBS $SOUNDSYSTEM_LIBS"
220 AC_ARG_ENABLE(tag-writing,
221 AC_HELP_STRING([--enable-tag-writing],
222 [Enable tag writing support in rhythmbox **EXPERIMENTAL**]))
223 if test x"$enable_tag_writing" = xyes; then
224 AC_MSG_WARN([Tag writing support is experimental, and may corrupt files, use at your own risk])
225 AC_DEFINE(ENABLE_TAG_WRITING, 1, [Define if tag writing should be enabled])
229 AC_ARG_ENABLE(track-transfer,
230 AC_HELP_STRING([--enable-track-transfer],
231 [Enable track transfer support in rhythmbox **EXPERIMENTAL**]))
232 if test x"$enable_track_transfer" = xyes; then
233 AC_MSG_WARN([Track transfer support is experimental, and may corrupt files, use at your own risk])
234 PKG_CHECK_MODULES(GNOME_MEDIA_PROFILES,
235 gnome-media-profiles,
236 have_gnome_media_profiles=yes,
237 have_gnome_media_profiles=no)
239 if test x$have_gnome_media_profiles = xno; then
240 AC_MSG_ERROR([Track transfer support explicitly requested but gnome-media-profiles not found.])
243 AC_DEFINE(ENABLE_TRACK_TRANSFER, 1, [Define if track transfer should be enabled])
245 AM_CONDITIONAL(ENABLE_TRACK_TRANSFER, test "x$have_gnome_media_profiles" = "xyes")
249 AC_ARG_ENABLE(audioscrobbler,
250 AC_HELP_STRING([--disable-audioscrobbler],
251 [Disable Audioscrobbler support in Rhythmbox]))
253 dnl DAAP (iTunes Music Shares)
255 AC_HELP_STRING([--enable-daap],
256 [Enable Digital Audio Access Protocol (music sharing) in rhythmbox **EXPERIMENTAL**]))
259 AC_HELP_STRING([--with-mdns=auto|howl|avahi],
260 [Select the mDNS/DNS-SD implementation to use (default auto)]),,
269 PKG_CHECK_MODULES(AVAHI,
274 if test x$have_avahi_06 != xyes; then
275 PKG_CHECK_MODULES(AVAHI,
281 if test x$have_avahi_06 = xyes || test x$have_avahi_05 = xyes; then
287 PKG_CHECK_MODULES(HOWL,
292 if test x"$with_mdns" = xauto; then
293 if test x"$have_avahi" = xyes; then
294 MDNS_CFLAGS=$AVAHI_CFLAGS
295 MDNS_LIBS=$AVAHI_LIBS
296 AC_DEFINE(WITH_AVAHI, 1, [Define if mDNS/DNS-SD implementation uses Avahi])
298 AC_MSG_NOTICE([Detected Avahi, using it for mDNS/DNS-SD])
299 if test x$have_avahi_06 = xyes; then
300 AC_DEFINE(HAVE_AVAHI_0_6, 1, [Define if mDNS/DNS-SD implementation uses Avahi 0.6])
302 AC_DEFINE(HAVE_AVAHI_0_5, 1, [Define if mDNS/DNS-SD implementation uses Avahi 0.5])
306 elif test x"$have_howl" = xyes; then
307 MDNS_CFLAGS=$HOWL_CFLAGS
309 AC_DEFINE(WITH_HOWL, 1, [Define if mDNS/DNS-SD implementation uses Howl])
311 AC_MSG_NOTICE([Detected Howl, using it for mDNS/DNS-SD])
317 if test x"$with_mdns" = xhowl; then
318 if test x"$have_howl" = xno; then
319 AC_MSG_ERROR([Howl explicitly requested but not found. Install Howl or try --with-mdns=avahi])
322 MDNS_CFLAGS=$HOWL_CFLAGS
324 AC_DEFINE(WITH_HOWL, 1, [Define if mDNS/DNS-SD implementation uses Howl])
326 AC_MSG_NOTICE([Using Howl for mDNS/DNS-SD])
330 if test x"$with_mdns" = xavahi; then
331 if test x"$have_avahi" = xno; then
332 AC_MSG_ERROR([Avahi explicitly requested but not found. Install Avahi or try --with-mdns=howl])
335 MDNS_CFLAGS=$AVAHI_CFLAGS
336 MDNS_LIBS=$AVAHI_LIBS
337 AC_DEFINE(WITH_AVAHI, 1, [Define if mDNS/DNS-SD implementation uses Avahi])
339 AC_MSG_NOTICE([Using Avahi for mDNS/DNS-SD])
341 if test x$have_avahi_06 = xyes; then
342 AC_DEFINE(HAVE_AVAHI_0_6, 1, [Define if mDNS/DNS-SD implementation uses Avahi 0.6])
344 AC_DEFINE(HAVE_AVAHI_0_5, 1, [Define if mDNS/DNS-SD implementation uses Avahi 0.5])
350 AM_CONDITIONAL(USE_HOWL, test "x$use_howl" = "xyes")
351 AM_CONDITIONAL(USE_AVAHI, test "x$use_avahi" = "xyes")
353 LIBNOTIFY_REQUIRED=0.2.2
354 AC_ARG_ENABLE(libnotify,
355 AC_HELP_STRING([--disable-libnotify],
356 [Disable libnotify support]),,
357 enable_libnotify=auto)
358 if test "x$enable_libnotify" != "xno"; then
359 PKG_CHECK_MODULES(NOTIFY, \
360 libnotify >= $LIBNOTIFY_REQUIRED,
363 if test "x$have_libnotify" = "xno" -a "x$enable_libnotify" = "xyes"; then
364 AC_MSG_ERROR([libnotify support explicitly requested, but libnotify couldn't be found])
366 if test "x$have_libnotify" = "xyes"; then
370 AM_CONDITIONAL(USE_NOTIFY, test x"$enable_libnotify" = xyes)
371 if test x$enable_libnotify = xyes ; then
372 # Find out the version of LIBNOTIFY we're using
373 libnotify_version=`pkg-config --modversion libnotify`
374 LIBNOTIFY_VERSION_MAJOR=`echo $libnotify_version | awk -F. '{print $1}'`
375 LIBNOTIFY_VERSION_MINOR=`echo $libnotify_version | awk -F. '{print $2}'`
376 LIBNOTIFY_VERSION_MICRO=`echo $libnotify_version | awk -F. '{print $3}'`
377 if test "z$LIBNOTIFY_VERSION_MAJOR" = "z"; then
378 LIBNOTIFY_VERSION_MAJOR="0"
380 if test "z$LIBNOTIFY_VERSION_MINOR" = "z"; then
381 LIBNOTIFY_VERSION_MINOR="0"
383 if test "z$LIBNOTIFY_VERSION_MICRO" = "z"; then
384 LIBNOTIFY_VERSION_MICRO="0"
386 echo "Your libnotify version is $LIBNOTIFY_VERSION_MAJOR,$LIBNOTIFY_VERSION_MINOR,$LIBNOTIFY_VERSION_MICRO."
387 NOTIFY_CFLAGS="$NOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MAJOR=$LIBNOTIFY_VERSION_MAJOR"
388 NOTIFY_CFLAGS="$NOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MINOR=$LIBNOTIFY_VERSION_MINOR"
389 NOTIFY_CFLAGS="$NOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MICRO=$LIBNOTIFY_VERSION_MICRO"
391 AC_DEFINE(HAVE_NOTIFY, 1, [Define if libnotify support is enabled])
392 AC_SUBST(NOTIFY_CFLAGS)
393 AC_SUBST(NOTIFY_LIBS)
396 dnl Check for libsoup, needed for DAAP and audioscrobbler
397 if test "x$enable_daap" = "xyes" || test "x$enable_audioscrobbler" != "xno"; then
398 PKG_CHECK_MODULES(SOUP, \
402 if test x"$have_libsoup" = "xno"; then
403 PKG_CHECK_MODULES(SOUP,
408 if test x"$have_libsoup" = "xyes"; then
409 AC_DEFINE(HAVE_LIBSOUP, 1, [Define if libsoup support is enabled])
413 AM_CONDITIONAL(USE_LIBSOUP, test x"$have_libsoup" = "xyes")
416 dnl audioscrobbler support
417 if test "x$enable_audioscrobbler" != "xno"; then
418 if test x"$have_libsoup" = "xno"; then
419 if test "x$enable_audioscrobbler" = "xyes"; then
420 AC_MSG_ERROR([AudioScrobbler support explicitly requested, but no libsoup found. Install libsoup])
422 enable_audioscrobbler=no
424 AC_DEFINE(WITH_AUDIOSCROBBLER, 1, [define if Audioscrobbler support should be enabled])
427 AM_CONDITIONAL(WITH_AUDIOSCROBBLER, test "x$enable_audioscrobbler" != "xno")
431 if test "x$enable_daap" != "xno"; then
432 if test x"$have_libsoup" = "xno"; then
433 if test "x$enable_daap" = "xyes"; then
434 AC_MSG_ERROR([DAAP support explicitly requested, but no libsoup found. Install libsoup])
437 elif test x"$have_mdns" = xno; then
438 if test "x$enable_daap" = "xyes"; then
439 AC_MSG_ERROR([DAAP support explicitly requested, but no mDNS implementation found. Install Howl or Avahi])
443 AC_DEFINE(WITH_DAAP_SUPPORT, 1, [Define if DAAP should be enabled])
445 AC_SUBST(MDNS_CFLAGS)
449 AM_CONDITIONAL(USE_DAAP, test "x$enable_daap" != "xno")
451 AC_CHECK_LIB(z, uncompress)
455 dnl check for MusicBrainz
456 AC_ARG_ENABLE(musicbrainz, AC_HELP_STRING([--disable-musicbrainz],
457 [don't build with MusicBrainz support]))
458 if test x"$enable_musicbrainz" != "xno"; then
459 PKG_CHECK_MODULES(MUSICBRAINZ, libmusicbrainz >= 2.1.0, enable_musicbrainz=yes,
460 enable_musicbrainz=no)
462 if test x"$enable_musicbrainz" = xyes; then
463 RHYTHMBOX_CFLAGS="$RHYTHMBOX_CFLAGS $MUSICBRAINZ_CFLAGS"
464 RHYTHMBOX_LIBS="$RHYTHMBOX_LIBS $MUSICBRAINZ_LIBS"
465 AC_DEFINE(HAVE_MUSICBRAINZ, 1, [define if you have Musicbrainz])
467 AM_CONDITIONAL(HAVE_MUSICBRAINZ, test "x$enable_musicbrainz" = "xyes")
473 if test x"$x_includes" != x"NONE" && test -n "$x_includes" ; then
474 CFLAGS=$CFLAGS -I`echo $x_includes | sed -e "s/:/ -I/g"`
476 if test x"$x_libraries" != x"NONE" && test -n "$x_libraries" ; then
477 LIBS=-L`echo $x_libraries | sed -e "s/:/ -L/g"`
482 #include <X11/extensions/xidle.h>
483 int main(int argc,char **argv) {
487 AC_MSG_CHECKING(for XIDLE extension)
488 AC_MSG_RESULT($have_xidle)
489 if test x"$have_xidle" = "xyes" ; then
490 AC_DEFINE(HAVE_XIDLE_EXTENSION, 1, [defined if you have X11/extensions/xidle.h])
496 #include <X11/XF86keysym.h>
497 int main(int argc,char **argv) {
501 AC_MSG_CHECKING(for XFree86 headers)
502 AC_MSG_RESULT($have_xfree)
503 if test x"$have_xfree" = "xyes" ; then
504 AC_DEFINE(HAVE_XFREE, 1, [defined if you have X11/XF86keysym.h])
507 AC_ARG_ENABLE(mmkeys, AC_HELP_STRING([--disable-mmkeys],
508 [don't build with Multimedia Keys support]))
509 if test x"$have_xfree" = xyes; then
510 if test x"$enable_mmkeys" != xno; then
512 AC_DEFINE(HAVE_MMKEYS, 1, [define if Multimedia Keys are enabled])
515 if test x"$enable_mmkeys" = xyes; then
516 AC_MSG_ERROR([Multimedia keys explicitly requested but no support found])
521 AC_DEFINE(WITH_AUDIOCD_SUPPORT, 1, [Define if audio cd support is enabled])
522 AC_CHECK_HEADER(linux/cdrom.h,[enable_linux_cdrom=yes],)
523 if test "x$enable_linux_cdrom" = "xyes"; then
524 AC_MSG_CHECKING([whether linux/cdrom.h actually works])
527 #include <sys/ioctl.h>
528 #include <linux/cdrom.h>
529 int main(int argc,char **argv) {
530 ioctl (0, CDROM_GET_CAPABILITY, 0);
531 ioctl (0, CDROM_DRIVE_STATUS, CDSL_CURRENT);
532 ioctl (0, CDROMREADTOCHDR, NULL);
534 }], [enable_linux_cdrom=yes],[enable_linux_cdrom=no])
535 if test "x$enable_linux_cdrom" = "xyes"; then
539 AC_MSG_FAILURE([linux/cdrom.h is damaged; fix your system or use --disable-audiocd])
542 AM_CONDITIONAL(HAVE_LINUX_CDROM, test "x$enable_linux_cdrom" = "xyes")
544 NCB_DRIVE_DOOR_VERSION=2.11.3
545 dnl CD burner support
546 PKG_CHECK_MODULES(LIBNAUTILUS_BURN, [libnautilus-burn >= $NCB_MIN_REQS], have_cd_burner=yes, have_cd_burner=no)
547 if test "x$have_cd_burner" = xno; then
548 AC_MSG_ERROR([libnautilus-burn not found or too cold])
550 AC_CHECK_LIB(nautilus-burn, nautilus_burn_drive_door_is_open,
551 [AC_DEFINE([HAVE_BURN_DRIVE_DOOR], 1, [Have nautilus-burn function to check drive door state])],
552 ,[$LIBNAUTILUS_BURN_LIBS $LIBNAUTILUS_BURN_CFLAGS])
553 AC_CHECK_LIB(nautilus-burn, nautilus_burn_drive_unref,
554 [AC_DEFINE([HAVE_BURN_DRIVE_UNREF], 1, [Have nautilus-burn 2.13 drive unref function])],
555 ,[$LIBNAUTILUS_BURN_LIBS $LIBNAUTILUS_BURN_CFLAGS])
556 AC_CHECK_LIB(nautilus-burn, nautilus_burn_drive_new_from_path,
557 [AC_DEFINE([HAVE_BURN_DRIVE_NEW_FROM_PATH], 1, [Have nautilus-burn 2.13 drive new_from_path function])],
558 ,[$LIBNAUTILUS_BURN_LIBS $LIBNAUTILUS_BURN_CFLAGS])
559 AC_CHECK_LIB(nautilus-burn, nautilus_burn_drive_get_write_speeds,
560 [AC_DEFINE([HAVE_BURN_DRIVE_GET_WRITE_SPEEDS], 1, [Have nautilus-burn 2.13 drive get_write_speeds])],
561 ,[$LIBNAUTILUS_BURN_LIBS $LIBNAUTILUS_BURN_CFLAGS])
566 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
567 AC_PATH_PROG(GCONFTOOL, gconftool-2)
569 AC_SUBST(RHYTHMBOX_CFLAGS)
570 AC_SUBST(RHYTHMBOX_LIBS)
572 GETTEXT_PACKAGE=rhythmbox
573 AC_SUBST(GETTEXT_PACKAGE)
574 AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
575 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Define to the Gettext package name])
576 ALL_LINGUAS="`cat "$srcdir/po/LINGUAS" | grep -v '^#'`"
580 dnl Workaround for automake 1.8
581 AC_SUBST(mkdir_p) if test x"$mkdir_p" = "x"; then
582 MKINSTALLDIRS="mkinstalldirs"
584 AC_SUBST(MKINSTALLDIRS)
586 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
588 AS_AC_EXPAND(DATADIR, $datadir)
591 PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= $DBUS_MIN_REQS, enable_dbus=yes, enable_dbus=no)
592 if test "x$enable_dbus" = xno; then
593 PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= $OLD_DBUS_MIN_REQS, enable_old_dbus=yes, enable_old_dbus=no)
594 if test "x$enable_old_dbus" = xno; then
595 AC_MSG_ERROR([DBUS not found or too old])
597 AC_DEFINE(WITH_OLD_DBUS, 1, [Define if old D-BUS is enabled])
599 AC_DEFINE(WITH_DBUS, 1, [Define if D-BUS is enabled])
602 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_API_SUBJECT_TO_CHANGE"
603 DBUS_GLIB_BIN="`$PKG_CONFIG --variable=exec_prefix dbus-glib-1`/bin"
604 AC_SUBST(DBUS_GLIB_BIN)
605 AM_CONDITIONAL(WITH_DBUS, test "x$enable_dbus" = "xyes")
606 AM_CONDITIONAL(WITH_OLD_DBUS, test "x$enable_old_dbus" = "xyes")
608 dnl out-of-process metadata reader (requires dbus)
609 AC_ARG_WITH(metadata-helper,
610 AC_HELP_STRING([--with-metadata-helper],
611 [Use a separate process for metadata reading]),,
612 with_metadata_helper=auto)
613 enable_metadata_helper=no
614 if test "x$with_metadata_helper" != xno; then
615 if test "x$enable_dbus" = xyes || test "x$enable_old_dbus" = xyes; then
616 AC_DEFINE(WITH_METADATA_HELPER, 1, [Define if the metadata helper process is enabled])
617 enable_metadata_helper=yes
618 elif test "x$with_metadata_helper" = xyes; then
619 AC_MSG_ERROR([Metadata helper process explicitly requested, but D-BUS is not enabled])
622 AM_CONDITIONAL(WITH_METADATA_HELPER, test "x$enable_metadata_helper" = "xyes")
628 AC_HELP_STRING([--enable-lirc],[enable lirc support]))
630 if test x"$enable_lirc" != xno; then
631 AC_CHECK_HEADER(lirc/lirc_client.h,[with_lirc=yes],[with_lirc=no])
632 if test x"$with_lirc" = xyes; then
633 AC_CHECK_LIB(lirc_client,lirc_init,[with_lirc=yes],[with_lirc=no])
635 if test x"$with_lirc" = xno -a x"$enable_lirc" = xyes; then
636 AC_MSG_ERROR([lirc explicitly requested but no support found])
639 AM_CONDITIONAL(WITH_LIRC, test x"$with_lirc" = xyes)
642 AC_ARG_ENABLE(uninstalled-build,
643 AC_HELP_STRING([--enable-uninstalled-build],
644 [Search for files in build directory as well]),
645 enable_uninstalled=yes,)
646 if test x"$enable_uninstalled" = xyes; then
647 AC_DEFINE_UNQUOTED(SHARE_UNINSTALLED_DIR,"`pwd`/data",[path to source data dir])
648 AC_DEFINE_UNQUOTED(METADATA_UNINSTALLED_DIR,"`pwd`/metadata",[path to metadata build dir])
651 AC_ARG_WITH(internal-libsexy,
652 AC_HELP_STRING([--with-internal-libsexy],
653 [Build using internal libsexy library]),,
654 with_internal_libsexy=no)
655 if test "x$with_internal_libsexy" = "xno"; then
656 PKG_CHECK_MODULES(LIBSEXY, libsexy >= 0.1.5, with_internal_libsexy=no,
657 with_internal_libsexy=yes)
659 AC_SUBST(LIBSEXY_CFLAGS)
660 AC_SUBST(LIBSEXY_LIBS)
661 AM_CONDITIONAL(WITH_INTERNAL_LIBSEXY, test "x$with_internal_libsexy" = "xyes")
663 dnl warnings bits, copied from gnome-keyring configure.in
664 dnl Turn on the additional warnings last, so -Werror doesn't affect other tests.
666 AC_ARG_ENABLE(more-warnings,
667 [ --enable-more-warnings Maximum compiler warnings],
668 set_more_warnings="$enableval",[
669 if test -d "$srcdir/{arch}" || test -d "$srcdir/CVS" || test -d "$srcdir/_darcs"; then
670 set_more_warnings=yes
675 AC_MSG_CHECKING(for more warnings, including -Werror)
676 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
679 -Wcomment -Wformat -Wnonnull -Wimplicit-int -Wimplicit \
680 -Wmain -Wmissing-braces -Wparentheses -Wsequence-point \
681 -Wreturn-type -Wswitch -Wtrigraphs -Wunused-function \
682 -Wunused-label -Wunused-value \
683 -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
684 -Wnested-externs -Wpointer-arith \
688 if echo "$CFLAGS" | grep -e '-O[1-9]'; then
689 WARN_CFLAGS="-Wuninitialized $WARN_CFLAGS"
692 for option in $WARN_CFLAGS; do
693 SAVE_CFLAGS="$CFLAGS"
694 CFLAGS="$CFLAGS $option"
695 AC_MSG_CHECKING([whether gcc understands $option])
696 AC_TRY_COMPILE([], [],
699 if test x$has_option = xyes; then
700 RHYTHMBOX_CFLAGS="$RHYTHMBOX_CFLAGS $option"
702 AC_MSG_RESULT($has_option)
703 CFLAGS="$SAVE_CFLAGS"
709 SAVE_CFLAGS="$CFLAGS"
710 CFLAGS="$CFLAGS -Wno-error"
711 AC_TRY_COMPILE([], [],
712 WNOERROR_CFLAGS="-Wno-error",
714 AC_SUBST(WNOERROR_CFLAGS)
715 CFLAGS="$SAVE_CFLAGS"
725 dnl Enable gnome-doc-utils
729 dnl ================================================================
731 dnl ================================================================
733 PLUGIN_LIBTOOL_FLAGS="-module -avoid-version"
734 AC_SUBST(PLUGIN_LIBTOOL_FLAGS)
736 AS_AC_EXPAND(PLUGINDIR, ${libdir}/rhythmbox/plugins)
739 dnl ================================================================
741 dnl ================================================================
743 AC_MSG_CHECKING([whether Python support is requested])
744 AC_ARG_ENABLE([python],
745 AS_HELP_STRING([--enable-python],[Enable python support]),
746 [enable_python=$enableval have_python=$enableval],
747 [enable_python=autodetect have_python=yes])
748 AC_MSG_RESULT([$enable_python])
750 if test "x$have_python" != "xno"; then
751 AM_PATH_PYTHON([2.3],[],[no])
752 if test "x$PYTHON" = "x:"; then
757 if test "x$have_python" != "xno"; then
758 PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
759 PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; print sys.exec_prefix'`
760 PYTHON_LIBS="-lpython$PYTHON_VERSION"
761 PYTHON_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config"
762 PYTHON_CFLAGS="-I$PY_PREFIX/include/python$PYTHON_VERSION"
763 PYTHON_MAKEFILE="$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config/Makefile"
764 PYTHON_LOCALMODLIBS=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
765 PYTHON_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
766 PYTHON_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
767 PYTHON_EXTRA_LIBS="$PYTHON_LOCALMODLIBS $PYTHON_BASEMODLIBS $PYTHON_OTHER_LIBS"
768 AC_SUBST([PYTHON_LIBS])
769 AC_SUBST([PYTHON_LIB_LOC])
770 AC_SUBST([PYTHON_CFLAGS])
771 AC_SUBST([PYTHON_EXTRA_LIBS])
773 dnl FIXME: do we really need this test?
774 AC_MSG_CHECKING([whether we can build a shared library depending on libpython])
778 cat > testpython.c <<EOF
780 int testpython (void)
786 if /bin/sh ../libtool --mode=compile ${CC} $PYTHON_CFLAGS -c testpython.c >/dev/null 2>&1 && \
787 /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 && \
788 grep 'dlname.*testpython' testpython.la >/dev/null 2>&1; then
796 AC_MSG_RESULT([$result])
799 if test "x$have_python" != "xno"; then
802 PKG_CHECK_MODULES([PYGTK], [
803 pygtk-2.0 >= $PYGTK_REQUIRED],
806 AC_SUBST([PYGTK_CFLAGS])
807 AC_SUBST([PYGTK_LIBS])
810 if test "x$have_python" != "xno"; then
811 AC_MSG_CHECKING([for pygtk defs])
812 PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
813 AC_MSG_RESULT([$PYGTK_DEFSDIR])
815 AC_MSG_CHECKING([for pygtk codegen])
816 PYGTK_CODEGEN="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/codegen.py"
817 AC_MSG_RESULT([$PYGTK_CODEGEN])
819 AC_MSG_CHECKING([for pygtk h2def])
820 PYGTK_H2DEF="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/h2def.py"
821 AC_MSG_RESULT([$PYGTK_H2DEF])
823 AC_SUBST([PYGTK_DEFSDIR])
824 AC_SUBST([PYGTK_CODEGEN])
825 AC_SUBST([PYGTK_H2DEF])
827 dnl Check for -fno-strict-aliasing
828 FLAGS="-fno-strict-aliasing"
829 save_CFLAGS="$CFLAGS"
830 CFLAGS="$CFLAGS $FLAGS"
831 AC_MSG_CHECKING([whether [$]CC understands $FLAGS])
832 AC_TRY_COMPILE([], [], [compiler_has_option=yes], [compiler_has_option=no])
833 CFLAGS="$save_CFLAGS"
834 AC_MSG_RESULT($compiler_has_option)
835 if test $compiler_has_option = yes; then
836 NO_STRICT_ALIASING_CFLAGS="$FLAGS"
838 AC_SUBST([NO_STRICT_ALIASING_CFLAGS])
841 if test "x$have_python" != "xyes"; then
842 if test "x$enable_python" = "xyes"; then
843 AC_MSG_ERROR([Python support explicity requested, but not found])
844 elif test "x$enable_python" != "xno"; then
846 AC_MSG_WARN([Python not found, disabling python support])
848 elif test "x$enable_python" != "xno"; then
850 AC_DEFINE([ENABLE_PYTHON],[1],[Define to compile with python support])
853 AM_CONDITIONAL([ENABLE_PYTHON],[test "x$enable_python" = "xyes"])
857 dnl ================================================================
859 dnl ================================================================
869 widgets/libsexy/Makefile
880 plugins/sample/Makefile
881 plugins/audioscrobbler/Makefile
882 plugins/ipod/Makefile
883 plugins/lirc/Makefile
884 plugins/sample-python/Makefile
885 plugins/pythonconsole/Makefile
886 plugins/artdisplay/Makefile
887 plugins/artdisplay/artdisplay/Makefile
889 bindings/python/Makefile
894 doc/reference/Makefile
896 backends/gstreamer/Makefile
899 AC_MSG_NOTICE([Rhythmbox was configured with the following options:])
900 if test x"$with_database" = xtree; then
901 AC_MSG_NOTICE([** Tree database is enabled])
902 elif test x"$with_database" = xlibgda; then
903 AC_MSG_NOTICE([** libgda/sqlite database is enabled])
905 AC_MSG_ERROR([Unknown database!])
907 if test x"${with_rhythmdb_debug}" != x0; then
908 AC_MSG_NOTICE([** RhythmDB sanity checking enabled (may be slow!)])
912 if test x"$enable_tag_writing" = xyes; then
913 AC_MSG_NOTICE([** Tag writing is enabled - USE AT YOUR OWN RISK])
915 AC_MSG_NOTICE([ Tag writing is disabled])
917 if test x"$enable_track_transfer" = xyes; then
918 AC_MSG_NOTICE([** Track transfer is enabled - USE AT YOUR OWN RISK])
920 AC_MSG_NOTICE([ Track transfer is disabled])
922 if test x"$enable_mmkeys" != "xyes"; then
923 AC_MSG_NOTICE([ Multimedia keys support is disabled])
925 AC_MSG_NOTICE([** Multimedia keys support is enabled])
927 if test x"$enable_musicbrainz" != "xyes"; then
928 AC_MSG_NOTICE([ MusicBrainz support is disabled])
930 AC_MSG_NOTICE([** MusicBrainz support is enabled])
933 if test x"$with_playback" = xgstreamer_0_8; then
934 AC_MSG_NOTICE([** GStreamer 0.8 player is enabled])
935 elif test x"$with_playback" = xgstreamer_0_10; then
936 AC_MSG_NOTICE([** GStreamer 0.10 player is enabled])
938 AC_MSG_ERROR([ Playback engine set incorrectly])
941 if test x"$use_ipod" = xyes; then
942 AC_MSG_NOTICE([** iPod integration enabled])
944 AC_MSG_NOTICE([ iPod integration disabled])
946 if test x"$enable_daap" = xyes; then
947 AC_MSG_NOTICE([** DAAP (music sharing) support is enabled])
949 AC_MSG_NOTICE([ DAAP (music sharing) support is disabled])
951 if test x"$have_libnotify" = xyes; then
952 AC_MSG_NOTICE([** libnotify support is enabled])
954 AC_MSG_NOTICE([ libnotify support is disabled])
956 if test x"$enable_hal" = xyes; then
957 AC_MSG_NOTICE([** HAL support enabled])
959 AC_MSG_NOTICE([ HAL support disabled])
961 if test x"$enable_old_dbus" = xyes; then
962 AC_MSG_NOTICE([** using D-BUS < 0.35 control/activation])
964 if test x"$enable_python" != xno; then
965 AC_MSG_NOTICE([** Python support enabled])
967 AC_MSG_NOTICE([ Python support disabled])
970 if test x"$enable_audioscrobbler" != xno; then
971 AC_MSG_NOTICE([** Audioscrobbler support enabled])
973 AC_MSG_NOTICE([ Audioscrobbler support disabled])
975 if test x"$enable_metadata_helper" = xyes; then
976 AC_MSG_NOTICE([** Separate metadata helper process enabled])
978 AC_MSG_NOTICE([ Separate metadata helper process disabled])
980 if test x"$with_internal_libsexy" = xyes; then
981 AC_MSG_NOTICE([ using internal libsexy])
983 AC_MSG_NOTICE([** using system-wide libsexy])
986 AC_MSG_NOTICE([End options])