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])])
51 PKG_CHECK_MODULES(RB_CLIENT, gnome-vfs-2.0 >= $GNOME_VFS_REQS)
53 PKG_CHECK_MODULES(RHYTHMBOX, \
54 gtk+-2.0 >= $GTK_REQS \
57 gnome-vfs-2.0 >= $GNOME_VFS_REQS \
60 PKG_CHECK_MODULES(TOTEM_PLPARSER, totem-plparser >= $TOTEM_PLPARSER_REQS, have_totem_plparser=yes, have_totem_plparser=no)
61 if test x$have_totem_plparser != xyes; then
62 AC_MSG_ERROR([totem playlist parsing library not found or too old])
66 AC_HELP_STRING([--without-hal],
67 [Disable HAL support]))
68 if test "x$with_hal" != "xno"; then
69 PKG_CHECK_MODULES(HAL, hal >= 0.5 hal < 0.6, enable_hal05=yes, enable_hal05=no)
70 if test x$enable_hal05 != xyes; then
71 PKG_CHECK_MODULES(HAL, hal >= 0.2.92 hal < 0.5, enable_hal02=yes, enable_hal02=no)
73 if test x$enable_hal05 = xyes || test x$enable_hal02 = xyes; then
75 AC_DEFINE(HAVE_HAL, 1, [Define if you HAL support])
76 if test x$enable_hal05 = xyes; then
77 AC_DEFINE(HAVE_HAL_0_5, 1, [Define if you have HAL 0.5 or later])
79 AC_DEFINE(HAVE_HAL_0_2, 1, [Define if you have HAL 0.2 or later])
84 if test "x$with_hal" = "xyes"; then
85 AC_MSG_ERROR([HAL support explicitly requested but HAL couldn't be found])
89 AM_CONDITIONAL(HAVE_HAL_0_5, test x"$enable_hal05" = xyes)
90 AM_CONDITIONAL(HAVE_HAL_0_2, test x"$enable_hal02" = xyes)
91 AM_CONDITIONAL(HAVE_HAL, test x"$enable_hal" = xyes)
96 AC_HELP_STRING([--with-ipod],
97 [Enable iPod support]),,
99 if test "x$with_ipod" != "xno"; then
101 PKG_CHECK_MODULES(IPOD, libgpod-1.0, have_libgpod=yes, have_libgpod=no)
102 if test "x$have_libgpod" = "xno" -a "x$with_ipod" = "xyes"; then
103 AC_MSG_ERROR([iPod explicitly requested but libgpod couldn't be found])
105 if test "x$have_libgpod" = "xyes"; then
106 if test "x$with_hal" = xyes && test "x$enable_hal" = xno; then
107 AC_MSG_ERROR([iPod explicitly requested but HAL not found or too old])
109 if test "x$enable_hal" = xyes; then
110 AC_DEFINE(WITH_IPOD_SUPPORT, 1, [Define if iPod support is enabled])
113 PKG_CHECK_MODULES(IPOD_PHONE, libgpod-1.0 >= 0.3.3, support_phone=yes, support_phone=no)
114 if test "x$support_phone" = xyes; then
115 AC_DEFINE(IPOD_PHONE_SUPPORT, 1, [iPod support for phone])
118 AC_SUBST(IPOD_CFLAGS)
122 AM_CONDITIONAL(USE_IPOD, test x"$use_ipod" = xyes)
125 AC_ARG_WITH(database,
126 AC_HELP_STRING([--with-database=tree|libgda],
127 [Select the database to use (default tree)]),,
129 AM_CONDITIONAL(USE_TREEDB, test x"$with_database" = xtree)
130 AM_CONDITIONAL(USE_GDADB, test x"$with_database" = xlibgda)
134 case "x$with_database" in
136 AC_DEFINE(WITH_RHYTHMDB_TREE, 1, [Define if you are using the RhythmDB tree database])
139 AC_DEFINE(WITH_RHYTHMDB_GDA, 1, [Define if you are using the RhythmDB sqlite/libgda database])
140 dnl FIXME: check for sqlite, too?
141 PKG_CHECK_MODULES(GDA, libgda > 1.0.3)
144 AC_MSG_ERROR([Unknown database selected])
150 dnl Database debugging
151 AC_ARG_WITH(rhythmdb-debug,
152 AC_HELP_STRING([--with-rhythmdb-debug=0|1|2],
153 [Level of RhythmDB sanity checking]),,with_rhythmdb_debug=0)
154 if test x"${with_rhythmdb_debug}" != x0; then
155 AC_DEFINE_UNQUOTED([RHYTHMDB_ENABLE_SANITY_CHECK], "${with_rhythmdb_debug}", [Define to the level of RhythmDB sanity checking])
159 dnl Now we're ready to ask for gstreamer libs and cflags
160 dnl And we can also ask for the right version of gstreamer
163 GST_0_8_MAJORMINOR=0.8
164 GST_0_8_REQUIRED_VERSION=0.8.2
165 PKG_CHECK_MODULES(GSTREAMER_0_8, \
166 gstreamer-$GST_0_8_MAJORMINOR >= $GST_0_8_REQUIRED_VERSION gstreamer-libs-$GST_0_8_MAJORMINOR >= $GST_0_8_REQUIRED_VERSION
167 gstreamer-control-$GST_0_8_MAJORMINOR >= $GST_0_8_REQUIRED_VERSION
168 gstreamer-gconf-$GST_0_8_MAJORMINOR >= $GST_0_8_REQUIRED_VERSION,
169 have_gstreamer_0_8=yes,have_gstreamer_0_8=no)
171 GST_0_10_MAJORMINOR=0.10
172 GST_0_10_REQUIRED_VERSION=0.9.7
173 PKG_CHECK_MODULES(GSTREAMER_0_10, \
174 gstreamer-$GST_0_10_MAJORMINOR >= $GST_0_10_REQUIRED_VERSION
175 gstreamer-base-$GST_0_10_MAJORMINOR >= $GST_0_10_REQUIRED_VERSION
176 gstreamer-plugins-base-$GST_0_10_MAJORMINOR >= $GST_0_10_REQUIRED_VERSION,
177 have_gstreamer_0_10=yes,have_gstreamer_0_10=no)
179 AC_ARG_WITH(playback,
180 AC_HELP_STRING([--with-playback=auto|gstreamer-0-8|gstreamer-0-10],
181 [Select the playback backend to use (default auto)]),,
184 if test x$with_playback = xauto -o x$with_playback = xgstreamer-0-10; then
185 if test x"$have_gstreamer_0_10" = xyes; then
186 with_playback=gstreamer_0_10
187 SOUNDSYSTEM_DEPS="gstreamer-$GST_0_10_MAJORMINOR"
188 AC_DEFINE(HAVE_GSTREAMER,1,[Define if you want to use the GStreamer media framework])
189 AC_DEFINE(HAVE_GSTREAMER_0_10,1,[Define if you want to use the GStreamer 0.10])
190 SOUNDSYSTEM_CFLAGS="$GSTREAMER_0_10_CFLAGS"
191 SOUNDSYSTEM_LIBS="$GSTREAMER_0_10_LIBS"
192 elif test x$with_playback = xgstreamer-0-10; then
193 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])
196 if test x$with_playback = xauto -o x$with_playback = xgstreamer-0-8; then
197 if test x"$have_gstreamer_0_8" = xyes; then
198 with_playback=gstreamer_0_8
199 SOUNDSYSTEM_DEPS="gstreamer-$GST_0_8_MAJORMINOR"
200 AC_DEFINE(HAVE_GSTREAMER,1,[Define if you want to use the GStreamer media framework])
201 AC_DEFINE(HAVE_GSTREAMER_0_8,1,[Define if you want to use the GStreamer 0.8])
202 SOUNDSYSTEM_CFLAGS="$GSTREAMER_0_8_CFLAGS"
203 SOUNDSYSTEM_LIBS="$GSTREAMER_0_8_LIBS"
204 elif test x$with_playback = xgstreamer-0-8; then
205 AC_MSG_ERROR([GStreamer 0.8 explicity requested, and it was not found or older than version $GST_REQUIRED_VERSION])
208 AM_CONDITIONAL(USE_GSTREAMER_0_10, test x"$with_playback" = xgstreamer_0_10)
209 AM_CONDITIONAL(USE_GSTREAMER_0_8, test x"$with_playback" = xgstreamer_0_8)
211 dnl Give error and exit if we don't have gstreamer
212 if test x$with_playback = xauto; then
213 AC_MSG_ERROR([GStreamer not found, or older than version $GST_0_8_REQUIRED_VERSION/$GST_0_10_REQUIRED_VERSION])
216 AC_SUBST(SOUNDSYSTEM_DEPS)
217 RHYTHMBOX_CFLAGS="$RHYTHMBOX_CFLAGS $SOUNDSYSTEM_CFLAGS"
218 RHYTHMBOX_LIBS="$RHYTHMBOX_LIBS $SOUNDSYSTEM_LIBS"
222 AC_ARG_ENABLE(tag-writing,
223 AC_HELP_STRING([--enable-tag-writing],
224 [Enable tag writing support in rhythmbox **EXPERIMENTAL**]))
225 if test x"$enable_tag_writing" = xyes; then
226 AC_MSG_WARN([Tag writing support is experimental, and may corrupt files, use at your own risk])
227 AC_DEFINE(ENABLE_TAG_WRITING, 1, [Define if tag writing should be enabled])
231 AC_ARG_ENABLE(track-transfer,
232 AC_HELP_STRING([--disable-track-transfer],
233 [Enable track transfer support in rhythmbox]))
234 if test x"$enable_track_transfer" != xno; then
235 PKG_CHECK_MODULES(GNOME_MEDIA_PROFILES,
236 gnome-media-profiles >= 2.8,
237 with_track_transfer=yes,
238 with_track_transfer=no)
240 if test "x$with_track_transfer" = xno -a "x$enable_track_transfer" = xyes; then
241 AC_MSG_ERROR([Track transfer support explicitly requested but gnome-media-profiles not found.])
244 if test "x$with_track_transfer" = xyes; then
245 AC_DEFINE(ENABLE_TRACK_TRANSFER, 1, [Define if track transfer should be enabled])
248 AM_CONDITIONAL(ENABLE_TRACK_TRANSFER, test "x$with_track_transfer" = "xyes")
251 AC_ARG_ENABLE(ipod-writing,
252 AC_HELP_STRING([--enable-ipod-writing],
253 [Enable support for writing to ipods in rhythmbox **EXPERIMENTAL**]))
254 if test x"$enable_ipod_writing" = xyes; then
255 if test "x$use_ipod" != xyes -a "x$enable_ipod_writing" = xyes; then
256 AC_MSG_ERROR([iPod write support explicitly requested but iPod support is disabled.])
258 if test "x$with_track_transfer" != xyes -a "x$enable_ipod_writing" = xyes; then
259 AC_MSG_ERROR([iPod write support explicitly requested but track transfer support is disabled.])
261 AC_MSG_WARN([iPod writing support is experimental, and may corrupt iPod databases, use at your own risk])
262 AC_DEFINE(ENABLE_IPOD_WRITING, 1, [Define if ipod writing should be enabled])
267 AC_ARG_ENABLE(audioscrobbler,
268 AC_HELP_STRING([--disable-audioscrobbler],
269 [Disable Audioscrobbler support in Rhythmbox]))
271 dnl DAAP (iTunes Music Shares)
273 AC_HELP_STRING([--disable-daap],
274 [Enable Digital Audio Access Protocol (music sharing) in rhythmbox]))
277 AC_HELP_STRING([--with-mdns=auto|howl|avahi],
278 [Select the mDNS/DNS-SD implementation to use (default auto)]),,
287 PKG_CHECK_MODULES(AVAHI,
292 if test x$have_avahi_06 != xyes; then
293 PKG_CHECK_MODULES(AVAHI,
299 if test x$have_avahi_06 = xyes || test x$have_avahi_05 = xyes; then
305 PKG_CHECK_MODULES(HOWL,
310 if test x"$with_mdns" = xauto; then
311 if test x"$have_avahi" = xyes; then
312 MDNS_CFLAGS=$AVAHI_CFLAGS
313 MDNS_LIBS=$AVAHI_LIBS
314 AC_DEFINE(WITH_AVAHI, 1, [Define if mDNS/DNS-SD implementation uses Avahi])
316 AC_MSG_NOTICE([Detected Avahi, using it for mDNS/DNS-SD])
317 if test x$have_avahi_06 = xyes; then
318 AC_DEFINE(HAVE_AVAHI_0_6, 1, [Define if mDNS/DNS-SD implementation uses Avahi 0.6])
320 AC_DEFINE(HAVE_AVAHI_0_5, 1, [Define if mDNS/DNS-SD implementation uses Avahi 0.5])
324 elif test x"$have_howl" = xyes; then
325 MDNS_CFLAGS=$HOWL_CFLAGS
327 AC_DEFINE(WITH_HOWL, 1, [Define if mDNS/DNS-SD implementation uses Howl])
329 AC_MSG_NOTICE([Detected Howl, using it for mDNS/DNS-SD])
335 if test x"$with_mdns" = xhowl; then
336 if test x"$have_howl" = xno; then
337 AC_MSG_ERROR([Howl explicitly requested but not found. Install Howl or try --with-mdns=avahi])
340 MDNS_CFLAGS=$HOWL_CFLAGS
342 AC_DEFINE(WITH_HOWL, 1, [Define if mDNS/DNS-SD implementation uses Howl])
344 AC_MSG_NOTICE([Using Howl for mDNS/DNS-SD])
348 if test x"$with_mdns" = xavahi; then
349 if test x"$have_avahi" = xno; then
350 AC_MSG_ERROR([Avahi explicitly requested but not found. Install Avahi or try --with-mdns=howl])
353 MDNS_CFLAGS=$AVAHI_CFLAGS
354 MDNS_LIBS=$AVAHI_LIBS
355 AC_DEFINE(WITH_AVAHI, 1, [Define if mDNS/DNS-SD implementation uses Avahi])
357 AC_MSG_NOTICE([Using Avahi for mDNS/DNS-SD])
359 if test x$have_avahi_06 = xyes; then
360 AC_DEFINE(HAVE_AVAHI_0_6, 1, [Define if mDNS/DNS-SD implementation uses Avahi 0.6])
362 AC_DEFINE(HAVE_AVAHI_0_5, 1, [Define if mDNS/DNS-SD implementation uses Avahi 0.5])
368 AM_CONDITIONAL(USE_HOWL, test "x$use_howl" = "xyes")
369 AM_CONDITIONAL(USE_AVAHI, test "x$use_avahi" = "xyes")
371 LIBNOTIFY_REQUIRED=0.2.2
372 AC_ARG_ENABLE(libnotify,
373 AC_HELP_STRING([--disable-libnotify],
374 [Disable libnotify support]),,
375 enable_libnotify=auto)
376 if test "x$enable_libnotify" != "xno"; then
377 PKG_CHECK_MODULES(NOTIFY, \
378 libnotify >= $LIBNOTIFY_REQUIRED,
381 if test "x$have_libnotify" = "xno" -a "x$enable_libnotify" = "xyes"; then
382 AC_MSG_ERROR([libnotify support explicitly requested, but libnotify couldn't be found])
384 if test "x$have_libnotify" = "xyes"; then
388 AM_CONDITIONAL(USE_NOTIFY, test x"$enable_libnotify" = xyes)
389 if test x$enable_libnotify = xyes ; then
390 # Find out the version of LIBNOTIFY we're using
391 libnotify_version=`pkg-config --modversion libnotify`
392 LIBNOTIFY_VERSION_MAJOR=`echo $libnotify_version | awk -F. '{print $1}'`
393 LIBNOTIFY_VERSION_MINOR=`echo $libnotify_version | awk -F. '{print $2}'`
394 LIBNOTIFY_VERSION_MICRO=`echo $libnotify_version | awk -F. '{print $3}'`
395 if test "z$LIBNOTIFY_VERSION_MAJOR" = "z"; then
396 LIBNOTIFY_VERSION_MAJOR="0"
398 if test "z$LIBNOTIFY_VERSION_MINOR" = "z"; then
399 LIBNOTIFY_VERSION_MINOR="0"
401 if test "z$LIBNOTIFY_VERSION_MICRO" = "z"; then
402 LIBNOTIFY_VERSION_MICRO="0"
404 echo "Your libnotify version is $LIBNOTIFY_VERSION_MAJOR,$LIBNOTIFY_VERSION_MINOR,$LIBNOTIFY_VERSION_MICRO."
405 NOTIFY_CFLAGS="$NOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MAJOR=$LIBNOTIFY_VERSION_MAJOR"
406 NOTIFY_CFLAGS="$NOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MINOR=$LIBNOTIFY_VERSION_MINOR"
407 NOTIFY_CFLAGS="$NOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MICRO=$LIBNOTIFY_VERSION_MICRO"
409 AC_DEFINE(HAVE_NOTIFY, 1, [Define if libnotify support is enabled])
410 AC_SUBST(NOTIFY_CFLAGS)
411 AC_SUBST(NOTIFY_LIBS)
414 dnl Check for libsoup, needed for DAAP and audioscrobbler
415 if test "x$enable_daap" = "xyes" || test "x$enable_audioscrobbler" != "xno"; then
416 PKG_CHECK_MODULES(SOUP, \
420 if test x"$have_libsoup" = "xno"; then
421 PKG_CHECK_MODULES(SOUP,
426 if test x"$have_libsoup" = "xyes"; then
427 AC_DEFINE(HAVE_LIBSOUP, 1, [Define if libsoup support is enabled])
431 AM_CONDITIONAL(USE_LIBSOUP, test x"$have_libsoup" = "xyes")
434 dnl audioscrobbler support
435 if test "x$enable_audioscrobbler" != "xno"; then
436 if test x"$have_libsoup" = "xno"; then
437 if test "x$enable_audioscrobbler" = "xyes"; then
438 AC_MSG_ERROR([AudioScrobbler support explicitly requested, but no libsoup found. Install libsoup])
440 enable_audioscrobbler=no
442 AC_DEFINE(WITH_AUDIOSCROBBLER, 1, [define if Audioscrobbler support should be enabled])
445 AM_CONDITIONAL(WITH_AUDIOSCROBBLER, test "x$enable_audioscrobbler" != "xno")
449 if test "x$enable_daap" != "xno"; then
450 if test x"$have_libsoup" = "xno"; then
451 if test "x$enable_daap" = "xyes"; then
452 AC_MSG_ERROR([DAAP support explicitly requested, but no libsoup found. Install libsoup])
455 elif test x"$have_mdns" = xno; then
456 if test "x$enable_daap" = "xyes"; then
457 AC_MSG_ERROR([DAAP support explicitly requested, but no mDNS implementation found. Install Howl or Avahi])
461 AC_DEFINE(WITH_DAAP_SUPPORT, 1, [Define if DAAP should be enabled])
463 AC_SUBST(MDNS_CFLAGS)
467 AM_CONDITIONAL(USE_DAAP, test "x$enable_daap" != "xno")
469 AC_CHECK_LIB(z, uncompress)
473 dnl check for MusicBrainz
474 AC_ARG_ENABLE(musicbrainz, AC_HELP_STRING([--disable-musicbrainz],
475 [don't build with MusicBrainz support]))
476 if test x"$enable_musicbrainz" != "xno"; then
477 PKG_CHECK_MODULES(MUSICBRAINZ, libmusicbrainz >= 2.1.0, enable_musicbrainz=yes,
478 enable_musicbrainz=no)
480 if test x"$enable_musicbrainz" = xyes; then
481 RHYTHMBOX_CFLAGS="$RHYTHMBOX_CFLAGS $MUSICBRAINZ_CFLAGS"
482 RHYTHMBOX_LIBS="$RHYTHMBOX_LIBS $MUSICBRAINZ_LIBS"
483 AC_DEFINE(HAVE_MUSICBRAINZ, 1, [define if you have Musicbrainz])
485 AM_CONDITIONAL(HAVE_MUSICBRAINZ, test "x$enable_musicbrainz" = "xyes")
491 if test x"$x_includes" != x"NONE" && test -n "$x_includes" ; then
492 CFLAGS=$CFLAGS -I`echo $x_includes | sed -e "s/:/ -I/g"`
494 if test x"$x_libraries" != x"NONE" && test -n "$x_libraries" ; then
495 LIBS=-L`echo $x_libraries | sed -e "s/:/ -L/g"`
500 #include <X11/extensions/xidle.h>
501 int main(int argc,char **argv) {
505 AC_MSG_CHECKING(for XIDLE extension)
506 AC_MSG_RESULT($have_xidle)
507 if test x"$have_xidle" = "xyes" ; then
508 AC_DEFINE(HAVE_XIDLE_EXTENSION, 1, [defined if you have X11/extensions/xidle.h])
514 #include <X11/XF86keysym.h>
515 int main(int argc,char **argv) {
519 AC_MSG_CHECKING(for XFree86 headers)
520 AC_MSG_RESULT($have_xfree)
521 if test x"$have_xfree" = "xyes" ; then
522 AC_DEFINE(HAVE_XFREE, 1, [defined if you have X11/XF86keysym.h])
525 AC_ARG_ENABLE(mmkeys, AC_HELP_STRING([--disable-mmkeys],
526 [don't build with Multimedia Keys support]))
527 if test x"$have_xfree" = xyes; then
528 if test x"$enable_mmkeys" != xno; then
530 AC_DEFINE(HAVE_MMKEYS, 1, [define if Multimedia Keys are enabled])
533 if test x"$enable_mmkeys" = xyes; then
534 AC_MSG_ERROR([Multimedia keys explicitly requested but no support found])
539 AC_DEFINE(WITH_AUDIOCD_SUPPORT, 1, [Define if audio cd support is enabled])
540 AC_CHECK_HEADER(linux/cdrom.h,[enable_linux_cdrom=yes],)
541 if test "x$enable_linux_cdrom" = "xyes"; then
542 AC_MSG_CHECKING([whether linux/cdrom.h actually works])
545 #include <sys/ioctl.h>
546 #include <linux/cdrom.h>
547 int main(int argc,char **argv) {
548 ioctl (0, CDROM_GET_CAPABILITY, 0);
549 ioctl (0, CDROM_DRIVE_STATUS, CDSL_CURRENT);
550 ioctl (0, CDROMREADTOCHDR, NULL);
552 }], [enable_linux_cdrom=yes],[enable_linux_cdrom=no])
553 if test "x$enable_linux_cdrom" = "xyes"; then
557 AC_MSG_FAILURE([linux/cdrom.h is damaged; fix your system or use --disable-audiocd])
560 AM_CONDITIONAL(HAVE_LINUX_CDROM, test "x$enable_linux_cdrom" = "xyes")
562 NCB_DRIVE_DOOR_VERSION=2.11.3
563 dnl CD burner support
564 PKG_CHECK_MODULES(LIBNAUTILUS_BURN, [libnautilus-burn >= $NCB_MIN_REQS], have_cd_burner=yes, have_cd_burner=no)
565 if test "x$have_cd_burner" = xno; then
566 AC_MSG_ERROR([libnautilus-burn not found or too cold])
568 AC_CHECK_LIB(nautilus-burn, nautilus_burn_drive_door_is_open,
569 [AC_DEFINE([HAVE_BURN_DRIVE_DOOR], 1, [Have nautilus-burn function to check drive door state])],
570 ,[$LIBNAUTILUS_BURN_LIBS $LIBNAUTILUS_BURN_CFLAGS])
571 AC_CHECK_LIB(nautilus-burn, nautilus_burn_drive_unref,
572 [AC_DEFINE([HAVE_BURN_DRIVE_UNREF], 1, [Have nautilus-burn 2.13 drive unref function])],
573 ,[$LIBNAUTILUS_BURN_LIBS $LIBNAUTILUS_BURN_CFLAGS])
574 AC_CHECK_LIB(nautilus-burn, nautilus_burn_drive_new_from_path,
575 [AC_DEFINE([HAVE_BURN_DRIVE_NEW_FROM_PATH], 1, [Have nautilus-burn 2.13 drive new_from_path function])],
576 ,[$LIBNAUTILUS_BURN_LIBS $LIBNAUTILUS_BURN_CFLAGS])
577 AC_CHECK_LIB(nautilus-burn, nautilus_burn_drive_get_write_speeds,
578 [AC_DEFINE([HAVE_BURN_DRIVE_GET_WRITE_SPEEDS], 1, [Have nautilus-burn 2.13 drive get_write_speeds])],
579 ,[$LIBNAUTILUS_BURN_LIBS $LIBNAUTILUS_BURN_CFLAGS])
584 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
585 AC_PATH_PROG(GCONFTOOL, gconftool-2)
587 AC_SUBST(RHYTHMBOX_CFLAGS)
588 AC_SUBST(RHYTHMBOX_LIBS)
589 AC_SUBST(RB_CLIENT_CFLAGS)
590 AC_SUBST(RB_CLIENT_LIBS)
592 AC_TRY_RUN([#include <time.h>
598 if (strftime(buf, 100, "%EY", &tm) == 4 &&
599 strcmp (buf, "1999")==0)
604 AC_DEFINE(HAVE_STRFTIME_EXTENSION, 1, [Define if strftime supports %E and %O modifiers.])
607 GETTEXT_PACKAGE=rhythmbox
608 AC_SUBST(GETTEXT_PACKAGE)
609 AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
610 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Define to the Gettext package name])
611 ALL_LINGUAS="`cat "$srcdir/po/LINGUAS" | grep -v '^#'`"
615 dnl Workaround for automake 1.8
616 AC_SUBST(mkdir_p) if test x"$mkdir_p" = "x"; then
617 MKINSTALLDIRS="mkinstalldirs"
619 AC_SUBST(MKINSTALLDIRS)
621 AS_AC_EXPAND(DATADIR, $datadir)
624 PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= $DBUS_MIN_REQS, enable_dbus=yes, enable_dbus=no)
625 if test "x$enable_dbus" = xno; then
626 PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= $OLD_DBUS_MIN_REQS, enable_old_dbus=yes, enable_old_dbus=no)
627 if test "x$enable_old_dbus" = xno; then
628 AC_MSG_ERROR([DBUS not found or too old])
630 AC_DEFINE(WITH_OLD_DBUS, 1, [Define if old D-BUS is enabled])
632 AC_DEFINE(WITH_DBUS, 1, [Define if D-BUS is enabled])
635 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_API_SUBJECT_TO_CHANGE"
636 DBUS_GLIB_BIN="`$PKG_CONFIG --variable=exec_prefix dbus-glib-1`/bin"
637 AC_SUBST(DBUS_GLIB_BIN)
638 AM_CONDITIONAL(WITH_DBUS, test "x$enable_dbus" = "xyes")
639 AM_CONDITIONAL(WITH_OLD_DBUS, test "x$enable_old_dbus" = "xyes")
641 dnl out-of-process metadata reader (requires dbus)
642 AC_ARG_WITH(metadata-helper,
643 AC_HELP_STRING([--with-metadata-helper],
644 [Use a separate process for metadata reading]),,
645 with_metadata_helper=auto)
646 enable_metadata_helper=no
647 if test "x$with_metadata_helper" != xno; then
648 if test "x$enable_dbus" = xyes || test "x$enable_old_dbus" = xyes; then
649 AC_DEFINE(WITH_METADATA_HELPER, 1, [Define if the metadata helper process is enabled])
650 enable_metadata_helper=yes
651 elif test "x$with_metadata_helper" = xyes; then
652 AC_MSG_ERROR([Metadata helper process explicitly requested, but D-BUS is not enabled])
655 AM_CONDITIONAL(WITH_METADATA_HELPER, test "x$enable_metadata_helper" = "xyes")
661 AC_HELP_STRING([--enable-lirc],[enable lirc support]))
663 if test x"$enable_lirc" != xno; then
664 AC_CHECK_HEADER(lirc/lirc_client.h,[with_lirc=yes],[with_lirc=no])
665 if test x"$with_lirc" = xyes; then
666 AC_CHECK_LIB(lirc_client,lirc_init,[with_lirc=yes],[with_lirc=no])
668 if test x"$with_lirc" = xno -a x"$enable_lirc" = xyes; then
669 AC_MSG_ERROR([lirc explicitly requested but no support found])
672 AM_CONDITIONAL(WITH_LIRC, test x"$with_lirc" = xyes)
675 AC_ARG_ENABLE(uninstalled-build,
676 AC_HELP_STRING([--enable-uninstalled-build],
677 [Search for files in build directory as well]),
678 enable_uninstalled=yes,)
679 if test x"$enable_uninstalled" = xyes; then
680 AC_DEFINE_UNQUOTED(SHARE_UNINSTALLED_DIR,"`pwd`/data",[path to source data dir])
681 AC_DEFINE_UNQUOTED(METADATA_UNINSTALLED_DIR,"`pwd`/metadata",[path to metadata build dir])
684 AC_ARG_WITH(internal-libsexy,
685 AC_HELP_STRING([--with-internal-libsexy],
686 [Build using internal libsexy library]),,
687 with_internal_libsexy=no)
688 if test "x$with_internal_libsexy" = "xno"; then
689 PKG_CHECK_MODULES(LIBSEXY, libsexy >= 0.1.5, with_internal_libsexy=no,
690 with_internal_libsexy=yes)
692 AC_SUBST(LIBSEXY_CFLAGS)
693 AC_SUBST(LIBSEXY_LIBS)
694 AM_CONDITIONAL(WITH_INTERNAL_LIBSEXY, test "x$with_internal_libsexy" = "xyes")
696 dnl warnings bits, copied from gnome-keyring configure.in
697 dnl Turn on the additional warnings last, so -Werror doesn't affect other tests.
699 AC_ARG_ENABLE(more-warnings,
700 [ --enable-more-warnings Maximum compiler warnings],
701 set_more_warnings="$enableval",[
702 if test -d "$srcdir/{arch}" || test -d "$srcdir/CVS" || test -d "$srcdir/_darcs"; then
703 set_more_warnings=yes
708 AC_MSG_CHECKING(for more warnings, including -Werror)
709 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
712 -Wcomment -Wformat -Wnonnull -Wimplicit-int -Wimplicit \
713 -Wmain -Wmissing-braces -Wparentheses -Wsequence-point \
714 -Wreturn-type -Wswitch -Wtrigraphs -Wunused-function \
715 -Wunused-label -Wunused-value \
716 -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
717 -Wnested-externs -Wpointer-arith \
721 if echo "$CFLAGS" | grep -e '-O[1-9]'; then
722 WARN_CFLAGS="-Wuninitialized $WARN_CFLAGS"
725 for option in $WARN_CFLAGS; do
726 SAVE_CFLAGS="$CFLAGS"
727 CFLAGS="$CFLAGS $option"
728 AC_MSG_CHECKING([whether gcc understands $option])
729 AC_TRY_COMPILE([], [],
732 if test x$has_option = xyes; then
733 RHYTHMBOX_CFLAGS="$RHYTHMBOX_CFLAGS $option"
735 AC_MSG_RESULT($has_option)
736 CFLAGS="$SAVE_CFLAGS"
742 SAVE_CFLAGS="$CFLAGS"
743 CFLAGS="$CFLAGS -Wno-error"
744 AC_TRY_COMPILE([], [],
745 WNOERROR_CFLAGS="-Wno-error",
747 AC_SUBST(WNOERROR_CFLAGS)
748 CFLAGS="$SAVE_CFLAGS"
758 dnl Enable gnome-doc-utils
762 dnl ================================================================
764 dnl ================================================================
766 PLUGIN_LIBTOOL_FLAGS="-module -avoid-version"
767 AC_SUBST(PLUGIN_LIBTOOL_FLAGS)
769 AS_AC_EXPAND(PLUGINDIR, ${libdir}/rhythmbox/plugins)
772 dnl ================================================================
774 dnl ================================================================
776 AC_MSG_CHECKING([whether Python support is requested])
777 AC_ARG_ENABLE([python],
778 AS_HELP_STRING([--enable-python],[Enable python support]),
779 [enable_python=$enableval have_python=$enableval],
780 [enable_python=autodetect have_python=yes])
781 AC_MSG_RESULT([$enable_python])
783 if test "x$have_python" != "xno"; then
784 AM_PATH_PYTHON([2.3],[],[no])
785 if test "x$PYTHON" = "x:"; then
790 if test "x$have_python" != "xno"; then
791 PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
792 PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; print sys.exec_prefix'`
793 PYTHON_LIBS="-lpython$PYTHON_VERSION"
794 PYTHON_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config"
795 PYTHON_CFLAGS="-I$PY_PREFIX/include/python$PYTHON_VERSION"
796 PYTHON_MAKEFILE="$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config/Makefile"
797 PYTHON_LOCALMODLIBS=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
798 PYTHON_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
799 PYTHON_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
800 PYTHON_EXTRA_LIBS="$PYTHON_LOCALMODLIBS $PYTHON_BASEMODLIBS $PYTHON_OTHER_LIBS"
801 AC_SUBST([PYTHON_LIBS])
802 AC_SUBST([PYTHON_LIB_LOC])
803 AC_SUBST([PYTHON_CFLAGS])
804 AC_SUBST([PYTHON_EXTRA_LIBS])
806 dnl FIXME: do we really need this test?
807 AC_MSG_CHECKING([whether we can build a shared library depending on libpython])
811 cat > testpython.c <<EOF
813 int testpython (void)
819 if /bin/sh ../libtool --mode=compile ${CC} $PYTHON_CFLAGS -c testpython.c >/dev/null 2>&1 && \
820 /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 && \
821 grep 'dlname.*testpython' testpython.la >/dev/null 2>&1; then
829 AC_MSG_RESULT([$result])
832 if test "x$have_python" != "xno"; then
835 PKG_CHECK_MODULES([PYGTK], [
836 pygtk-2.0 >= $PYGTK_REQUIRED],
839 AC_SUBST([PYGTK_CFLAGS])
840 AC_SUBST([PYGTK_LIBS])
843 if test "x$have_python" != "xno"; then
844 AC_MSG_CHECKING([for pygtk defs])
845 PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
846 AC_MSG_RESULT([$PYGTK_DEFSDIR])
848 AC_MSG_CHECKING([for pygtk codegen])
849 PYGTK_CODEGEN="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/codegen.py"
850 AC_MSG_RESULT([$PYGTK_CODEGEN])
852 AC_MSG_CHECKING([for pygtk h2def])
853 PYGTK_H2DEF="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/h2def.py"
854 AC_MSG_RESULT([$PYGTK_H2DEF])
856 AC_SUBST([PYGTK_DEFSDIR])
857 AC_SUBST([PYGTK_CODEGEN])
858 AC_SUBST([PYGTK_H2DEF])
860 dnl Check for -fno-strict-aliasing
861 FLAGS="-fno-strict-aliasing"
862 save_CFLAGS="$CFLAGS"
863 CFLAGS="$CFLAGS $FLAGS"
864 AC_MSG_CHECKING([whether [$]CC understands $FLAGS])
865 AC_TRY_COMPILE([], [], [compiler_has_option=yes], [compiler_has_option=no])
866 CFLAGS="$save_CFLAGS"
867 AC_MSG_RESULT($compiler_has_option)
868 if test $compiler_has_option = yes; then
869 NO_STRICT_ALIASING_CFLAGS="$FLAGS"
871 AC_SUBST([NO_STRICT_ALIASING_CFLAGS])
874 if test "x$have_python" != "xyes"; then
875 if test "x$enable_python" = "xyes"; then
876 AC_MSG_ERROR([Python support explicity requested, but not found])
877 elif test "x$enable_python" != "xno"; then
879 AC_MSG_WARN([Python not found, disabling python support])
881 elif test "x$enable_python" != "xno"; then
883 AC_DEFINE([ENABLE_PYTHON],[1],[Define to compile with python support])
886 AM_CONDITIONAL([ENABLE_PYTHON],[test "x$enable_python" = "xyes"])
889 dnl check, for unit tests
890 AM_PATH_CHECK([], have_check=yes, have_check=no)
891 AM_CONDITIONAL([HAVE_CHECK],[test "x$have_check" = "xyes"])
894 dnl ================================================================
896 dnl ================================================================
906 widgets/libsexy/Makefile
917 plugins/sample/Makefile
918 plugins/audioscrobbler/Makefile
919 plugins/ipod/Makefile
920 plugins/lirc/Makefile
921 plugins/lyrics/Makefile
922 plugins/sample-python/Makefile
923 plugins/pythonconsole/Makefile
924 plugins/artdisplay/Makefile
925 plugins/artdisplay/artdisplay/Makefile
926 plugins/generic-player/Makefile
928 bindings/python/Makefile
933 doc/reference/Makefile
935 backends/gstreamer/Makefile
940 AC_MSG_NOTICE([Rhythmbox was configured with the following options:])
941 if test x"$with_database" = xtree; then
942 AC_MSG_NOTICE([** Tree database is enabled])
943 elif test x"$with_database" = xlibgda; then
944 AC_MSG_NOTICE([** libgda/sqlite database is enabled])
946 AC_MSG_ERROR([Unknown database!])
948 if test x"${with_rhythmdb_debug}" != x0; then
949 AC_MSG_NOTICE([** RhythmDB sanity checking enabled (may be slow!)])
953 if test x"$enable_tag_writing" = xyes; then
954 AC_MSG_NOTICE([** Tag writing is enabled - USE AT YOUR OWN RISK])
956 AC_MSG_NOTICE([ Tag writing is disabled])
958 if test x"$with_track_transfer" = xyes; then
959 AC_MSG_NOTICE([** Track transfer is enabled])
961 AC_MSG_NOTICE([ Track transfer is disabled])
963 if test x"$enable_ipod_writing" = xyes; then
964 AC_MSG_NOTICE([** iPod write support is enabled])
966 AC_MSG_NOTICE([ iPod write support is disabled])
968 if test x"$enable_mmkeys" != "xyes"; then
969 AC_MSG_NOTICE([ Multimedia keys support is disabled])
971 AC_MSG_NOTICE([** Multimedia keys support is enabled])
973 if test x"$enable_musicbrainz" != "xyes"; then
974 AC_MSG_NOTICE([ MusicBrainz support is disabled])
976 AC_MSG_NOTICE([** MusicBrainz support is enabled])
979 if test x"$with_playback" = xgstreamer_0_8; then
980 AC_MSG_NOTICE([** GStreamer 0.8 player is enabled])
981 elif test x"$with_playback" = xgstreamer_0_10; then
982 AC_MSG_NOTICE([** GStreamer 0.10 player is enabled])
984 AC_MSG_ERROR([ Playback engine set incorrectly])
987 if test x"$use_ipod" = xyes; then
988 AC_MSG_NOTICE([** iPod integration enabled])
990 AC_MSG_NOTICE([ iPod integration disabled])
992 if test x"$enable_daap" = xyes; then
993 AC_MSG_NOTICE([** DAAP (music sharing) support is enabled])
995 AC_MSG_NOTICE([ DAAP (music sharing) support is disabled])
997 if test x"$have_libnotify" = xyes; then
998 AC_MSG_NOTICE([** libnotify support is enabled])
1000 AC_MSG_NOTICE([ libnotify support is disabled])
1002 if test x"$enable_hal" = xyes; then
1003 AC_MSG_NOTICE([** HAL support enabled])
1005 AC_MSG_NOTICE([ HAL support disabled])
1007 if test x"$enable_old_dbus" = xyes; then
1008 AC_MSG_NOTICE([** using D-BUS < 0.35 control/activation])
1010 if test x"$enable_python" != xno; then
1011 AC_MSG_NOTICE([** Python support enabled])
1013 AC_MSG_NOTICE([ Python support disabled])
1016 if test x"$enable_audioscrobbler" != xno; then
1017 AC_MSG_NOTICE([** Audioscrobbler support enabled])
1019 AC_MSG_NOTICE([ Audioscrobbler support disabled])
1021 if test x"$enable_metadata_helper" = xyes; then
1022 AC_MSG_NOTICE([** Separate metadata helper process enabled])
1024 AC_MSG_NOTICE([ Separate metadata helper process disabled])
1026 if test x"$with_internal_libsexy" = xyes; then
1027 AC_MSG_NOTICE([ using internal libsexy])
1029 AC_MSG_NOTICE([** using system-wide libsexy])
1032 AC_MSG_NOTICE([End options])