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)
11 dnl XXXX hack to kill off all the libtool tags ...
12 dnl it isn't like we are using C++ or Fortran.
13 m4_define([_LT_AC_TAGCONFIG],[])
27 OLD_DBUS_MIN_REQS=0.31
29 TOTEM_PLPARSER_REQS=1.1.5
31 AC_MSG_CHECKING([for GNU extension fwrite_unlocked])
37 [[fwrite_unlocked ("foo", 1, sizeof ("foo"), stdout);]])],[have_fwrite_unlocked=yes])
38 if test x"$have_fwrite_unlocked" = xyes; then
39 AC_DEFINE(HAVE_GNU_FWRITE_UNLOCKED,1,[Define if you have GNU fwrite_unlocked])
46 AC_CHECK_FUNC(mkdtemp,
47 [AC_DEFINE([HAVE_MKDTEMP], 1, [Have GlibC function to make temp dirs])],
49 AM_CONDITIONAL(MKDTEMP_MISSING, test x$mkdtemp_missing = xtrue)
51 AC_CHECK_LIB(glib-2.0, g_utf8_collate_key_for_filename,
52 [AC_DEFINE([HAVE_COLLATE_KEY_FILENAME], 1, [Have glib function to collate filename sort keys])])
53 AC_CHECK_LIB(glib-2.0, g_mapped_file_new,
54 [AC_DEFINE([HAVE_G_MAPPED_FILE], 1, [Have glib mmap wrapper])])
58 PKG_CHECK_MODULES(RB_CLIENT, gnome-vfs-2.0 >= $GNOME_VFS_REQS)
60 PKG_CHECK_MODULES(RHYTHMBOX, \
61 gtk+-2.0 >= $GTK_REQS \
64 gnome-vfs-2.0 >= $GNOME_VFS_REQS \
67 PKG_CHECK_MODULES(TOTEM_PLPARSER, totem-plparser >= $TOTEM_PLPARSER_REQS, have_totem_plparser=yes, have_totem_plparser=no)
68 if test x$have_totem_plparser != xyes; then
69 AC_MSG_ERROR([totem playlist parsing library not found or too old])
73 AC_HELP_STRING([--without-hal],
74 [Disable HAL support]))
75 if test "x$with_hal" != "xno"; then
76 PKG_CHECK_MODULES(HAL, hal >= 0.5 hal < 0.6, enable_hal05=yes, enable_hal05=no)
77 if test x$enable_hal05 != xyes; then
78 PKG_CHECK_MODULES(HAL, hal >= 0.2.92 hal < 0.5, enable_hal02=yes, enable_hal02=no)
80 if test x$enable_hal05 = xyes || test x$enable_hal02 = xyes; then
82 AC_DEFINE(HAVE_HAL, 1, [Define if you HAL support])
83 if test x$enable_hal05 = xyes; then
84 AC_DEFINE(HAVE_HAL_0_5, 1, [Define if you have HAL 0.5 or later])
86 AC_DEFINE(HAVE_HAL_0_2, 1, [Define if you have HAL 0.2 or later])
91 if test "x$with_hal" = "xyes"; then
92 AC_MSG_ERROR([HAL support explicitly requested but HAL couldn't be found])
96 AM_CONDITIONAL(HAVE_HAL_0_5, test x"$enable_hal05" = xyes)
97 AM_CONDITIONAL(HAVE_HAL_0_2, test x"$enable_hal02" = xyes)
98 AM_CONDITIONAL(HAVE_HAL, test x"$enable_hal" = xyes)
103 AC_HELP_STRING([--with-ipod],
104 [Enable iPod support]),,
106 if test "x$with_ipod" != "xno"; then
108 PKG_CHECK_MODULES(IPOD, libgpod-1.0, have_libgpod=yes, have_libgpod=no)
109 if test "x$have_libgpod" = "xno" -a "x$with_ipod" = "xyes"; then
110 AC_MSG_ERROR([iPod explicitly requested but libgpod couldn't be found])
112 if test "x$have_libgpod" = "xyes"; then
113 if test "x$with_hal" = xyes && test "x$enable_hal" = xno; then
114 AC_MSG_ERROR([iPod explicitly requested but HAL not found or too old])
116 if test "x$enable_hal" = xyes; then
117 AC_DEFINE(WITH_IPOD_SUPPORT, 1, [Define if iPod support is enabled])
120 PKG_CHECK_MODULES(IPOD_PHONE, libgpod-1.0 >= 0.3.3, support_phone=yes, support_phone=no)
121 if test "x$support_phone" = xyes; then
122 AC_DEFINE(IPOD_PHONE_SUPPORT, 1, [iPod support for phone])
125 AC_SUBST(IPOD_CFLAGS)
129 AM_CONDITIONAL(USE_IPOD, test x"$use_ipod" = xyes)
132 dnl gnome-keyring support
134 AC_ARG_WITH(gnome-keyring,
135 AC_HELP_STRING([--with-gnome-keyring],
136 [Enable gnome-keyring support]),,
137 with_gnome_keyring=auto)
138 if test "x$with_gnome_keyring" != "xno"; then
140 PKG_CHECK_MODULES(GNOME_KEYRING, gnome-keyring-1, have_gnome_keyring=yes, have_gnome_keyring=no)
141 if test "x$have_gnome_keyring" = "xno" -a "x$with_gnome_keyring" = "xyes"; then
142 AC_MSG_ERROR([gnome-keyring support explicitly requested but gnome-keyring couldn't be found])
144 if test "x$have_gnome_keyring" = "xyes"; then
145 AC_DEFINE(WITH_GNOME_KEYRING, 1, [Define if gnome-keyring support is enabled])
146 use_gnome_keyring=yes
147 AC_SUBST(GNOME_KEYRING_CFLAGS)
148 AC_SUBST(GNOME_KEYRING_LIBS)
151 AM_CONDITIONAL(USE_GNOME_KEYRING, test x"$use_gnome_keyring" = xyes)
154 AC_ARG_WITH(database,
155 AC_HELP_STRING([--with-database=tree|libgda],
156 [Select the database to use (default tree)]),,
158 AM_CONDITIONAL(USE_TREEDB, test x"$with_database" = xtree)
159 AM_CONDITIONAL(USE_GDADB, test x"$with_database" = xlibgda)
163 case "x$with_database" in
165 AC_DEFINE(WITH_RHYTHMDB_TREE, 1, [Define if you are using the RhythmDB tree database])
168 AC_DEFINE(WITH_RHYTHMDB_GDA, 1, [Define if you are using the RhythmDB sqlite/libgda database])
169 dnl FIXME: check for sqlite, too?
170 PKG_CHECK_MODULES(GDA, libgda > 1.0.3)
173 AC_MSG_ERROR([Unknown database selected])
179 dnl Database debugging
180 AC_ARG_WITH(rhythmdb-debug,
181 AC_HELP_STRING([--with-rhythmdb-debug=0|1|2],
182 [Level of RhythmDB sanity checking]),,with_rhythmdb_debug=0)
183 if test x"${with_rhythmdb_debug}" != x0; then
184 AC_DEFINE_UNQUOTED([RHYTHMDB_ENABLE_SANITY_CHECK], "${with_rhythmdb_debug}", [Define to the level of RhythmDB sanity checking])
188 dnl Now we're ready to ask for gstreamer libs and cflags
189 dnl And we can also ask for the right version of gstreamer
192 GST_0_8_MAJORMINOR=0.8
193 GST_0_8_REQUIRED_VERSION=0.8.2
194 PKG_CHECK_MODULES(GSTREAMER_0_8, \
195 gstreamer-$GST_0_8_MAJORMINOR >= $GST_0_8_REQUIRED_VERSION gstreamer-libs-$GST_0_8_MAJORMINOR >= $GST_0_8_REQUIRED_VERSION
196 gstreamer-control-$GST_0_8_MAJORMINOR >= $GST_0_8_REQUIRED_VERSION
197 gstreamer-gconf-$GST_0_8_MAJORMINOR >= $GST_0_8_REQUIRED_VERSION,
198 have_gstreamer_0_8=yes,have_gstreamer_0_8=no)
200 GST_0_10_MAJORMINOR=0.10
201 GST_0_10_REQUIRED_VERSION=0.9.7
202 PKG_CHECK_MODULES(GSTREAMER_0_10, \
203 gstreamer-$GST_0_10_MAJORMINOR >= $GST_0_10_REQUIRED_VERSION
204 gstreamer-base-$GST_0_10_MAJORMINOR >= $GST_0_10_REQUIRED_VERSION
205 gstreamer-plugins-base-$GST_0_10_MAJORMINOR >= $GST_0_10_REQUIRED_VERSION,
206 have_gstreamer_0_10=yes,have_gstreamer_0_10=no)
208 AC_ARG_WITH(playback,
209 AC_HELP_STRING([--with-playback=auto|gstreamer-0-8|gstreamer-0-10],
210 [Select the playback backend to use (default auto)]),,
213 if test x$with_playback = xauto -o x$with_playback = xgstreamer-0-10; then
214 if test x"$have_gstreamer_0_10" = xyes; then
215 with_playback=gstreamer_0_10
216 SOUNDSYSTEM_DEPS="gstreamer-$GST_0_10_MAJORMINOR"
217 AC_DEFINE(HAVE_GSTREAMER,1,[Define if you want to use the GStreamer media framework])
218 AC_DEFINE(HAVE_GSTREAMER_0_10,1,[Define if you want to use the GStreamer 0.10])
219 SOUNDSYSTEM_CFLAGS="$GSTREAMER_0_10_CFLAGS"
220 SOUNDSYSTEM_LIBS="$GSTREAMER_0_10_LIBS"
221 elif test x$with_playback = xgstreamer-0-10; then
222 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])
225 if test x$with_playback = xauto -o x$with_playback = xgstreamer-0-8; then
226 if test x"$have_gstreamer_0_8" = xyes; then
227 with_playback=gstreamer_0_8
228 SOUNDSYSTEM_DEPS="gstreamer-$GST_0_8_MAJORMINOR"
229 AC_DEFINE(HAVE_GSTREAMER,1,[Define if you want to use the GStreamer media framework])
230 AC_DEFINE(HAVE_GSTREAMER_0_8,1,[Define if you want to use the GStreamer 0.8])
231 SOUNDSYSTEM_CFLAGS="$GSTREAMER_0_8_CFLAGS"
232 SOUNDSYSTEM_LIBS="$GSTREAMER_0_8_LIBS"
233 elif test x$with_playback = xgstreamer-0-8; then
234 AC_MSG_ERROR([GStreamer 0.8 explicity requested, and it was not found or older than version $GST_REQUIRED_VERSION])
237 AM_CONDITIONAL(USE_GSTREAMER_0_10, test x"$with_playback" = xgstreamer_0_10)
238 AM_CONDITIONAL(USE_GSTREAMER_0_8, test x"$with_playback" = xgstreamer_0_8)
240 dnl Give error and exit if we don't have gstreamer
241 if test x$with_playback = xauto; then
242 AC_MSG_ERROR([GStreamer not found, or older than version $GST_0_8_REQUIRED_VERSION/$GST_0_10_REQUIRED_VERSION])
245 AC_SUBST(SOUNDSYSTEM_DEPS)
246 RHYTHMBOX_CFLAGS="$RHYTHMBOX_CFLAGS $SOUNDSYSTEM_CFLAGS"
247 RHYTHMBOX_LIBS="$RHYTHMBOX_LIBS $SOUNDSYSTEM_LIBS"
251 AC_ARG_ENABLE(tag-writing,
252 AC_HELP_STRING([--enable-tag-writing],
253 [Enable tag writing support in rhythmbox **EXPERIMENTAL**]))
254 if test x"$enable_tag_writing" = xyes; then
255 AC_MSG_WARN([Tag writing support is experimental, and may corrupt files, use at your own risk])
256 AC_DEFINE(ENABLE_TAG_WRITING, 1, [Define if tag writing should be enabled])
260 AC_ARG_ENABLE(track-transfer,
261 AC_HELP_STRING([--disable-track-transfer],
262 [Enable track transfer support in rhythmbox]))
263 if test x"$enable_track_transfer" != xno; then
264 PKG_CHECK_MODULES(GNOME_MEDIA_PROFILES,
265 gnome-media-profiles >= 2.8,
266 with_track_transfer=yes,
267 with_track_transfer=no)
269 if test "x$with_track_transfer" = xno -a "x$enable_track_transfer" = xyes; then
270 AC_MSG_ERROR([Track transfer support explicitly requested but gnome-media-profiles not found.])
273 if test "x$with_track_transfer" = xyes; then
274 AC_DEFINE(ENABLE_TRACK_TRANSFER, 1, [Define if track transfer should be enabled])
277 AM_CONDITIONAL(ENABLE_TRACK_TRANSFER, test "x$with_track_transfer" = "xyes")
280 AC_ARG_ENABLE(ipod-writing,
281 AC_HELP_STRING([--enable-ipod-writing],
282 [Enable support for writing to ipods in rhythmbox **EXPERIMENTAL**]))
283 if test x"$enable_ipod_writing" = xyes; then
284 if test "x$use_ipod" != xyes -a "x$enable_ipod_writing" = xyes; then
285 AC_MSG_ERROR([iPod write support explicitly requested but iPod support is disabled.])
287 if test "x$with_track_transfer" != xyes -a "x$enable_ipod_writing" = xyes; then
288 AC_MSG_ERROR([iPod write support explicitly requested but track transfer support is disabled.])
290 AC_MSG_WARN([iPod writing support is experimental, and may corrupt iPod databases, use at your own risk])
291 AC_DEFINE(ENABLE_IPOD_WRITING, 1, [Define if ipod writing should be enabled])
296 AC_ARG_ENABLE(audioscrobbler,
297 AC_HELP_STRING([--disable-audioscrobbler],
298 [Disable Audioscrobbler support in Rhythmbox]))
300 dnl DAAP (iTunes Music Shares)
302 AC_HELP_STRING([--disable-daap],
303 [Enable Digital Audio Access Protocol (music sharing) in rhythmbox]))
306 AC_HELP_STRING([--with-mdns=auto|howl|avahi],
307 [Select the mDNS/DNS-SD implementation to use (default auto)]),,
316 PKG_CHECK_MODULES(AVAHI,
321 if test x$have_avahi_06 != xyes; then
322 PKG_CHECK_MODULES(AVAHI,
328 if test x$have_avahi_06 = xyes || test x$have_avahi_05 = xyes; then
334 PKG_CHECK_MODULES(HOWL,
339 if test x"$with_mdns" = xauto; then
340 if test x"$have_avahi" = xyes; then
341 MDNS_CFLAGS=$AVAHI_CFLAGS
342 MDNS_LIBS=$AVAHI_LIBS
343 AC_DEFINE(WITH_AVAHI, 1, [Define if mDNS/DNS-SD implementation uses Avahi])
345 AC_MSG_NOTICE([Detected Avahi, using it for mDNS/DNS-SD])
346 if test x$have_avahi_06 = xyes; then
347 AC_DEFINE(HAVE_AVAHI_0_6, 1, [Define if mDNS/DNS-SD implementation uses Avahi 0.6])
349 AC_DEFINE(HAVE_AVAHI_0_5, 1, [Define if mDNS/DNS-SD implementation uses Avahi 0.5])
353 elif test x"$have_howl" = xyes; then
354 MDNS_CFLAGS=$HOWL_CFLAGS
356 AC_DEFINE(WITH_HOWL, 1, [Define if mDNS/DNS-SD implementation uses Howl])
358 AC_MSG_NOTICE([Detected Howl, using it for mDNS/DNS-SD])
364 if test x"$with_mdns" = xhowl; then
365 if test x"$have_howl" = xno; then
366 AC_MSG_ERROR([Howl explicitly requested but not found. Install Howl or try --with-mdns=avahi])
369 MDNS_CFLAGS=$HOWL_CFLAGS
371 AC_DEFINE(WITH_HOWL, 1, [Define if mDNS/DNS-SD implementation uses Howl])
373 AC_MSG_NOTICE([Using Howl for mDNS/DNS-SD])
377 if test x"$with_mdns" = xavahi; then
378 if test x"$have_avahi" = xno; then
379 AC_MSG_ERROR([Avahi explicitly requested but not found. Install Avahi or try --with-mdns=howl])
382 MDNS_CFLAGS=$AVAHI_CFLAGS
383 MDNS_LIBS=$AVAHI_LIBS
384 AC_DEFINE(WITH_AVAHI, 1, [Define if mDNS/DNS-SD implementation uses Avahi])
386 AC_MSG_NOTICE([Using Avahi for mDNS/DNS-SD])
388 if test x$have_avahi_06 = xyes; then
389 AC_DEFINE(HAVE_AVAHI_0_6, 1, [Define if mDNS/DNS-SD implementation uses Avahi 0.6])
391 AC_DEFINE(HAVE_AVAHI_0_5, 1, [Define if mDNS/DNS-SD implementation uses Avahi 0.5])
397 AM_CONDITIONAL(USE_HOWL, test "x$use_howl" = "xyes")
398 AM_CONDITIONAL(USE_AVAHI, test "x$use_avahi" = "xyes")
400 LIBNOTIFY_REQUIRED=0.2.2
401 AC_ARG_ENABLE(libnotify,
402 AC_HELP_STRING([--disable-libnotify],
403 [Disable libnotify support]),,
404 enable_libnotify=auto)
405 if test "x$enable_libnotify" != "xno"; then
406 PKG_CHECK_MODULES(NOTIFY, \
407 libnotify >= $LIBNOTIFY_REQUIRED,
410 if test "x$have_libnotify" = "xno" -a "x$enable_libnotify" = "xyes"; then
411 AC_MSG_ERROR([libnotify support explicitly requested, but libnotify couldn't be found])
413 if test "x$have_libnotify" = "xyes"; then
417 AM_CONDITIONAL(USE_NOTIFY, test x"$enable_libnotify" = xyes)
418 if test x$enable_libnotify = xyes ; then
419 # Find out the version of LIBNOTIFY we're using
420 libnotify_version=`pkg-config --modversion libnotify`
421 LIBNOTIFY_VERSION_MAJOR=`echo $libnotify_version | awk -F. '{print $1}'`
422 LIBNOTIFY_VERSION_MINOR=`echo $libnotify_version | awk -F. '{print $2}'`
423 LIBNOTIFY_VERSION_MICRO=`echo $libnotify_version | awk -F. '{print $3}'`
424 if test "z$LIBNOTIFY_VERSION_MAJOR" = "z"; then
425 LIBNOTIFY_VERSION_MAJOR="0"
427 if test "z$LIBNOTIFY_VERSION_MINOR" = "z"; then
428 LIBNOTIFY_VERSION_MINOR="0"
430 if test "z$LIBNOTIFY_VERSION_MICRO" = "z"; then
431 LIBNOTIFY_VERSION_MICRO="0"
433 echo "Your libnotify version is $LIBNOTIFY_VERSION_MAJOR,$LIBNOTIFY_VERSION_MINOR,$LIBNOTIFY_VERSION_MICRO."
434 NOTIFY_CFLAGS="$NOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MAJOR=$LIBNOTIFY_VERSION_MAJOR"
435 NOTIFY_CFLAGS="$NOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MINOR=$LIBNOTIFY_VERSION_MINOR"
436 NOTIFY_CFLAGS="$NOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MICRO=$LIBNOTIFY_VERSION_MICRO"
438 AC_DEFINE(HAVE_NOTIFY, 1, [Define if libnotify support is enabled])
439 AC_SUBST(NOTIFY_CFLAGS)
440 AC_SUBST(NOTIFY_LIBS)
443 dnl Check for libsoup, needed for DAAP and audioscrobbler
444 if test "x$enable_daap" = "xyes" || test "x$enable_audioscrobbler" != "xno"; then
445 PKG_CHECK_MODULES(SOUP, \
449 if test x"$have_libsoup" = "xno"; then
450 PKG_CHECK_MODULES(SOUP,
455 if test x"$have_libsoup" = "xyes"; then
456 AC_DEFINE(HAVE_LIBSOUP, 1, [Define if libsoup support is enabled])
460 AM_CONDITIONAL(USE_LIBSOUP, test x"$have_libsoup" = "xyes")
463 dnl audioscrobbler support
464 if test "x$enable_audioscrobbler" != "xno"; then
465 if test x"$have_libsoup" = "xno"; then
466 if test "x$enable_audioscrobbler" = "xyes"; then
467 AC_MSG_ERROR([AudioScrobbler support explicitly requested, but no libsoup found. Install libsoup])
469 enable_audioscrobbler=no
471 AC_DEFINE(WITH_AUDIOSCROBBLER, 1, [define if Audioscrobbler support should be enabled])
474 AM_CONDITIONAL(WITH_AUDIOSCROBBLER, test "x$enable_audioscrobbler" != "xno")
478 if test "x$enable_daap" != "xno"; then
479 if test x"$have_libsoup" = "xno"; then
480 if test "x$enable_daap" = "xyes"; then
481 AC_MSG_ERROR([DAAP support explicitly requested, but no libsoup found. Install libsoup])
484 elif test x"$have_mdns" = xno; then
485 if test "x$enable_daap" = "xyes"; then
486 AC_MSG_ERROR([DAAP support explicitly requested, but no mDNS implementation found. Install Howl or Avahi])
490 AC_DEFINE(WITH_DAAP_SUPPORT, 1, [Define if DAAP should be enabled])
492 AC_SUBST(MDNS_CFLAGS)
496 AM_CONDITIONAL(USE_DAAP, test "x$enable_daap" != "xno")
498 AC_CHECK_LIB(z, uncompress)
502 dnl check for MusicBrainz
503 AC_ARG_ENABLE(musicbrainz, AC_HELP_STRING([--disable-musicbrainz],
504 [don't build with MusicBrainz support]))
505 if test x"$enable_musicbrainz" != "xno"; then
506 PKG_CHECK_MODULES(MUSICBRAINZ, libmusicbrainz >= 2.1.0, enable_musicbrainz=yes,
507 enable_musicbrainz=no)
509 if test x"$enable_musicbrainz" = xyes; then
510 RHYTHMBOX_CFLAGS="$RHYTHMBOX_CFLAGS $MUSICBRAINZ_CFLAGS"
511 RHYTHMBOX_LIBS="$RHYTHMBOX_LIBS $MUSICBRAINZ_LIBS"
512 AC_DEFINE(HAVE_MUSICBRAINZ, 1, [define if you have Musicbrainz])
514 AM_CONDITIONAL(HAVE_MUSICBRAINZ, test "x$enable_musicbrainz" = "xyes")
520 if test x"$x_includes" != x"NONE" && test -n "$x_includes" ; then
521 CFLAGS=$CFLAGS -I`echo $x_includes | sed -e "s/:/ -I/g"`
523 if test x"$x_libraries" != x"NONE" && test -n "$x_libraries" ; then
524 LIBS=-L`echo $x_libraries | sed -e "s/:/ -L/g"`
529 #include <X11/extensions/xidle.h>
530 int main(int argc,char **argv) {
534 AC_MSG_CHECKING(for XIDLE extension)
535 AC_MSG_RESULT($have_xidle)
536 if test x"$have_xidle" = "xyes" ; then
537 AC_DEFINE(HAVE_XIDLE_EXTENSION, 1, [defined if you have X11/extensions/xidle.h])
543 #include <X11/XF86keysym.h>
544 int main(int argc,char **argv) {
548 AC_MSG_CHECKING(for XFree86 headers)
549 AC_MSG_RESULT($have_xfree)
550 if test x"$have_xfree" = "xyes" ; then
551 AC_DEFINE(HAVE_XFREE, 1, [defined if you have X11/XF86keysym.h])
554 AC_ARG_ENABLE(mmkeys, AC_HELP_STRING([--disable-mmkeys],
555 [don't build with Multimedia Keys support]))
556 if test x"$have_xfree" = xyes; then
557 if test x"$enable_mmkeys" != xno; then
559 AC_DEFINE(HAVE_MMKEYS, 1, [define if Multimedia Keys are enabled])
562 if test x"$enable_mmkeys" = xyes; then
563 AC_MSG_ERROR([Multimedia keys explicitly requested but no support found])
568 AC_DEFINE(WITH_AUDIOCD_SUPPORT, 1, [Define if audio cd support is enabled])
569 AC_CHECK_HEADER(linux/cdrom.h,[enable_linux_cdrom=yes],)
570 if test "x$enable_linux_cdrom" = "xyes"; then
571 AC_MSG_CHECKING([whether linux/cdrom.h actually works])
574 #include <sys/ioctl.h>
575 #include <linux/cdrom.h>
576 int main(int argc,char **argv) {
577 ioctl (0, CDROM_GET_CAPABILITY, 0);
578 ioctl (0, CDROM_DRIVE_STATUS, CDSL_CURRENT);
579 ioctl (0, CDROMREADTOCHDR, NULL);
581 }], [enable_linux_cdrom=yes],[enable_linux_cdrom=no])
582 if test "x$enable_linux_cdrom" = "xyes"; then
586 AC_MSG_FAILURE([linux/cdrom.h is damaged; fix your system or use --disable-audiocd])
589 AM_CONDITIONAL(HAVE_LINUX_CDROM, test "x$enable_linux_cdrom" = "xyes")
591 dnl CD burner support
592 AC_ARG_WITH(cd-burning,
593 AC_HELP_STRING([--with-cd-burning],
594 [Enable CD burning support]),,
595 with_cd_burning=auto)
596 if test "x$with_cd_burning" != "xno"; then
597 NCB_DRIVE_DOOR_VERSION=2.11.3
598 PKG_CHECK_MODULES(LIBNAUTILUS_BURN, [libnautilus-burn >= $NCB_MIN_REQS], have_cd_burner=yes, have_cd_burner=no)
599 if test "x$have_cd_burner" = xno; then
600 AC_MSG_ERROR([libnautilus-burn not found or too cold])
603 AC_CHECK_LIB(nautilus-burn, nautilus_burn_drive_door_is_open,
604 [AC_DEFINE([HAVE_BURN_DRIVE_DOOR], 1, [Have nautilus-burn function to check drive door state])],
605 ,[$LIBNAUTILUS_BURN_LIBS $LIBNAUTILUS_BURN_CFLAGS])
606 AC_CHECK_LIB(nautilus-burn, nautilus_burn_drive_unref,
607 [AC_DEFINE([HAVE_BURN_DRIVE_UNREF], 1, [Have nautilus-burn 2.13 drive unref function])],
608 ,[$LIBNAUTILUS_BURN_LIBS $LIBNAUTILUS_BURN_CFLAGS])
609 AC_CHECK_LIB(nautilus-burn, nautilus_burn_drive_new_from_path,
610 [AC_DEFINE([HAVE_BURN_DRIVE_NEW_FROM_PATH], 1, [Have nautilus-burn 2.13 drive new_from_path function])],
611 ,[$LIBNAUTILUS_BURN_LIBS $LIBNAUTILUS_BURN_CFLAGS])
612 AC_CHECK_LIB(nautilus-burn, nautilus_burn_drive_get_write_speeds,
613 [AC_DEFINE([HAVE_BURN_DRIVE_GET_WRITE_SPEEDS], 1, [Have nautilus-burn 2.13 drive get_write_speeds])],
614 ,[$LIBNAUTILUS_BURN_LIBS $LIBNAUTILUS_BURN_CFLAGS])
616 AC_DEFINE([HAVE_NAUTILUS_BURN], 1, [Have nautilus-burn])
619 AM_CONDITIONAL(USE_CD_BURNING, test "x$with_cd_burning" != "xno")
624 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
625 AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource)
626 AC_PATH_PROG(GCONFTOOL, gconftool-2)
628 AC_SUBST(RHYTHMBOX_CFLAGS)
629 AC_SUBST(RHYTHMBOX_LIBS)
630 AC_SUBST(RB_CLIENT_CFLAGS)
631 AC_SUBST(RB_CLIENT_LIBS)
633 AC_TRY_RUN([#include <time.h>
639 if (strftime(buf, 100, "%EY", &tm) == 4 &&
640 strcmp (buf, "1999")==0)
645 AC_DEFINE(HAVE_STRFTIME_EXTENSION, 1, [Define if strftime supports %E and %O modifiers.])
648 GETTEXT_PACKAGE=rhythmbox
649 AC_SUBST(GETTEXT_PACKAGE)
650 AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
651 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Define to the Gettext package name])
652 ALL_LINGUAS="`cat "$srcdir/po/LINGUAS" | grep -v '^#'`"
656 dnl Workaround for automake 1.8
657 AC_SUBST(mkdir_p) if test x"$mkdir_p" = "x"; then
658 MKINSTALLDIRS="mkinstalldirs"
660 AC_SUBST(MKINSTALLDIRS)
662 AS_AC_EXPAND(DATADIR, $datadir)
665 PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= $DBUS_MIN_REQS, enable_dbus=yes, enable_dbus=no)
666 if test "x$enable_dbus" = xno; then
667 PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= $OLD_DBUS_MIN_REQS, enable_old_dbus=yes, enable_old_dbus=no)
668 if test "x$enable_old_dbus" = xno; then
669 AC_MSG_ERROR([DBUS not found or too old])
671 AC_DEFINE(WITH_OLD_DBUS, 1, [Define if old D-BUS is enabled])
673 AC_DEFINE(WITH_DBUS, 1, [Define if D-BUS is enabled])
676 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_API_SUBJECT_TO_CHANGE"
677 DBUS_GLIB_BIN="`$PKG_CONFIG --variable=exec_prefix dbus-glib-1`/bin"
678 AC_SUBST(DBUS_GLIB_BIN)
679 AM_CONDITIONAL(WITH_DBUS, test "x$enable_dbus" = "xyes")
680 AM_CONDITIONAL(WITH_OLD_DBUS, test "x$enable_old_dbus" = "xyes")
682 dnl out-of-process metadata reader (requires dbus)
683 AC_ARG_WITH(metadata-helper,
684 AC_HELP_STRING([--with-metadata-helper],
685 [Use a separate process for metadata reading]),,
686 with_metadata_helper=auto)
687 enable_metadata_helper=no
688 if test "x$with_metadata_helper" != xno; then
689 if test "x$enable_dbus" = xyes || test "x$enable_old_dbus" = xyes; then
690 AC_DEFINE(WITH_METADATA_HELPER, 1, [Define if the metadata helper process is enabled])
691 enable_metadata_helper=yes
692 elif test "x$with_metadata_helper" = xyes; then
693 AC_MSG_ERROR([Metadata helper process explicitly requested, but D-BUS is not enabled])
696 AM_CONDITIONAL(WITH_METADATA_HELPER, test "x$enable_metadata_helper" = "xyes")
702 AC_HELP_STRING([--enable-lirc],[enable lirc support]))
704 if test x"$enable_lirc" != xno; then
705 AC_CHECK_HEADER(lirc/lirc_client.h,[with_lirc=yes],[with_lirc=no])
706 if test x"$with_lirc" = xyes; then
707 AC_CHECK_LIB(lirc_client,lirc_init,[with_lirc=yes],[with_lirc=no])
709 if test x"$with_lirc" = xno -a x"$enable_lirc" = xyes; then
710 AC_MSG_ERROR([lirc explicitly requested but no support found])
713 AM_CONDITIONAL(WITH_LIRC, test x"$with_lirc" = xyes)
716 AC_ARG_ENABLE(uninstalled-build,
717 AC_HELP_STRING([--enable-uninstalled-build],
718 [Search for files in build directory as well]),
719 enable_uninstalled=yes,)
720 if test x"$enable_uninstalled" = xyes; then
721 AC_DEFINE_UNQUOTED(SHARE_UNINSTALLED_DIR,"`pwd`/data",[path to source data dir])
722 AC_DEFINE_UNQUOTED(METADATA_UNINSTALLED_DIR,"`pwd`/metadata",[path to metadata build dir])
725 AC_ARG_WITH(internal-libsexy,
726 AC_HELP_STRING([--with-internal-libsexy],
727 [Build using internal libsexy library]),,
728 with_internal_libsexy=no)
729 if test "x$with_internal_libsexy" = "xno"; then
730 PKG_CHECK_MODULES(LIBSEXY, libsexy >= 0.1.5, with_internal_libsexy=no,
731 with_internal_libsexy=yes)
733 AC_SUBST(LIBSEXY_CFLAGS)
734 AC_SUBST(LIBSEXY_LIBS)
735 AM_CONDITIONAL(WITH_INTERNAL_LIBSEXY, test "x$with_internal_libsexy" = "xyes")
737 dnl warnings bits, copied from gnome-keyring configure.in
738 dnl Turn on the additional warnings last, so -Werror doesn't affect other tests.
740 AC_ARG_ENABLE(more-warnings,
741 [ --enable-more-warnings Maximum compiler warnings],
742 set_more_warnings="$enableval",[
743 if test -d "$srcdir/{arch}" || test -d "$srcdir/CVS" || test -d "$srcdir/_darcs"; then
744 set_more_warnings=yes
749 AC_MSG_CHECKING(for more warnings, including -Werror)
750 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
753 -Wcomment -Wformat -Wnonnull -Wimplicit-int -Wimplicit \
754 -Wmain -Wmissing-braces -Wparentheses -Wsequence-point \
755 -Wreturn-type -Wswitch -Wtrigraphs -Wunused-function \
756 -Wunused-label -Wunused-value \
757 -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
758 -Wnested-externs -Wpointer-arith \
762 if echo "$CFLAGS" | grep -e '-O[1-9]'; then
763 WARN_CFLAGS="-Wuninitialized $WARN_CFLAGS"
766 for option in $WARN_CFLAGS; do
767 SAVE_CFLAGS="$CFLAGS"
768 CFLAGS="$CFLAGS $option"
769 AC_MSG_CHECKING([whether gcc understands $option])
770 AC_TRY_COMPILE([], [],
773 if test x$has_option = xyes; then
774 RHYTHMBOX_CFLAGS="$RHYTHMBOX_CFLAGS $option"
776 AC_MSG_RESULT($has_option)
777 CFLAGS="$SAVE_CFLAGS"
783 SAVE_CFLAGS="$CFLAGS"
784 CFLAGS="$CFLAGS -Wno-error"
785 AC_TRY_COMPILE([], [],
786 WNOERROR_CFLAGS="-Wno-error",
788 AC_SUBST(WNOERROR_CFLAGS)
789 CFLAGS="$SAVE_CFLAGS"
799 dnl Enable gnome-doc-utils
803 dnl ================================================================
805 dnl ================================================================
807 PLUGIN_LIBTOOL_FLAGS="-module -avoid-version"
808 AC_SUBST(PLUGIN_LIBTOOL_FLAGS)
810 AS_AC_EXPAND(PLUGINDIR, ${libdir}/rhythmbox/plugins)
813 dnl ================================================================
815 dnl ================================================================
817 AC_MSG_CHECKING([whether Python support is requested])
818 AC_ARG_ENABLE([python],
819 AS_HELP_STRING([--enable-python],[Enable python support]),
820 [enable_python=$enableval have_python=$enableval],
821 [enable_python=autodetect have_python=yes])
822 AC_MSG_RESULT([$enable_python])
824 if test "x$have_python" != "xno"; then
825 AM_PATH_PYTHON([2.3],[],[no])
826 if test "x$PYTHON" = "x:"; then
831 if test "x$have_python" != "xno"; then
832 PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
833 PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; print sys.exec_prefix'`
834 PYTHON_LIBS="-lpython$PYTHON_VERSION"
835 PYTHON_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config"
836 PYTHON_CFLAGS="-I$PY_PREFIX/include/python$PYTHON_VERSION"
837 PYTHON_MAKEFILE="$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config/Makefile"
838 PYTHON_LOCALMODLIBS=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
839 PYTHON_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
840 PYTHON_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
841 PYTHON_EXTRA_LIBS="$PYTHON_LOCALMODLIBS $PYTHON_BASEMODLIBS $PYTHON_OTHER_LIBS"
842 AC_SUBST([PYTHON_LIBS])
843 AC_SUBST([PYTHON_LIB_LOC])
844 AC_SUBST([PYTHON_CFLAGS])
845 AC_SUBST([PYTHON_EXTRA_LIBS])
847 dnl FIXME: do we really need this test?
848 AC_MSG_CHECKING([whether we can build a shared library depending on libpython])
852 cat > testpython.c <<EOF
854 int testpython (void)
860 if /bin/sh ../libtool --mode=compile ${CC} $PYTHON_CFLAGS -c testpython.c >/dev/null 2>&1 && \
861 /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 && \
862 grep 'dlname.*testpython' testpython.la >/dev/null 2>&1; then
870 AC_MSG_RESULT([$result])
873 if test "x$have_python" != "xno"; then
876 PKG_CHECK_MODULES([PYGTK], [
877 pygtk-2.0 >= $PYGTK_REQUIRED],
880 AC_SUBST([PYGTK_CFLAGS])
881 AC_SUBST([PYGTK_LIBS])
884 if test "x$have_python" != "xno"; then
885 AC_MSG_CHECKING([for pygtk defs])
886 PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
887 AC_MSG_RESULT([$PYGTK_DEFSDIR])
889 AC_MSG_CHECKING([for pygtk codegen])
890 PYGTK_CODEGEN="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/codegen.py"
891 AC_MSG_RESULT([$PYGTK_CODEGEN])
893 AC_MSG_CHECKING([for pygtk h2def])
894 PYGTK_H2DEF="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/h2def.py"
895 AC_MSG_RESULT([$PYGTK_H2DEF])
897 AC_SUBST([PYGTK_DEFSDIR])
898 AC_SUBST([PYGTK_CODEGEN])
899 AC_SUBST([PYGTK_H2DEF])
901 dnl Check for -fno-strict-aliasing
902 FLAGS="-fno-strict-aliasing"
903 save_CFLAGS="$CFLAGS"
904 CFLAGS="$CFLAGS $FLAGS"
905 AC_MSG_CHECKING([whether [$]CC understands $FLAGS])
906 AC_TRY_COMPILE([], [], [compiler_has_option=yes], [compiler_has_option=no])
907 CFLAGS="$save_CFLAGS"
908 AC_MSG_RESULT($compiler_has_option)
909 if test $compiler_has_option = yes; then
910 NO_STRICT_ALIASING_CFLAGS="$FLAGS"
912 AC_SUBST([NO_STRICT_ALIASING_CFLAGS])
915 if test "x$have_python" != "xyes"; then
916 if test "x$enable_python" = "xyes"; then
917 AC_MSG_ERROR([Python support explicity requested, but not found])
918 elif test "x$enable_python" != "xno"; then
920 AC_MSG_WARN([Python not found, disabling python support])
922 elif test "x$enable_python" != "xno"; then
924 AC_DEFINE([ENABLE_PYTHON],[1],[Define to compile with python support])
927 AM_CONDITIONAL([ENABLE_PYTHON],[test "x$enable_python" = "xyes"])
930 dnl check, for unit tests
931 AM_PATH_CHECK([], have_check=yes, have_check=no)
932 AM_CONDITIONAL([HAVE_CHECK],[test "x$have_check" = "xyes"])
935 dnl ================================================================
937 dnl ================================================================
946 widgets/libsexy/Makefile
951 data/rhythmbox.desktop.in
958 plugins/sample/Makefile
959 plugins/audioscrobbler/Makefile
960 plugins/cd-recorder/Makefile
961 plugins/ipod/Makefile
962 plugins/lirc/Makefile
963 plugins/lyrics/Makefile
964 plugins/sample-python/Makefile
965 plugins/pythonconsole/Makefile
966 plugins/artdisplay/Makefile
967 plugins/artdisplay/artdisplay/Makefile
968 plugins/generic-player/Makefile
971 bindings/python/Makefile
976 doc/reference/Makefile
978 backends/gstreamer/Makefile
983 AC_MSG_NOTICE([Rhythmbox was configured with the following options:])
984 if test x"$with_database" = xtree; then
985 AC_MSG_NOTICE([** Tree database is enabled])
986 elif test x"$with_database" = xlibgda; then
987 AC_MSG_NOTICE([** libgda/sqlite database is enabled])
989 AC_MSG_ERROR([Unknown database!])
991 if test x"${with_rhythmdb_debug}" != x0; then
992 AC_MSG_NOTICE([** RhythmDB sanity checking enabled (may be slow!)])
996 if test x"$enable_tag_writing" = xyes; then
997 AC_MSG_NOTICE([** Tag writing is enabled - USE AT YOUR OWN RISK])
999 AC_MSG_NOTICE([ Tag writing is disabled])
1001 if test x"$with_track_transfer" = xyes; then
1002 AC_MSG_NOTICE([** Track transfer is enabled])
1004 AC_MSG_NOTICE([ Track transfer is disabled])
1006 if test x"$enable_ipod_writing" = xyes; then
1007 AC_MSG_NOTICE([** iPod write support is enabled])
1009 AC_MSG_NOTICE([ iPod write support is disabled])
1011 if test x"$enable_mmkeys" != "xyes"; then
1012 AC_MSG_NOTICE([ Multimedia keys support is disabled])
1014 AC_MSG_NOTICE([** Multimedia keys support is enabled])
1016 if test x"$enable_musicbrainz" != "xyes"; then
1017 AC_MSG_NOTICE([ MusicBrainz support is disabled])
1019 AC_MSG_NOTICE([** MusicBrainz support is enabled])
1022 if test x"$with_playback" = xgstreamer_0_8; then
1023 AC_MSG_NOTICE([** GStreamer 0.8 player is enabled])
1024 elif test x"$with_playback" = xgstreamer_0_10; then
1025 AC_MSG_NOTICE([** GStreamer 0.10 player is enabled])
1027 AC_MSG_ERROR([ Playback engine set incorrectly])
1030 if test x"$use_ipod" = xyes; then
1031 AC_MSG_NOTICE([** iPod integration enabled])
1033 AC_MSG_NOTICE([ iPod integration disabled])
1035 if test x"$with_cd_burning" != xno; then
1036 AC_MSG_NOTICE([** CD burning support enabled])
1038 AC_MSG_NOTICE([ CD burning support disabled])
1040 if test x"$enable_daap" = xyes; then
1041 AC_MSG_NOTICE([** DAAP (music sharing) support is enabled])
1043 AC_MSG_NOTICE([ DAAP (music sharing) support is disabled])
1045 if test x"$have_libnotify" = xyes; then
1046 AC_MSG_NOTICE([** libnotify support is enabled])
1048 AC_MSG_NOTICE([ libnotify support is disabled])
1050 if test x"$enable_hal" = xyes; then
1051 AC_MSG_NOTICE([** HAL support enabled])
1053 AC_MSG_NOTICE([ HAL support disabled])
1055 if test x"$enable_old_dbus" = xyes; then
1056 AC_MSG_NOTICE([** using D-BUS < 0.35 control/activation])
1058 if test x"$enable_python" != xno; then
1059 AC_MSG_NOTICE([** Python support enabled])
1061 AC_MSG_NOTICE([ Python support disabled])
1063 if test x"$use_gnome_keyring" = xyes; then
1064 AC_MSG_NOTICE([** gnome-keyring support enabled])
1066 AC_MSG_NOTICE([ gnome-keyring support disabled])
1068 if test x"$enable_audioscrobbler" != xno; then
1069 AC_MSG_NOTICE([** Audioscrobbler support enabled])
1071 AC_MSG_NOTICE([ Audioscrobbler support disabled])
1073 if test x"$enable_metadata_helper" = xyes; then
1074 AC_MSG_NOTICE([** Separate metadata helper process enabled])
1076 AC_MSG_NOTICE([ Separate metadata helper process disabled])
1078 if test x"$with_internal_libsexy" = xyes; then
1079 AC_MSG_NOTICE([ using internal libsexy])
1081 AC_MSG_NOTICE([** using system-wide libsexy])
1084 AC_MSG_NOTICE([End options])