Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/ekiga/ChangeLog,v
retrieving revision 1.1958
diff -u -p -r1.1958 ChangeLog
--- ChangeLog	9 Jul 2006 12:49:51 -0000	1.1958
+++ ChangeLog	24 Jul 2006 21:59:51 -0000
@@ -1,3 +1,9 @@
+2006-07-24  Marc-Andre Lureau  <marcandre.lureau@gmail.com>
+
+	* src/devices/audio.h, src/devices/audio.cpp, configure.in:
+	Make esound optional (original patch by Benoit Boissinot)
+	Fixes #348564
+
 2006-07-09  Damien Sandras  <dsandras@gnome.org>
 
 	* src/endpoints/manager.cpp:
Index: configure.in
===================================================================
RCS file: /cvs/gnome/ekiga/configure.in,v
retrieving revision 1.374
diff -u -p -r1.374 configure.in
--- configure.in	14 Jun 2006 20:18:25 -0000	1.374
+++ configure.in	24 Jul 2006 21:59:51 -0000
@@ -109,7 +109,7 @@ if test ${enable_gnome} = no; then
 PKG_CHECK_MODULES(EKIGA, gtk+-2.0 >= 2.4.0 gthread-2.0 >= 2.4.0 libxml-2.0 >= 2.5.0)
 EKIGA_CFLAGS="$EKIGA_CFLAGS -DDISABLE_GNOME"
 else
-PKG_CHECK_MODULES(EKIGA, gtk+-2.0 >= 2.4.0 gthread-2.0 >= 2.4.0 esound >= 0.2.28 gconf-2.0 >= 2.2.0 libgnome-2.0 >= 2.14.0 libgnomeui-2.0 >= 2.14.0)
+PKG_CHECK_MODULES(EKIGA, gtk+-2.0 >= 2.4.0 gthread-2.0 >= 2.4.0 gconf-2.0 >= 2.2.0 libgnome-2.0 >= 2.14.0 libgnomeui-2.0 >= 2.14.0)
 PKG_CHECK_MODULES(EDS, libebook-1.2 >= 1.1.3,ebook12=yes,ebook12=no)
 if test x"${ebook12}" = xno ; then
 PKG_CHECK_MODULES(EDS, libebook-1.0 >= 0.0.94)
@@ -190,6 +190,39 @@ esac
 AM_CONDITIONAL(WIN32, test "x${win32}" = "x1")
 
 dnl ###########################################################################
+dnl   Check for Esound and disable-esd
+dnl ###########################################################################
+AC_ARG_ENABLE(esd,
+        [  --disable-esd        Enable Esound support.],,)
+if test "x${enable_esd}" = "x"; then
+  enable_esd=yes
+fi
+
+AC_MSG_CHECKING(whether Esound support must be compiled in)
+if test ${enable_esd} = yes ; then
+   ESD="enabled"
+   AC_MSG_RESULT([yes])
+else
+   ESD="disabled"
+   AC_MSG_RESULT([no])
+fi
+
+if test ${enable_esd} = yes ; then
+   dnl Esound does not work on Win32 yet, so disable it
+	if test ${gm_platform} = "win32" ; then
+	   ESD="disabled"
+	   AC_MSG_WARN([*** Esound cannot be used on Win32.])
+	else
+	   PKG_CHECK_MODULES(ESD, esound >= 0.2.28)
+	   AC_SUBST(ESD_CFLAGS)
+	   AC_SUBST(ESD_LIBS)
+	   EKIGA_CFLAGS="$EKIGA_CFLAGS $ESD_CFLAGS -DHAS_ESD"
+	   EKIGA_LIBS="$EKIGA_LIBS $ESD_LIBS"
+	fi
+fi
+AM_CONDITIONAL(HAS_ESD, test ${enable_esd} = yes)
+
+dnl ###########################################################################
 dnl  Check for library path
 dnl ###########################################################################
 case $host in
