Commits

basicer committed 01bfbec

- Fixed --disable-mpg123
- Added --disable-vorbis
- Added --disable-modplug

  • Participants
  • Parent commits 2a2a4b9

Comments (0)

Files changed (8)

File platform/unix/configure.ac

 AC_SEARCH_LIBS([ilInit], [IL], [], AC_MSG_ERROR([Can't LÖVE without DevIL]))
 AC_SEARCH_LIBS([FT_Load_Glyph], [freetype], [], AC_MSG_ERROR([Can't LÖVE without FreeType]))
 AC_SEARCH_LIBS([PHYSFS_init], [physfs], [], AC_MSG_ERROR([Can't LÖVE without PhysicsFS]))
-AC_SEARCH_LIBS([ModPlug_Load], [modplug], [], AC_MSG_ERROR([Can't LÖVE without ModPlug]))
-AC_SEARCH_LIBS([ov_open], [vorbisfile], [], AC_MSG_ERROR([Can't LÖVE without VorbisFile]))
+
+
+AC_ARG_ENABLE([modplug], AC_HELP_STRING([--disable-modplug], [Disable ModPlug support, if you don't like trackers.]), [], [enable_modplug=yes])
+AS_IF([test "x$enable_modplug" != xno],
+	AC_SEARCH_LIBS([ModPlug_Load], [modplug], [], AC_MSG_ERROR([Can't LÖVE without ModPlug])),
+	AC_DEFINE([LOVE_NOMODPLUG], [], [Build without modplug]))
+
+
+AC_ARG_ENABLE([vorbis], AC_HELP_STRING([--disable-vorbis], [Disable OGG Vorbis support.]), [], [enable_vorbis=yes])
+AS_IF([test "x$enable_vorbis" != xno],
+	AC_SEARCH_LIBS([ov_open], [vorbisfile], [], AC_MSG_ERROR([Can't LÖVE without VorbisFile])),
+	AC_DEFINE([LOVE_NOVORBIS], [], [Build without modplug]))
+
 
 AC_ARG_ENABLE([mpg123], AC_HELP_STRING([--disable-mpg123], [Disable mp3 support, for patent-free builds]), [], [enable_mpg123=yes])
 AS_IF([test "x$enable_mpg123" != xno],

File src/modules/sound/lullaby/ModPlugDecoder.cpp

  *    misrepresented as being the original software.
  * 3. This notice may not be removed or altered from any source distribution.
  **/
+
+
 #include "common/config.h"
 #include "ModPlugDecoder.h"
 
 #include "common/Exception.h"
+#ifndef LOVE_NOMODPLUG
 
 namespace love
 {
 } // lullaby
 } // sound
 } // love
+
+#endif // LOVE_NOMODPLUG

File src/modules/sound/lullaby/ModPlugDecoder.h

 #include "common/Data.h"
 #include "Decoder.h"
 
+#ifndef LOVE_NOMODPLUG
+
 // SDL_sound
 #include <libmodplug/modplug.h>
 
 } // sound
 } // love
 
+#endif // LOVE_NOMODPLUG
 #endif // LOVE_SOUND_LULLABY_MODPLUG_DECODER_H

File src/modules/sound/lullaby/Mpg123Decoder.cpp

  * 3. This notice may not be removed or altered from any source distribution.
  **/
 
-#ifndef LOVE_NOMPG123
 
 #include "Mpg123Decoder.h"
 
 #include "common/Exception.h"
 
+#ifndef LOVE_NOMPG123
 #include <iostream>
 
 namespace love

File src/modules/sound/lullaby/Mpg123Decoder.h

  * 3. This notice may not be removed or altered from any source distribution.
  **/
 
-#ifndef LOVE_NOMPG123
 #ifndef LOVE_SOUND_LULLABY_LIBMPG123_DECODER_H
 #define LOVE_SOUND_LULLABY_LIBMPG123_DECODER_H
 
 #include "common/Data.h"
 #include "Decoder.h"
 
+#ifndef LOVE_NOMPG123
 // libmpg123
 #ifdef LOVE_MACOSX
 #include <mpg123/mpg123.h>
 } // sound
 } // love
 
+#endif // LOVE_NOMPG123
 #endif // LOVE_SOUND_LULLABY_LIBMPG123_DECODER_H
-#endif // LOVE_NOMPG123

File src/modules/sound/lullaby/Sound.cpp

 	sound::Decoder *decoder = 0;
 
 	// Find a suitable decoder here, and return it.
-	if (ModPlugDecoder::accepts(ext))
+	if ( false ) { }
+#ifndef LOVE_NOMODPLUG
+	else if (ModPlugDecoder::accepts(ext))
 		decoder = new ModPlugDecoder(data, ext, bufferSize);
+#endif // LOVE_NOMODPLUG
 #ifndef LOVE_NOMPG123
 	else if (Mpg123Decoder::accepts(ext))
 		decoder = new Mpg123Decoder(data, ext, bufferSize);
 #endif // LOVE_NOMPG123
+#ifndef LOVE_NOVORBIS
 	else if (VorbisDecoder::accepts(ext))
 		decoder = new VorbisDecoder(data, ext, bufferSize);
+#endif // LOVE_NOVORBIS
 #ifdef LOVE_SUPPORT_GME
 	else if (GmeDecoder::accepts(ext))
 		decoder = new GmeDecoder(data, ext, bufferSize);

File src/modules/sound/lullaby/VorbisDecoder.cpp

 #include "common/config.h"
 #include "common/Exception.h"
 
+#ifndef LOVE_NOVORBIS
+
 namespace love
 {
 namespace sound
 } // lullaby
 } // sound
 } // love
+
+#endif // LOVE_NO_VORBIS

File src/modules/sound/lullaby/VorbisDecoder.h

 #include "common/Data.h"
 #include "Decoder.h"
 
+#ifndef LOVE_NOVORBIS
+
 // vorbis
 #include <vorbis/codec.h>
 #include <vorbis/vorbisfile.h>
 } // sound
 } // love
 
+#endif // LOVE_NOVORBIS
 #endif // LOVE_SOUND_LULLABY_VORBIS_DECODER_H