Fix --disable-mpg123 by telling automake to not compile it, instead of using ifdefs

This commit is contained in:
Bart van Strien
2013-05-26 22:34:04 +02:00
parent 6bc4f7a34e
commit c99fb2fb99
5 changed files with 22 additions and 13 deletions
+1
View File
@@ -66,6 +66,7 @@ AS_VAR_IF([enable_exe], [no], [], #else
AC_DEFINE([LOVE_BUILD_EXE], [], [Don't build launcher])) AC_DEFINE([LOVE_BUILD_EXE], [], [Don't build launcher]))
AM_CONDITIONAL([LOVE_BUILD_EXE], [test "x$enable_exe" != xno]) 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 # Set our includes as automake variable
AC_SUBST([LOVE_INCLUDES], ["$includes"]) AC_SUBST([LOVE_INCLUDES], ["$includes"])
+2
View File
@@ -1,3 +1,5 @@
\./libraries/luasocket/libluasocket/wsocket\.* \./libraries/luasocket/libluasocket/wsocket\.*
\./modules/sound/lullaby/FLACDecoder\.* \./modules/sound/lullaby/FLACDecoder\.*
\./love\.cpp \./love\.cpp
\./modules/sound/lullaby/Mpg123Decoder\.cpp
\./modules/sound/lullaby/Mpg123Decoder\.h
+19 -7
View File
@@ -4,7 +4,9 @@ cd src
inc_current='$(srcdir)' inc_current='$(srcdir)'
inc_modules="$inc_current/modules" inc_modules="$inc_current/modules"
inc_libraries="$inc_current/libraries" 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 AUTOMAKE_OPTIONS = subdir-objects
SUBDIRS = SUBDIRS =
@@ -19,10 +21,20 @@ endif
# libLÖVE # libLÖVE
lib_LTLIBRARIES = liblove.la lib_LTLIBRARIES = liblove.la
liblove_la_LDFLAGS = -module -export-dynamic \$(LDFLAGS) liblove_la_LDFLAGS = -module -export-dynamic \$(LDFLAGS)
liblove_la_SOURCES = \\" > Makefile.am.tmp liblove_la_SOURCES = \\
find . \( \( -iname "*.c" -o -iname "*.cpp" -o -iname "*.h" -o -iname "*.lch" \) \) -exec echo '{}' \\ \; >> Makefile.am.tmp EOF
cat Makefile.am.tmp | grep -v -f"../platform/unix/exclude" | head -c -3 > Makefile.am
#head -c -3 Makefile.am.tmp > Makefile.am find . \( \( -iname "*.c" -o -iname "*.cpp" -o -iname "*.h" -o -iname "*.lch" \) \) -exec echo '{}' \\ \; \
rm Makefile.am.tmp | 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 .. cd ..
echo src/Makefile.am is updated! \^.^ echo "src/Makefile.am is updated! ^.^"
@@ -18,8 +18,6 @@
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
**/ **/
#ifndef LOVE_NOMPG123
#include "Mpg123Decoder.h" #include "Mpg123Decoder.h"
#include "common/Exception.h" #include "common/Exception.h"
@@ -234,5 +232,3 @@ int Mpg123Decoder::feed(int bytes)
} // lullaby } // lullaby
} // sound } // sound
} // love } // love
#endif // LOVE_NOMPG123
@@ -18,7 +18,6 @@
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
**/ **/
#ifndef LOVE_NOMPG123
#ifndef LOVE_SOUND_LULLABY_LIBMPG123_DECODER_H #ifndef LOVE_SOUND_LULLABY_LIBMPG123_DECODER_H
#define LOVE_SOUND_LULLABY_LIBMPG123_DECODER_H #define LOVE_SOUND_LULLABY_LIBMPG123_DECODER_H
@@ -77,4 +76,3 @@ private:
} // love } // love
#endif // LOVE_SOUND_LULLABY_LIBMPG123_DECODER_H #endif // LOVE_SOUND_LULLABY_LIBMPG123_DECODER_H
#endif // LOVE_NOMPG123