@@ -513,8 +546,8 @@ dnl  EKIGA_LIB_CFLAGS
 dnl ###########################################################################
 EKIGA_CFLAGS="$EKIGA_CFLAGS $LDAP_CFLAGS"
 EKIGA_LIB_CFLAGS="$EKIGA_CFLAGS"
-EKIGA_CFLAGS="$EKIGA_CFLAGS $PWLIB_CFLAGS $LDAP_INCLUDES $OPAL_CFLAGS $SDL_CFLAGS $LDAP_CFLAGS $ARCH_OPAL_CFLAGS"
-EKIGA_LIBS="$PWLIB_LIBS $OPAL_LIBS $EKIGA_LIBS $LDAP_LIBS $SDL_LDFLAGS $ARCH_OPAL_LIBS"
+EKIGA_CFLAGS="$EKIGA_CFLAGS $PWLIB_CFLAGS $LDAP_INCLUDES $OPAL_CFLAGS $SDL_CFLAGS $LDAP_CFLAGS $ARCH_OPAL_CFLAGS $ESD_CFLAGS"
+EKIGA_LIBS="$PWLIB_LIBS $OPAL_LIBS $EKIGA_LIBS $LDAP_LIBS $SDL_LDFLAGS $ARCH_OPAL_LIBS $ESD_LIBS"
 
 
 dnl ###########################################################################
@@ -551,7 +584,7 @@ dnl  Data and configuration directories 
 dnl ###########################################################################
 gnomedatadir=`eval "echo ${datadir}"`
 gnomeconfdir=`eval "echo ${sysconfdir}"`
-                                                                                AC_SUBST(gnomedatadir)
+AC_SUBST(gnomedatadir)
 AC_SUBST(gnomeconfdir)
                                                                                         
 dnl ###########################################################################
@@ -594,6 +627,7 @@ echo "              PWLIB Directory is  
 echo "                 ptlib-config is  :  $with_pwlib_dir/bin/ptlib-config"
 echo ""
 echo "          SDL Fullscreen support  :  $HAS_SDL"
+echo "                  Esound support  :  $ESD"
 echo "                    DBUS support  :  $DBUS"
 echo "             mDNS/DNS-SD support  :  $HAS_AVAHI"
 echo ""
Index: src/devices/audio.cpp
===================================================================
RCS file: /cvs/gnome/ekiga/src/devices/audio.cpp,v
retrieving revision 1.15
diff -u -p -r1.15 audio.cpp
--- src/devices/audio.cpp	14 May 2006 20:06:26 -0000	1.15
+++ src/devices/audio.cpp	24 Jul 2006 21:59:52 -0000
@@ -92,6 +92,7 @@ void 
 gnomemeeting_sound_daemons_suspend (void)
 {
 #ifndef DISABLE_GNOME
+#ifdef HAS_ESD
   int esd_client = 0;
   
   /* Put ESD into standby mode */
@@ -104,6 +105,7 @@ gnomemeeting_sound_daemons_suspend (void
   }
   PThread::Current ()->Sleep (300); // FIXME dirty workaround for ESD bug
 #endif
+#endif
 }
 
 
@@ -111,6 +113,7 @@ void 
 gnomemeeting_sound_daemons_resume (void)
 {
 #ifndef DISABLE_GNOME
+#ifdef HAS_ESD
   int esd_client = 0;
 
   /* Put ESD into normal mode */
@@ -121,6 +124,7 @@ gnomemeeting_sound_daemons_resume (void)
     esd_resume (esd_client);
     esd_close (esd_client);
   }
+#endif
 #endif
 }
 
Index: src/devices/audio.h
===================================================================
RCS file: /cvs/gnome/ekiga/src/devices/audio.h,v
retrieving revision 1.5
diff -u -p -r1.5 audio.h
--- src/devices/audio.h	14 May 2006 20:06:26 -0000	1.5
+++ src/devices/audio.h	24 Jul 2006 21:59:52 -0000
@@ -43,7 +43,9 @@
 #include "manager.h"
 
 #ifndef DISABLE_GNOME
+#ifdef HAS_ESD
 #include <esd.h>
+#endif
 #endif
 
 
