diff --git a/platform/unix/configure.ac b/platform/unix/configure.ac index 22c0ddeb8..b209158a9 100644 --- a/platform/unix/configure.ac +++ b/platform/unix/configure.ac @@ -66,6 +66,7 @@ AS_VAR_IF([enable_exe], [no], [], #else AC_DEFINE([LOVE_BUILD_EXE], [], [Don't build launcher])) AM_CONDITIONAL([LOVE_BUILD_EXE], [test "x$enable_exe" != xno]) +AM_CONDITIONAL([LOVE_NOMPG123], [test "x$enable_mpg123" == xno]) # Set our includes as automake variable AC_SUBST([LOVE_INCLUDES], ["$includes"]) diff --git a/platform/unix/exclude b/platform/unix/exclude index 1de6e5168..b233a4d14 100644 --- a/platform/unix/exclude +++ b/platform/unix/exclude @@ -1,3 +1,5 @@ \./libraries/luasocket/libluasocket/wsocket\.* \./modules/sound/lullaby/FLACDecoder\.* \./love\.cpp +\./modules/sound/lullaby/Mpg123Decoder\.cpp +\./modules/sound/lullaby/Mpg123Decoder\.h diff --git a/platform/unix/gen-makefile b/platform/unix/gen-makefile index dd494af3c..dfd60bceb 100644 --- a/platform/unix/gen-makefile +++ b/platform/unix/gen-makefile @@ -4,7 +4,9 @@ cd src inc_current='$(srcdir)' inc_modules="$inc_current/modules" inc_libraries="$inc_current/libraries" -echo "AM_CPPFLAGS = -I$inc_current -I$inc_modules -I$inc_libraries \$(LOVE_INCLUDES) \$(FILE_OFFSET) + +cat > Makefile.am << EOF +AM_CPPFLAGS = -I$inc_current -I$inc_modules -I$inc_libraries \$(LOVE_INCLUDES) \$(FILE_OFFSET) AUTOMAKE_OPTIONS = subdir-objects SUBDIRS = @@ -19,10 +21,20 @@ endif # libLĂ–VE lib_LTLIBRARIES = liblove.la liblove_la_LDFLAGS = -module -export-dynamic \$(LDFLAGS) -liblove_la_SOURCES = \\" > Makefile.am.tmp -find . \( \( -iname "*.c" -o -iname "*.cpp" -o -iname "*.h" -o -iname "*.lch" \) \) -exec echo '{}' \\ \; >> Makefile.am.tmp -cat Makefile.am.tmp | grep -v -f"../platform/unix/exclude" | head -c -3 > Makefile.am -#head -c -3 Makefile.am.tmp > Makefile.am -rm Makefile.am.tmp +liblove_la_SOURCES = \\ +EOF + +find . \( \( -iname "*.c" -o -iname "*.cpp" -o -iname "*.h" -o -iname "*.lch" \) \) -exec echo '{}' \\ \; \ + | grep -v -f"../platform/unix/exclude" | head -c -3 >> Makefile.am + +printf "\n\n" >> Makefile.am +cat >> Makefile.am << EOF +if !LOVE_NOMPG123 +liblove_la_SOURCES += \\ +./modules/sound/lullaby/Mpg123Decoder.cpp \\ +./modules/sound/lullaby/Mpg123Decoder.h +endif +EOF + cd .. -echo src/Makefile.am is updated! \^.^ +echo "src/Makefile.am is updated! ^.^" diff --git a/src/modules/sound/lullaby/Mpg123Decoder.cpp b/src/modules/sound/lullaby/Mpg123Decoder.cpp index 96438f25b..987f86168 100644 --- a/src/modules/sound/lullaby/Mpg123Decoder.cpp +++ b/src/modules/sound/lullaby/Mpg123Decoder.cpp @@ -18,8 +18,6 @@ * 3. This notice may not be removed or altered from any source distribution. **/ -#ifndef LOVE_NOMPG123 - #include "Mpg123Decoder.h" #include "common/Exception.h" @@ -234,5 +232,3 @@ int Mpg123Decoder::feed(int bytes) } // lullaby } // sound } // love - -#endif // LOVE_NOMPG123 diff --git a/src/modules/sound/lullaby/Mpg123Decoder.h b/src/modules/sound/lullaby/Mpg123Decoder.h index 968540ce8..d73e3a5d0 100644 --- a/src/modules/sound/lullaby/Mpg123Decoder.h +++ b/src/modules/sound/lullaby/Mpg123Decoder.h @@ -18,7 +18,6 @@ * 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 @@ -77,4 +76,3 @@ private: } // love #endif // LOVE_SOUND_LULLABY_LIBMPG123_DECODER_H -#endif // LOVE_NOMPG123