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.6)
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([--disble-tag-writing],
253 [Disable tag writing support in rhythmbox]))
254 if test x"$enable_tag_writing" != xno; then
255 AC_DEFINE(ENABLE_TAG_WRITING, 1, [Define if tag writing should be enabled])
259 AC_ARG_ENABLE(track-transfer,
260 AC_HELP_STRING([--disable-track-transfer],
261 [Enable track transfer support in rhythmbox]))
262 if test x"$enable_track_transfer" != xno; then
263 PKG_CHECK_MODULES(GNOME_MEDIA_PROFILES,
264 gnome-media-profiles >= 2.8,
265 with_track_transfer=yes,
266 with_track_transfer=no)
268 if test "x$with_track_transfer" = xno -a "x$enable_track_transfer" = xyes; then
269 AC_MSG_ERROR([Track transfer support explicitly requested but gnome-media-profiles not found.])
272 if test "x$with_track_transfer" = xyes; then
273 AC_DEFINE(ENABLE_TRACK_TRANSFER, 1, [Define if track transfer should be enabled])
276 AM_CONDITIONAL(ENABLE_TRACK_TRANSFER, test "x$with_track_transfer" = "xyes")
279 AC_ARG_ENABLE(ipod-writing,
280 AC_HELP_STRING([--disable-ipod-writing],
281 [Disable support for writing to ipods in rhythmbox]))
282 if test x"$enable_ipod_writing" != xno; then
283 if test "x$use_ipod" != xyes; then
284 if test "x$enable_ipod_writing" = xyes; then
285 AC_MSG_ERROR([iPod write support explicitly requested but iPod support is disabled.])
287 enable_ipod_writing = no
288 elif test "x$with_track_transfer" != xyes; then
289 if test "x$enable_ipod_writing" = xyes; then
290 AC_MSG_ERROR([iPod write support explicitly requested but track transfer support is disabled.])
292 enable_ipod_writing = no
294 AC_DEFINE(ENABLE_IPOD_WRITING, 1, [Define if ipod writing should be enabled])
300 AC_ARG_ENABLE(audioscrobbler,
301 AC_HELP_STRING([--disable-audioscrobbler],
302 [Disable Audioscrobbler support in Rhythmbox]))
304 dnl DAAP (iTunes Music Shares)
306 AC_HELP_STRING([--disable-daap],
307 [Enable Digital Audio Access Protocol (music sharing) in rhythmbox]))
310 AC_HELP_STRING([--with-mdns=auto|howl|avahi],
311 [Select the mDNS/DNS-SD implementation to use (default auto)]),,
320 PKG_CHECK_MODULES(AVAHI,
325 if test x$have_avahi_06 != xyes; then
326 PKG_CHECK_MODULES(AVAHI,
332 if test x$have_avahi_06 = xyes || test x$have_avahi_05 = xyes; then
338 PKG_CHECK_MODULES(HOWL,
343 if test x"$with_mdns" = xauto; then
344 if test x"$have_avahi" = xyes; then
345 MDNS_CFLAGS=$AVAHI_CFLAGS
346 MDNS_LIBS=$AVAHI_LIBS
347 AC_DEFINE(WITH_AVAHI, 1, [Define if mDNS/DNS-SD implementation uses Avahi])
349 AC_MSG_NOTICE([Detected Avahi, using it for mDNS/DNS-SD])
350 if test x$have_avahi_06 = xyes; then
351 AC_DEFINE(HAVE_AVAHI_0_6, 1, [Define if mDNS/DNS-SD implementation uses Avahi 0.6])
353 AC_DEFINE(HAVE_AVAHI_0_5, 1, [Define if mDNS/DNS-SD implementation uses Avahi 0.5])
357 elif test x"$have_howl" = xyes; then
358 MDNS_CFLAGS=$HOWL_CFLAGS
360 AC_DEFINE(WITH_HOWL, 1, [Define if mDNS/DNS-SD implementation uses Howl])
362 AC_MSG_NOTICE([Detected Howl, using it for mDNS/DNS-SD])
368 if test x"$with_mdns" = xhowl; then
369 if test x"$have_howl" = xno; then
370 AC_MSG_ERROR([Howl explicitly requested but not found. Install Howl or try --with-mdns=avahi])
373 MDNS_CFLAGS=$HOWL_CFLAGS
375 AC_DEFINE(WITH_HOWL, 1, [Define if mDNS/DNS-SD implementation uses Howl])
377 AC_MSG_NOTICE([Using Howl for mDNS/DNS-SD])
381 if test x"$with_mdns" = xavahi; then
382 if test x"$have_avahi" = xno; then
383 AC_MSG_ERROR([Avahi explicitly requested but not found. Install Avahi or try --with-mdns=howl])
386 MDNS_CFLAGS=$AVAHI_CFLAGS
387 MDNS_LIBS=$AVAHI_LIBS
388 AC_DEFINE(WITH_AVAHI, 1, [Define if mDNS/DNS-SD implementation uses Avahi])
390 AC_MSG_NOTICE([Using Avahi for mDNS/DNS-SD])
392 if test x$have_avahi_06 = xyes; then
393 AC_DEFINE(HAVE_AVAHI_0_6, 1, [Define if mDNS/DNS-SD implementation uses Avahi 0.6])
395 AC_DEFINE(HAVE_AVAHI_0_5, 1, [Define if mDNS/DNS-SD implementation uses Avahi 0.5])
401 AM_CONDITIONAL(USE_HOWL, test "x$use_howl" = "xyes")
402 AM_CONDITIONAL(USE_AVAHI, test "x$use_avahi" = "xyes")
404 LIBNOTIFY_REQUIRED=0.2.2
405 AC_ARG_ENABLE(libnotify,
406 AC_HELP_STRING([--disable-libnotify],
407 [Disable libnotify support]),,
408 enable_libnotify=auto)
409 if test "x$enable_libnotify" != "xno"; then
410 PKG_CHECK_MODULES(NOTIFY, \
411 libnotify >= $LIBNOTIFY_REQUIRED,
414 if test "x$have_libnotify" = "xno" -a "x$enable_libnotify" = "xyes"; then
415 AC_MSG_ERROR([libnotify support explicitly requested, but libnotify couldn't be found])
417 if test "x$have_libnotify" = "xyes"; then
421 AM_CONDITIONAL(USE_NOTIFY, test x"$enable_libnotify" = xyes)
422 if test x$enable_libnotify = xyes ; then
423 # Find out the version of LIBNOTIFY we're using
424 libnotify_version=`pkg-config --modversion libnotify`
425 LIBNOTIFY_VERSION_MAJOR=`echo $libnotify_version | awk -F. '{print $1}'`
426 LIBNOTIFY_VERSION_MINOR=`echo $libnotify_version | awk -F. '{print $2}'`
427 LIBNOTIFY_VERSION_MICRO=`echo $libnotify_version | awk -F. '{print $3}'`
428 if test "z$LIBNOTIFY_VERSION_MAJOR" = "z"; then
429 LIBNOTIFY_VERSION_MAJOR="0"
431 if test "z$LIBNOTIFY_VERSION_MINOR" = "z"; then
432 LIBNOTIFY_VERSION_MINOR="0"
434 if test "z$LIBNOTIFY_VERSION_MICRO" = "z"; then
435 LIBNOTIFY_VERSION_MICRO="0"
437 echo "Your libnotify version is $LIBNOTIFY_VERSION_MAJOR,$LIBNOTIFY_VERSION_MINOR,$LIBNOTIFY_VERSION_MICRO."
438 NOTIFY_CFLAGS="$NOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MAJOR=$LIBNOTIFY_VERSION_MAJOR"
439 NOTIFY_CFLAGS="$NOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MINOR=$LIBNOTIFY_VERSION_MINOR"
440 NOTIFY_CFLAGS="$NOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MICRO=$LIBNOTIFY_VERSION_MICRO"
442 AC_DEFINE(HAVE_NOTIFY, 1, [Define if libnotify support is enabled])
443 AC_SUBST(NOTIFY_CFLAGS)
444 AC_SUBST(NOTIFY_LIBS)
447 dnl Check for libsoup, needed for DAAP and audioscrobbler
448 if test "x$enable_daap" = "xyes" || test "x$enable_audioscrobbler" != "xno"; then
449 PKG_CHECK_MODULES(SOUP, \
453 if test x"$have_libsoup" = "xno"; then
454 PKG_CHECK_MODULES(SOUP,
459 if test x"$have_libsoup" = "xyes"; then
460 AC_DEFINE(HAVE_LIBSOUP, 1, [Define if libsoup support is enabled])
464 AM_CONDITIONAL(USE_LIBSOUP, test x"$have_libsoup" = "xyes")
467 dnl audioscrobbler support
468 if test "x$enable_audioscrobbler" != "xno"; then
469 if test x"$have_libsoup" = "xno"; then
470 if test "x$enable_audioscrobbler" = "xyes"; then
471 AC_MSG_ERROR([AudioScrobbler support explicitly requested, but no libsoup found. Install libsoup])
473 enable_audioscrobbler=no
475 AC_DEFINE(WITH_AUDIOSCROBBLER, 1, [define if Audioscrobbler support should be enabled])
478 AM_CONDITIONAL(WITH_AUDIOSCROBBLER, test "x$enable_audioscrobbler" != "xno")
482 if test "x$enable_daap" != "xno"; then
483 if test x"$have_libsoup" = "xno"; then
484 if test "x$enable_daap" = "xyes"; then
485 AC_MSG_ERROR([DAAP support explicitly requested, but no libsoup found. Install libsoup])
488 elif test x"$have_mdns" = xno; then
489 if test "x$enable_daap" = "xyes"; then
490 AC_MSG_ERROR([DAAP support explicitly requested, but no mDNS implementation found. Install Howl or Avahi])
494 AC_DEFINE(WITH_DAAP_SUPPORT, 1, [Define if DAAP should be enabled])
496 AC_SUBST(MDNS_CFLAGS)
500 AM_CONDITIONAL(USE_DAAP, test "x$enable_daap" != "xno")
502 AC_CHECK_LIB(z, uncompress)
506 dnl check for MusicBrainz
507 AC_ARG_ENABLE(musicbrainz, AC_HELP_STRING([--disable-musicbrainz],
508 [don't build with MusicBrainz support]))
509 if test x"$enable_musicbrainz" != "xno"; then
510 PKG_CHECK_MODULES(MUSICBRAINZ, libmusicbrainz >= 2.1.0, enable_musicbrainz=yes,
511 enable_musicbrainz=no)
513 if test x"$enable_musicbrainz" = xyes; then
514 RHYTHMBOX_CFLAGS="$RHYTHMBOX_CFLAGS $MUSICBRAINZ_CFLAGS"
515 RHYTHMBOX_LIBS="$RHYTHMBOX_LIBS $MUSICBRAINZ_LIBS"
516 AC_DEFINE(HAVE_MUSICBRAINZ, 1, [define if you have Musicbrainz])
518 AM_CONDITIONAL(HAVE_MUSICBRAINZ, test "x$enable_musicbrainz" = "xyes")
524 if test x"$x_includes" != x"NONE" && test -n "$x_includes" ; then
525 CFLAGS=$CFLAGS -I`echo $x_includes | sed -e "s/:/ -I/g"`
527 if test x"$x_libraries" != x"NONE" && test -n "$x_libraries" ; then
528 LIBS=-L`echo $x_libraries | sed -e "s/:/ -L/g"`
533 #include <X11/extensions/xidle.h>
534 int main(int argc,char **argv) {
538 AC_MSG_CHECKING(for XIDLE extension)
539 AC_MSG_RESULT($have_xidle)
540 if test x"$have_xidle" = "xyes" ; then
541 AC_DEFINE(HAVE_XIDLE_EXTENSION, 1, [defined if you have X11/extensions/xidle.h])
547 #include <X11/XF86keysym.h>
548 int main(int argc,char **argv) {
552 AC_MSG_CHECKING(for XFree86 headers)
553 AC_MSG_RESULT($have_xfree)
554 if test x"$have_xfree" = "xyes" ; then
555 AC_DEFINE(HAVE_XFREE, 1, [defined if you have X11/XF86keysym.h])
558 AC_ARG_ENABLE(mmkeys, AC_HELP_STRING([--disable-mmkeys],
559 [don't build with Multimedia Keys support]))
560 if test x"$have_xfree" = xyes; then
561 if test x"$enable_mmkeys" != xno; then
563 AC_DEFINE(HAVE_MMKEYS, 1, [define if Multimedia Keys are enabled])
566 if test x"$enable_mmkeys" = xyes; then
567 AC_MSG_ERROR([Multimedia keys explicitly requested but no support found])
572 AC_DEFINE(WITH_AUDIOCD_SUPPORT, 1, [Define if audio cd support is enabled])
573 AC_CHECK_HEADER(linux/cdrom.h,[enable_linux_cdrom=yes],)
574 if test "x$enable_linux_cdrom" = "xyes"; then
575 AC_MSG_CHECKING([whether linux/cdrom.h actually works])
578 #include <sys/ioctl.h>
579 #include <linux/cdrom.h>
580 int main(int argc,char **argv) {
581 ioctl (0, CDROM_GET_CAPABILITY, 0);
582 ioctl (0, CDROM_DRIVE_STATUS, CDSL_CURRENT);
583 ioctl (0, CDROMREADTOCHDR, NULL);
585 }], [enable_linux_cdrom=yes],[enable_linux_cdrom=no])
586 if test "x$enable_linux_cdrom" = "xyes"; then
590 AC_MSG_FAILURE([linux/cdrom.h is damaged; fix your system or use --disable-audiocd])
593 AM_CONDITIONAL(HAVE_LINUX_CDROM, test "x$enable_linux_cdrom" = "xyes")
595 dnl CD burner support
596 AC_ARG_WITH(cd-burning,
597 AC_HELP_STRING([--with-cd-burning],
598 [Enable CD burning support]),,
599 with_cd_burning=auto)
600 if test "x$with_cd_burning" != "xno"; then
601 NCB_DRIVE_DOOR_VERSION=2.11.3
602 PKG_CHECK_MODULES(LIBNAUTILUS_BURN, [libnautilus-burn >= $NCB_MIN_REQS], have_cd_burner=yes, have_cd_burner=no)
603 if test "x$have_cd_burner" = xno; then
604 AC_MSG_ERROR([libnautilus-burn not found or too cold])
607 AC_CHECK_LIB(nautilus-burn, nautilus_burn_drive_door_is_open,
608 [AC_DEFINE([HAVE_BURN_DRIVE_DOOR], 1, [Have nautilus-burn function to check drive door state])],
609 ,[$LIBNAUTILUS_BURN_LIBS $LIBNAUTILUS_BURN_CFLAGS])
610 AC_CHECK_LIB(nautilus-burn, nautilus_burn_drive_unref,
611 [AC_DEFINE([HAVE_BURN_DRIVE_UNREF], 1, [Have nautilus-burn 2.13 drive unref function])],
612 ,[$LIBNAUTILUS_BURN_LIBS $LIBNAUTILUS_BURN_CFLAGS])
613 AC_CHECK_LIB(nautilus-burn, nautilus_burn_drive_new_from_path,
614 [AC_DEFINE([HAVE_BURN_DRIVE_NEW_FROM_PATH], 1, [Have nautilus-burn 2.13 drive new_from_path function])],
615 ,[$LIBNAUTILUS_BURN_LIBS $LIBNAUTILUS_BURN_CFLAGS])
616 AC_CHECK_LIB(nautilus-burn, nautilus_burn_drive_get_write_speeds,
617 [AC_DEFINE([HAVE_BURN_DRIVE_GET_WRITE_SPEEDS], 1, [Have nautilus-burn 2.13 drive get_write_speeds])],
618 ,[$LIBNAUTILUS_BURN_LIBS $LIBNAUTILUS_BURN_CFLAGS])
620 AC_DEFINE([HAVE_NAUTILUS_BURN], 1, [Have nautilus-burn])
623 AM_CONDITIONAL(USE_CD_BURNING, test "x$with_cd_burning" != "xno")
628 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
629 AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource)
630 AC_PATH_PROG(GCONFTOOL, gconftool-2)
632 AC_SUBST(RHYTHMBOX_CFLAGS)
633 AC_SUBST(RHYTHMBOX_LIBS)
634 AC_SUBST(RB_CLIENT_CFLAGS)
635 AC_SUBST(RB_CLIENT_LIBS)
637 AC_TRY_RUN([#include <time.h>
643 if (strftime(buf, 100, "%EY", &tm) == 4 &&
644 strcmp (buf, "1999")==0)
649 AC_DEFINE(HAVE_STRFTIME_EXTENSION, 1, [Define if strftime supports %E and %O modifiers.])
652 GETTEXT_PACKAGE=rhythmbox
653 AC_SUBST(GETTEXT_PACKAGE)
654 AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
655 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Define to the Gettext package name])
656 ALL_LINGUAS="`cat "$srcdir/po/LINGUAS" | grep -v '^#'`"
660 dnl Workaround for automake 1.8
661 AC_SUBST(mkdir_p) if test x"$mkdir_p" = "x"; then
662 MKINSTALLDIRS="mkinstalldirs"
664 AC_SUBST(MKINSTALLDIRS)
666 AS_AC_EXPAND(DATADIR, $datadir)
669 PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= $DBUS_MIN_REQS, enable_dbus=yes, enable_dbus=no)
670 if test "x$enable_dbus" = xno; then
671 PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= $OLD_DBUS_MIN_REQS, enable_old_dbus=yes, enable_old_dbus=no)
672 if test "x$enable_old_dbus" = xno; then
673 AC_MSG_ERROR([DBUS not found or too old])
675 AC_DEFINE(WITH_OLD_DBUS, 1, [Define if old D-BUS is enabled])
677 AC_DEFINE(WITH_DBUS, 1, [Define if D-BUS is enabled])
680 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_API_SUBJECT_TO_CHANGE"
681 DBUS_GLIB_BIN="`$PKG_CONFIG --variable=exec_prefix dbus-glib-1`/bin"
682 AC_SUBST(DBUS_GLIB_BIN)
683 AM_CONDITIONAL(WITH_DBUS, test "x$enable_dbus" = "xyes")
684 AM_CONDITIONAL(WITH_OLD_DBUS, test "x$enable_old_dbus" = "xyes")
686 dnl out-of-process metadata reader (requires dbus)
687 AC_ARG_WITH(metadata-helper,
688 AC_HELP_STRING([--with-metadata-helper],
689 [Use a separate process for metadata reading]),,
690 with_metadata_helper=auto)
691 enable_metadata_helper=no
692 if test "x$with_metadata_helper" != xno; then
693 if test "x$enable_dbus" = xyes || test "x$enable_old_dbus" = xyes; then
694 AC_DEFINE(WITH_METADATA_HELPER, 1, [Define if the metadata helper process is enabled])
695 enable_metadata_helper=yes
696 elif test "x$with_metadata_helper" = xyes; then
697 AC_MSG_ERROR([Metadata helper process explicitly requested, but D-BUS is not enabled])
700 AM_CONDITIONAL(WITH_METADATA_HELPER, test "x$enable_metadata_helper" = "xyes")
706 AC_HELP_STRING([--enable-lirc],[enable lirc support]))
708 if test x"$enable_lirc" != xno; then
709 AC_CHECK_HEADER(lirc/lirc_client.h,[with_lirc=yes],[with_lirc=no])
710 if test x"$with_lirc" = xyes; then
711 AC_CHECK_LIB(lirc_client,lirc_init,[with_lirc=yes],[with_lirc=no])
713 if test x"$with_lirc" = xno -a x"$enable_lirc" = xyes; then
714 AC_MSG_ERROR([lirc explicitly requested but no support found])
717 AM_CONDITIONAL(WITH_LIRC, test x"$with_lirc" = xyes)
720 AC_ARG_ENABLE(uninstalled-build,
721 AC_HELP_STRING([--enable-uninstalled-build],
722 [Search for files in build directory as well]),
723 enable_uninstalled=yes,)
724 if test x"$enable_uninstalled" = xyes; then
725 AC_DEFINE_UNQUOTED(SHARE_UNINSTALLED_DIR,"`pwd`/data",[path to source data dir])
726 AC_DEFINE_UNQUOTED(METADATA_UNINSTALLED_DIR,"`pwd`/metadata",[path to metadata build dir])
729 AC_ARG_WITH(internal-libsexy,
730 AC_HELP_STRING([--with-internal-libsexy],
731 [Build using internal libsexy library]),,
732 with_internal_libsexy=no)
733 if test "x$with_internal_libsexy" = "xno"; then
734 PKG_CHECK_MODULES(LIBSEXY, libsexy >= 0.1.5, with_internal_libsexy=no,
735 with_internal_libsexy=yes)
737 AC_SUBST(LIBSEXY_CFLAGS)
738 AC_SUBST(LIBSEXY_LIBS)
739 AM_CONDITIONAL(WITH_INTERNAL_LIBSEXY, test "x$with_internal_libsexy" = "xyes")
741 dnl warnings bits, copied from gnome-keyring configure.in
742 dnl Turn on the additional warnings last, so -Werror doesn't affect other tests.
744 AC_ARG_ENABLE(more-warnings,
745 [ --enable-more-warnings Maximum compiler warnings],
746 set_more_warnings="$enableval",[
747 if test -d "$srcdir/{arch}" || test -d "$srcdir/CVS" || test -d "$srcdir/_darcs"; then
748 set_more_warnings=yes
753 AC_MSG_CHECKING(for more warnings, including -Werror)
754 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
757 -Wcomment -Wformat -Wnonnull -Wimplicit-int -Wimplicit \
758 -Wmain -Wmissing-braces -Wparentheses -Wsequence-point \
759 -Wreturn-type -Wswitch -Wtrigraphs -Wunused-function \
760 -Wunused-label -Wunused-value \
761 -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
762 -Wnested-externs -Wpointer-arith \
766 if echo "$CFLAGS" | grep -e '-O[1-9]'; then
767 WARN_CFLAGS="-Wuninitialized $WARN_CFLAGS"
770 for option in $WARN_CFLAGS; do
771 SAVE_CFLAGS="$CFLAGS"
772 CFLAGS="$CFLAGS $option"
773 AC_MSG_CHECKING([whether gcc understands $option])
774 AC_TRY_COMPILE([], [],
777 if test x$has_option = xyes; then
778 RHYTHMBOX_CFLAGS="$RHYTHMBOX_CFLAGS $option"
780 AC_MSG_RESULT($has_option)
781 CFLAGS="$SAVE_CFLAGS"
787 SAVE_CFLAGS="$CFLAGS"
788 CFLAGS="$CFLAGS -Wno-error"
789 AC_TRY_COMPILE([], [],
790 WNOERROR_CFLAGS="-Wno-error",
792 AC_SUBST(WNOERROR_CFLAGS)
793 CFLAGS="$SAVE_CFLAGS"
803 dnl Enable gnome-doc-utils
807 dnl ================================================================
809 dnl ================================================================
811 PLUGIN_LIBTOOL_FLAGS="-module -avoid-version"
812 AC_SUBST(PLUGIN_LIBTOOL_FLAGS)
814 AS_AC_EXPAND(PLUGINDIR, ${libdir}/rhythmbox/plugins)
817 dnl ================================================================
819 dnl ================================================================
821 AC_MSG_CHECKING([whether Python support is requested])
822 AC_ARG_ENABLE([python],
823 AS_HELP_STRING([--enable-python],[Enable python support]),
824 [enable_python=$enableval have_python=$enableval],
825 [enable_python=autodetect have_python=yes])
826 AC_MSG_RESULT([$enable_python])
828 if test "x$have_python" != "xno"; then
829 AM_PATH_PYTHON([2.3],[],[no])
830 if test "x$PYTHON" = "x:"; then
835 if test "x$have_python" != "xno"; then
836 PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
837 PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; print sys.exec_prefix'`
838 PYTHON_LIBS="-lpython$PYTHON_VERSION"
839 PYTHON_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config"
840 PYTHON_CFLAGS="-I$PY_PREFIX/include/python$PYTHON_VERSION"
841 PYTHON_MAKEFILE="$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config/Makefile"
842 PYTHON_LOCALMODLIBS=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
843 PYTHON_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
844 PYTHON_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
845 PYTHON_EXTRA_LIBS="$PYTHON_LOCALMODLIBS $PYTHON_BASEMODLIBS $PYTHON_OTHER_LIBS"
846 AC_SUBST([PYTHON_LIBS])
847 AC_SUBST([PYTHON_LIB_LOC])
848 AC_SUBST([PYTHON_CFLAGS])
849 AC_SUBST([PYTHON_EXTRA_LIBS])
851 dnl FIXME: do we really need this test?
852 AC_MSG_CHECKING([whether we can build a shared library depending on libpython])
856 cat > testpython.c <<EOF
858 int testpython (void)
864 if /bin/sh ../libtool --mode=compile ${CC} $PYTHON_CFLAGS -c testpython.c >/dev/null 2>&1 && \
865 /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 && \
866 grep 'dlname.*testpython' testpython.la >/dev/null 2>&1; then
874 AC_MSG_RESULT([$result])
877 if test "x$have_python" != "xno"; then
880 PKG_CHECK_MODULES([PYGTK], [
881 pygtk-2.0 >= $PYGTK_REQUIRED],
884 AC_SUBST([PYGTK_CFLAGS])
885 AC_SUBST([PYGTK_LIBS])
888 if test "x$have_python" != "xno"; then
889 AC_MSG_CHECKING([for pygtk defs])
890 PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
891 AC_MSG_RESULT([$PYGTK_DEFSDIR])
893 AC_MSG_CHECKING([for pygtk codegen])
894 PYGTK_CODEGEN="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/codegen.py"
895 AC_MSG_RESULT([$PYGTK_CODEGEN])
897 AC_MSG_CHECKING([for pygtk h2def])
898 PYGTK_H2DEF="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/h2def.py"
899 AC_MSG_RESULT([$PYGTK_H2DEF])
901 AC_SUBST([PYGTK_DEFSDIR])
902 AC_SUBST([PYGTK_CODEGEN])
903 AC_SUBST([PYGTK_H2DEF])
905 dnl uncomment when http://bugzilla.gnome.org/show_bug.cgi?id=351072 fixed
906 dnl PKG_CHECK_EXISTS([pygobject-2.0 >= X.XX.X],
907 dnl AC_DEFINE([PYGOBJECT_CAN_MARSHAL_GVALUE]))
909 dnl Check for -fno-strict-aliasing
910 FLAGS="-fno-strict-aliasing"
911 save_CFLAGS="$CFLAGS"
912 CFLAGS="$CFLAGS $FLAGS"
913 AC_MSG_CHECKING([whether [$]CC understands $FLAGS])
914 AC_TRY_COMPILE([], [], [compiler_has_option=yes], [compiler_has_option=no])
915 CFLAGS="$save_CFLAGS"
916 AC_MSG_RESULT($compiler_has_option)
917 if test $compiler_has_option = yes; then
918 NO_STRICT_ALIASING_CFLAGS="$FLAGS"
920 AC_SUBST([NO_STRICT_ALIASING_CFLAGS])
923 if test "x$have_python" != "xyes"; then
924 if test "x$enable_python" = "xyes"; then
925 AC_MSG_ERROR([Python support explicity requested, but not found])
926 elif test "x$enable_python" != "xno"; then
928 AC_MSG_WARN([Python not found, disabling python support])
930 elif test "x$enable_python" != "xno"; then
932 AC_DEFINE([ENABLE_PYTHON],[1],[Define to compile with python support])
935 AM_CONDITIONAL([ENABLE_PYTHON],[test "x$enable_python" = "xyes"])
938 dnl check, for unit tests
939 AM_PATH_CHECK([], have_check=yes, have_check=no)
940 AM_CONDITIONAL([HAVE_CHECK],[test "x$have_check" = "xyes"])
943 dnl ================================================================
945 dnl ================================================================
954 widgets/libsexy/Makefile
958 data/rhythmbox.desktop.in
965 plugins/sample/Makefile
966 plugins/audiocd/Makefile
967 plugins/audioscrobbler/Makefile
968 plugins/cd-recorder/Makefile
969 plugins/ipod/Makefile
970 plugins/iradio/Makefile
971 plugins/lirc/Makefile
972 plugins/lyrics/Makefile
973 plugins/sample-python/Makefile
974 plugins/pythonconsole/Makefile
975 plugins/artdisplay/Makefile
976 plugins/artdisplay/artdisplay/Makefile
977 plugins/magnatune/Makefile
978 plugins/magnatune/magnatune/Makefile
979 plugins/generic-player/Makefile
981 plugins/power-manager/Makefile
983 bindings/python/Makefile
988 doc/reference/Makefile
990 backends/gstreamer/Makefile
995 AC_MSG_NOTICE([Rhythmbox was configured with the following options:])
996 if test x"$with_database" = xtree; then
997 AC_MSG_NOTICE([** Tree database is enabled])
998 elif test x"$with_database" = xlibgda; then
999 AC_MSG_NOTICE([** libgda/sqlite database is enabled])
1001 AC_MSG_ERROR([Unknown database!])
1003 if test x"${with_rhythmdb_debug}" != x0; then
1004 AC_MSG_NOTICE([** RhythmDB sanity checking enabled (may be slow!)])
1008 if test x"$enable_tag_writing" != xno; then
1009 AC_MSG_NOTICE([** Tag writing is enabled])
1011 AC_MSG_NOTICE([ Tag writing is disabled])
1013 if test x"$with_track_transfer" = xyes; then
1014 AC_MSG_NOTICE([** Track transfer is enabled])
1016 AC_MSG_NOTICE([ Track transfer is disabled])
1018 if test x"$enable_ipod_writing" != xno; then
1019 AC_MSG_NOTICE([** iPod write support is enabled])
1021 AC_MSG_NOTICE([ iPod write support is disabled])
1023 if test x"$enable_mmkeys" != "xyes"; then
1024 AC_MSG_NOTICE([ Multimedia keys support is disabled])
1026 AC_MSG_NOTICE([** Multimedia keys support is enabled])
1028 if test x"$enable_musicbrainz" != "xyes"; then
1029 AC_MSG_NOTICE([ MusicBrainz support is disabled])
1031 AC_MSG_NOTICE([** MusicBrainz support is enabled])
1034 if test x"$with_playback" = xgstreamer_0_8; then
1035 AC_MSG_NOTICE([** GStreamer 0.8 player is enabled])
1036 elif test x"$with_playback" = xgstreamer_0_10; then
1037 AC_MSG_NOTICE([** GStreamer 0.10 player is enabled])
1039 AC_MSG_ERROR([ Playback engine set incorrectly])
1042 if test x"$use_ipod" = xyes; then
1043 AC_MSG_NOTICE([** iPod integration enabled])
1045 AC_MSG_NOTICE([ iPod integration disabled])
1047 if test x"$with_cd_burning" != xno; then
1048 AC_MSG_NOTICE([** CD burning support enabled])
1050 AC_MSG_NOTICE([ CD burning support disabled])
1052 if test x"$enable_daap" = xyes; then
1053 AC_MSG_NOTICE([** DAAP (music sharing) support is enabled])
1055 AC_MSG_NOTICE([ DAAP (music sharing) support is disabled])
1057 if test x"$have_libnotify" = xyes; then
1058 AC_MSG_NOTICE([** libnotify support is enabled])
1060 AC_MSG_NOTICE([ libnotify support is disabled])
1062 if test x"$enable_hal" = xyes; then
1063 AC_MSG_NOTICE([** HAL support enabled])
1065 AC_MSG_NOTICE([ HAL support disabled])
1067 if test x"$enable_old_dbus" = xyes; then
1068 AC_MSG_NOTICE([** using D-BUS < 0.35 control/activation])
1070 if test x"$enable_python" != xno; then
1071 AC_MSG_NOTICE([** Python support enabled])
1073 AC_MSG_NOTICE([ Python support disabled])
1075 if test x"$use_gnome_keyring" = xyes; then
1076 AC_MSG_NOTICE([** gnome-keyring support enabled])
1078 AC_MSG_NOTICE([ gnome-keyring support disabled])
1080 if test x"$enable_audioscrobbler" != xno; then
1081 AC_MSG_NOTICE([** Audioscrobbler support enabled])
1083 AC_MSG_NOTICE([ Audioscrobbler support disabled])
1085 if test x"$enable_metadata_helper" = xyes; then
1086 AC_MSG_NOTICE([** Separate metadata helper process enabled])
1088 AC_MSG_NOTICE([ Separate metadata helper process disabled])
1090 if test x"$with_internal_libsexy" = xyes; then
1091 AC_MSG_NOTICE([ using internal libsexy])
1093 AC_MSG_NOTICE([** using system-wide libsexy])
1096 AC_MSG_NOTICE([End options])