Updated vi.po
[rhythmbox.git] / configure.ac
blob1cd204d8a929c3bcb2a8dd42e83cbfe3601c02b6
1 define(arch-tag)
2 # arch-tag: Toplevel Autoconf configuration script
3 AC_PREREQ(2.53)
4 AC_INIT(shell)
5 AC_CONFIG_MACRO_DIR(macros)
6 AM_CONFIG_HEADER(config.h)
7 AM_INIT_AUTOMAKE(rhythmbox, 0.9.3)
9 AM_MAINTAINER_MODE
11 AC_PROG_INTLTOOL
13 AC_ISC_POSIX
14 AC_PROG_CC
15 AC_STDC_HEADERS
16 AM_PROG_LIBTOOL
17 AC_C_BIGENDIAN
18 AC_CHECK_SIZEOF(long)
19 GTK_REQS=2.5.4
20 GNOME_VFS_REQS=2.7.4
21 NCB_MIN_REQS=2.9.0
22 DBUS_MIN_REQS=0.35
23 TOTEM_PLPARSER_REQS=1.1.5
25 AC_MSG_CHECKING([for GNU extension fwrite_unlocked])
26 AC_LINK_IFELSE(
27 [AC_LANG_PROGRAM([[
28 #define _GNU_SOURCE
29 #include <stdio.h>
30 ]],
31 [[fwrite_unlocked ("foo", 1, sizeof ("foo"), stdout);]])],[have_fwrite_unlocked=yes])
32 if test x"$have_fwrite_unlocked" = xyes; then
33         AC_DEFINE(HAVE_GNU_FWRITE_UNLOCKED,1,[Define if you have GNU fwrite_unlocked])
34         AC_MSG_RESULT([yes])
35 else
36         AC_MSG_RESULT([no])
37 fi      
39 mkdtemp_missing=false
40 AC_CHECK_FUNC(mkdtemp,
41     [AC_DEFINE([HAVE_MKDTEMP], 1, [Have GlibC function to make temp dirs])],
42     mkdtemp_missing=true)
43 AM_CONDITIONAL(MKDTEMP_MISSING, test x$mkdtemp_missing = xtrue)
45 AC_CHECK_LIB(glib-2.0, g_utf8_collate_key_for_filename,
46     [AC_DEFINE([HAVE_COLLATE_KEY_FILENAME], 1, [Have glib function to collate filename sort keys])])
48 PKG_PROG_PKG_CONFIG
50 PKG_CHECK_MODULES(RHYTHMBOX,                            \
51                   gtk+-2.0 >= $GTK_REQS                 \
52                   libgnomeui-2.0                        \
53                   libglade-2.0                          \
54                   gnome-vfs-2.0 >= $GNOME_VFS_REQS      \
55                   gnome-vfs-module-2.0)
57 PKG_CHECK_MODULES(TOTEM_PLPARSER, totem-plparser >= $TOTEM_PLPARSER_REQS, have_totem_plparser=yes, have_totem_plparser=no)
58 if test x$have_totem_plparser != xyes; then
59    AC_MSG_ERROR([totem playlist parsing library not found or too old])
60 fi   
62 AC_ARG_WITH(hal,
63               AC_HELP_STRING([--without-hal],
64                              [Disable HAL support]))
65 if test "x$with_hal" != "xno"; then
66   PKG_CHECK_MODULES(HAL, hal >= 0.5 hal < 0.6, enable_hal05=yes, enable_hal05=no)
67   if test x$enable_hal05 != xyes; then
68      PKG_CHECK_MODULES(HAL, hal >= 0.2.92 hal < 0.5, enable_hal02=yes, enable_hal02=no)
69   fi
70   if test x$enable_hal05 == xyes || test x$enable_hal02 == xyes; then
71       enable_hal=yes
72       if test x$enable_hal05 == xyes; then
73          AC_DEFINE(HAVE_HAL_0_5, 1, [Define if you have HAL 0.5 or later])
74       else
75          AC_DEFINE(HAVE_HAL_0_2, 1, [Define if you have HAL 0.2 or later])
76       fi
77           AC_SUBST(HAL_CFLAGS)
78           AC_SUBST(HAL_LIBS)
79   else
80     if test "x$with_hal" = "xyes"; then
81           AC_MSG_ERROR([HAL support explicitly requested but HAL couldn't be found])
82     fi
83   fi
88 dnl iPod support
90 AC_ARG_WITH(ipod,
91             AC_HELP_STRING([--with-ipod],
92                            [Enable iPod support]),,
93               with_ipod=auto)
94 if test "x$with_ipod" != "xno"; then
96         PKG_CHECK_MODULES(IPOD, libgpod-1.0, have_libgpod=yes, have_libgpod=no)
97         if test "x$have_libgpod" = "xno" -a "x$with_ipod" = "xyes"; then
98           AC_MSG_ERROR([iPod explicitly requested but libgpod couldn't be found])
99         fi
100         if test "x$have_libgpod" = "xyes"; then
101           if test "x$with_hal" = xyes && test "x$enable_hal" = xno; then
102              AC_MSG_ERROR([iPod explicitly requested but HAL not found or too old])        
103           fi
104           if test "x$enable_hal" = xyes; then
105              AC_DEFINE(WITH_IPOD_SUPPORT, 1, [Define if iPod support is enabled])
106              use_ipod=yes
107           fi
108           AC_SUBST(IPOD_CFLAGS)
109           AC_SUBST(IPOD_LIBS)
110         fi
111 fi                        
112 AM_CONDITIONAL(USE_IPOD, test x"$use_ipod" = xyes)
114 dnl Database
115 AC_ARG_WITH(database,
116               AC_HELP_STRING([--with-database=tree|libgda],
117                              [Select the database to use (default tree)]),,
118               with_database=tree)
119 AM_CONDITIONAL(USE_TREEDB, test x"$with_database" = xtree)
120 AM_CONDITIONAL(USE_GDADB, test x"$with_database" = xlibgda)
122 GDA_CFLAGS=""
123 GDA_LIBS=""
124 case "x$with_database" in
125   "xtree")
126     AC_DEFINE(WITH_RHYTHMDB_TREE, 1, [Define if you are using the RhythmDB tree database])
127     ;;
128   "xlibgda")
129     AC_DEFINE(WITH_RHYTHMDB_GDA, 1, [Define if you are using the RhythmDB sqlite/libgda database])
130     dnl FIXME: check for sqlite, too?
131     PKG_CHECK_MODULES(GDA, libgda > 1.0.3)
132     ;;
133   *)
134     AC_MSG_ERROR([Unknown database selected])
135     ;;
136 esac
137 AC_SUBST(GDA_CFLAGS)
138 AC_SUBST(GDA_LIBS)
140 dnl Database debugging
141 AC_ARG_WITH(rhythmdb-debug,
142               AC_HELP_STRING([--with-rhythmdb-debug=0|1|2],
143                              [Level of RhythmDB sanity checking]),,with_rhythmdb_debug=0)
144 if test x"${with_rhythmdb_debug}" != x0; then
145    AC_DEFINE_UNQUOTED([RHYTHMDB_ENABLE_SANITY_CHECK], "${with_rhythmdb_debug}", [Define to the level of RhythmDB sanity checking])
148 dnl Sound system
149 dnl Now we're ready to ask for gstreamer libs and cflags
150 dnl And we can also ask for the right version of gstreamer
151 HAVE_SOUNDSYSTEM=no
153 GST_0_8_MAJORMINOR=0.8
154 GST_0_8_REQUIRED_VERSION=0.8.2
155 PKG_CHECK_MODULES(GSTREAMER_0_8, \
156         gstreamer-$GST_0_8_MAJORMINOR >= $GST_0_8_REQUIRED_VERSION gstreamer-libs-$GST_0_8_MAJORMINOR >= $GST_0_8_REQUIRED_VERSION
157         gstreamer-control-$GST_0_8_MAJORMINOR >= $GST_0_8_REQUIRED_VERSION
158         gstreamer-gconf-$GST_0_8_MAJORMINOR >= $GST_0_8_REQUIRED_VERSION,
159         have_gstreamer_0_8=yes,have_gstreamer_0_8=no)
160         
161 GST_0_10_MAJORMINOR=0.10
162 GST_0_10_REQUIRED_VERSION=0.9.7
163 PKG_CHECK_MODULES(GSTREAMER_0_10, \
164         gstreamer-$GST_0_10_MAJORMINOR >= $GST_0_10_REQUIRED_VERSION
165         gstreamer-base-$GST_0_10_MAJORMINOR >= $GST_0_10_REQUIRED_VERSION
166         gstreamer-plugins-base-$GST_0_10_MAJORMINOR >= $GST_0_10_REQUIRED_VERSION,
167         have_gstreamer_0_10=yes,have_gstreamer_0_10=no)
169 AC_ARG_WITH(playback,
170    AC_HELP_STRING([--with-playback=auto|gstreamer-0-8|gstreamer-0-10],
171    [Select the playback backend to use (default auto)]),,
172    with_playback=auto)
174 if test x$with_playback = xauto -o x$with_playback = xgstreamer-0-10; then
175         if test x"$have_gstreamer_0_10" = xyes; then
176                 with_playback=gstreamer_0_10
177                 SOUNDSYSTEM_DEPS="gstreamer-$GST_0_10_MAJORMINOR"
178                 AC_DEFINE(HAVE_GSTREAMER,1,[Define if you want to use the GStreamer media framework])
179                 AC_DEFINE(HAVE_GSTREAMER_0_10,1,[Define if you want to use the GStreamer 0.10])
180                 SOUNDSYSTEM_CFLAGS="$GSTREAMER_0_10_CFLAGS"
181                 SOUNDSYSTEM_LIBS="$GSTREAMER_0_10_LIBS"
182         elif test x$with_playback = xgstreamer-0-10; then
183                 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])
184         fi
186 if test x$with_playback = xauto -o x$with_playback = xgstreamer-0-8; then
187         if test x"$have_gstreamer_0_8" = xyes; then
188                 with_playback=gstreamer_0_8
189                 SOUNDSYSTEM_DEPS="gstreamer-$GST_0_8_MAJORMINOR"
190                 AC_DEFINE(HAVE_GSTREAMER,1,[Define if you want to use the GStreamer media framework])
191                 AC_DEFINE(HAVE_GSTREAMER_0_8,1,[Define if you want to use the GStreamer 0.8])
192                 SOUNDSYSTEM_CFLAGS="$GSTREAMER_0_8_CFLAGS"
193                 SOUNDSYSTEM_LIBS="$GSTREAMER_0_8_LIBS"
194         elif test x$with_playback = xgstreamer-0-8; then
195                 AC_MSG_ERROR([GStreamer 0.8 explicity requested, and it was not found or older than version $GST_REQUIRED_VERSION])
196         fi
198 AM_CONDITIONAL(USE_GSTREAMER_0_10, test x"$with_playback" = xgstreamer_0_10)
199 AM_CONDITIONAL(USE_GSTREAMER_0_8, test x"$with_playback" = xgstreamer_0_8)
201 dnl Give error and exit if we don't have gstreamer
202 if test x$with_playback = xauto; then
203                 AC_MSG_ERROR([GStreamer not found, or older than version $GST_0_8_REQUIRED_VERSION/$GST_0_10_REQUIRED_VERSION])
206 AC_SUBST(SOUNDSYSTEM_DEPS)
207 RHYTHMBOX_CFLAGS="$RHYTHMBOX_CFLAGS $SOUNDSYSTEM_CFLAGS"
208 RHYTHMBOX_LIBS="$RHYTHMBOX_LIBS $SOUNDSYSTEM_LIBS"
211 dnl Tag writing
212 AC_ARG_ENABLE(tag-writing,
213               AC_HELP_STRING([--enable-tag-writing],
214                              [Enable tag writing support in rhythmbox **EXPERIMENTAL**]))
215 if test x"$enable_tag_writing" = xyes; then
216    AC_MSG_WARN([Tag writing support is experimental, and may corrupt files, use at your own risk])
217    AC_DEFINE(ENABLE_TAG_WRITING, 1, [Define if tag writing should be enabled])
221 dnl Audioscrobbler
222 AC_ARG_ENABLE(audioscrobbler,
223               AC_HELP_STRING([--disable-audioscrobbler],
224                              [Disable Audioscrobbler support in Rhythmbox]))
226 dnl DAAP (iTunes Music Shares)
227 AC_ARG_ENABLE(daap,
228               AC_HELP_STRING([--enable-daap],
229                              [Enable Digital Audio Access Protocol (music sharing) in rhythmbox **EXPERIMENTAL**]))
231 AC_ARG_WITH(mdns,
232    AC_HELP_STRING([--with-mdns=auto|howl|avahi],
233    [Select the mDNS/DNS-SD implementation to use (default auto)]),,
234    with_mdns=auto)
236 have_howl=no
237 have_avahi=no
238 have_mdns=no
239 use_howl=no
240 use_avahi=no
242 PKG_CHECK_MODULES(AVAHI,
243    avahi-client >= 0.6
244    avahi-glib >= 0.6,
245    have_avahi_06=yes,
246    have_avahi_06=no)
247 if test x$have_avahi_06 != xyes; then
248    PKG_CHECK_MODULES(AVAHI,
249       avahi-client >= 0.5
250       avahi-glib >= 0.5,
251       have_avahi_05=yes,
252       have_avahi_05=no)
254 if test x$have_avahi_06 == xyes || test x$have_avahi_05 == xyes; then
255    have_avahi=yes
256 else
257    have_avahi=no
260 PKG_CHECK_MODULES(HOWL,
261    howl,
262    have_howl=yes,
263    have_howl=no)
265 if test x"$with_mdns" = xauto; then
266    if test x"$have_avahi" = xyes; then
267       MDNS_CFLAGS=$AVAHI_CFLAGS
268       MDNS_LIBS=$AVAHI_LIBS
269       AC_DEFINE(WITH_AVAHI, 1, [Define if mDNS/DNS-SD implementation uses Avahi])
270       use_avahi=yes
271       AC_MSG_NOTICE([Detected Avahi, using it for mDNS/DNS-SD])
272       if test x$have_avahi_06 == xyes; then
273          AC_DEFINE(HAVE_AVAHI_0_6, 1, [Define if mDNS/DNS-SD implementation uses Avahi 0.6])
274       else
275          AC_DEFINE(HAVE_AVAHI_0_5, 1, [Define if mDNS/DNS-SD implementation uses Avahi 0.5])
276       fi
278       have_mdns=yes
279    elif test x"$have_howl" = xyes; then
280       MDNS_CFLAGS=$HOWL_CFLAGS
281       MDNS_LIBS=$HOWL_LIBS
282       AC_DEFINE(WITH_HOWL, 1, [Define if mDNS/DNS-SD implementation uses Howl])
283       use_howl=yes
284       AC_MSG_NOTICE([Detected Howl, using it for mDNS/DNS-SD])
286       have_mdns=yes
287    fi
290 if test x"$with_mdns" = xhowl; then
291    if test x"$have_howl" = xno; then
292       AC_MSG_ERROR([Howl explicitly requested but not found.  Install Howl or try --with-mdns=avahi])
293    fi
295    MDNS_CFLAGS=$HOWL_CFLAGS
296    MDNS_LIBS=$HOWL_LIBS
297    AC_DEFINE(WITH_HOWL, 1, [Define if mDNS/DNS-SD implementation uses Howl])
298    use_howl=yes
299    AC_MSG_NOTICE([Using Howl for mDNS/DNS-SD])
300    have_mdns=yes
303 if test x"$with_mdns" = xavahi; then
304    if test x"$have_avahi" = xno; then
305       AC_MSG_ERROR([Avahi explicitly requested but not found.  Install Avahi or try --with-mdns=howl])
306    fi
308    MDNS_CFLAGS=$AVAHI_CFLAGS
309    MDNS_LIBS=$AVAHI_LIBS
310    AC_DEFINE(WITH_AVAHI, 1, [Define if mDNS/DNS-SD implementation uses Avahi])
311    use_avahi=yes
312    AC_MSG_NOTICE([Using Avahi for mDNS/DNS-SD])
314    if test x$have_avahi_06 == xyes; then
315       AC_DEFINE(HAVE_AVAHI_0_6, 1, [Define if mDNS/DNS-SD implementation uses Avahi 0.6])
316    else
317       AC_DEFINE(HAVE_AVAHI_0_5, 1, [Define if mDNS/DNS-SD implementation uses Avahi 0.5])
318    fi
320    have_mdns=yes
323 AM_CONDITIONAL(USE_HOWL, test "x$use_howl" = "xyes")
324 AM_CONDITIONAL(USE_AVAHI, test "x$use_avahi" = "xyes")
326 LIBNOTIFY_REQUIRED=0.2.2
327 AC_ARG_ENABLE(libnotify,
328             AC_HELP_STRING([--disable-libnotify],
329                            [Disable libnotify support]),,
330               enable_libnotify=auto)
331 if test "x$enable_libnotify" != "xno"; then
332         PKG_CHECK_MODULES(NOTIFY,                            \
333                           libnotify >= $LIBNOTIFY_REQUIRED,
334                           have_libnotify=yes,
335                           have_libnotify=no)
336         if test "x$have_libnotify" = "xno" -a "x$enable_libnotify" = "xyes"; then
337           AC_MSG_ERROR([libnotify support explicitly requested, but libnotify couldn't be found])
338         fi
339         if test "x$have_libnotify" = "xyes"; then
340              enable_libnotify=yes
341         fi
342 fi                        
343 AM_CONDITIONAL(USE_NOTIFY, test x"$enable_libnotify" = xyes)
344 if test x$enable_libnotify = xyes ; then
345     # Find out the version of LIBNOTIFY we're using
346     libnotify_version=`pkg-config --modversion libnotify`
347     LIBNOTIFY_VERSION_MAJOR=`echo $libnotify_version | awk -F. '{print $1}'`
348     LIBNOTIFY_VERSION_MINOR=`echo $libnotify_version | awk -F. '{print $2}'`
349     LIBNOTIFY_VERSION_MICRO=`echo $libnotify_version | awk -F. '{print $3}'`
350     if test "z$LIBNOTIFY_VERSION_MAJOR" = "z"; then
351         LIBNOTIFY_VERSION_MAJOR="0"
352     fi
353     if test "z$LIBNOTIFY_VERSION_MINOR" = "z"; then
354         LIBNOTIFY_VERSION_MINOR="0"
355     fi
356     if test "z$LIBNOTIFY_VERSION_MICRO" = "z"; then
357         LIBNOTIFY_VERSION_MICRO="0"
358     fi
359     echo "Your libnotify version is $LIBNOTIFY_VERSION_MAJOR,$LIBNOTIFY_VERSION_MINOR,$LIBNOTIFY_VERSION_MICRO."
360     NOTIFY_CFLAGS="$NOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MAJOR=$LIBNOTIFY_VERSION_MAJOR"
361     NOTIFY_CFLAGS="$NOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MINOR=$LIBNOTIFY_VERSION_MINOR"
362     NOTIFY_CFLAGS="$NOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MICRO=$LIBNOTIFY_VERSION_MICRO"
364     AC_DEFINE(HAVE_NOTIFY, 1, [Define if libnotify support is enabled])
365     AC_SUBST(NOTIFY_CFLAGS)
366     AC_SUBST(NOTIFY_LIBS)
369 dnl Check for libsoup, needed for DAAP and audioscrobbler
370 if test "x$enable_daap" = "xyes" || test "x$enable_audioscrobbler" != "xno"; then
371         dnl We want libsoup now
372         PKG_CHECK_MODULES(SOUP,                            \
373                 libsoup-2.2,
374                 have_libsoup=yes,
375                 have_libsoup=no)
376         if test x"$have_libsoup" = "xno"; then
377                 PKG_CHECK_MODULES(SOUP,
378                         libsoup-2.4,
379                         have_libsoup=yes,
380                         have_libsoup=no)
381         fi
383 AM_CONDITIONAL(USE_LIBSOUP, test x"$have_libsoup" = "xyes")
386 dnl audioscrobbler support
387 if test "x$enable_audioscrobbler" != "xno"; then
388         if test x"$have_libsoup" = "xno"; then
389                 if test "x$enable_audioscrobbler" = "xyes"; then
390                         AC_MSG_ERROR([AudioScrobbler support explicitly requested, but no libsoup found.  Install libsoup])
391                 fi
392                 enable_audioscrobbler=no
393         else
394                 AC_DEFINE(WITH_AUDIOSCROBBLER, 1, [define if Audioscrobbler support should be enabled])
395         fi
397 AM_CONDITIONAL(WITH_AUDIOSCROBBLER, test "x$enable_audioscrobbler" != "xno")
400 dnl daap support
401 if test "x$enable_daap" != "xno"; then
402         if test x"$have_libsoup" = "xno"; then
403                 if test "x$enable_daap" = "xyes"; then
404                         AC_MSG_ERROR([DAAP support explicitly requested, but no libsoup found.  Install libsoup])
405                 fi
406                 enable_daap=no
407         elif test x"$have_mdns" = xno; then
408                 if test "x$enable_daap" = "xyes"; then
409                         AC_MSG_ERROR([DAAP support explicitly requested, but no mDNS implentation found.  Install Howl or Avahi])
410                 fi
411                 enable_daap=no
412         else
413                 AC_DEFINE(WITH_DAAP_SUPPORT, 1, [Define if DAAP should be enabled])
414                 enable_daap="yes"
415                 AC_SUBST(MDNS_CFLAGS)
416                 AC_SUBST(MDNS_LIBS)
417         fi
419 AM_CONDITIONAL(USE_DAAP, test "x$enable_daap" != "xno")
421 AC_CHECK_LIB(z, uncompress)
425 dnl check for MusicBrainz
426 AC_ARG_ENABLE(musicbrainz, AC_HELP_STRING([--disable-musicbrainz],
427                                 [don't build with MusicBrainz support]))
428 if test x"$enable_musicbrainz" != "xno"; then
429         PKG_CHECK_MODULES(MUSICBRAINZ, libmusicbrainz >= 2.1.0, enable_musicbrainz=yes,
430                           enable_musicbrainz=no)
432 if test x"$enable_musicbrainz" = xyes; then
433         RHYTHMBOX_CFLAGS="$RHYTHMBOX_CFLAGS $MUSICBRAINZ_CFLAGS"
434         RHYTHMBOX_LIBS="$RHYTHMBOX_LIBS $MUSICBRAINZ_LIBS"
435         AC_DEFINE(HAVE_MUSICBRAINZ, 1, [define if you have Musicbrainz])
437 AM_CONDITIONAL(HAVE_MUSICBRAINZ, test "x$enable_musicbrainz" = "xyes")
441 AC_PATH_X
443 if test x"$x_includes" != x"NONE" && test -n "$x_includes" ; then
444         CFLAGS=$CFLAGS -I`echo $x_includes | sed -e "s/:/ -I/g"`
446 if test x"$x_libraries" != x"NONE" && test -n "$x_libraries" ; then
447         LIBS=-L`echo $x_libraries | sed -e "s/:/ -L/g"`
450 have_xidle=no
451 AC_COMPILE_IFELSE([
452         #include <X11/extensions/xidle.h>
453 int main(int argc,char **argv) {
454   return 0;
456 ], have_xidle=yes)
457 AC_MSG_CHECKING(for XIDLE extension)
458 AC_MSG_RESULT($have_xidle)
459 if test x"$have_xidle" = "xyes" ; then
460         AC_DEFINE(HAVE_XIDLE_EXTENSION, 1, [defined if you have X11/extensions/xidle.h])
463 dnl Multimedia keys
464 have_xfree=no
465 AC_COMPILE_IFELSE([
466         #include <X11/XF86keysym.h>
467 int main(int argc,char **argv) {
468   return 0;
470 ], have_xfree=yes)
471 AC_MSG_CHECKING(for XFree86 headers)
472 AC_MSG_RESULT($have_xfree)
473 if test x"$have_xfree" = "xyes" ; then
474         AC_DEFINE(HAVE_XFREE, 1, [defined if you have X11/XF86keysym.h])
477 AC_ARG_ENABLE(mmkeys, AC_HELP_STRING([--disable-mmkeys],
478                                         [don't build with Multimedia Keys support]))
479 if test x"$have_xfree" = xyes; then
480         if test x"$enable_mmkeys" != xno; then
481                 enable_mmkeys=yes
482                 AC_DEFINE(HAVE_MMKEYS, 1, [define if Multimedia Keys are enabled])
483         fi
484 else
485         if test x"$enable_mmkeys" = xyes; then
486                 AC_MSG_ERROR([Multimedia keys explicitly requested but no support found])
487         fi
490 dnl CD Audio support              
491 AC_DEFINE(WITH_AUDIOCD_SUPPORT, 1, [Define if audio cd support is enabled])
492 AC_CHECK_HEADER(linux/cdrom.h,[enable_linux_cdrom=yes],)
493 if test "x$enable_linux_cdrom" = "xyes"; then
494   AC_MSG_CHECKING([whether linux/cdrom.h actually works])
495   AC_COMPILE_IFELSE([
496 #include <stdlib.h>    
497 #include <sys/ioctl.h>    
498 #include <linux/cdrom.h>
499 int main(int argc,char **argv) {
500   ioctl (0, CDROM_GET_CAPABILITY, 0);
501   ioctl (0, CDROM_DRIVE_STATUS, CDSL_CURRENT);  
502   ioctl (0, CDROMREADTOCHDR, NULL);
503   exit(0);
504 }], [enable_linux_cdrom=yes],[enable_linux_cdrom=no])
505   if test "x$enable_linux_cdrom" = "xyes"; then
506     AC_MSG_RESULT([yes])
507     enable_audiocd=yes
508   else
509     AC_MSG_FAILURE([linux/cdrom.h is damaged; fix your system or use --disable-audiocd])
510   fi
512 AM_CONDITIONAL(HAVE_LINUX_CDROM, test "x$enable_linux_cdrom" = "xyes")
514 NCB_DRIVE_DOOR_VERSION=2.11.3
515 dnl CD burner support
516 PKG_CHECK_MODULES(LIBNAUTILUS_BURN, [libnautilus-burn >= $NCB_MIN_REQS], have_cd_burner=yes, have_cd_burner=no)
517 if test "x$have_cd_burner" = xno; then
518    AC_MSG_ERROR([libnautilus-burn not found or too cold])          
520 AC_CHECK_LIB(nautilus-burn, nautilus_burn_drive_door_is_open,
521     [AC_DEFINE([HAVE_BURN_DRIVE_DOOR], 1, [Have nautilus-burn function to check drive door state])],
522     ,[$LIBNAUTILUS_BURN_LIBS $LIBNAUTILUS_BURN_CFLAGS])
523 AC_CHECK_LIB(nautilus-burn, nautilus_burn_drive_unref,
524     [AC_DEFINE([HAVE_BURN_DRIVE_UNREF], 1, [Have nautilus-burn 2.13 drive unref function])],
525     ,[$LIBNAUTILUS_BURN_LIBS $LIBNAUTILUS_BURN_CFLAGS])
527 AC_SUBST(CFLAGS)
528 AC_SUBST(LDFLAGS)
530 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
531 AC_PATH_PROG(GCONFTOOL, gconftool-2)
533 AC_SUBST(RHYTHMBOX_CFLAGS)
534 AC_SUBST(RHYTHMBOX_LIBS)
536 ALL_LINGUAS="am ar az be bg ca cs cy da de el en_CA en_GB es et eu fi fr ga gl he hr hu id is it ja ko lt lv mk ml mn ms nb ne nl no pa pl pt pt_BR ro ru rw sk sr sr@Latn sv th tr uk vi zh_CN zh_TW"
538 GETTEXT_PACKAGE=rhythmbox
539 AC_SUBST(GETTEXT_PACKAGE)
540 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Define to the Gettext package name])
542 AM_GLIB_GNU_GETTEXT
544 dnl Workaround for automake 1.8
545 AC_SUBST(mkdir_p) if test x"$mkdir_p" = "x"; then
546   MKINSTALLDIRS="mkinstalldirs"
548 AC_SUBST(MKINSTALLDIRS)
550 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
552 AS_AC_EXPAND(DATADIR, $datadir)
554 AC_MSG_CHECKING([for D-BUS])
555 AC_ARG_WITH(dbus,
556             AC_HELP_STRING([--with-dbus],
557                            [Enable D-BUS support]),,
558               with_dbus=auto)
559 if test "x$with_dbus" != "xno"; then
560         PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= $DBUS_MIN_REQS, enable_dbus=yes, enable_dbus=no)
561         if test "x$with_dbus" = xyes && test "x$enable_dbus" = xno; then
562            AC_MSG_ERROR([D-BUS explicitly requested but no support found])         
563         fi
564         if test "x$enable_dbus" = xyes; then
565                 AC_DEFINE(WITH_DBUS, 1, [Define if D-BUS is enabled])      
566                 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_API_SUBJECT_TO_CHANGE"
567                 AC_MSG_RESULT([we're getting on D-BUS])
569                 DBUS_GLIB_BIN="`$PKG_CONFIG --variable=exec_prefix dbus-glib-1`/bin"
570                 AC_SUBST(DBUS_GLIB_BIN)
571         else
572                 AC_MSG_RESULT([not found])
573         fi
575 fi                        
576 AM_CONDITIONAL(WITH_DBUS, test "x$enable_dbus" = "xyes")
578 AC_MSG_CHECKING([for Bonobo])
579 AC_ARG_WITH(bonobo,
580             AC_HELP_STRING([--with-bonobo],
581                            [Enable bonobo support]),,
582               with_bonobo=auto)
583 if test "x$with_bonobo" != "xno"; then
584         PKG_CHECK_MODULES(BONOBO, libbonobo-2.0 >= 2.0.0, enable_bonobo=yes,
585                           enable_bonobo=no)
586         if test "x$with_bonobo" = xyes && test "x$enable_bonobo" = xno; then
587            AC_MSG_ERROR([Bonobo explicitly requested but no support found])        
588         fi
589         if test "x$enable_bonobo" = xyes; then
590                 AC_DEFINE(WITH_BONOBO, 1, [Define if Bonobo is enabled])           
591                 ORBIT_IDL="`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`"
592                 AC_SUBST(ORBIT_IDL)
594                 LIBBONOBO_IDL="`$PKG_CONFIG --variable=idldir libbonobo-2.0`"
595                 AC_SUBST(LIBBONOBO_IDL)
597                 BONOBO_ACTIVATION_IDL="`$PKG_CONFIG --variable=idldir bonobo-activation-2.0`"
598                 AC_SUBST(BONOBO_ACTIVATION_IDL)
599                 AC_MSG_RESULT([found])
600         else
601                 AC_MSG_RESULT([not found])
602         fi
603         
604 fi                        
605 AM_CONDITIONAL(WITH_BONOBO, test "x$enable_bonobo" = "xyes")
606               
607 AM_GCONF_SOURCE_2
609 AC_ARG_ENABLE(uninstalled-build,
610               AC_HELP_STRING([--enable-uninstalled-build],
611                              [Search for files in build directory as well]),
612               enable_uninstalled=yes,)
613 if test x"$enable_uninstalled" = xyes; then
614         AC_DEFINE_UNQUOTED(SHARE_UNINSTALLED_DIR,"`pwd`/data",[path to source data dir])
617 dnl warnings bits, copied from gnome-keyring configure.in
618 dnl Turn on the additional warnings last, so -Werror doesn't affect other tests.
620 AC_ARG_ENABLE(more-warnings,
621 [  --enable-more-warnings  Maximum compiler warnings],
622 set_more_warnings="$enableval",[
623 if test -d "$srcdir/{arch}" || test -d "$srcdir/CVS"; then
624         set_more_warnings=yes
625 else
626         set_more_warnings=no
629 AC_MSG_CHECKING(for more warnings, including -Werror)
630 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
631         AC_MSG_RESULT(yes)
632         WARN_CFLAGS="\
633         -Wcomment -Wformat -Wnonnull -Wimplicit-int -Wimplicit \
634         -Wmain -Wmissing-braces -Wparentheses -Wsequence-point \
635         -Wreturn-type -Wswitch -Wtrigraphs -Wunused-function \
636         -Wunused-label -Wunused-value \
637         -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
638         -Wnested-externs -Wpointer-arith \
639         -Wcast-align -Wall \
640         -Werror -std=gnu89"
642         if echo "$CFLAGS" | grep -e '-O[1-9]'; then
643            WARN_CFLAGS="-Wuninitialized $WARN_CFLAGS"
644         fi
646         for option in $WARN_CFLAGS; do
647                 SAVE_CFLAGS="$CFLAGS"
648                 CFLAGS="$CFLAGS $option"
649                 AC_MSG_CHECKING([whether gcc understands $option])
650                 AC_TRY_COMPILE([], [],
651                         has_option=yes,
652                         has_option=no,)
653                 if test $has_option = no; then
654                         CFLAGS="$SAVE_CFLAGS"
655                 fi
656                 AC_MSG_RESULT($has_option)
657                 unset has_option
658                 unset SAVE_CFLAGS
659         done
660         unset option
661 else
662         AC_MSG_RESULT(no)
665 dnl Enable gtk-doc
666 GTK_DOC_CHECK(1.4)
668 AC_OUTPUT([ 
669 Makefile
670 macros/Makefile
671 lib/Makefile
672 metadata/Makefile
673 player/Makefile
674 rhythmdb/Makefile
675 widgets/Makefile
676 iradio/Makefile
677 podcast/Makefile
678 remote/Makefile
679 remote/bonobo/Makefile
680 remote/dbus/Makefile
681 shell/Makefile
682 data/Makefile
683 data/ui/Makefile
684 data/art/Makefile
685 data/glade/Makefile
686 data/rhythmbox.pc
687 sources/Makefile
688 daapsharing/Makefile
689 help/Makefile
690 help/C/Makefile
691 help/ja/Makefile
692 po/Makefile.in
693 tests/Makefile
694 doc/Makefile
695 doc/reference/Makefile
698 AC_MSG_NOTICE([Rhythmbox was configured with the following options:])
699 if test x"$with_database" = xtree; then
700         AC_MSG_NOTICE([** Tree database is enabled])
701 elif test x"$with_database" = xlibgda; then
702         AC_MSG_NOTICE([** libgda/sqlite database is enabled])
703 else
704         AC_MSG_ERROR([Unknown database!])
706 if test x"${with_rhythmdb_debug}" != x0; then
707         AC_MSG_NOTICE([** RhythmDB sanity checking enabled (may be slow!)])
711 if test x"$enable_tag_writing" = xyes; then
712         AC_MSG_NOTICE([** Tag writing is enabled - USE AT YOUR OWN RISK])
713 else
714         AC_MSG_NOTICE([   Tag writing is disabled])
716 if test x"$enable_mmkeys" != "xyes"; then
717         AC_MSG_NOTICE([   Multimedia keys support is disabled])
718 else
719         AC_MSG_NOTICE([** Multimedia keys support is enabled])
721 if test x"$enable_musicbrainz" != "xyes"; then
722         AC_MSG_NOTICE([   MusicBrainz support is disabled])
723 else
724         AC_MSG_NOTICE([** MusicBrainz support is enabled])
727 if test x"$with_playback" = xgstreamer_0_8; then
728         AC_MSG_NOTICE([** GStreamer 0.8 player is enabled])
729 elif test x"$with_playback" = xgstreamer_0_10; then
730         AC_MSG_NOTICE([** GStreamer 0.10 player is enabled])
731 else
732         AC_MSG_ERROR([   Playback engine set incorrectly])
735 if test x"$use_ipod" = xyes; then
736         AC_MSG_NOTICE([** iPod integration enabled])
737 else
738         AC_MSG_NOTICE([   iPod integration disabled])
740 if test x"$enable_daap" = xyes; then
741         AC_MSG_NOTICE([** DAAP (music sharing) support is enabled])
742 else
743         AC_MSG_NOTICE([   DAAP (music sharing) support is disabled])
745 if test x"$have_libnotify" = xyes; then
746         AC_MSG_NOTICE([** libnotify support is enabled])
747 else
748         AC_MSG_NOTICE([   libnotify support is disabled])
750 if test x"$enable_bonobo" = xyes; then
751         AC_MSG_NOTICE([** Bonobo control/activation enabled])
752 else
753         AC_MSG_NOTICE([   Bonobo control/activation disabled])
755 if test x"$enable_hal" = xyes; then
756         AC_MSG_NOTICE([** HAL support enabled])
757 else
758         AC_MSG_NOTICE([   HAL support disabled])
760 if test x"$enable_dbus" = xyes; then
761         AC_MSG_NOTICE([** D-BUS control/activation enabled])
762 else
763         AC_MSG_NOTICE([   D-BUS control/activation disabled])
765 if test x"$enable_audioscrobbler" != xno; then
766         AC_MSG_NOTICE([** Audioscrobbler support enabled])
767 else
768         AC_MSG_NOTICE([   Audioscrobbler support disabled])
771 AC_MSG_NOTICE([End options])