Updated to love-android changeset 3b5e5e182a00

This commit is contained in:
Martin Felis
2014-01-12 21:21:46 +01:00
parent 0ff0941068
commit 69b200b144
396 changed files with 52558 additions and 2317 deletions
+14 -9
View File
@@ -14,11 +14,11 @@ if [[ ! -d platform/unix ]]; then
exit 1
fi
AUTOHEADER=$(which autoheader)
AUTOCONF=$(which autoconf)
LIBTOOLIZE=$(which libtoolize)
ACLOCAL=$(which aclocal)
AUTOMAKE=$(which automake)
AUTOHEADER=${AUTOHEADER:-$(which autoheader)}
AUTOCONF=${AUTOCONF:-$(which autoconf)}
LIBTOOLIZE=${LIBTOOLIZE:-$(which libtoolize)}
ACLOCAL=${ACLOCAL:-$(which aclocal)}
AUTOMAKE=${AUTOMAKE:-$(which automake)}
[[ -x ${AUTOHEADER} ]] || die "Could not find autoheader. Install autoconf."
[[ -x ${AUTOCONF} ]] || die "Could not find autoconf."
@@ -27,10 +27,12 @@ AUTOMAKE=$(which automake)
[[ -x ${AUTOMAKE} ]] || die "Could not find automake."
automagic() {
log "Copying files..." >&2
cp platform/unix/configure.ac .
cp platform/unix/Makefile.am .
if ! sh platform/unix/gen-makefile; then
log "Running genmodules..." >&2
if ! bash platform/unix/genmodules "$1"; then
echo "You should be doing this from the root directory of the project."
exit 1
fi
@@ -52,12 +54,15 @@ automagic() {
}
if [[ $1 == "-d" ]]; then
automagic 2>&1
shift 1
automagic "$@" 2>&1
else
(automagic > /dev/null) 2>&1
(automagic "$@" > /dev/null) 2>&1
fi
if [[ $? -eq 1 ]]; then
log "Failed, please contact the developers."
log "Failed, sadface."
log "You can make this script more verbose running it in debug mode (-d)"
log "This is generally a configuration error (I'm looking at you aclocal)"
exit 1
else
log "Success, carry on configuring."
+64 -25
View File
@@ -12,6 +12,7 @@ AC_PROG_CC
AC_PROG_CXX
AC_PROG_SED
AC_PROG_MKDIR_P
AC_PROG_OBJCXX
AC_C_BIGENDIAN
AC_LANG([C++])
@@ -26,47 +27,72 @@ AC_DEFUN([ACLOVE_CXX_FLAG_TEST], # WARNING: NOT REENTRANT
[AC_MSG_RESULT([no]); $3])
CXXFLAGS="$aclove_cxx_flag_test_save_cflags"])
AC_DEFUN([LOVE_MSG_ERROR],
[AC_MSG_ERROR([LÖVE needs "$1"[,] please install "$1" with development files and try again])])
# C++11 support
cxx11name="no"
ACLOVE_CXX_FLAG_TEST([-std=c++0x], cxx11name="c++0x", [])
ACLOVE_CXX_FLAG_TEST([-std=c++11], cxx11name="c++11", [])
AS_VAR_IF([cxx11name], [no], AC_MSG_ERROR([Can't LÖVE without C++11]), CXXFLAGS="$CXXFLAGS -std=$cxx11name")
AS_VAR_IF([cxx11name], [no], AC_MSG_ERROR([LÖVE needs a C++ compiler with C++11 support]), CXXFLAGS="$CXXFLAGS -std=$cxx11name")
# Libraries
AC_SEARCH_LIBS([sqrt], [m], [], AC_MSG_ERROR([Can't LÖVE without C math library]))
AC_SEARCH_LIBS([glLoadIdentity], [GL], [], AC_MSG_ERROR([Can't LÖVE without OpenGL]))
AC_SEARCH_LIBS([alSourcePlay], [openal], [], AC_MSG_ERROR([Can't LÖVE without OpenAL]))
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]))
# Allow people on OSX to use autotools, they need their platform files
AC_ARG_ENABLE([osx],
AC_HELP_STRING([--enable-osx], [Compile platform-specific files for OSX]), [], [enable_osx=no])
AS_VAR_IF([enable_osx], [no], [], #else
ac_cv_search_glLoadIdentity="-framework OpenGL"
AC_SUBST([LDFLAGS], ["${LDFLAGS} -framework CoreFoundation -framework Cocoa"])
AC_SUBST([CPPFLAGS], ["${CPPFLAGS} -I../platform/macosx"]))
# Includes
AC_CHECK_HEADER([freetype2/freetype/config/ftheader.h], [includes="$includes -I/usr/include/freetype2"])
# SDL 2, treated seperately because it combines setting SDL2_LIBS and SDL2_CFLAGS into one step
AM_PATH_SDL2([], [], AC_MSG_ERROR([Can't LÖVE without SDL 2]))
# Lua, treated seperately because of --with-lua
# --with-lua and --with-luaversion
AC_ARG_WITH([lua], [AS_HELP_STRING([--with-lua], [Select the lua implementation])],
[], [with_lua=lua])
[], [with_lua=luajit])
AC_ARG_WITH([luaversion], [AS_HELP_STRING([--with-luaversion], [Select the lua version])],
[], [with_luaversion=5.1])
# pkg-config libraries
AM_PATH_SDL2([], [], [LOVE_MSG_ERROR([SDL 2])])
PKG_CHECK_MODULES([lua], [${with_lua}${with_luaversion}], [lua_found=yes],
[PKG_CHECK_MODULES([lua], [${with_lua}], [lua_found=yes], [lua_found=no])])
PKG_CHECK_MODULES([freetype2], [freetype2], [], [LOVE_MSG_ERROR([FreeType2])])
PKG_CHECK_MODULES([openal], [openal], [], [LOVE_MSG_ERROR([OpenAL])])
PKG_CHECK_MODULES([devil], [IL], [], [LOVE_MSG_ERROR([DevIL])])
PKG_CHECK_MODULES([libmodplug], [libmodplug], [], [LOVE_MSG_ERROR([libmodplug])])
PKG_CHECK_MODULES([vorbisfile], [vorbisfile], [], [LOVE_MSG_ERROR([libvorbis and libvorbisfile])])
# Other libraries
AC_SEARCH_LIBS([sqrt], [m], [], [LOVE_MSG_ERROR([the C math library])])
AC_SEARCH_LIBS([PHYSFS_init], [physfs], [], [LOVE_MSG_ERROR([PhysicsFS])])
AC_SEARCH_LIBS([glLoadIdentity], [GL], [], [LOVE_MSG_ERROR([OpenGL])])
# Lua, treated seperately because of --with-lua
AS_VAR_IF([with_luaversion], [5.2], [luatest=lua_version], [luatest=lua_pcall]) # use lua_version for 5.2
AC_SEARCH_LIBS([$luatest], ["${with_lua}${with_luaversion}" "${with_lua}"], [],
AC_MSG_ERROR([Can't LÖVE without $with_lua]))
AC_CHECK_HEADER(["${with_lua}${with_luaversion}/lua.h"], [includes="$includes -I/usr/include/${with_lua}${with_luaversion}"], [])
AC_CHECK_HEADER(["${with_lua}/lua.h"], [includes="$includes -I/usr/include/${with_lua}"], [])
AS_VAR_IF([lua_found], [yes],
#if
[
luaheaders_found=yes
AC_MSG_CHECKING([for library containing ${luatest}])
AC_MSG_RESULT([${lua_LIBS}])],
#else
[
AC_MSG_WARN([Could not find pkg-config definition for ${with_lua}${with_luaversion} or ${with_lua}, falling back to manual detection])
AC_SEARCH_LIBS([$luatest], ["${with_lua}${with_luaversion}" "${with_lua}"], [],
[LOVE_MSG_ERROR([$with_lua])])
luaheaders_found=no
AC_CHECK_HEADER(["${with_lua}${with_luaversion}/lua.h"], [luaheaders_found=yes includes="$includes -I/usr/include/${with_lua}${with_luaversion}"], [])
AC_CHECK_HEADER(["${with_lua}/lua.h"], [luaheaders_found=yes includes="$includes -I/usr/include/${with_lua}"], [])])
AS_VAR_IF([luaheaders_found], [yes], [], #else
[
AC_MSG_WARN([Could not locate lua headers for ${with_lua}${with_luaversion} or ${with_lua}, you probably need to specify them with CPPFLAGS])])
# mpg123, treated seperately because it can be disabled (default on)
# also not pkg-config because of the FILE_OFFSET_BITS.. bit
AC_ARG_ENABLE([mpg123], AC_HELP_STRING([--disable-mpg123], [Disable mp3 support, for patent-free builds]), [], [enable_mpg123=yes])
AS_VAR_IF([enable_mpg123], [no],
AC_DEFINE([LOVE_NOMPG123], [], [Build without mpg123]),
# else
AC_SEARCH_LIBS([mpg123_open_feed], [mpg123], [],
AC_MSG_ERROR([Can't LÖVE without Mpg123]))
[LOVE_MSG_ERROR([libmpg123])])
AC_SEARCH_LIBS([mpg123_seek_64], [mpg123],
AC_SUBST([FILE_OFFSET],[-D_FILE_OFFSET_BITS=64]),
AC_SUBST([FILE_OFFSET],[])))
@@ -74,7 +100,7 @@ AS_VAR_IF([enable_mpg123], [no],
# GME, treated seperately because it can be enabled (default off)
AC_ARG_ENABLE([gme], AC_HELP_STRING([--enable-gme], [Enable GME support, for more chiptuney goodness]), [], [enable_gme=no])
AS_VAR_IF([enable_gme], [yes],
AC_SEARCH_LIBS([gme_open_data], [gme], [], AC_MSG_ERROR([Can't LÖVE without gme]))
AC_SEARCH_LIBS([gme_open_data], [gme], [], [LOVE_MSG_ERROR([gme])])
AC_DEFINE([LOVE_SUPPORT_GME], [], [Enable gme])
AC_CHECK_HEADER([gme/gme.h], [includes="$includes -I/usr/include/gme"], []))
@@ -89,16 +115,29 @@ AC_ARG_ENABLE([exe],
AC_HELP_STRING([--disable-exe], [Disable building of executable launcher]), [], [enable_exe=yes])
AS_VAR_IF([enable_exe], [no], [], #else
AC_DEFINE([LOVE_BUILD_EXE], [], [Don't build launcher]))
AC_DEFINE([LOVE_BUILD_EXE], [], [Skip building launcher]))
AM_CONDITIONAL([LOVE_BUILD_EXE], [test "x$enable_exe" != xno])
AM_CONDITIONAL([LOVE_NOMPG123], [test "x$enable_mpg123" == xno])
AM_CONDITIONAL([LOVE_TARGET_OSX], [test "x$enable_osx" != xno])
# Automatic script file rebuilding
AC_CHECK_PROGS([LUA_EXECUTABLE], ["${with_lua}${with_luaversion}" "${with_lua}" "lua"], [:])
AS_VAR_IF([LUA_EXECUTABLE], [:],
[AC_MSG_WARN([Did not find a lua executable, you may need to update the scripts manually if you change them])], [])
# Set our includes as automake variable
AC_SUBST([LOVE_INCLUDES], ["$includes"])
m4_include([configure-modules.ac])
AC_CONFIG_FILES([
Makefile
src/Makefile
platform/unix/debian/control
platform/unix/debian/changelog
platform/unix/debian/rules
])
AC_OUTPUT
chmod 755 platform/unix/debian/rules
@@ -0,0 +1,5 @@
love@LOVE_SUFFIX@ (0.9.0~ppatest5) precise; urgency=medium
* Upstream testing release
-- Bart van Strien <bart.bes@gmail.com> Sat, 2 Nov 2013 16:23:40 +0100
+59
View File
@@ -0,0 +1,59 @@
Source: love@LOVE_SUFFIX@
Section: games
Priority: extra
Maintainer: Bart van Strien <bart.bes@gmail.com>
Build-Depends: debhelper (>= 9),
autotools-dev,
pkg-config,
libdevil-dev,
libfreetype6-dev,
libluajit-5.1-dev,
libphysfs-dev,
libsdl2-dev (>= 2.0.0),
libopenal-dev,
libogg-dev,
libvorbis-dev,
libflac-dev,
libflac++-dev,
libmodplug-dev,
libmpg123-dev,
libmng-dev
Standards-Version: 3.9.3
Homepage: http://love2d.org
Package: liblove@LOVE_SUFFIX@
Architecture: any
Multi-Arch: same
Pre-Depends: ${misc:Pre-Depends}
Depends: ${misc:Depends},
${shlibs:Depends},
libdevil1c2,
libmng1,
libfreetype6,
libgl1-mesa-glx,
libluajit-5.1-2,
libphysfs-1.0-0,
libsdl2 (>= 2.0.0),
libopenal1,
libogg0,
libvorbis0a,
libvorbisfile3,
libmodplug1,
libmpg123-0
Description: LOVE is a free 2D game engine which enables easy game creation in Lua.
Package: love@LOVE_SUFFIX@
Architecture: any
Multi-Arch: same
Depends: ${misc:Depends},
liblove@LOVE_SUFFIX@ (= ${binary:Version})
Description: LOVE is a free 2D game engine which enables easy game creation in Lua.
Package: love@LOVE_SUFFIX@-dbg
Priority: extra
Section: debug
Architecture: any
Multi-Arch: same
Depends: ${misc:Depends},
love@LOVE_SUFFIX@ (= ${binary:Version}),
Description: LOVE is a free 2D game engine which enables easy game creation in Lua.
+2 -2
View File
@@ -1,4 +1,4 @@
Copyright (c) 2006-2010 LOVE Development Team
Copyright (c) 2006-2013 LOVE Development Team
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -17,4 +17,4 @@ appreciated but is not required.
misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
distribution.
@@ -0,0 +1 @@
usr/lib/*/liblove-unstable.so.*
@@ -0,0 +1 @@
usr/bin/love-unstable
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/make -f
DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
override_dh_auto_configure:
dh_auto_configure -- --with-lua=luajit
override_dh_link:
dh_link -plove@LOVE_SUFFIX@-dev usr/lib/$(DEB_HOST_MULTIARCH)/liblove@LOVE_SUFFIX@.so.0.0.0 usr/lib/$(DEB_HOST_MULTIARCH)/liblove@LOVE_SUFFIX@.so
override_dh_strip:
dh_strip --dbg-package=love@LOVE_SUFFIX@-dbg
%:
dh $@ --parallel
+3 -13
View File
@@ -1,11 +1,10 @@
#!/bin/bash
echo Generating src/Makefile.am ...
cd src
inc_current='$(srcdir)'
inc_modules="$inc_current/modules"
inc_libraries="$inc_current/libraries"
cat > Makefile.am << EOF
cat > src/Makefile.am << EOF
AM_CPPFLAGS = -I$inc_current -I$inc_modules -I$inc_libraries -I$inc_libraries/enet/libenet/include \$(LOVE_INCLUDES) \$(FILE_OFFSET)
AM_CXXFLAGS = \$(SDL_CFLAGS)
AUTOMAKE_OPTIONS = subdir-objects
@@ -29,20 +28,11 @@ endif
# libLÖVE
lib_LTLIBRARIES = liblove.la
liblove_la_LDFLAGS = -module -export-dynamic \$(LDFLAGS) \$(SDL_LIBS)
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
platform/unix/genmodules >> src/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
printf "\n" >> src/Makefile.am
cd ..
echo "src/Makefile.am is updated! ^.^"
+168
View File
@@ -0,0 +1,168 @@
#!/bin/bash
love_suffix="$1"
love_amsuffix="$(echo "$love_suffix" | sed 's/\-/_/g' | sed 's/\./_/g')"
flags=""
upper()
{
echo "$@" | tr '[:lower:]' '[:upper:]'
}
implfind()
{
find "$1" -maxdepth 1 -type d -exec basename '{}' \; | grep -v "^\." | tail -n +2
}
sourcefind()
{
find "$1" $2 -type f \( -iname "*.c" -o -iname "*.cpp" -o -iname "*.h" -o -iname "*.lch" \) | awk "{print \"./$prefix\"\$0\" \\\\\"}" | grep -v -f"$LOVEROOT/platform/unix/exclude"
}
handlemodule()
{
module="$1"
DEFINENAME="LOVE_MODULE_$(upper "$module")"
printf "$DEFINENAME"
}
handleimpl()
{
module="$1"
implementation="$2"
name="$3"
printf "if $name\n"
FILES="$(sourcefind "$module/$implementation" | sed "s/^/ /")"
if [[ "x$FILES" != "x" ]]; then
printf "liblove${love_amsuffix}_la_SOURCES += \\\\\n"
printf "${FILES:0:${#FILES}-2}\n"
fi
printf "endif\n\n"
}
genmodules()
{
LOVEROOT="$(pwd)"
cd src
printf "liblove${love_amsuffix}_la_SOURCES = \\\\\n"
sourcefind "common" | sed "s/^/ /"
FILES="$(sourcefind "scripts" | sed "s/^/ /")"
printf "${FILES:0:${#FILES}-2}\n\n"
cd modules
prefix="modules/"
for module in *; do
NAME=$(handlemodule "$module")
flags="$flags module-$module"
printf "if $NAME\n"
for implementation in $(implfind "$module"); do
flags="$flags implementation-$module-$implementation"
handleimpl "$module" "$implementation" "LOVE_IMPLEMENTATION_$(upper "$module")_$(upper "$implementation")"
done
FILES="$(sourcefind "$module" "-maxdepth 1" | sed "s/^/ /")"
if [[ "x$FILES" != "x" ]]; then
printf "liblove${love_amsuffix}_la_SOURCES += \\\\\n"
printf "${FILES:0:${#FILES}-2}\n"
fi
printf "endif\n\n"
done
cd ../libraries
prefix="libraries/"
for library in *; do
NAME="LOVE_LIBRARY_$(upper "$library")"
flags="$flags library-$library"
printf "if $NAME\n"
printf "liblove${love_amsuffix}_la_SOURCES += \\\\\n"
FILES="$(sourcefind "$library" | sed "s/^/ /")"
printf "${FILES:0:${#FILES}-2}\nendif\n\n"
done
cd ../..
}
genflags()
{
for flag in $flags; do
prettyflag="$(echo "$flag" | sed 's/-/ love./' | sed 's/-/./g')"
varflag="enable_$(echo "$flag" | sed 's/^[^-]*-//' | sed 's/[^a-zA-Z0-9]/_/')"
defineflag="LOVE_ENABLE_$(upper $(echo $flag | sed 's/^[^-]*-//' | sed 's/-/_/g'))"
amflag="$(upper $(echo love-$flag | sed 's/-/_/g'))"
printf "AC_ARG_ENABLE([$flag], [ --disable-$flag Turn off $prettyflag], [], [$varflag=true])\n"
printf "AH_TEMPLATE([$defineflag], [])\n"
printf "if test x\"\$$varflag\" == xtrue; then\n"
printf " AC_DEFINE([$defineflag], [])\n"
printf "fi\n"
printf "AM_CONDITIONAL([$amflag], [test x\$$varflag == xtrue])\n\n"
done
}
echo Generating src/Makefile.am ...
inc_current='$(srcdir)'
inc_modules="$inc_current/modules"
inc_libraries="$inc_current/libraries"
cat > src/Makefile.am << EOF
AM_CPPFLAGS = -I$inc_current -I$inc_modules -I$inc_libraries -I$inc_libraries/enet/libenet/include \$(LOVE_INCLUDES) \$(FILE_OFFSET)\
\$(SDL_CFLAGS) \$(lua_CFLAGS) \$(freetype2_CFLAGS)\
\$(openal_CFLAGS) \$(devil_CFLAGS) \$(libmodplug_CFLAGS)\
\$(vorbisfile_CFLAGS)
AUTOMAKE_OPTIONS = subdir-objects
SUBDIRS =
SUFFIXES = .lua .lua.h
if LOVE_BUILD_EXE
# LÖVE executable
bin_PROGRAMS = love${love_suffix}
#love_LDFLAGS =
love${love_amsuffix}_LDADD = liblove${love_suffix}.la \$(lua_LIBS)
love${love_amsuffix}_SOURCES = love.cpp
if LOVE_TARGET_OSX
love${love_amsuffix}_LIBTOOLFLAGS = --tag=OBJCXX
love${love_amsuffix}_SOURCES += \\
../platform/macosx/OSX.h \\
../platform/macosx/OSX.mm
else
love${love_amsuffix}_LIBTOOLFLAGS = --tag=CXX
endif
endif
# Compile scripts
.lua.lua.h:
cd scripts; \
\$(LUA_EXECUTABLE) auto.lua \$<
# libLÖVE
lib_LTLIBRARIES = liblove${love_suffix}.la
liblove${love_amsuffix}_la_LDFLAGS = -module -export-dynamic \$(LDFLAGS)
liblove${love_amsuffix}_la_LIBADD = \
\$(SDL_LIBS) \$(freetype2_LIBS) \$(lua_LIBS)\
\$(openal_LIBS) \$(devil_LIBS) \$(libmodplug_LIBS)\
\$(vorbisfile_LIBS)
EOF
genmodules >> src/Makefile.am
cat >> src/Makefile.am << EOF
if !LOVE_NOMPG123
liblove${love_amsuffix}_la_SOURCES += \\
./modules/sound/lullaby/Mpg123Decoder.cpp \\
./modules/sound/lullaby/Mpg123Decoder.h
endif
EOF
echo "src/Makefile.am is updated! ^.^"
echo "Generating configure-modules.ac"
genflags > configure-modules.ac
cat >> configure-modules.ac << EOF
AC_SUBST([LOVE_SUFFIX], [${love_suffix}])
EOF
echo "configure-modules.ac is updated! ^.^"