Rework configure.ac, clean up platform/unix

This commit is contained in:
Bart van Strien
2013-05-26 17:45:14 +02:00
parent 7b923dc75b
commit d8dfd62035
6 changed files with 50 additions and 287 deletions
-135
View File
@@ -1,135 +0,0 @@
#!/bin/bash
#
# This script gets all needed packages, builds LOVE, makes deb and tar.gz
# and optionally uploads them to servers.
#
# Note: this script must be called in the same directory as the love
# folder resides. It also assumes that love has been checked out previously.
#
# Usage:
#
# autobuild [action [revision [version]]]
#
# action:
#
# There are only two recognized actions:
#
# build -- Causes files to be uploaded to tehlol servers.
# release -- Coming soon.
#
# All other actions will be ignored, so if you don not wish to upload
# files (but still build LOVE), you can write "test", for instance.
#
# revision:
#
# The revision that should be built. Should be a valid revision
# number or tip. If not specified, it defaults to tip.
#
# version:
#
# The display version that will appear in files, eg. love-version.tar.gz.
# If not specified, the script defaults to use the SVN revision number.
#
# Examples:
#
# autobuild
# (Builds HEAD, but does not upload)
#
# autobuild build
# (Builds tip and uploads to tehlol server with the current rev. as
# version number)
#
# autobuild build tip 1.0
# (Builds tip and uploads it using the version 1.0)
#
#
# Passwords for servers must be in these external files:
#
# tehlol.com: pwtehlol
# sourceforge.net: pwsourceforge
#
cd ../..
# Get required packages.
#sudo apt-get -y install subversion build-essential liblua5.1-dev \
#libopenal-dev libsdl1.2-dev libfreetype6-dev \
#libphysfs-dev libdevil-dev libtiff4-dev libmng-dev \
#liblcms1-dev ftp-upload libmpg123-dev libmodplug-dev libpng12-dev
# Check which revision to build.
if [ -z $2 ]; then
buildrev="tip"
else
buildrev=$2
fi
echo $buildrev
# Upload to the appropriate revision.
hg pull
hg update -r $buildrev
# Set the displayversion.
if [ -z $3 ]; then
if [ "$buildrev" == "tip" ]; then
# Get the current SVN version, use sed to remove any non-numbers.
currentversion=`hg log -l1 --template "{node|short}"`
currentdate=`date +%Y%m%d`
displayversion="$currentdate-$currentversion"
else
# The revision is already specified, so we'll use that as the
# display version.
displayversion="$buildrev"
fi
else
# If the param is present, it overrides everything else.
displayversion=$3
fi
echo $displayversion
# Update version in configure.
# cat configure.in | sed "s/LOVE_VERSION/$displayversion/g" > configure.in
head -c 15 configure.in > configure.in.tmp
echo " [$displayversion])" >> configure.in.tmp
tail -n +2 configure.in >> configure.in.tmp
cp configure.in.tmp configure.in
rm configure.in.tmp
# Build ... BUILD!
#sh platform/unix/gen-makefile
sh platform/unix/automagic
./configure
make
make dist
# Move and rename the tar.
tar="love-$displayversion-linux-src.tar.gz"
mv "love-$displayversion.tar.gz" platform/unix/$tar
# Create the deb.
cd platform/unix
sh make-package deb $displayversion
machine=`uname -m`
# Move and rename the deb.
deb="love-$displayversion-ubuntu-$machine.deb"
mv "love-$displayversion.deb" $deb
# Copy and rename the binary.
binary="love-$displayversion-linux-$machine"
cp ../../src/love $binary
# Deal with uploading.
#if [ "$1" == "build" ]; then
# curl -F build=@$deb -F press=ok http://love2d.org/builds/upload.php?upload
# curl -F build=@$tar -F press=ok http://love2d.org/builds/upload.php?upload
# curl -F build=@$binary -F press=ok http://love2d.org/builds/upload.php?upload
#fi
if [ "$1" == "release" ]; then
echo "release"
fi
+49 -58
View File
@@ -13,71 +13,62 @@ AC_PROG_CXX
AC_PROG_SED
AC_PROG_MKDIR_P
AC_C_BIGENDIAN
AC_SEARCH_LIBS([sqrt], [m], [], AC_MSG_ERROR([Can't LÖVE without C math library]))
AC_SEARCH_LIBS([SDL_Init], [SDL], [], AC_MSG_ERROR([Can't LÖVE without SDL]))
AC_SEARCH_LIBS([glLoadIdentity], [GL], [], AC_MSG_ERROR([Can't LÖVE without OpenGL]))
#AC_SEARCH_LIBS([gluOrtho2D], [GLU], [], AC_MSG_ERROR([Can't LÖVE without OpenGL Utility Library]))
AC_SEARCH_LIBS([alSourcePlay], [openal], [], AC_MSG_ERROR([Can't LÖVE without OpenAL]))
lua=lua
AC_ARG_WITH([luajit],
[AS_HELP_STRING([--with-luajit], [Use LuaJIT instead of lua and llvm-lua])],
[lua=luajit],
[])
AC_ARG_WITH([llvm-lua],
[AS_HELP_STRING([--with-llvm-lua], [Use llvm-lua instead of lua and LuaJIT])],
[lua=llvm-lua],
[])
AS_IF([test "$lua" = "lua"],
AC_SEARCH_LIBS(
[lua_pcall],
[lua lua5.1],
if test "$ac_cv_search_lua_pcall" = "-llua5.1"; then
AC_SUBST([INCLUDE_LUA], [-I/usr/include/lua5.1])
fi,
AC_MSG_ERROR([Can't LÖVE without Lua])
)
)
AS_IF([test "$lua" = "luajit"],
AC_SEARCH_LIBS(
[lua_pcall],
[luajit luajit-5.1],
AC_SUBST([INCLUDE_LUA], [-I/usr/include/luajit-2.0]),
AC_MSG_ERROR([Can't LÖVE without LuaJIT])
)
)
AS_IF([test "$lua" = "llvm-lua"],
AC_SEARCH_LIBS(
[lua_pcall],
[llvm-lua],
[],
AC_MSG_ERROR([Can't LÖVE without llvm-lua])
)
)
includes=
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]))
# Libraries
AC_SEARCH_LIBS([sqrt], [m], [], AC_MSG_ERROR([Can''t LÖVE without C math library]))
AC_SEARCH_LIBS([SDL_Init], [SDL], [], AC_MSG_ERROR([Can''t LÖVE without SDL]))
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]))
# Includes
AC_CHECK_HEADER([SDL/SDL.h], [includes="$includes -I/usr/include/SDL"])
AC_CHECK_HEADER([freetype2/freetype/config/ftheader.h], [includes="$includes -I/usr/include/freetype2"])
# Lua, treated seperately because of --with-lua
AC_ARG_WITH([lua], [AS_HELP_STRING([--with-lua], [Select the lua implementation])],
[], [with_lua=lua])
AC_SEARCH_LIBS([lua_pcall], ["$with_lua" "${with_lua}5.1"], [],
AC_MSG_ERROR([Can''t LÖVE without $with_lua]))
AC_CHECK_HEADER(["${with_lua}/lua.h"], [includes="$includes -I/usr/include/${with_lua}"], [])
AC_CHECK_HEADER(["${with_lua}5.1/lua.h"], [includes="$includes -I/usr/include/${with_lua}5.1"], [])
# mpg123, treated seperately because it can be disabled (default on)
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],
AC_SEARCH_LIBS([mpg123_open_feed], [mpg123], [], AC_MSG_ERROR([Can't LÖVE without Mpg123])),
AC_DEFINE([LOVE_NOMPG123], [], [Build without mpg123]))
AS_IF([test "x$enable_mpg123" != xno],
AC_SEARCH_LIBS([mpg123_seek_64], [mpg123], AC_SUBST([FILE_OFFSET],[-D_FILE_OFFSET_BITS=64]), AC_SUBST([FILE_OFFSET],[])))
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]))
AC_SEARCH_LIBS([mpg123_seek_64], [mpg123],
AC_SUBST([FILE_OFFSET],[-D_FILE_OFFSET_BITS=64]),
AC_SUBST([FILE_OFFSET],[])))
# 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_DEFINE([LOVE_SUPPORT_GME], [], [Enable gme])
AC_CHECK_HEADER([gme/gme.h], [includes="$includes -I/usr/include/gme"], []))
# Optionally build the executable (default on)
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_ARG_ENABLE([exe], AC_HELP_STRING([--disable-exe], [Disable building of executable launcher]), [], [enable_exe=yes])
AS_IF([test "x$enable_exe" != xno],
AC_DEFINE([LOVE_BUILD_EXE], [], [Don't build launcher]))
AM_CONDITIONAL([LOVE_BUILD_EXE], [test "x$enable_exe" != xno])
AC_ARG_ENABLE([gme], AC_HELP_STRING([--enable-gme], [Enable GME support, for more chiptuney goodness]), [], [enable_gme=no])
AS_IF([test "x$enable_gme" == xyes],
AC_SEARCH_LIBS([gme_open_data], [gme], [], AC_MSG_ERROR([Can't LÖVE without gme])))
AS_IF([test "x$enable_gme" == xyes],
AC_DEFINE([LOVE_SUPPORT_GME], [], [Enable gme]))
# Set our includes as automake variable
AC_SUBST([LOVE_INCLUDES], ["$includes"])
AC_CONFIG_FILES([
Makefile
-21
View File
@@ -1,24 +1,3 @@
\./modules/native/tcc/libtcc/tccelf\.c
\./modules/native/tcc/libtcc/x86_64-gen\.c
\./modules/native/tcc/libtcc/tccasm\.c
\./modules/native/tcc/libtcc/tccpp\.c
\./modules/native/tcc/libtcc/il-gen\.c
\./modules/native/tcc/libtcc/c67-gen\.c
\./modules/native/tcc/libtcc/tcc\.c
\./modules/native/tcc/libtcc/elf\.h
\./modules/native/tcc/libtcc/tcccoff\.c
\./modules/native/tcc/libtcc/config\.h
\./modules/native/tcc/libtcc/i386-asm\.h
\./modules/native/tcc/libtcc/tccpe\.c
\./modules/native/tcc/libtcc/tcctok\.h
\./modules/native/tcc/libtcc/arm-gen\.c
\./modules/native/tcc/libtcc/i386-asm\.c
\./modules/native/tcc/libtcc/i386-gen\.c
\./modules/native/tcc/libtcc/tccgen\.c
\./modules/native/tcc/libtcc/tcc\.h
\./modules/native/tcc/libtcc/il-opcodes\.h
\./modules/native/tcc/libtcc/coff\.h
\./modules/native/tcc/libtcc/stab\.h
\./libraries/luasocket/libluasocket/wsocket\.*
\./modules/sound/lullaby/FLACDecoder\.*
\./love\.cpp
+1 -1
View File
@@ -4,7 +4,7 @@ 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 -I/usr/include/AL -I/usr/include/freetype2 \$(INCLUDE_LUA) -I/usr/include/SDL \$(FILE_OFFSET) -I/usr/include/gme
echo "AM_CPPFLAGS = -I$inc_current -I$inc_modules -I$inc_libraries \$(LOVE_INCLUDES) \$(FILE_OFFSET)
AUTOMAKE_OPTIONS = subdir-objects
SUBDIRS =
-7
View File
@@ -1,7 +0,0 @@
#!/bin/sh
# Get required packages.
sudo apt-get -y install subversion build-essential automake autoconf libtool \
liblua5.1-dev libopenal-dev libsdl1.2-dev libfreetype6-dev \
libphysfs-dev libdevil-dev libtiff4-dev libmng-dev \
liblcms1-dev ftp-upload libmpg123-dev libmodplug-dev libpng12-dev \
libvorbis-dev
-65
View File
@@ -1,65 +0,0 @@
#!/bin/bash
echo
echo "Packing LÖVE to go v1.2"
echo
arch="i386"
if [ "`uname -m | grep -c -G x86_64`" != 0 ]; then
arch="amd64"
elif [ "`uname -m | grep -c -G ppc`" != 0 ]; then
arch="ppc"
fi
if [ -z "$2" ]; then
echo "Syntax: ./make-package <package> <version>"
echo "Example: ./make-package deb 0.3.0-1"
echo "All files will be created in this folder."
echo
exit 0
fi
case "$1" in
deb )
strip ../../src/love
mkdir deb
mkdir deb/DEBIAN
cat debian | sed "s/%VERSION%/$2/" | sed "s/%ARCHITECTURE%/$arch/g" > deb/DEBIAN/tmp
cat deb/DEBIAN/tmp
sed "s/%INSTALLSIZE%/`ls -l ../../src/love | awk '{ sum += $5 } END { printf "%.2f", sum / 1000 }'`/" < deb/DEBIAN/tmp > deb/DEBIAN/control
rm deb/DEBIAN/tmp
cp postinst deb/DEBIAN/postinst
cp postrm deb/DEBIAN/postrm
mkdir deb/usr
mkdir deb/usr/bin
cp ../../src/love deb/usr/bin/love
mkdir deb/usr/share
mkdir deb/usr/share/mime
mkdir deb/usr/share/mime/packages
cp love.xml deb/usr/share/mime/packages
mkdir deb/usr/share/icons
mkdir deb/usr/share/icons/gnome
mkdir deb/usr/share/icons/gnome/scalable
mkdir deb/usr/share/icons/gnome/scalable/apps
cp app.svg deb/usr/share/icons/gnome/scalable/apps/love.svg
mkdir deb/usr/share/icons/gnome/scalable/mimetypes
cp game.svg deb/usr/share/icons/gnome/scalable/mimetypes/gnome-mime-application-x-love-game.svg
mkdir deb/usr/share/applications
cp love.desktop deb/usr/share/applications
dpkg -b deb love-$2.deb && \
echo " * love-$2.deb created"
rm -rf deb
;;
src )
cd ../../../
tar -czf love/platform/unix/love-$2-src.tar.gz --exclude=*.o --exclude=.* love/demos/* love/*.txt love/src/ && \
echo " * love-$2-src.tar.gz created"
tar -cjf love/platform/unix/love-$2-src.tar.bz2 --exclude=*.o --exclude=.* love/demos/* love/*.txt love/src/ && \
echo " * love-$2-src.tar.bz2 created"
zip -9q love/platform/unix/love-$2-src.zip love/*.txt love/demos/* `find love/src/* | grep -viE *.o` && \
echo " * love-$2-src.zip created"
;;
* )
echo "Unknown package type: $1"
echo "Valid types: deb src"
esac
echo