File squaroid-0.60.3-config-sound.diff of Package squaroid

--- configure.in
+++ configure.in
@@ -27,21 +27,26 @@
 fi
 
 
+force_sound=no
+AC_ARG_ENABLE(force_sound,
+[  --enable-force_sound    force sfx effects],
+   force_sound=$enableval, force_sound=yes)
+
 sound=yes
 AC_ARG_ENABLE(sound,
-[  --enable-sound         enable sfx effects],
+[  --enable-sound          enable sfx effects],
    sound=$enableval, sound=yes)
 
 AC_MSG_CHECKING(whether to enable sound)
 if test "$sound" != "yes" ; then
 	 CFLAGS="-DSOUND=0 $CFLAGS"
 	 AC_MSG_RESULT(no)
-else if test -z "$sound"; then
+else 
    CFLAGS="-DSOUND=1 $CFLAGS"
 	 LIBS="-lqdwav $LIBS"
 	 LDFLAGS="-L../libqdwav $LDFLAGS"
 	 AC_MSG_RESULT(yes)
-fi fi
+fi
 
 AC_ARG_ENABLE(sfxdev,
 [  --with-sound-device     device for sound output],
@@ -55,13 +60,15 @@
 
 AC_MSG_CHECKING(for sound device $sfxdev)
 if test "$sound" != "yes"; then
-  AC_MSG_RESULT(sound disabled)  
+  AC_MSG_RESULT(sound disabled)
+else if test "$force_sound" = "yes"; then
+        AC_MSG_RESULT(sound forced)
 else if test -w $sfxdev; then
         AC_MSG_RESULT(ok)
 else
 	AC_MSG_RESULT([not found])
 	AC_MSG_ERROR("Cannot find sound device $sfxdev!")
-fi fi
+fi fi fi
 
 
 AC_ARG_ENABLE(debug,
@@ -196,6 +203,9 @@
 echo "Building with Imlib                  : yes (`imlib-config --version`)"
 echo
 echo "Enable SFX effects                   : $sound"
+if test "$force_sound" = "yes"; then
+echo "                                       (forced)"
+fi
 if test "$sound" = "yes"; then
 echo "   using sound device                : $sfxdev"
 fi
openSUSE Build Service is sponsored by